Properly split+data code_801C620/code_801D760

This commit is contained in:
Kermalis 2023-09-18 01:13:13 -04:00
parent 9c105309ee
commit 322e13a6be
74 changed files with 2357 additions and 2388 deletions

View File

@ -240,10 +240,11 @@
'ナ' = 83 69
POKE = 83 BF 83 C4
UNK_ICON_40 = 87 40
STAR_BULLET = 87 42
TM = 87 4E
ORB = 87 4F
STAR_BULLET = 87 42
A_BUTTON = 87 50
B_BUTTON = 87 51
L_BUTTON = 87 74

View File

@ -1,213 +1,5 @@
.section .rodata
@ code_801C620 #1
.align 2,0
.string "pksdir0\0"
.global gUnknown_80DBD98
gUnknown_80DBD98: @ 80DBD98
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBDB0
gUnknown_80DBDB0: @ 80DBDB0
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x14, 0x00, 0x04, 0x00
.byte 0x06, 0x00, 0x03, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBDC8
gUnknown_80DBDC8: @ 80DBDC8
.string "Switch\0"
@ code_801C620 #2
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_80DBDD8
gUnknown_80DBDD8: @ 80DBDD8
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBDF0
gUnknown_80DBDF0: @ 80DBDF0
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x06, 0x00, 0x00, 0x00
.byte 0x02, 0x00, 0x02, 0x00
.byte 0x10, 0x00, 0x11, 0x00
.byte 0x13, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBE08
gUnknown_80DBE08: @ 80DBE08
.string "IQ Skills\0"
.align 2,0
.global gUnknown_80DBE14
gUnknown_80DBE14: @ 80DBE14
.byte 0x87, 0x42, 0x00, 0x00
.global gUnknown_80DBE18
gUnknown_80DBE18: @ 80DBE18
.byte 0x87, 0x40, 0x00, 0x00
.global gUnknown_80DBE1C
gUnknown_80DBE1C: @ 80DBE1C
.string "{ARG_MOVE_ITEM_0}{ARG_MOVE_ITEM_1}\0"
@ code_801C620 #3
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_80DBE2C
gUnknown_80DBE2C: @ 80DBE2C
.string "{ARG_MOVE_ITEM_0}\0"
.align 2,0
.global gUnknown_80DBE30
gUnknown_80DBE30: @ 80DBE30
.string "{ARG_POKEMON_0}\0"
@ code_801C620 #4
.string "pksdir0\0"
.align 2,0
.global gUnknown_80DBE3C
gUnknown_80DBE3C: @ 80DBE3C
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBE54
gUnknown_80DBE54: @ 80DBE54
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x06, 0x00, 0x00, 0x00
.byte 0x02, 0x00, 0x02, 0x00
.byte 0x10, 0x00, 0x0E, 0x00
.byte 0x10, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBE6C
gUnknown_80DBE6C: @ 80DBE6C
@ code_801C620 #5
.string "Storage\0"
.string "pksdir0\0"
.align 2,0
.global gUnknown_80DBE7C
gUnknown_80DBE7C: @ 80DBE7C
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global UnkData_80DBE94
UnkData_80DBE94:
.byte 0x01, 0x00, 0x07, 0x00
.global gUnknown_80DBE98
gUnknown_80DBE98: @ 80DBE98
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x06, 0x00, 0x00, 0x00
.byte 0x02, 0x00, 0x02, 0x00
.byte 0x09, 0x00, 0x06, 0x00
.byte 0x06, 0x00, 0x00, 0x00
.4byte UnkData_80DBE94
.global gUnknown_80DBEB0
gUnknown_80DBEB0: @ 80DBEB0
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
.byte 0x0c, 0x00, 0x04, 0x00, 0x10, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x1a, 0x00, 0x04, 0x00
.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gMenuItems
gMenuItems: @ 80DBF10
.string "Items\0"
.align 2,0
.global gMenuTeam
gMenuTeam: @ 80DBF18
.string "Team\0"
.align 2,0
.global gMenuJobList
gMenuJobList: @ 80DBF20
.string "Job List\0"
.align 2,0
.global gMenuOthers
gMenuOthers: @ 80DBF2C
.string "Others\0"
.align 2,0
.global gUnknown_80DBF34
gUnknown_80DBF34: @ 80DBF34
.byte 0x81, 0x48
.byte 0x81, 0x48
.byte 0x81, 0x48
.byte 0x00, 0x00
.global gUnknown_80DBF3C
gUnknown_80DBF3C: @ 80DBF3C
.string "%s {COLOR_1 CYAN}%d{END_COLOR_TEXT_1} Pts.\0"
.align 2,0
.global gUnknown_80DBF4C
gUnknown_80DBF4C: @ 80DBF4C
.string "Money: {COLOR_1 CYAN}%d{END_COLOR_TEXT_1} {POKE}"
.align 2,0
.global gTeamRankBadgeFileName
gTeamRankBadgeFileName: @ 80DBF60
.string "tmrkpat\0"
@ code_801D760
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_80DBF70
gUnknown_80DBF70: @ 80DBF70
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBF88
gUnknown_80DBF88: @ 80DBF88
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x06, 0x00, 0x00, 0x00
.byte 0x02, 0x00, 0x02, 0x00
.byte 0x18, 0x00, 0x11, 0x00
.byte 0x11, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80DBFA0
gUnknown_80DBFA0: @ 80DBFA0
.string "Field\0"
@ options_menu #1
.align 2,0
.string "pksdir0\0"

View File

@ -8,7 +8,7 @@
"types": [
"TYPE_NORMAL"
],
"friendArea": "NONE",
"friendArea": "FRIEND_AREA_NONE",
"abilities": [
"ABILITY_OVERGROW"
],
@ -19959,7 +19959,7 @@
"types": [
"TYPE_PSYCHIC"
],
"friendArea": "NONE",
"friendArea": "FRIEND_AREA_NONE",
"abilities": [
"ABILITY_PRESSURE"
],
@ -20002,7 +20002,7 @@
"types": [
"TYPE_STEEL"
],
"friendArea": "NONE",
"friendArea": "FRIEND_AREA_NONE",
"abilities": [
"ABILITY_PRESSURE"
],
@ -20045,7 +20045,7 @@
"types": [
"TYPE_WATER"
],
"friendArea": "NONE",
"friendArea": "FRIEND_AREA_NONE",
"abilities": [
"ABILITY_DRIZZLE"
],

View File

@ -15,5 +15,6 @@ extern void sub_8014248(const u8 *, u32, u32, const MenuItem *, void *, u32, u32
extern s32 sub_80144A4(s32 *);
extern void xxx_draw_string_80144C4(void);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
extern void xxx_format_string(const u8 *, u8 *, u8 *, u32);
#endif // GUARD_CODE_80130A8_H

29
include/code_801BEEC.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef GUARD_CODE_801BEEC_H
#define GUARD_CODE_801BEEC_H
#include "constants/iq_skill.h"
#include "menu.h"
#include "pokemon.h"
#include "text.h"
// size: 0x124
struct unkStruct_203B238
{
/* 0x0 */ u32 state;
/* 0x4 */ s16 species;
/* 0x8 */ PokemonStruct1 *pokeStruct;
/* 0xC */ u8 iqSkills[NUM_IQ_SKILLS];
u32 unk24;
/* 0x28 */ u8 iqSkillIndex;
/* 0x2C */ u32 numIQSkills;
/* 0x30 */ s32 menuAction;
MenuItem unk34[8];
MenuStruct unk74;
UnkTextStruct2 unkC4[4];
};
bool8 sub_801BEEC(s16 species);
u32 sub_801BF48(void);
void sub_801BF98(void);
#endif // GUARD_CODE_801BEEC_H

35
include/code_801C244.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef GUARD_CODE_801C244_H
#define GUARD_CODE_801C244_H
#include "constants/iq_skill.h"
#include "menu.h"
#include "pokemon.h"
#include "text.h"
// size: 0xC4
struct unkStruct_203B23C
{
/* 0x0 */ s16 species;
/* 0x4 */ PokemonStruct1 *pokeStruct;
/* 0x8 */ u8 iqSkills[NUM_IQ_SKILLS];
/* 0x20 */ s32 numIQSkills;
/* 0x24 */ MenuInputStruct input;
u32 unk58;
UnkTextStruct2 *unk5C;
UnkTextStruct2 unk60[4];
u8 unkC0;
u8 unkC1;
u8 unkC2;
u8 unkC3;
};
bool8 HasNoAvailIQSkills(s16 species);
bool8 sub_801C244(s16 species, u32 index, u32);
u32 sub_801C308(bool8);
s32 sub_801C390(void);
void sub_801C3B0(bool8);
void sub_801C3F8(void);
void sub_801C4C8(void);
#endif // GUARD_CODE_801C244_H

View File

@ -1,21 +1,27 @@
#ifndef GUARD_CODE_801C620_H
#define GUARD_CODE_801C620_H
#include "menu.h"
#include "subStruct_203B240.h"
#include "text.h"
bool8 sub_801BEEC(s16 species);
u32 sub_801BF48(void);
void sub_801BF98(void);
bool8 sub_801C8C4(s32, s32, UnkTextStruct2_sub *, u32);
u32 sub_801CA08(bool8);
u8 sub_801CB24(void);
void sub_801CB5C(bool8);
void sub_801CBB8(void);
void sub_801CCD8(void);
bool8 sub_801CF14(s32);
bool8 sub_801CF50(s32);
void sub_801CF94(void);
s32 sub_801CFB8(void);
u32 sub_801CFE0(u8 index);
// size: 0x94
struct unkStruct_203B240
{
/* 0x0 */ s32 state;
/* 0x4 */ u8 chosenIQSkill;
s32 unk8;
s32 unkC;
struct subStruct_203B240 *unk10[2];
u8 fill14[0x20 - 0x18];
u32 unk20;
u32 unk24;
UnkTextStruct2 unk28[4];
MenuInputStructSub unk88;
};
bool8 sub_801C620(u8 iqSkill);
u32 sub_801C674(void);
void sub_801C6B4(void);
#endif // GUARD_CODE_801C620_H

34
include/code_801C8C4.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef GUARD_CODE_801C8C4_H
#define GUARD_CODE_801C8C4_H
#include "constants/item.h"
#include "menu.h"
#include "text.h"
// size: 0x554
struct unkStruct_203B244
{
u32 unk0;
/* 0x4 */ u8 itemIDs[NUMBER_OF_ITEM_IDS];
u32 unkF4[NUMBER_OF_ITEM_IDS];
/* 0x4B4 */ MenuInputStruct input;
u32 unk4E8;
UnkTextStruct2 *unk4EC;
UnkTextStruct2 unk4F0[4];
u8 unk550[4];
};
bool8 sub_801C8C4(s32, s32, UnkTextStruct2_sub *, u32);
u32 sub_801CA08(bool8);
u8 sub_801CB24(void);
void sub_801CB5C(bool8);
void sub_801CBB8(void);
void sub_801CCD8(void);
bool8 sub_801CF14(s32);
bool8 sub_801CF50(s32);
void sub_801CF94(void);
s32 sub_801CFB8(void);
u32 sub_801CFE0(u8 index);
struct unkStruct_203B244 *sub_801D008(void);
#endif // GUARD_CODE_801C8C4_H

39
include/code_801D014.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef GUARD_CODE_801D014_H
#define GUARD_CODE_801D014_H
#include "menu.h"
#include "pokemon.h"
#include "text.h"
// size: 0x118
struct unk_203B250
{
/* 0x0 */ PokemonStruct1 *pokeStruct;
/* 0x4 */ s16 index;
/* 0x6 */ u8 currFriendAreaLocation; // 0 when not in a friend area
u8 unk7;
u8 unk8;
u8 unk9;
PokemonStruct1 *unkC;
/* 0x10 */ u32 state;
/* 0x14 */ u32 menuAction;
MenuStruct unk18;
MenuItem unk68[8];
u16 unkA8[8];
UnkTextStruct2 unkB8[4];
};
// size: 0x8
struct TeamBadgeData
{
/* 0x0 */ u8 *pics; // probably a pointer to an arrays of pixels?
/* 0x4 */ u8 *pallete; // Pics share common pallete
};
bool8 sub_801D014(PokemonStruct1 *);
u32 sub_801D0DC(void);
u32 sub_801D178(void);
u8 sub_801D1D4(void);
void sub_801D1E0(void);
#endif // GUARD_CODE_801D014_H

35
include/code_801D9E4.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef GUARD_CODE_801D9E4_H
#define GUARD_CODE_801D9E4_H
#include "menu.h"
#include "text.h"
// size: 0xA0
struct unkStruct_203B258
{
/* 0x0 */ MenuInputStruct input;
u32 unk34;
UnkTextStruct2 *unk38;
UnkTextStruct2 unk3C[4];
u8 unk9C[4];
};
// size: 0x1C
struct unkStruct_81188F0
{
/* 0x0 */ u8 *text1;
/* 0x4 */ u8 *text2;
/* 0x8 */ u8 *text3;
/* 0xC */ u8 *text4;
/* 0x10 */ u32 unk1;
/* 0x14 */ u32 unk2;
/* 0x18 */ u32 unk3;
};
bool8 sub_801D9E4(void);
void sub_801DA58(s16);
u32 sub_801DA78(void);
s16 sub_801DAC0(void);
void sub_801DB0C(void);
#endif // GUARD_CODE_801D9E4_H

View File

@ -2,6 +2,7 @@
#define GUARD_CODE_801EE10_1_H
bool8 sub_8024458(s16 speciesNum, s32);
u32 sub_80244E4(void);
void sub_802453C(void);
// code_801EE10_1.s
@ -11,5 +12,6 @@ extern s16 sub_8023B44(void);
extern void sub_8023B7C(u32);
extern void sub_8023C60(void);
extern void sub_8023DA4(void);
extern bool8 sub_8024108(u32);
#endif // GUARD_CODE_801EE10_1_H

View File

@ -1,8 +0,0 @@
#ifndef GUARD_CODE_8021774_H
#define GUARD_CODE_8021774_H
bool8 sub_8021774(u8, u8, s32);
u32 sub_80217EC(void);
void sub_8021830(void);
#endif // GUARD_CODE_8021774_H

View File

@ -1,10 +0,0 @@
#ifndef GUARD_CODE_8021774_PRE_H
#define GUARD_CODE_8021774_PRE_H
bool8 sub_80211AC(u32, u32);
u32 sub_8021274(bool8);
u8 sub_802132C(void);
void sub_8021354(bool8);
void sub_80213A0(void);
#endif // GUARD_CODE_8021774_PRE_H

View File

@ -48,4 +48,8 @@ typedef struct unkStruct_3001B5C
u8 unk3F8[4];
} unkStruct_3001B5C;
bool8 sub_80227B8(PokemonStruct1 *pokeStruct);
u32 sub_8022860(void);
void sub_8022908(void);
#endif // GUARD_CODE_8023144_H

7
include/code_8096AF8.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef GUARD_CODE_8096AF8_H
#define GUARD_CODE_8096AF8_H
// code_8096AF8.s
extern bool8 sub_8096E2C(void);
#endif // GUARD_CODE_8096AF8_H

8
include/code_8097DD0.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_CODE_8097DD0_H
#define GUARD_CODE_8097DD0_H
#include "subStruct_203B240.h"
extern u32 sub_8097DF0(u8 *, struct subStruct_203B240 **);
#endif // GUARD_CODE_8097DD0_H

View File

@ -10,7 +10,7 @@
#define UNLOCK_WONDER_MAIL 2
#define UNLOCK_LEGENDARY_REQUEST 3
#define NONE 0
#define FRIEND_AREA_NONE 0
#define BOUNTIFUL_SEA 1
#define TREASURE_SEA 2
#define SERENE_SEA 3

View File

@ -3,31 +3,31 @@
enum IQSkillID
{
IQ_NONE = 0x0,
IQ_TYPE_ADVANTAGE_MASTER = 0x1,
IQ_ITEM_CATCHER = 0x2,
IQ_COURSE_CHECKER = 0x3,
IQ_SURE_HIT_ATTACKER = 0x4,
IQ_QUICK_DODGER = 0x5,
IQ_PP_CHECKER = 0x6,
IQ_NONTRAITOR = 0x7,
IQ_STATUS_CHECKER = 0x8,
IQ_EXP_GO_GETTER = 0x9,
IQ_EFFICIENCY_EXPERT = 0xA,
IQ_WEAK_TYPE_PICKER = 0xB,
IQ_ALL_TERRAIN_HIKER = 0xC,
IQ_SUPER_MOBILE = 0xD,
IQ_TRAP_AVOIDER = 0xE,
IQ_HOUSE_AVOIDER = 0xF,
IQ_ENERGY_SAVER = 0x10,
IQ_NONSLEEPER = 0x11,
IQ_SELF_CURER = 0x12,
IQ_TRAP_SEER = 0x13,
IQ_LAVA_EVADER = 0x14,
IQ_DEDICATED_TRAVELER = 0x15,
IQ_ITEM_MASTER = 0x16,
IQ_EXCLUSIVE_MOVE_USER = 0x17,
NUM_IQ_SKILLS = 0x18
IQ_NONE,
IQ_TYPE_ADVANTAGE_MASTER,
IQ_ITEM_CATCHER,
IQ_COURSE_CHECKER,
IQ_SURE_HIT_ATTACKER,
IQ_QUICK_DODGER,
IQ_PP_CHECKER,
IQ_NONTRAITOR,
IQ_STATUS_CHECKER,
IQ_EXP_GO_GETTER,
IQ_EFFICIENCY_EXPERT,
IQ_WEAK_TYPE_PICKER,
IQ_ALL_TERRAIN_HIKER,
IQ_SUPER_MOBILE,
IQ_TRAP_AVOIDER,
IQ_HOUSE_AVOIDER,
IQ_ENERGY_SAVER,
IQ_NONSLEEPER,
IQ_SELF_CURER,
IQ_TRAP_SEER,
IQ_LAVA_EVADER,
IQ_DEDICATED_TRAVELER,
IQ_ITEM_MASTER,
IQ_EXCLUSIVE_MOVE_USER,
NUM_IQ_SKILLS
};
#endif
#endif // GUARD_CONSTANTS_IQ_SKILL_H

View File

@ -1,10 +1,47 @@
#ifndef GUARD_FRIEND_AREA_ACTION_MENU_H
#define GUARD_FRIEND_AREA_ACTION_MENU_H
#include "constants/move.h"
#include "items.h"
#include "menu.h"
#include "pokemon.h"
#include "text.h"
enum FriendAreaActionMenuStates
{
FRIEND_AREA_ACTION_MENU_INIT,
FRIEND_AREA_ACTION_MENU_MAIN,
FRIEND_AREA_ACTION_MENU_MAIN_2,
//
FRIEND_AREA_ACTION_MENU_SUMMARY = 4,
FRIEND_AREA_ACTION_MENU_CHECK_IQ,
//
FRIEND_AREA_ACTION_MENU_SAY_FAREWELL_PROMPT = 8,
FRIEND_AREA_ACTION_MENU_SAY_FAREWELL_CONFIRM,
//
FRIEND_AREA_ACTION_MENU_EXIT = 17,
};
enum FriendAreaActionMenuActions
{
FRIEND_AREA_ACTION_MENU_ACTION_NONE = 1,
FRIEND_AREA_ACTION_MENU_ACTION_YES,
FRIEND_AREA_ACTION_MENU_ACTION_NO,
FRIEND_AREA_ACTION_MENU_ACTION_INFO = 4,
FRIEND_AREA_ACTION_MENU_ACTION_SUMMARY = 4,
FRIEND_AREA_ACTION_MENU_ACTION_CHECK_IQ,
FRIEND_AREA_ACTION_MENU_ACTION_JOIN_TEAM,
FRIEND_AREA_ACTION_MENU_ACTION_STANDBY,
FRIEND_AREA_ACTION_MENU_ACTION_MAKE_LEADER,
FRIEND_AREA_ACTION_MENU_ACTION_SAY_FAREWELL,
FRIEND_AREA_ACTION_MENU_ACTION_GIVE,
FRIEND_AREA_ACTION_MENU_ACTION_TAKE,
FRIEND_AREA_ACTION_MENU_ACTION_MOVES,
};
// size: 0x1E0
struct unkStruct_203B2BC
{
// size: 0x1E0
u32 state;
u32 fallbackState;
s16 targetPoke;
@ -31,31 +68,8 @@ struct unkStruct_203B2BC
UnkTextStruct2 unk180[4];
};
enum FriendAreaActionMenuStates {
FRIEND_AREA_ACTION_MENU_INIT,
FRIEND_AREA_ACTION_MENU_MAIN,
FRIEND_AREA_ACTION_MENU_MAIN_2,
FRIEND_AREA_ACTION_MENU_SUMMARY = 4,
FRIEND_AREA_ACTION_MENU_CHECK_IQ = 5,
FRIEND_AREA_ACTION_MENU_SAY_FAREWELL_PROMPT = 8,
FRIEND_AREA_ACTION_MENU_SAY_FAREWELL_CONFIRM,
FRIEND_AREA_ACTION_MENU_EXIT = 0x11,
};
u32 sub_8027074(void);
u32 sub_80270A4(void);
void sub_8027168(void);
enum FriendAreaActionMenuActions {
FRIEND_AREA_ACTION_MENU_ACTION_NONE = 1,
FRIEND_AREA_ACTION_MENU_ACTION_YES,
FRIEND_AREA_ACTION_MENU_ACTION_NO,
FRIEND_AREA_ACTION_MENU_ACTION_INFO = 4,
FRIEND_AREA_ACTION_MENU_ACTION_SUMMARY = 4,
FRIEND_AREA_ACTION_MENU_ACTION_CHECK_IQ,
FRIEND_AREA_ACTION_MENU_ACTION_JOIN_TEAM,
FRIEND_AREA_ACTION_MENU_ACTION_STANDBY,
FRIEND_AREA_ACTION_MENU_ACTION_MAKE_LEADER,
FRIEND_AREA_ACTION_MENU_ACTION_SAY_FAREWELL,
FRIEND_AREA_ACTION_MENU_ACTION_GIVE,
FRIEND_AREA_ACTION_MENU_ACTION_TAKE,
FRIEND_AREA_ACTION_MENU_ACTION_MOVES,
};
#endif
#endif // GUARD_FRIEND_AREA_ACTION_MENU_H

7
include/ground_lives.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef GUARD_GROUND_LIVES_H
#define GUARD_GROUND_LIVES_H
// ground_lives.s
s16 sub_80A7AE8(s32);
#endif // GUARD_GROUND_LIVES_H

View File

@ -12,5 +12,6 @@ typedef struct unkStruct_811BAF4
} unkStruct_811BAF4;
bool8 sub_8098F88(void);
const char *sub_8098FB4(void);
#endif // GUARD_GROUND_MAIN_H

View File

@ -8,4 +8,7 @@ void GroundMap_ExecuteStation(s16, s16, s8, u32);
bool8 sub_80A4D2C(s16);
bool8 sub_80A4D48(s16 index);
// ground_map_1.s
extern s16 sub_80A5728(void);
#endif // GUARD_GROUND_MAP_1_H

8
include/options_menu.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_OPTIONS_MENU_H
#define GUARD_OPTIONS_MENU_H
bool8 sub_801DCC4(void);
u32 sub_801DCE8(void);
void sub_801DD50(void);
#endif // GUARD_OPTIONS_MENU_H

43
include/party_list_menu.h Normal file
View File

@ -0,0 +1,43 @@
#ifndef GUARD_PARTY_LIST_MENU_H
#define GUARD_PARTY_LIST_MENU_H
#include "constants/move.h"
#include "items.h"
#include "menu.h"
#include "pokemon.h"
#include "text.h"
// size: 0x280
typedef struct unkStruct_203B2B8
{
/* 0x0 */ s32 state;
/* 0x4 */ s32 fallbackState;
bool8 unk8;
/* 0xA */ s16 pokeSpecies;
/* 0xC */ u32 id;
/* 0x10 */ BulkItem item1;
/* 0x14 */ BulkItem item2;
/* 0x18 */ PokemonStruct1 *pokeStruct;
/* 0x1C */ bool8 isTeamLeader;
/* 0x20 */ u32 moveIndex;
/* 0x24 */ u16 moveID;
/* 0x28 */ Move moves[8];
/* 0x68 */ u16 moveIDs[4]; // some list of move IDs
/* 0x70 */ u32 menuAction1;
/* 0x74 */ u32 menuAction2;
/* 0x78 */ u32 menuAction3; // unused
MenuStruct unk7C;
MenuStruct unkCC;
MenuStruct unk11C; // unused
MenuItem unk16C[10];
MenuItem unk1BC[10];
u16 unk20C[10];
UnkTextStruct2 unk220[4];
} unkStruct_203B2B8;
bool8 sub_8025EF4(PokemonStruct1 *pokeStruct);
u32 sub_8025F68(void);
bool8 sub_802604C(void);
void sub_8026058(void);
#endif // GUARD_PARTY_LIST_MENU_H

View File

@ -250,6 +250,7 @@ s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon);
extern PokemonStruct1 *GetPlayerPokemonStruct(void);
extern void sub_808CFD0(u8 *, s16, u8 *, u8, u32 *, u16 *);
extern u32 sub_808D1DC(u8 *);
extern PokemonStruct1 *sub_808D3F8(void);
extern s32 sub_808D544(u32);
extern s32 sub_808D580(s32 *);

View File

@ -47,6 +47,7 @@ extern void InitGraphics(void);
extern void sub_800898C(void);
extern void sub_80089AC(const UnkTextStruct2 *, UnkTextStruct2_sub *);
extern void sub_8008C54(u32);
extern s32 sub_8008ED0(const u8 *);
extern void sub_8009388(void);
extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32);

View File

@ -1,6 +1,15 @@
#ifndef GUARD_WONDER_MAIL_2_1_H
#define GUARD_WONDER_MAIL_2_1_H
#include "code_802C39C.h"
#include "constants/mailbox.h"
#include "input.h"
#include "menu.h"
#include "text.h"
// size: 0xA8
struct unkStruct_203B2E8
{
// size: 0xA8
u8 pelipperBoardSlots[MAX_ACCEPTED_JOBS];
MenuInputStruct input;
u32 unk3C;
@ -9,9 +18,9 @@ struct unkStruct_203B2E8
u8 unkA4[4];
};
// size: 0x1FC
struct unkStruct_203B2F0
{
// size: 0x1FC
u32 unk0;
u32 state;
u8 unk8[0xC - 0x8];
@ -25,3 +34,11 @@ struct unkStruct_203B2F0
u8 fill18C[0x19C - 0x18C];
UnkTextStruct2 unk19C[4];
};
bool8 HasNoAcceptedJobs(void);
bool8 InitializeJobListMenu(u32);
u32 sub_802C898(void);
void sub_802C8F4(void);
#endif // GUARD_WONDER_MAIL_2_1_H

View File

@ -105,8 +105,12 @@ SECTIONS {
src/code_801AFA4.o(.text);
src/code_801B3C0.o(.text);
src/code_801B60C.o(.text);
src/code_801BEEC.o(.text);
src/code_801C244.o(.text);
src/code_801C620.o(.text);
src/code_801D760.o(.text);
src/code_801C8C4.o(.text);
src/code_801D014.o(.text);
src/code_801D9E4.o(.text);
src/options_menu.o(.text);
src/hints_menu.o(.text);
src/gulpin_shop.o(.text);
@ -416,6 +420,12 @@ SECTIONS {
src/code_801AFA4.o(.rodata);
src/code_801B3C0.o(.rodata);
src/code_801B60C.o(.rodata);
src/code_801BEEC.o(.rodata);
src/code_801C244.o(.rodata);
src/code_801C620.o(.rodata);
src/code_801C8C4.o(.rodata);
src/code_801D014.o(.rodata);
src/code_801D9E4.o(.rodata);
data/data_80DBD98.o(.rodata);
src/gulpin_shop.o(.rodata);
data/data_80DC240.o(.rodata);

View File

@ -75,6 +75,8 @@ s32 sub_8016028(void)
return 60;
}
///////////// THIS IS ITS OWN FILE
u32 sub_801602C(u32 r0, u8 *name)
{
ResetUnusedInputStruct();

207
src/code_801BEEC.c Normal file
View File

@ -0,0 +1,207 @@
#include "global.h"
#include "code_80118A4.h"
#include "code_801BEEC.h"
#include "code_801C244.h"
#include "code_801C620.h"
#include "common_strings.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon_3.h"
#include "text1.h"
#include "text2.h"
static EWRAM_DATA_2 struct unkStruct_203B238 *sUnknown_203B238 = {0};
#include "data/code_801BEEC.h"
static void sub_801BFB4(s32 newState);
static void sub_801BFCC(void);
static void sub_801C03C(void);
static void sub_801C0C8(void);
static void sub_801C118(void);
static void sub_801C1A0(void);
static void sub_801C228(void);
bool8 sub_801BEEC(s16 species)
{
s32 species_s32 = species;
if (HasNoAvailIQSkills(species_s32))
return FALSE;
sUnknown_203B238 = MemoryAlloc(sizeof(struct unkStruct_203B238), 8);
sUnknown_203B238->menuAction = 0;
sUnknown_203B238->species = species_s32;
sUnknown_203B238->pokeStruct = &gRecruitedPokemonRef->pokemon[species_s32];
sUnknown_203B238->numIQSkills = GetNumAvailableIQSkills(sUnknown_203B238->iqSkills, sUnknown_203B238->pokeStruct->IQ);
sub_801BFB4(0);
return TRUE;
}
u32 sub_801BF48(void)
{
switch (sUnknown_203B238->state) {
case 4:
return 3;
case 0:
case 1:
sub_801C118();
break;
case 2:
sub_801C1A0();
break;
case 3:
sub_801C228();
break;
}
return 0;
}
void sub_801BF98(void)
{
if (sUnknown_203B238 != NULL) {
MemoryFree(sUnknown_203B238);
sUnknown_203B238 = NULL;
}
}
static void sub_801BFB4(s32 newState)
{
sUnknown_203B238->state = newState;
sub_801BFCC();
sub_801C03C();
}
static void sub_801BFCC(void)
{
s32 i;
sub_8006518(sUnknown_203B238->unkC4);
if (sUnknown_203B238->state == 2)
sUnknown_203B238->unkC4[2] = sUnknown_80DBDB0;
else {
for (i = 0; i < 4; i++)
sUnknown_203B238->unkC4[i] = sUnknown_80DBD98;
}
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B238->unkC4, TRUE, TRUE);
}
static void sub_801C03C(void)
{
switch (sUnknown_203B238->state) {
case 0:
sub_801C244(sUnknown_203B238->species, 0, 8);
break;
case 1:
sub_801C3B0(TRUE);
break;
case 2:
sub_801C4C8();
sub_801C0C8();
sub_8012D60(&sUnknown_203B238->unk74, sUnknown_203B238->unk34, 0, 0, sUnknown_203B238->menuAction, 2);
break;
case 3:
sub_801C620(sUnknown_203B238->iqSkillIndex);
break;
case 4:
break;
}
}
static void sub_801C0C8(void)
{
struct unkStruct_203B238 *puVar1;
s32 i;
u8 *nullText;
u32 menuAction;
s32 max;
puVar1 = sUnknown_203B238;
nullText = NULL;
sUnknown_203B238->unk34[0].text = sSwitch;
puVar1->unk34[0].menuAction = 2;
menuAction = 1;
puVar1->unk34[1].text = gCommonInfo[0];
puVar1->unk34[1].menuAction = 3;
max = 2;
puVar1->unk34[2].text = nullText;
puVar1->unk34[2].menuAction = menuAction;
for (i = 0; i < max; i++) {
if (sUnknown_203B238->unk34[i].menuAction == sUnknown_203B238->menuAction)
return;
}
sUnknown_203B238->menuAction = 2;
}
static void sub_801C118(void)
{
switch (sub_801C308(TRUE)) {
case 3:
sUnknown_203B238->unk24 = sub_801C390();
sUnknown_203B238->iqSkillIndex = sUnknown_203B238->iqSkills[sUnknown_203B238->unk24];
sub_801BFB4(2);
break;
case 4:
sUnknown_203B238->unk24 = sub_801C390();
sUnknown_203B238->iqSkillIndex = sUnknown_203B238->iqSkills[sUnknown_203B238->unk24];
sub_801BFB4(3);
break;
case 2:
sub_801C3F8();
sub_801BFB4(4);
break;
case 0:
case 1:
break;
}
}
static void sub_801C1A0(void)
{
s32 menuAction;
menuAction = 0;
sub_801C308(FALSE);
if (!sub_8012FD8(&sUnknown_203B238->unk74)) {
sub_8013114(&sUnknown_203B238->unk74, &menuAction);
if (menuAction != 1)
sUnknown_203B238->menuAction = menuAction;
}
switch (menuAction) {
case 2:
PlaySound(307);
ToggleIQSkill((u8 *)&sUnknown_203B238->pokeStruct->IQSkills, sUnknown_203B238->iqSkillIndex);
sub_801BFB4(1);
break;
case 3:
sub_801BFB4(3);
break;
case 1:
sub_801BFB4(1);
break;
}
}
static void sub_801C228(void)
{
switch (sub_801C674()) {
case 2:
case 3:
sub_801C6B4();
sub_801BFB4(1);
case 0:
case 1:
break;
}
}

246
src/code_801C244.c Normal file
View File

@ -0,0 +1,246 @@
#include "global.h"
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801C244.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon_3.h"
#include "text1.h"
#include "text2.h"
extern u8 gUnknown_202DEA8[];
static EWRAM_DATA_2 struct unkStruct_203B23C *sUnknown_203B23C = {0};
#include "data/code_801C244.h"
static void sub_801C440(void);
bool8 sub_801C244(s16 species, u32 index, u32 a2)
{
#ifndef NONMATCHING
register s32 species_s32 asm("r4");
#else
s32 species_s32;
#endif
species_s32 = species;
if (HasNoAvailIQSkills(species))
return FALSE;
if (sUnknown_203B23C == NULL)
sUnknown_203B23C = MemoryAlloc(sizeof(struct unkStruct_203B23C), 8);
sUnknown_203B23C->species = species_s32;
sUnknown_203B23C->pokeStruct = &gRecruitedPokemonRef->pokemon[species_s32];
sUnknown_203B23C->numIQSkills = GetNumAvailableIQSkills(sUnknown_203B23C->iqSkills, sUnknown_203B23C->pokeStruct->IQ);
sUnknown_203B23C->unk58 = index;
sUnknown_203B23C->unk5C = &sUnknown_203B23C->unk60[index];
sub_8006518(sUnknown_203B23C->unk60);
sUnknown_203B23C->unk60[sUnknown_203B23C->unk58] = sUnknown_80DBDF0;
sUnknown_203B23C->unk5C->unk14 = &sUnknown_203B23C->unkC0;
sub_8012D08(sUnknown_203B23C->unk5C, a2);
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B23C->unk60, TRUE, TRUE);
sub_8013818(&sUnknown_203B23C->input, sUnknown_203B23C->numIQSkills, a2, index);
sub_801C440();
sub_801C4C8();
return TRUE;
}
u32 sub_801C308(bool8 a0)
{
if (!a0) {
sub_8013660(&sUnknown_203B23C->input);
return 0;
}
switch (GetKeyPress(&sUnknown_203B23C->input)) {
case 2:
PlayMenuSoundEffect(1);
return 2;
case 1:
PlayMenuSoundEffect(0);
return 3;
case 4:
PlayMenuSoundEffect(4);
return 4;
default:
if (sub_80138B8(&sUnknown_203B23C->input, 1) != 0) {
sub_801C440();
sub_801C4C8();
return 1;
}
return 0;
}
}
s32 sub_801C390(void)
{
return (sUnknown_203B23C->input.unk1E * sUnknown_203B23C->input.unk1C) + sUnknown_203B23C->input.menuIndex;
}
void sub_801C3B0(bool8 r0)
{
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B23C->unk60, FALSE, FALSE);
sUnknown_203B23C->input.unk22 = sUnknown_203B23C->numIQSkills;
sub_8013984(&sUnknown_203B23C->input);
sub_801C440();
sub_801C4C8();
if (r0)
AddMenuCursorSprite(&sUnknown_203B23C->input);
}
void sub_801C3F8(void)
{
if (sUnknown_203B23C != NULL) {
sUnknown_203B23C->unk60[sUnknown_203B23C->unk58] = sUnknown_80DBDD8;
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B23C->unk60, TRUE, TRUE);
MemoryFree(sUnknown_203B23C);
sUnknown_203B23C = NULL;
}
}
#ifdef NONMATCHING // sub_80095E4 memes
// https://decomp.me/scratch/NdDP3 (98.06% matching) - Seth
static void sub_801C440(void)
{
u16 sVar2;
sUnknown_203B23C->unkC0 = sUnknown_203B23C->unk24.unk20;
sUnknown_203B23C->unkC1 = sUnknown_203B23C->unk24.unk1E;
sUnknown_203B23C->unkC2 = 10;
sUnknown_203B23C->unkC3 = 0;
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B23C->unk60, TRUE, TRUE);
sVar2 = sub_80095E4(sUnknown_203B23C->unk24.unk1A, 12) + 2;
sUnknown_203B23C->unk60[sUnknown_203B23C->unk58].unkE = sVar2;
sUnknown_203B23C->unk60[sUnknown_203B23C->unk58].unk10 = sVar2;
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B23C->unk60, TRUE, TRUE);
}
#else
NAKED
static void sub_801C440(void)
{
asm_unified(
"\tpush {r4,lr}\n"
"\tldr r4, _0801C4C4\n"
"\tldr r0, [r4]\n"
"\tadds r1, r0, 0\n"
"\tadds r1, 0x44\n"
"\tldrh r1, [r1]\n"
"\tadds r0, 0xC0\n"
"\tmovs r2, 0\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r1, r0, 0\n"
"\tadds r1, 0x42\n"
"\tldrh r1, [r1]\n"
"\tadds r0, 0xC1\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0xC2\n"
"\tmovs r1, 0xA\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0xC3\n"
"\tstrb r2, [r0]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x60\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tldr r0, [r4]\n"
"\tmovs r1, 0x3E\n"
"\tldrsh r0, [r0, r1]\n"
"\tmovs r1, 0xC\n"
"\tbl sub_80095E4\n"
"\tadds r0, 0x2\n"
"\tldr r2, [r4]\n"
"\tldr r3, [r2, 0x58]\n"
"\tlsls r1, r3, 1\n"
"\tadds r1, r3\n"
"\tlsls r1, 3\n"
"\tadds r1, r2, r1\n"
"\tadds r1, 0x6E\n"
"\tlsls r0, 16\n"
"\tlsrs r0, 16\n"
"\tstrh r0, [r1]\n"
"\tldr r3, [r2, 0x58]\n"
"\tlsls r1, r3, 1\n"
"\tadds r1, r3\n"
"\tlsls r1, 3\n"
"\tadds r2, r1\n"
"\tadds r2, 0x70\n"
"\tstrh r0, [r2]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x60\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tpop {r4}\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"_0801C4C4: .4byte sUnknown_203B23C"
);
}
#endif
void sub_801C4C8(void)
{
u32 y;
s32 x;
s32 x2;
u32 skillIndex;
s32 counter;
sub_8008C54(sUnknown_203B23C->unk58);
sub_80073B8(sUnknown_203B23C->unk58);
x = sUnknown_203B23C->input.unk1E * 8;
x2 = x;
x2 += 10;
xxx_call_draw_string(x2, 0, sIQSkills, sUnknown_203B23C->unk58, 0);
x += 4;
x2 = x + sUnknown_203B23C->unkC2 * 8;
sub_8012BC4(x2, 0, sUnknown_203B23C->input.unk1E + 1, 1, 7, sUnknown_203B23C->unk58);
for (counter = 0; counter < sUnknown_203B23C->input.unk1A; counter++) {
skillIndex = sUnknown_203B23C->iqSkills[(sUnknown_203B23C->input.unk1E * sUnknown_203B23C->input.unk1C) + counter];
y = sub_8013800(&sUnknown_203B23C->input, counter);
strncpy(gUnknown_202DEA8, GetIQSkillName(skillIndex), 80);
if (IsIQSkillSet((u8 *)&sUnknown_203B23C->pokeStruct->IQSkills, 1 << skillIndex))
strcpy(gUnknown_202DEA8 - 80, sStarBullet);
else
strcpy(gUnknown_202DEA8 - 80, sUnknown_80DBE18);
xxx_format_and_draw(12, y, sFmt01, sUnknown_203B23C->unk58, 0);
}
sub_80073E0(sUnknown_203B23C->unk58);
}
bool8 HasNoAvailIQSkills(s16 species)
{
s32 species_s32;
u8 iqSkillBuffer[NUM_IQ_SKILLS];
PokemonStruct1 *pokeStruct;
species_s32 = species;
pokeStruct = &gRecruitedPokemonRef->pokemon[species_s32];
if (GetNumAvailableIQSkills(iqSkillBuffer, pokeStruct->IQ) == 0)
return TRUE;
return FALSE;
}

File diff suppressed because it is too large Load Diff

341
src/code_801C8C4.c Normal file
View File

@ -0,0 +1,341 @@
#include "global.h"
#include "code_80118A4.h"
#include "code_801C8C4.h"
#include "items.h"
#include "memory.h"
#include "menu_input.h"
#include "text1.h"
#include "text2.h"
static EWRAM_DATA_2 struct unkStruct_203B244 *sUnknown_203B244 = {0};
static EWRAM_DATA_2 u32 sUnknown_203B248 = {0};
static EWRAM_DATA_2 u16 sUnknown_203B24C = {0};
static EWRAM_DATA_2 u16 sUnknown_203B24E = {0};
#include "data/code_801C8C4.h"
static void sub_801CC38(void);
static u32 sub_801CE58(void);
bool8 sub_801C8C4(s32 a0, s32 a1, UnkTextStruct2_sub *a2, u32 a3)
{
if (sub_801CF14(a0))
return FALSE;
if (sUnknown_203B244 == NULL)
sUnknown_203B244 = MemoryAlloc(sizeof(struct unkStruct_203B244), 8);
sUnknown_203B244->unk0 = a0;
sub_801CF94();
sUnknown_203B244->unk4E8 = a1;
sUnknown_203B244->unk4EC = &sUnknown_203B244->unk4F0[a1];
sub_8006518(sUnknown_203B244->unk4F0);
sUnknown_203B244->unk4F0[sUnknown_203B244->unk4E8] = sUnknown_80DBE54;
sUnknown_203B244->unk4EC->unk14 = sUnknown_203B244->unk550;
if (a2 != NULL)
sUnknown_203B244->unk4F0[sUnknown_203B244->unk4E8].unk8 = *a2;
sub_8012D08(sUnknown_203B244->unk4EC, a3);
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B244->unk4F0, TRUE, TRUE);
sub_8013818(&sUnknown_203B244->input, sub_801CE58(), a3, a1);
if (sUnknown_203B248 == sUnknown_203B244->unk0) {
sUnknown_203B244->input.menuIndex = sUnknown_203B24C;
sUnknown_203B244->input.unk1E = sUnknown_203B24E;
sub_8013984(&sUnknown_203B244->input);
}
sub_801CC38();
sub_801CCD8();
return TRUE;
}
u32 sub_801CA08(bool8 a0)
{
u32 index;
u32 temp;
u32 flag;
if (a0 == FALSE) {
sub_8013660(&sUnknown_203B244->input);
return 0;
}
switch (GetKeyPress(&sUnknown_203B244->input)) {
case 2:
PlayMenuSoundEffect(1);
return 2;
case 1:
PlayMenuSoundEffect(0);
return 3;
case 5:
case 6:
if (sUnknown_203B244->unk0 != 1)
goto _0801CAF2;
index = sub_801CB24();
temp = sub_801CFE0(index);
flag = FALSE;
if (temp != 0 || (flag = (INVENTORY_SIZE > GetNumberOfFilledInventorySlots() + sub_801CFB8())) || flag) {
PlayMenuSoundEffect(6);
sUnknown_203B244->unkF4[index] = sUnknown_203B244->unkF4[index] ^ 1;
sub_80138B8(&sUnknown_203B244->input,0);
sub_801CCD8();
return 1;
}
PlayMenuSoundEffect(2);
goto _0801CAF2;
case 4:
PlayMenuSoundEffect(4);
return 4;
default:
_0801CAF2:
if (sub_80138B8(&sUnknown_203B244->input, 1)) {
sub_801CC38();
sub_801CCD8();
return 1;
}
return 0;
}
}
u8 sub_801CB24(void)
{
return sUnknown_203B244->itemIDs[(sUnknown_203B244->input.unk1E * sUnknown_203B244->input.unk1C) + sUnknown_203B244->input.menuIndex];
}
void sub_801CB5C(bool8 a0)
{
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B244->unk4F0, FALSE, FALSE);
sUnknown_203B244->input.unk22 = sub_801CE58();
sub_8013984(&sUnknown_203B244->input);
sub_801CC38();
sub_801CCD8();
if (a0)
AddMenuCursorSprite(&sUnknown_203B244->input);
}
void sub_801CBB8(void)
{
if (sUnknown_203B244 != NULL) {
sUnknown_203B248 = sUnknown_203B244->unk0;
sUnknown_203B24C = sUnknown_203B244->input.menuIndex;
sUnknown_203B24E = sUnknown_203B244->input.unk1E;
sUnknown_203B244->unk4F0[sUnknown_203B244->unk4E8] = sUnknown_80DBE3C;
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B244->unk4F0, TRUE, TRUE);
MemoryFree(sUnknown_203B244);
sUnknown_203B244 = NULL;
}
}
NAKED
static void sub_801CC38(void)
{
asm_unified(
"\tpush {r4,r5,lr}\n"
"\tldr r4, _0801CCC4\n"
"\tldr r0, [r4]\n"
"\tmovs r1, 0xAA\n"
"\tlsls r1, 3\n"
"\tadds r0, r1\n"
"\tmovs r2, 0\n"
"\tmovs r1, 0x1\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tldr r1, _0801CCC8\n"
"\tadds r0, r1\n"
"\tstrb r2, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r1, 0x1\n"
"\tadds r0, r1\n"
"\tmovs r1, 0xC\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tldr r1, _0801CCCC\n"
"\tadds r0, r1\n"
"\tstrb r2, [r0]\n"
"\tldr r0, [r4]\n"
"\tldr r2, _0801CCD0\n"
"\tadds r0, r2\n"
"\tmovs r1, 0\n"
"\tldrsh r0, [r0, r1]\n"
"\tmovs r1, 0xC\n"
"\tbl sub_80095E4\n"
"\tadds r0, 0x2\n"
"\tlsls r0, 16\n"
"\tldr r3, [r4]\n"
"\tmovs r2, 0x9D\n"
"\tlsls r2, 3\n"
"\tadds r5, r3, r2\n"
"\tldr r2, [r5]\n"
"\tlsls r1, r2, 1\n"
"\tadds r1, r2\n"
"\tlsls r1, 3\n"
"\tadds r1, r3, r1\n"
"\tldr r2, _0801CCD4\n"
"\tadds r1, r2\n"
"\tasrs r2, r0, 16\n"
"\tlsrs r0, 16\n"
"\tstrh r0, [r1]\n"
"\tldr r1, [r5]\n"
"\tlsls r0, r1, 1\n"
"\tadds r0, r1\n"
"\tlsls r0, 3\n"
"\tadds r3, r0\n"
"\tadds r2, 0x2\n"
"\tmovs r0, 0xA0\n"
"\tlsls r0, 3\n"
"\tadds r3, r0\n"
"\tstrh r2, [r3]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tmovs r1, 0x9E\n"
"\tlsls r1, 3\n"
"\tadds r0, r1\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tpop {r4,r5}\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"_0801CCC4: .4byte sUnknown_203B244\n"
"_0801CCC8: .4byte 0x00000551\n"
"_0801CCCC: .4byte 0x00000553\n"
"_0801CCD0: .4byte 0x000004ce\n"
"_0801CCD4: .4byte 0x000004fe");
}
void sub_801CCD8(void)
{
u32 y;
u32 y2;
u32 uVar3;
s32 index;
u8 buffer[80];
sub_8008C54(sUnknown_203B244->unk4E8);
sub_80073B8(sUnknown_203B244->unk4E8);
xxx_call_draw_string(10, 0, sStorage, sUnknown_203B244->unk4E8, 0);
sub_8012BC4(sUnknown_203B244->unk550[2] * 8 + 4, 0, sUnknown_203B244->input.unk1E + 1, 2, 7, sUnknown_203B244->unk4E8);
for(index = 0; index < sUnknown_203B244->input.unk1A; index++) {
uVar3 = sUnknown_203B244->itemIDs[(sUnknown_203B244->input.unk1E * sUnknown_203B244->input.unk1C) + index];
BufferItemName(buffer, uVar3, NULL);
y = sub_8013800(&sUnknown_203B244->input, index);
xxx_call_draw_string(8, y, buffer, sUnknown_203B244->unk4E8, 0);
y2 = sub_8013800(&sUnknown_203B244->input, index);
sub_8012BC4((sUnknown_203B244->unk4EC->unkC * 8) - 2, y2, gTeamInventoryRef->teamStorage[uVar3], 3, 5, sUnknown_203B244->unk4E8);
if (sub_801CFE0(uVar3) & 1)
sub_8007B7C(sUnknown_203B244->unk4E8, 8, sub_8013800(&sUnknown_203B244->input, index), (sUnknown_203B244->unk4EC->unkC - 1) * '\b', 10); // TODO: Ghidra being crazy
}
sub_80073E0(sUnknown_203B244->unk4E8);
}
static u32 sub_801CE58(void)
{
u8 uVar1;
s32 orderL;
s32 orderR;
s32 itemCount;
s32 itemR;
s32 itemIndex; // re-used variable to match
itemCount = 0;
for (itemIndex = 1; itemIndex < NUMBER_OF_ITEM_IDS; itemIndex++) {
if (sUnknown_203B244->unk0 == 2 || (gTeamInventoryRef->teamStorage[itemIndex] != 0 && IsNotMoneyOrUsedTMItem(itemIndex))) {
sUnknown_203B244->itemIDs[itemCount] = itemIndex;
itemCount++;
}
}
for (itemIndex = 0; itemIndex < itemCount - 1; itemIndex++) {
for (itemR = itemIndex + 1; itemR < itemCount; itemR++) {
orderL = GetItemOrder(sUnknown_203B244->itemIDs[itemIndex]);
orderR = GetItemOrder(sUnknown_203B244->itemIDs[itemR]);
if (orderL > orderR) {
uVar1 = sUnknown_203B244->itemIDs[itemIndex];
sUnknown_203B244->itemIDs[itemIndex] = sUnknown_203B244->itemIDs[itemR];
sUnknown_203B244->itemIDs[itemR] = uVar1;
}
}
}
return itemCount;
}
bool8 sub_801CF14(s32 a0)
{
s32 itemID;
if (a0 == 2)
return FALSE;
for (itemID = ITEM_STICK; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
if (gTeamInventoryRef->teamStorage[itemID] != 0 && IsNotMoneyOrUsedTMItem(itemID))
return FALSE;
}
return TRUE;
}
bool8 sub_801CF50(s32 a0)
{
s32 itemID;
if (a0 == 2)
return FALSE;
for (itemID = ITEM_STICK; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
if (IsNotMoneyOrUsedTMItem(itemID) && gTeamInventoryRef->teamStorage[itemID] < 999)
return FALSE;
}
return TRUE;
}
void sub_801CF94(void)
{
s32 itemID;
for (itemID = ITEM_NOTHING; itemID < NUMBER_OF_ITEM_IDS; itemID++)
sUnknown_203B244->unkF4[itemID] = 0;
}
s32 sub_801CFB8(void)
{
s32 itemID;
s32 counter;
counter = 0;
for (itemID = ITEM_NOTHING; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
if (sUnknown_203B244->unkF4[itemID] != 0)
counter++;
}
return counter;
}
u32 sub_801CFE0(u8 index)
{
return sUnknown_203B244->unkF4[index];
}
UNUSED static void sub_801CFF4(u8 index, u32 value)
{
sUnknown_203B244->unkF4[index] = value;
}
struct unkStruct_203B244 *sub_801D008(void)
{
return sUnknown_203B244;
}

622
src/code_801D014.c Normal file
View File

@ -0,0 +1,622 @@
#include "global.h"
#include "bg_palette_buffer.h"
#include "code_800D090.h"
#include "code_80130A8.h"
#include "code_801BEEC.h"
#include "code_801D014.h"
#include "code_801EE10_1.h"
#include "code_8023144.h"
#include "code_8096AF8.h"
#include "common_strings.h"
#include "constants/friend_area.h"
#include "event_flag.h"
#include "friend_area.h"
#include "friend_area_action_menu.h"
#include "friend_list_menu.h"
#include "ground_lives.h"
#include "ground_main.h"
#include "ground_map_1.h"
#include "memory.h"
#include "menu_input.h"
#include "options_menu.h"
#include "party_list_menu.h"
#include "rescue_team_info.h"
#include "text1.h"
#include "text2.h"
#include "wigglytuff_shop.h"
#include "wonder_mail_2_1.h"
extern u8 gAvailablePokemonNames[]; // 202DF98
static EWRAM_DATA_2 struct unk_203B250 *sUnknown_203B250 = {0};
static EWRAM_DATA_2 u32 sUnknown_203B254 = {0};
extern const struct FileArchive gTitleMenuFileArchive;
#include "data/code_801D014.h"
static void LoadTeamRankBadge(u32, u32, u32);
static void sub_801D208(u32 newState);
static void sub_801D220(void);
static void sub_801D3A8(void);
static void sub_801D4C0(void);
static void sub_801D680(void);
static void sub_801D760(void);
static void sub_801D77C(void);
static void sub_801D798(void);
static void sub_801D7CC(void);
static void sub_801D808(void);
static void sub_801D824(void);
static void sub_801D840(void);
static void sub_801D85C(void);
static void sub_801D878(void);
static void sub_801D894(void);
bool8 sub_801D014(PokemonStruct1 *a0)
{
s32 index;
PokemonStruct1 *pokemon;
struct unk_203B250 *preload;
ResetUnusedInputStruct();
sub_800641C(NULL, TRUE, TRUE);
sUnknown_203B250 = MemoryAlloc(sizeof(struct unk_203B250), 8);
sUnknown_203B250->menuAction = sUnknown_203B254;
sUnknown_203B250->pokeStruct = a0;
if (sUnknown_203B250->pokeStruct != NULL) {
for (index = 0; index < NUM_MONSTERS; index++) {
preload = sUnknown_203B250;
pokemon = &gRecruitedPokemonRef->pokemon[(s16)index]; // cast is needed here
if (preload->pokeStruct == pokemon) {
preload->index = index;
break;
}
}
}
else
sUnknown_203B250->index = NUM_MONSTERS;
sUnknown_203B250->currFriendAreaLocation = sub_8002658(sub_80A5728());
sUnknown_203B250->unk8 = 0;
sUnknown_203B250->unk9 = 0;
sUnknown_203B250->unkC = GetPlayerPokemonStruct();
sUnknown_203B250->unk7 = 0;
if (sUnknown_203B250->pokeStruct != NULL)
sub_801D208(5);
else
sub_801D208(0);
return TRUE;
}
u32 sub_801D0DC(void)
{
switch (sUnknown_203B250->state) {
case 0:
case 1:
sub_801D680();
break;
case 3:
sub_801D760();
break;
case 4:
sub_801D77C();
break;
case 5:
sub_801D798();
break;
case 6:
case 7:
sub_801D7CC();
break;
case 8:
sub_801D808();
break;
case 9:
sub_801D824();
break;
case 10:
sub_801D840();
break;
case 11:
sub_801D85C();
break;
case 12:
sub_801D878();
break;
default:
return 3;
}
return 0;
}
u32 sub_801D178(void)
{
PokemonStruct1 *pokeStruct;
if (sUnknown_203B250->unk9 != 0)
return 2;
if (sUnknown_203B250->unk7 != 0)
return 3;
if (sUnknown_203B250->unk8 != 0)
return 1;
if (sUnknown_203B250->unkC != GetPlayerPokemonStruct())
goto _ret4;
if (sub_80A7AE8(7) < 0)
return 0;
pokeStruct = sub_808D3F8();
if (!(pokeStruct->unk0 >> 1 & 1))
_ret4:
return 4;
return 0;
}
u8 sub_801D1D4(void)
{
return sUnknown_203B250->unk7;
}
void sub_801D1E0(void)
{
if (sUnknown_203B250 != NULL) {
sUnknown_203B254 = sUnknown_203B250->menuAction;
MemoryFree(sUnknown_203B250);
sUnknown_203B250 = NULL;
}
}
static void sub_801D208(u32 newState)
{
sUnknown_203B250->state = newState;
sub_801D220();
sub_801D3A8();
}
static void sub_801D220(void)
{
s32 i;
sub_8006518(sUnknown_203B250->unkB8);
switch (sUnknown_203B250->state) {
case 0:
sub_801D4C0();
if (sUnknown_203B250->pokeStruct != NULL) {
for (i = 0; i < 4; i++)
sUnknown_203B250->unkB8[i] = sUnknown_80DBE7C;
sUnknown_203B250->unkB8[0] = sUnknown_80DBE98;
sub_8012CAC(sUnknown_203B250->unkB8, sUnknown_203B250->unk68);
sUnknown_203B250->unkB8[0].unkC = 9;
}
else {
for (i = 0; i < 4; i++)
sUnknown_203B250->unkB8[i] = sUnknown_80DBEB0[i];
sub_8012CAC(sUnknown_203B250->unkB8, sUnknown_203B250->unk68);
sUnknown_203B250->unkB8[0].unkC = 8;
}
break;
case 1:
sub_801D4C0();
if (sUnknown_203B250->pokeStruct != NULL) {
for (i = 0; i < 4; i++)
sUnknown_203B250->unkB8[i] = sUnknown_80DBE7C;
sUnknown_203B250->unkB8[0] = sUnknown_80DBE98;
sub_8012CAC(sUnknown_203B250->unkB8, sUnknown_203B250->unk68);
sUnknown_203B250->unkB8[0].unkC = 9;
}
else {
for (i = 0; i < 4; i++)
sUnknown_203B250->unkB8[i] = sUnknown_80DBEB0[i];
sub_8012CAC(sUnknown_203B250->unkB8, sUnknown_203B250->unk68);
sUnknown_203B250->unkB8[0].unkC = 8;
}
break;
default:
for (i = 0; i < 4; i++)
sUnknown_203B250->unkB8[i] = sUnknown_80DBE7C;
break;
}
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B250->unkB8, TRUE, TRUE);
}
static void sub_801D3A8(void)
{
switch (sUnknown_203B250->state) {
case 0:
case 1:
if (sUnknown_203B250->pokeStruct != NULL) {
PrintColoredPokeNameToBuffer(gAvailablePokemonNames, sUnknown_203B250->pokeStruct, 7);
sUnknown_203B250->unk18.unk0 = gAvailablePokemonNames;
sub_8012D60(&sUnknown_203B250->unk18, sUnknown_203B250->unk68, 0, sUnknown_203B250->unkA8, sUnknown_203B250->menuAction, 0);
}
else {
sub_801D894();
sub_8012D60(&sUnknown_203B250->unk18, sUnknown_203B250->unk68, 0, sUnknown_203B250->unkA8, sUnknown_203B250->menuAction, 0);
}
break;
case 3:
sub_80227B8(sUnknown_203B250->pokeStruct);
break;
case 4:
sub_8027074();
break;
case 5:
sub_8025EF4(sUnknown_203B250->pokeStruct);
break;
case 6:
sub_80252F0(0);
break;
case 7:
sub_80252F0(1);
break;
case 8:
sub_8024458(sUnknown_203B250->index, 2);
break;
case 9:
sub_801BEEC(sUnknown_203B250->index);
break;
case 10:
sub_8021774(sUnknown_203B250->currFriendAreaLocation, TRUE, 2);
break;
case 11:
InitializeJobListMenu(0);
break;
case 12:
sub_801DCC4();
break;
}
}
static void sub_801D4C0(void)
{
s32 index;
s32 loopMax;
loopMax = 0;
MemoryFill16(sUnknown_203B250->unkA8, 0, sizeof(sUnknown_203B250->unkA8));
if (sUnknown_203B250->currFriendAreaLocation == 0) {
if (sub_8096E2C()) {
sUnknown_203B250->unk68[loopMax].menuAction = 2;
sUnknown_203B250->unk68[loopMax].text = sItems;
if (GetNumberOfFilledInventorySlots() == 0)
sUnknown_203B250->unkA8[loopMax] = 1;
loopMax++;
sUnknown_203B250->unk68[loopMax].text = sTeam;
sUnknown_203B250->unk68[loopMax].menuAction = 4;
loopMax++;
if (sub_80023E4(2)) {
sUnknown_203B250->unk68[loopMax].text = sJobList;
sUnknown_203B250->unk68[loopMax].menuAction = 9;
if (HasNoAcceptedJobs())
sUnknown_203B250->unkA8[loopMax] = 1;
loopMax++;
}
}
sUnknown_203B250->unk68[loopMax].text = sOthers;
sUnknown_203B250->unk68[loopMax].menuAction = 11;
loopMax++;
}
else {
strcpy(gAvailablePokemonNames, sTripleQuestionMark);
if (sub_8096E2C()) {
sUnknown_203B250->unk68[loopMax].text = gCommonFriend[0];
sUnknown_203B250->unk68[loopMax].menuAction = 5;
if (sub_8024108(4))
sUnknown_203B250->unkA8[loopMax] = 1;
loopMax++;
sUnknown_203B250->unk68[loopMax].menuAction = 2;
sUnknown_203B250->unk68[loopMax].text = sItems;
if (GetNumberOfFilledInventorySlots() == 0)
sUnknown_203B250->unkA8[loopMax] = 1;
loopMax++;
}
sUnknown_203B250->unk68[loopMax].text = gCommonInfo[0];
sUnknown_203B250->unk68[loopMax].menuAction = 8;
loopMax++;
sUnknown_203B250->unk68[loopMax].text = gCommonExit[0];
sUnknown_203B250->unk68[loopMax].menuAction = 10;
loopMax++;
}
sUnknown_203B250->unk68[loopMax].text = NULL;
sUnknown_203B250->unk68[loopMax].menuAction = 1;
for (index = 0; index < loopMax; index++) {
if (sUnknown_203B250->unkA8[index] == 0) {
if (sUnknown_203B250->unk68[index].menuAction == sUnknown_203B250->menuAction)
return;
}
}
for (index = 0; index < loopMax; index++) {
if (sUnknown_203B250->unkA8[index] == 0) {
sUnknown_203B250->menuAction = sUnknown_203B250->unk68[index].menuAction;
break;
}
}
}
static void sub_801D680(void)
{
s32 menuAction;
menuAction = 0;
if (!sub_8012FD8(&sUnknown_203B250->unk18)) {
sub_8013114(&sUnknown_203B250->unk18, &menuAction);
if (menuAction != 1)
sUnknown_203B250->menuAction = menuAction;
}
switch (menuAction) {
case 2:
sub_801D208(3);
break;
case 4:
sub_801D208(6);
break;
case 3:
sub_801D208(4);
break;
case 5:
sub_801D208(7);
break;
case 6:
sub_801D208(8);
break;
case 7:
sub_801D208(9);
break;
case 8:
sub_801D208(10);
break;
case 9:
sub_801D208(11);
break;
case 10:
sUnknown_203B250->unk9 = 1;
sub_801D208(2);
break;
case 11:
sub_801D208(12);
break;
case 1:
sub_801D208(2);
break;
}
}
static void sub_801D760(void)
{
switch (sub_8022860()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_8022908();
sub_801D208(1);
break;
}
}
static void sub_801D77C(void)
{
switch (sub_80270A4()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_8027168();
sub_801D208(1);
break;
}
}
static void sub_801D798(void)
{
switch (sub_8025F68()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
if (sub_802604C())
sUnknown_203B250->unk7 = sUnknown_203B250->currFriendAreaLocation;
sub_8026058();
sub_801D208(2);
break;
}
}
static void sub_801D7CC(void)
{
switch (sub_8025354()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sUnknown_203B250->unk7 = sub_802540C();
sub_8025418();
if (sUnknown_203B250->unk7 != 0)
sub_801D208(2);
else
sub_801D208(1);
break;
}
}
static void sub_801D808(void)
{
switch (sub_80244E4()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_802453C();
sub_801D208(1);
break;
}
}
static void sub_801D824(void)
{
switch (sub_801BF48()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_801BF98();
sub_801D208(1);
break;
}
}
static void sub_801D840(void)
{
switch (sub_80217EC()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_8021830();
sub_801D208(1);
break;
}
}
static void sub_801D85C(void)
{
switch (sub_802C898()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_802C8F4();
sub_801D208(1);
break;
}
}
static void sub_801D878(void)
{
switch (sub_801DCE8()) {
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_801DD50();
sub_801D208(1);
break;
}
}
static void sub_801D894(void)
{
u8 rank;
const u8 *location;
s32 location_length;
s32 x_coord;
// Stored on stack
u32 *preload_string;
const u8 *r5; // R5
u8 buffer[96]; // sp +4
if (sUnknown_203B250->currFriendAreaLocation == FRIEND_AREA_NONE)
location = sub_8098FB4();
else
location = GetFriendAreaName(sUnknown_203B250->currFriendAreaLocation);
// TODO this is def a hack
xxx_format_string(location, buffer, (u8 *)(&preload_string + 1), 0);
location_length = sub_8008ED0(buffer);
x_coord = (128 - location_length) / 2; // Centers the location name
sub_8008C54(1);
sub_80073B8(1);
xxx_call_draw_string(x_coord, 4, buffer, 1, 0);
sub_80073E0(1);
sub_8008C54(2);
sub_80073B8(2);
LoadTeamRankBadge(2, 8, 6);
// Have to load before TeamRank funcs
r5 = sFmtPointsCyan; // %s {COLOR_1 CYAN}%d{END_COLOR_TEXT_1} Pts.
rank = GetRescueTeamRank();
sprintfStatic(buffer, r5, GetTeamRankString(rank), GetTeamRankPts());
xxx_call_draw_string(32, 4, buffer, 2, 0);
sprintfStatic(buffer, sFmtMoneyCyan, gTeamInventoryRef->teamMoney);
xxx_call_draw_string(32, 18, buffer, 2, 0);
sub_80073E0(2);
}
static void LoadTeamRankBadge(u32 a0, u32 a1, u32 a2)
{
OpenedFile *teamBadgeFile;
s32 palleteIndex;
u8 rank;
u8 *colorArray;
u8 *teamBadgePic;
teamBadgeFile = OpenFileAndGetFileDataPtr(sTeamRankBadgeFileName, &gTitleMenuFileArchive);
teamBadgePic = ((struct TeamBadgeData *)(teamBadgeFile->data))->pics;
colorArray = ((struct TeamBadgeData *)(teamBadgeFile->data))->pallete;
for (palleteIndex = 0; palleteIndex < 16; palleteIndex++) {
SetBGPaletteBufferColorArray(palleteIndex + 224, colorArray);
colorArray = colorArray + 4;
}
rank = GetRescueTeamRank();
teamBadgePic = &teamBadgePic[rank * 128];
sub_8007E20(a0, a1, a2, 16, 16, teamBadgePic, 14);
CloseFile(teamBadgeFile);
}

View File

@ -1,686 +0,0 @@
#include "global.h"
#include "bg_palette_buffer.h"
#include "code_801EE10_1.h"
#include "friend_area.h"
#include "constants/friend_area.h"
#include "constants/input.h"
#include "file_system.h"
#include "friend_list_menu.h"
#include "items.h"
#include "menu.h"
#include "pokemon.h"
#include "memory.h"
#include "input.h"
#include "text1.h"
#include "text2.h"
#include "rescue_team_info.h"
#include "code_800D090.h"
#include "menu_input.h"
#include "code_8021774.h"
#include "code_80118A4.h"
#include "wigglytuff_shop.h"
#include "event_flag.h"
#include "ground_main.h"
#include "code_801C620.h"
#include "common_strings.h"
struct unkStruct_203B258
{
// size: 0xA0
MenuInputStruct input;
u32 unk34;
UnkTextStruct2 *unk38;
UnkTextStruct2 unk3C[4];
u8 unk9C[4];
};
extern struct unkStruct_203B258 *gUnknown_203B258;
extern UnkTextStruct2 gUnknown_80DBF88;
extern UnkTextStruct2 gUnknown_80DBF70;
extern unkStruct_811BAF4 gUnknown_811BAF4[10];
struct unkStruct_81188F0
{
u8 *text1;
u8 *text2;
u8 *text3;
u8 *text4;
u32 unk1;
u32 unk2;
u32 unk3;
};
extern struct unkStruct_81188F0 gUnknown_81188F0[10];
extern u8 gUnknown_80DBFA0[]; // Field
extern void sub_801DB54();
extern void sub_801DBD4();
extern void sub_801D208(u8);
extern u32 sub_801DCE8(void);
extern void sub_801DD50(void);
extern u32 sub_8022860();
extern void sub_8022908();
extern u32 sub_80244E4(void);
extern u32 sub_8025F68();
extern u8 sub_802604C();
extern void sub_8026058();
extern void sub_8027168();
extern u32 sub_80270A4();
extern u32 sub_802C898(void);
extern void sub_802C8F4(void);
extern void InitializeJobListMenu(u32);
extern const char *sub_8098FB4();
extern void xxx_format_string(const char *, u8 *, u32 **, u32);
extern s32 sub_8008ED0(u8 *);
void LoadTeamRankBadge(u32, u32, u32);
extern struct FileArchive gTitleMenuFileArchive;
extern const char gTeamRankBadgeFileName;
extern u8 gAvailablePokemonNames[];
extern char gUnknown_80DBF3C[];
extern char gUnknown_80DBF4C[];
extern u8 gMenuItems[];
extern u8 gMenuJobList[];
extern u8 gMenuTeam[];
extern u8 gMenuOthers[];
extern u8 gUnknown_80DBF34[];
struct TeamBadgeData
{
/* 0x0 */ u8 *pics; // probably a pointer to an arrays of pixels?
/* 0x4 */ u8 *pallete; // Pics share common pallete
};
struct unk_203B250
{
PokemonStruct1 *pokeStruct;
s16 index;
/* 0x6 */ u8 currFriendAreaLocation; // 0 when not in a friend area
u8 unk7;
u8 unk8;
u8 unk9;
PokemonStruct1 *unkC;
u32 state;
u32 menuAction;
MenuStruct unk18;
MenuItem unk68[8];
u16 unkA8[8];
UnkTextStruct2 unkB8[4];
};
struct unk_203B250 *gUnknown_203B250;
extern bool8 HasNoAcceptedJobs(void);
extern bool8 sub_8024108(u32);
extern bool8 sub_8096E2C(void);
extern u32 sub_801DCC4(void);
extern u32 sub_8027074(void);
extern void sub_80227B8(PokemonStruct1 *);
void sub_801D894(void);
u32 sub_8025EF4(PokemonStruct1 *);
void sub_801D3A8(void)
{
switch(gUnknown_203B250->state)
{
case 0:
case 1:
if(gUnknown_203B250->pokeStruct != NULL)
{
PrintColoredPokeNameToBuffer(gAvailablePokemonNames, gUnknown_203B250->pokeStruct, 7);
gUnknown_203B250->unk18.unk0 = gAvailablePokemonNames;
sub_8012D60(&gUnknown_203B250->unk18, gUnknown_203B250->unk68, 0, gUnknown_203B250->unkA8, gUnknown_203B250->menuAction, 0);
}
else {
sub_801D894();
sub_8012D60(&gUnknown_203B250->unk18, gUnknown_203B250->unk68, 0, gUnknown_203B250->unkA8, gUnknown_203B250->menuAction, 0);
}
break;
case 3:
sub_80227B8(gUnknown_203B250->pokeStruct);
break;
case 4:
sub_8027074();
break;
case 5:
sub_8025EF4(gUnknown_203B250->pokeStruct);
break;
case 6:
sub_80252F0(0);
break;
case 7:
sub_80252F0(1);
break;
case 8:
sub_8024458(gUnknown_203B250->index, 2);
break;
case 9:
sub_801BEEC(gUnknown_203B250->index);
break;
case 10:
sub_8021774(gUnknown_203B250->currFriendAreaLocation, TRUE, 2);
break;
case 11:
InitializeJobListMenu(0);
break;
case 12:
sub_801DCC4();
break;
}
}
void sub_801D4C0(void)
{
s32 index;
s32 loopMax;
loopMax = 0;
MemoryFill16(gUnknown_203B250->unkA8,0,sizeof(gUnknown_203B250->unkA8));
if (gUnknown_203B250->currFriendAreaLocation == 0) {
if (sub_8096E2C()) {
gUnknown_203B250->unk68[loopMax].menuAction = 2;
gUnknown_203B250->unk68[loopMax].text = gMenuItems;
if (GetNumberOfFilledInventorySlots() == 0) {
gUnknown_203B250->unkA8[loopMax] = 1;
}
loopMax++;
gUnknown_203B250->unk68[loopMax].text = gMenuTeam;
gUnknown_203B250->unk68[loopMax].menuAction = 4;
loopMax++;
if (sub_80023E4(2)) {
gUnknown_203B250->unk68[loopMax].text = gMenuJobList;
gUnknown_203B250->unk68[loopMax].menuAction = 9;
if (HasNoAcceptedJobs()) {
gUnknown_203B250->unkA8[loopMax] = 1;
}
loopMax++;
}
}
gUnknown_203B250->unk68[loopMax].text = gMenuOthers;
gUnknown_203B250->unk68[loopMax].menuAction = 0xb;
loopMax++;
}
else {
strcpy(gAvailablePokemonNames,gUnknown_80DBF34);
if (sub_8096E2C()) {
gUnknown_203B250->unk68[loopMax].text = *gCommonFriend;
gUnknown_203B250->unk68[loopMax].menuAction = 5;
if (sub_8024108(4)) {
gUnknown_203B250->unkA8[loopMax] = 1;
}
loopMax++;
gUnknown_203B250->unk68[loopMax].menuAction = 2;
gUnknown_203B250->unk68[loopMax].text = gMenuItems;
if (GetNumberOfFilledInventorySlots() == 0) {
gUnknown_203B250->unkA8[loopMax] = 1;
}
loopMax++;
}
gUnknown_203B250->unk68[loopMax].text = *gCommonInfo;
gUnknown_203B250->unk68[loopMax].menuAction = 8;
loopMax++;
gUnknown_203B250->unk68[loopMax].text = *gCommonExit;
gUnknown_203B250->unk68[loopMax].menuAction = 10;
loopMax++;
}
gUnknown_203B250->unk68[loopMax].text = NULL;
gUnknown_203B250->unk68[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
if(gUnknown_203B250->unkA8[index] == 0)
{
if(gUnknown_203B250->unk68[index].menuAction == gUnknown_203B250->menuAction)
{
return;
}
}
}
for(index = 0; index < loopMax; index++)
{
if(gUnknown_203B250->unkA8[index] == 0)
{
gUnknown_203B250->menuAction = gUnknown_203B250->unk68[index].menuAction;
break;
}
}
}
void sub_801D680(void)
{
int menuAction;
menuAction = 0;
if (!(sub_8012FD8(&gUnknown_203B250->unk18)) && (sub_8013114(&gUnknown_203B250->unk18,&menuAction), menuAction != 1)) {
gUnknown_203B250->menuAction = menuAction;
}
switch(menuAction) {
case 2:
sub_801D208(3);
break;
case 4:
sub_801D208(6);
break;
case 3:
sub_801D208(4);
break;
case 5:
sub_801D208(7);
break;
case 6:
sub_801D208(8);
break;
case 7:
sub_801D208(9);
break;
case 8:
sub_801D208(10);
break;
case 9:
sub_801D208(0xb);
break;
case 10:
gUnknown_203B250->unk9 = 1;
sub_801D208(2);
break;
case 11:
sub_801D208(0xc);
break;
case 1:
sub_801D208(2);
break;
}
}
void sub_801D760()
{
switch(sub_8022860())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_8022908();
sub_801D208(1);
break;
}
}
void sub_801D77C()
{
switch(sub_80270A4())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_8027168();
sub_801D208(1);
break;
}
}
void sub_801D798(void)
{
switch(sub_8025F68())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
if(sub_802604C() != 0)
gUnknown_203B250->unk7 = gUnknown_203B250->currFriendAreaLocation;
sub_8026058();
sub_801D208(2);
break;
}
}
void sub_801D7CC()
{
switch(sub_8025354())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
gUnknown_203B250->unk7 = sub_802540C();
sub_8025418();
if(gUnknown_203B250->unk7 != 0)
{
sub_801D208(2);
}
else
{
sub_801D208(1);
}
break;
}
}
void sub_801D808(void)
{
switch(sub_80244E4())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_802453C();
sub_801D208(1);
break;
}
}
void sub_801D824(void)
{
switch(sub_801BF48())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_801BF98();
sub_801D208(1);
break;
}
}
void sub_801D840(void)
{
switch(sub_80217EC())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_8021830();
sub_801D208(1);
break;
}
}
void sub_801D85C(void)
{
switch(sub_802C898())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_802C8F4();
sub_801D208(1);
break;
}
}
void sub_801D878(void)
{
switch(sub_801DCE8())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_801DD50();
sub_801D208(1);
break;
}
}
void sub_801D894(void)
{
u8 rank;
const char *location;
int location_length;
s32 x_coord;
// Stored on stack
u32 *preload_string;
char *r5; // R5
char buffer [96]; // sp +4
if (gUnknown_203B250->currFriendAreaLocation == NONE) {
location = sub_8098FB4();
}
else {
location = GetFriendAreaName(gUnknown_203B250->currFriendAreaLocation);
}
// TODO this is def a hack
xxx_format_string(location, buffer, &preload_string + 1, 0);
location_length = sub_8008ED0(buffer);
x_coord = (128 - location_length) / 2; // Centers the location name
sub_8008C54(1);
sub_80073B8(1);
xxx_call_draw_string(x_coord, 4, buffer, 1, 0);
sub_80073E0(1);
sub_8008C54(2);
sub_80073B8(2);
LoadTeamRankBadge(2, 8, 6);
// Have to load before TeamRank funcs
r5 = gUnknown_80DBF3C; // %s {COLOR_1 CYAN}%d{END_COLOR_TEXT_1} Pts.
rank = GetRescueTeamRank();
sprintfStatic(buffer, r5, GetTeamRankString(rank), GetTeamRankPts());
xxx_call_draw_string(32, 4, buffer, 2, 0);
sprintfStatic(buffer, gUnknown_80DBF4C, gTeamInventoryRef->teamMoney);
xxx_call_draw_string(32, 18, buffer, 2, 0);
sub_80073E0(2);
}
void LoadTeamRankBadge(u32 param_1, u32 param_2, u32 param_3)
{
OpenedFile *teamBadgeFile;
s32 palleteIndex;
u8 rank;
u8 *colorArray;
u8 *teamBadgePic;
teamBadgeFile = OpenFileAndGetFileDataPtr(&gTeamRankBadgeFileName, &gTitleMenuFileArchive);
teamBadgePic = ((struct TeamBadgeData *)(teamBadgeFile->data))->pics;
colorArray = ((struct TeamBadgeData *)(teamBadgeFile->data))->pallete;
for(palleteIndex = 0; palleteIndex < 16; palleteIndex++){
SetBGPaletteBufferColorArray(palleteIndex + 224,colorArray);
colorArray = colorArray + 4;
}
rank = GetRescueTeamRank();
teamBadgePic = &teamBadgePic[rank << 7]; // TODO figure out why the lft shft 7 is needed
sub_8007E20(param_1, param_2, param_3, 16, 16, teamBadgePic, 14);
CloseFile(teamBadgeFile);
}
u32 sub_801D9E4(void)
{
gUnknown_203B258 = MemoryAlloc(sizeof(struct unkStruct_203B258),8);
gUnknown_203B258->unk34 = 3;
gUnknown_203B258->unk38 = &gUnknown_203B258->unk3C[3];
sub_8006518(gUnknown_203B258->unk3C);
gUnknown_203B258->unk3C[gUnknown_203B258->unk34] = gUnknown_80DBF88;
gUnknown_203B258->unk38->unk14 = gUnknown_203B258->unk9C;
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B258->unk3C, TRUE, TRUE);
sub_8013818(&gUnknown_203B258->input,0xe5,10,gUnknown_203B258->unk34);
sub_801DB54();
sub_801DBD4();
return 1;
}
void sub_801DA58(s16 param_0)
{
s32 cast;
cast = param_0;
sub_8013878(&gUnknown_203B258->input, cast);
sub_801DB54();
sub_801DBD4();
}
u32 sub_801DA78(void)
{
switch(GetKeyPress(&gUnknown_203B258->input))
{
case INPUT_B_BUTTON:
PlayMenuSoundEffect(1);
return 2;
case INPUT_A_BUTTON:
return 3;
default:
if(sub_80138B8(&gUnknown_203B258->input, 1) != 0)
{
sub_801DB54();
sub_801DBD4();
return 1;
}
else {
return 0;
}
}
}
s16 sub_801DAC0(void)
{
return (gUnknown_203B258->input.unk1E * gUnknown_203B258->input.unk1C) + gUnknown_203B258->input.menuIndex;
}
void sub_801DADC(u8 r0)
{
gUnknown_203B258->input.unk22 = 0xE5;
sub_8013984(&gUnknown_203B258->input);
sub_801DB54();
sub_801DBD4();
if(r0)
AddMenuCursorSprite(&gUnknown_203B258->input);
}
void sub_801DB0C(void)
{
if(gUnknown_203B258 != NULL)
{
gUnknown_203B258->unk3C[gUnknown_203B258->unk34] = gUnknown_80DBF70;
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B258->unk3C, TRUE, TRUE);
MemoryFree(gUnknown_203B258);
gUnknown_203B258 = NULL;
}
}
NAKED // sub_80095E4 memes
void sub_801DB54(void)
{
asm_unified(
"\tpush {r4,lr}\n"
"\tldr r4, _0801DBD0\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9C\n"
"\tmovs r2, 0\n"
"\tmovs r1, 0x1\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9D\n"
"\tstrb r2, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9E\n"
"\tmovs r1, 0x8\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9F\n"
"\tstrb r2, [r0]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x3C\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tldr r0, [r4]\n"
"\tmovs r1, 0x1A\n"
"\tldrsh r0, [r0, r1]\n"
"\tmovs r1, 0xC\n"
"\tbl sub_80095E4\n"
"\tadds r0, 0x2\n"
"\tlsls r0, 16\n"
"\tldr r2, [r4]\n"
"\tldr r3, [r2, 0x34]\n"
"\tlsls r1, r3, 1\n"
"\tadds r1, r3\n"
"\tlsls r1, 3\n"
"\tadds r1, r2, r1\n"
"\tadds r1, 0x4A\n"
"\tasrs r3, r0, 16\n"
"\tlsrs r0, 16\n"
"\tstrh r0, [r1]\n"
"\tldr r1, [r2, 0x34]\n"
"\tlsls r0, r1, 1\n"
"\tadds r0, r1\n"
"\tlsls r0, 3\n"
"\tadds r2, r0\n"
"\tadds r3, 0x2\n"
"\tadds r2, 0x4C\n"
"\tstrh r3, [r2]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x3C\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tpop {r4}\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"_0801DBD0: .4byte gUnknown_203B258");
}
void sub_801DBD4(void)
{
unkStruct_811BAF4 *temp;
struct unkStruct_81188F0 *temp2;
s32 y;
#ifndef NONMATCHING
register s32 x asm("r4");
#else
s32 x;
#endif
s16 index;
int counter;
sub_8008C54(gUnknown_203B258->unk34);
sub_80073B8(gUnknown_203B258->unk34);
xxx_call_draw_string(10,0,gUnknown_80DBFA0,gUnknown_203B258->unk34,0); // Field
x = gUnknown_203B258->unk9C[2] * 8 - 2;
sub_8012BC4(x,0,gUnknown_203B258->input.unk1E + 1,2,7,gUnknown_203B258->unk34);
for(counter = 0; counter < gUnknown_203B258->input.unk1A; counter++)
{
index = gUnknown_203B258->input.unk1E * gUnknown_203B258->input.unk1C + counter;
temp = &gUnknown_811BAF4[index];
temp2 = &gUnknown_81188F0[temp->unk4];
y = sub_8013800(&gUnknown_203B258->input, counter);
xxx_call_draw_string(8,y,temp2->text1,gUnknown_203B258->unk34,0);
y = sub_8013800(&gUnknown_203B258->input,counter);
xxx_call_draw_string(0x3e,y,temp->text,gUnknown_203B258->unk34,0);
}
sub_80073E0(gUnknown_203B258->unk34);
}

188
src/code_801D9E4.c Normal file
View File

@ -0,0 +1,188 @@
#include "global.h"
#include "code_80118A4.h"
#include "code_801D9E4.h"
#include "constants/input.h"
#include "ground_main.h"
#include "memory.h"
#include "menu_input.h"
#include "text1.h"
#include "text2.h"
static EWRAM_DATA_2 struct unkStruct_203B258 *sUnknown_203B258 = {0};
extern struct unkStruct_81188F0 gUnknown_81188F0[10];
extern unkStruct_811BAF4 gUnknown_811BAF4[10];
#include "data/code_801D9E4.h"
static void sub_801DB54(void);
static void sub_801DBD4(void);
bool8 sub_801D9E4(void)
{
sUnknown_203B258 = MemoryAlloc(sizeof(struct unkStruct_203B258), 8);
sUnknown_203B258->unk34 = 3;
sUnknown_203B258->unk38 = &sUnknown_203B258->unk3C[3];
sub_8006518(sUnknown_203B258->unk3C);
sUnknown_203B258->unk3C[sUnknown_203B258->unk34] = sUnknown_80DBF88;
sUnknown_203B258->unk38->unk14 = sUnknown_203B258->unk9C;
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B258->unk3C, TRUE, TRUE);
sub_8013818(&sUnknown_203B258->input, 229, 10, sUnknown_203B258->unk34);
sub_801DB54();
sub_801DBD4();
return TRUE;
}
void sub_801DA58(s16 a0)
{
s32 cast;
cast = a0;
sub_8013878(&sUnknown_203B258->input, cast);
sub_801DB54();
sub_801DBD4();
}
u32 sub_801DA78(void)
{
switch (GetKeyPress(&sUnknown_203B258->input)) {
case INPUT_B_BUTTON:
PlayMenuSoundEffect(1);
return 2;
case INPUT_A_BUTTON:
return 3;
default:
if (sub_80138B8(&sUnknown_203B258->input, 1)) {
sub_801DB54();
sub_801DBD4();
return 1;
}
return 0;
}
}
s16 sub_801DAC0(void)
{
return (sUnknown_203B258->input.unk1E * sUnknown_203B258->input.unk1C) + sUnknown_203B258->input.menuIndex;
}
UNUSED static void sub_801DADC(bool8 a0)
{
sUnknown_203B258->input.unk22 = 229;
sub_8013984(&sUnknown_203B258->input);
sub_801DB54();
sub_801DBD4();
if (a0)
AddMenuCursorSprite(&sUnknown_203B258->input);
}
void sub_801DB0C(void)
{
if (sUnknown_203B258 != NULL) {
sUnknown_203B258->unk3C[sUnknown_203B258->unk34] = sUnknown_80DBF70;
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B258->unk3C, TRUE, TRUE);
MemoryFree(sUnknown_203B258);
sUnknown_203B258 = NULL;
}
}
NAKED // sub_80095E4 memes
static void sub_801DB54(void)
{
asm_unified(
"\tpush {r4,lr}\n"
"\tldr r4, _0801DBD0\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9C\n"
"\tmovs r2, 0\n"
"\tmovs r1, 0x1\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9D\n"
"\tstrb r2, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9E\n"
"\tmovs r1, 0x8\n"
"\tstrb r1, [r0]\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x9F\n"
"\tstrb r2, [r0]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x3C\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tldr r0, [r4]\n"
"\tmovs r1, 0x1A\n"
"\tldrsh r0, [r0, r1]\n"
"\tmovs r1, 0xC\n"
"\tbl sub_80095E4\n"
"\tadds r0, 0x2\n"
"\tlsls r0, 16\n"
"\tldr r2, [r4]\n"
"\tldr r3, [r2, 0x34]\n"
"\tlsls r1, r3, 1\n"
"\tadds r1, r3\n"
"\tlsls r1, 3\n"
"\tadds r1, r2, r1\n"
"\tadds r1, 0x4A\n"
"\tasrs r3, r0, 16\n"
"\tlsrs r0, 16\n"
"\tstrh r0, [r1]\n"
"\tldr r1, [r2, 0x34]\n"
"\tlsls r0, r1, 1\n"
"\tadds r0, r1\n"
"\tlsls r0, 3\n"
"\tadds r2, r0\n"
"\tadds r3, 0x2\n"
"\tadds r2, 0x4C\n"
"\tstrh r3, [r2]\n"
"\tbl ResetUnusedInputStruct\n"
"\tldr r0, [r4]\n"
"\tadds r0, 0x3C\n"
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x1\n"
"\tbl sub_800641C\n"
"\tpop {r4}\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"_0801DBD0: .4byte sUnknown_203B258");
}
static void sub_801DBD4(void)
{
unkStruct_811BAF4 *temp;
struct unkStruct_81188F0 *temp2;
s32 y;
#ifndef NONMATCHING
register s32 x asm("r4");
#else
s32 x;
#endif
s16 index;
int counter;
sub_8008C54(sUnknown_203B258->unk34);
sub_80073B8(sUnknown_203B258->unk34);
xxx_call_draw_string(10, 0, sField, sUnknown_203B258->unk34, 0); // Field
x = (sUnknown_203B258->unk9C[2] * 8) - 2;
sub_8012BC4(x, 0, sUnknown_203B258->input.unk1E + 1, 2, 7, sUnknown_203B258->unk34);
for (counter = 0; counter < sUnknown_203B258->input.unk1A; counter++) {
index = (sUnknown_203B258->input.unk1E * sUnknown_203B258->input.unk1C) + counter;
temp = &gUnknown_811BAF4[index];
temp2 = &gUnknown_81188F0[temp->unk4];
y = sub_8013800(&sUnknown_203B258->input, counter);
xxx_call_draw_string(8, y, temp2->text1, sUnknown_203B258->unk34, 0);
y = sub_8013800(&sUnknown_203B258->input, counter);
xxx_call_draw_string(62, y, temp->text, sUnknown_203B258->unk34, 0);
}
sub_80073E0(sUnknown_203B258->unk34);
}

View File

@ -237,7 +237,7 @@ bool8 sub_8024458(s16 speciesNum, s32 param_2)
return TRUE;
}
u8 sub_80244E4(void)
u32 sub_80244E4(void)
{
switch(GetKeyPress(&gUnknown_203B2AC->input))
{

View File

@ -6,7 +6,6 @@
#include "menu.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "text1.h"
#include "input.h"
#include "items.h"

View File

@ -19,29 +19,26 @@ extern u8 gUnknown_202DE58[];
extern u8 gAvailablePokemonNames[];
extern s32 gUnknown_202DE30[2];
extern u8 *gUnknown_811383C[];
extern u8 *gUnknown_8113850[];
extern u8 *gUnknown_8113868[];
extern u8 *gUnknown_8113898[];
extern u8 *gUnknown_81138C0[];
extern u8 *gUnknown_81138D0[];
extern u8 *gUnknown_81138E4[];
extern u8 *gUnknown_8113950[];
extern u8 *gUnknown_8113900[];
extern u8 *gUnknown_8113974[];
extern u8 *gUnknown_8113918[];
extern u8 *gUnknown_8113990[];
extern u8 *gUnknown_8113934[];
extern u8 *gUnknown_81139B4[];
extern u8 *gUnknown_81139B8[];
extern u8 *gUnknown_81139CC[];
extern u8 *gUnknown_8113870[];
extern const u8 *gUnknown_811383C[];
extern const u8 *gUnknown_8113850[];
extern const u8 *gUnknown_8113868[];
extern const u8 *gUnknown_8113898[];
extern const u8 *gUnknown_81138C0[];
extern const u8 *gUnknown_81138D0[];
extern const u8 *gUnknown_81138E4[];
extern const u8 *gUnknown_8113950[];
extern const u8 *gUnknown_8113900[];
extern const u8 *gUnknown_8113974[];
extern const u8 *gUnknown_8113918[];
extern const u8 *gUnknown_8113990[];
extern const u8 *gUnknown_8113934[];
extern const u8 *gUnknown_81139B4[];
extern const u8 *gUnknown_81139B8[];
extern const u8 *gUnknown_81139CC[];
extern const u8 *gUnknown_8113870[];
extern struct unkStruct_8113080 gUnknown_8113080[];
extern void xxx_format_string(const char *, u8 *, void *, u32);
extern s32 sub_8008ED0(u8 *);
void sub_809447C(struct unkStruct_8094924 *r0, u8 *r1)
{
RestoreIntegerBits(r0, r1, 0x10);
@ -100,11 +97,11 @@ void sub_8094558(u32 param_1,u8 *param_2,unkDungeonGlobal_unk1CE98_sub *param_3)
sub_80922B4(gAvailablePokemonNames + 0x50, param_3->buffer2, POKEMON_NAME_LENGTH);
if (sub_8094528(param_3->moveID) != 0) {
// $m1 was defeated by
xxx_format_string(*gUnknown_8113868,buffer,(u32 **)&buffer + 50,0); // TODO: fix this hack
xxx_format_string(*gUnknown_8113868,buffer,(u8*)((u32 **)&buffer + 50),0); // TODO: fix this hack
}
else {
// $m1
xxx_format_string(*gUnknown_8113870,buffer,(u32 **)&buffer + 50,0); // TODO: fix this hack
xxx_format_string(*gUnknown_8113870,buffer,(u8*)((u32 **)&buffer + 50),0); // TODO: fix this hack
}
iVar2 = sub_8008ED0(buffer);
xxx_format_and_draw(((0xb0 - iVar2) / 2),y,buffer,param_1,0);

View File

@ -147,7 +147,7 @@ u8 sub_8095E78(void)
return friendAreaStack[RandInt(counter)];
}
else {
return NONE;
return FRIEND_AREA_NONE;
}
}

20
src/data/code_801BEEC.h Normal file
View File

@ -0,0 +1,20 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
static const UnkTextStruct2 sUnknown_80DBD98 = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};
static const UnkTextStruct2 sUnknown_80DBDB0 = {
0, 0, 0, 0,
3,
20, 4,
6, 3,
3, 0,
NULL
};
ALIGNED(4) static const u8 sSwitch[] = _("Switch");

23
src/data/code_801C244.h Normal file
View File

@ -0,0 +1,23 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
static const UnkTextStruct2 sUnknown_80DBDD8 = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};
static const UnkTextStruct2 sUnknown_80DBDF0 = {
0, 0, 0, 0,
6,
2, 2,
16, 17,
19, 0,
NULL
};
ALIGNED(4) static const u8 sIQSkills[] = _("IQ Skills");
ALIGNED(4) static const u8 sStarBullet[] = _("{STAR_BULLET}");
ALIGNED(4) static const u8 sUnknown_80DBE18[] = _("{UNK_ICON_40}");
ALIGNED(4) static const u8 sFmt01[] = _("{ARG_MOVE_ITEM_0}{ARG_MOVE_ITEM_1}");

4
src/data/code_801C620.h Normal file
View File

@ -0,0 +1,4 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
ALIGNED(4) static const u8 sFmtMoveItem0[] = _("{ARG_MOVE_ITEM_0}");
ALIGNED(4) static const u8 sFmtPkmn0[] = _("{ARG_POKEMON_0}");

20
src/data/code_801C8C4.h Normal file
View File

@ -0,0 +1,20 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
static const UnkTextStruct2 sUnknown_80DBE3C = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};
static const UnkTextStruct2 sUnknown_80DBE54 = {
0, 0, 0, 0,
6,
2, 2,
16, 14,
16, 0,
NULL
};
ALIGNED(4) static const u8 sStorage[] = _("Storage");

66
src/data/code_801D014.h Normal file
View File

@ -0,0 +1,66 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
static const UnkTextStruct2 sUnknown_80DBE7C = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};
static const u8 sUnknown_80DBE94[] = {1, 0, 7, 0};
static const UnkTextStruct2 sUnknown_80DBE98 = {
0, 0, 0, 0,
6,
2, 2,
9, 6,
6, 0,
sUnknown_80DBE94
};
static const UnkTextStruct2 sUnknown_80DBEB0[4] =
{
{
0, 0, 0, 0,
3,
2, 3,
8, 6,
6, 0,
NULL
},
{
0, 0, 0, 0,
3,
12, 4,
16, 2,
2, 0,
NULL
},
{
0, 0, 0, 0,
3,
2, 14,
26, 4,
4, 0,
NULL
},
{
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
}
};
ALIGNED(4) static const u8 sItems[] = _("Items");
ALIGNED(4) static const u8 sTeam[] = _("Team");
ALIGNED(4) static const u8 sJobList[] = _("Job List");
ALIGNED(4) static const u8 sOthers[] = _("Others");
ALIGNED(4) static const u8 sTripleQuestionMark[] = _("");
ALIGNED(4) static const u8 sFmtPointsCyan[] = _("%s {COLOR_1 CYAN}%d{END_COLOR_TEXT_1} Pts.");
ALIGNED(4) static const u8 sFmtMoneyCyan[] = _("Money: {COLOR_1 CYAN}%d{END_COLOR_TEXT_1} {POKE}");
ALIGNED(4) static const u8 sTeamRankBadgeFileName[] = _("tmrkpat");

20
src/data/code_801D9E4.h Normal file
View File

@ -0,0 +1,20 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
static const UnkTextStruct2 sUnknown_80DBF70 = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};
static const UnkTextStruct2 sUnknown_80DBF88 = {
0, 0, 0, 0,
6,
2, 2,
24, 17,
17, 0,
NULL
};
ALIGNED(4) static const u8 sField[] = _("Field");

View File

@ -1,6 +1,6 @@
static const FriendAreaSettings sFriendAreaSettings[NUM_FRIEND_AREAS] = // 810AA90
{
[NONE] = {
[FRIEND_AREA_NONE] = {
.num_pokemon = 0,
.unlock_condition = UNLOCK_SHOP_STORY,
.price = 0,

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "common_strings.h"
#include "debug_menu2.h"
#include "memory.h"

View File

@ -1,7 +1,5 @@
#include "global.h"
#include "code_801EE10_mid.h"
#include "code_8021774.h"
#include "code_8021774_pre.h"
#include "common_strings.h"
#include "debug_menu3.h"
#include "friend_area.h"
@ -10,6 +8,7 @@
#include "pokemon.h"
#include "text1.h"
#include "text2.h"
#include "wigglytuff_shop.h"
static EWRAM_DATA_2 unkStruct_203B3F4 *sUnknown_203B3F4 = {0};

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801BEEC.h"
#include "code_801EE10.h"
#include "code_801EE10_1.h"
#include "code_801EE10_mid.h"
@ -48,10 +48,8 @@ extern void SetFriendAreaActionMenuState(u32);
extern void PlaySound(u32);
extern void sub_808D31C(PokemonStruct1 *);
extern PokemonStruct1 *sub_808D3F8(void);
extern PokemonStruct1 *sub_808D3BC(void);
extern u8 gUnknown_202DE58[];
extern u32 sub_80244E4(void);
extern bool8 sub_808D750(s16 index_);
extern void sub_808ED00(void);

View File

@ -3,7 +3,7 @@
#include "code_8012A18_1.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801BEEC.h"
#include "code_801EE10.h"
#include "code_801EE10_1.h"
#include "code_801EE10_mid.h"
@ -11,6 +11,7 @@
#include "common_strings.h"
#include "constants/dungeon.h"
#include "event_flag.h"
#include "ground_map_1.h"
#include "items.h"
#include "kecleon_bros4.h"
#include "memory.h"
@ -56,11 +57,8 @@ EWRAM_DATA_2 unkStruct_203B2B4 *gUnknown_203B2B4 = {0};
#include "data/friend_list_menu.h"
extern s16 sub_80A5728(void);
extern u8 sub_8002658(s16);
extern bool8 sub_8024108(u32);
extern void sub_808ED00(void);
extern u32 sub_80244E4(void);
extern void sub_80160D8(void);
extern u32 sub_8016080(void);

View File

@ -3,7 +3,7 @@
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801EE10_1.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "code_8094F88.h"
#include "constants/communication_error_codes.h"
#include "constants/monster.h"
@ -266,9 +266,7 @@ extern u8 sub_80307EC(void);
extern u32 sub_8031DCC(void);
extern void sub_8031E10(void);
extern void sub_8031E00(void);
extern u8 sub_8024108(u32);
extern void sub_802452C(void);
extern u32 sub_80244E4(void);
extern u32 sub_8039068(u32, u8 *passwordBuffer, unkStruct_203B480 *r0);
extern void sub_803084C(void);
@ -278,7 +276,6 @@ extern void sub_802F2C0(void);
extern void sub_8030DE4(void);
extern u8 sub_800D588(void);
extern void sub_80151C0(u32, u8 *);
extern u32 sub_801D008(void);
extern u32 sub_8023CE8(void);
extern void sub_802F204(unkStruct_802F204 *, u32);
extern u32 sub_80306A8(u32 wonderMailType, u32, UnkTextStruct2_sub *, u32);
@ -1056,7 +1053,7 @@ void sub_8032828(void)
sub_8035CF4(gUnknown_203B33C->unk21C, 3, 1);
break;
case 0x5F:
if (sub_801D008() == 0) {
if (sub_801D008() == NULL) {
ResetUnusedInputStruct();
sub_800641C(NULL, TRUE, TRUE);
{

View File

@ -303,7 +303,7 @@ s16 sub_8098FA0(void)
return sub_8001658(0, 0x11);
}
const char *sub_8098FB4(void)
const char *sub_8098FB4(void)
{
return sub_80A2B18(sub_8001658(0, 0x11));
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801C620.h"
#include "code_801BEEC.h"
#include "code_801EE10.h"
#include "code_801EE10_1.h"
#include "code_801EE10_mid.h"
@ -27,9 +27,6 @@ extern u8 gUnknown_202E5D8[];
#include "data/gulpin_shop_801FB50.h"
// code_801EE10_1.c (return var type)
extern u32 sub_80244E4(void);
static void CreateGulpinLinkMenu(void);
static void CreateGulpinShopMenu(void);

View File

@ -178,6 +178,13 @@ void DrawHintSelectionMenu(void)
sub_80073E0(gUnknown_203B264->unk34);
}
// THIS IS A NEW FILE
u32 CreateHintDisplayScreen(u32 index)
{
gUnknown_203B268 = MemoryAlloc(sizeof(struct unkStruct_203B268), 8);

View File

@ -1,11 +1,11 @@
#include "global.h"
#include "code_8097DD0.h"
#include "constants/colors.h"
#include "items.h"
#include "moves.h"
#include "random.h"
#include "pokemon.h"
#include "random.h"
#include "subStruct_203B240.h"
#include "code_800D090.h"
#include "text_util.h"
#include "text2.h"
@ -36,7 +36,6 @@ EWRAM_DATA ItemDataEntry *gItemParametersData = {0};
EWRAM_DATA TeamInventory gTeamInventory = {0};
EWRAM_DATA_2 TeamInventory *gTeamInventoryRef = {0};
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
extern s32 sub_8091E94(s32 a1, s32 a2, s32 a3);
extern void SortKecleonShopInventory();
bool8 AddKecleonWareItem(u8);

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "code_8098BDC.h"
#include "common_strings.h"
#include "kangaskhan_storage1.h"

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "code_8098BDC.h"
#include "common_strings.h"
#include "kangaskhan_storage2.h"

View File

@ -1,12 +1,14 @@
#include "global.h"
#include "bg_palette_buffer.h"
#include "code_800D090.h"
#include "code_80130A8.h"
#include "code_8094F88.h"
#include "code_8097670.h"
#include "constants/main_menu.h"
#include "constants/wonder_mail.h"
#include "event_flag.h"
#include "file_system.h"
#include "ground_main.h"
#include "input.h"
#include "main_menu1.h"
#include "memory.h"
@ -47,11 +49,8 @@ void DrawLoadScreenText(void);
void sub_80397B4(void);
extern void sub_80920D8(u8 *);
extern u8 *sub_8098FB4();
extern void PrintDungeonLocationtoBuffer(u8 *, DungeonLocation *);
extern void xxx_format_string(u8 *, u8 *, u8 *, u32);
const UnkTextStruct2 gUnknown_80E75F8 = {
0x00, 0x00, 0x00, 0x00,
0x03,

View File

@ -9,6 +9,7 @@
#include "wonder_mail.h"
#include "menu_input.h"
#include "code_80118A4.h"
#include "wonder_mail_2_1.h"
EWRAM_DATA_2 struct unkStruct_203B304 *gUnknown_203B304 = {0};
@ -82,7 +83,6 @@ extern void CreateMailMenu(void);
extern void CreateMailAcceptedStatusBox(u32);
extern void sub_803B35C(WonderMail *, unkStruct_802C39C *);
extern void sub_802DE84(unkStruct_802C39C *);
extern void InitializeJobListMenu(u32);
extern void sub_802B640(u32, u32, u32);
extern void sub_802B7D0(u32);
extern void sub_802B9FC(u8);
@ -91,8 +91,6 @@ extern void sub_802BACC(void);
extern u8 GetPokemonNewsIndex(void);
extern void sub_802B81C(void);
extern u32 sub_802B720(u32);
extern u32 sub_802C898(void);
extern void sub_802C8F4(void);
extern u32 sub_802DEE0(void);
extern void sub_802DF24(void);
extern WonderMail *GetMailboxSlotInfo(u8);
@ -106,7 +104,6 @@ extern void ReceivePKMNNews(u8);
extern void sub_8096078(void);
extern void sub_802BEDC(void);
extern u8 sub_802BE74(void);
extern u8 HasNoAcceptedJobs(void);
extern u8 HasNoPelipperBoardJobs(void);
extern u8 HasNoPKMNNews(void);

View File

@ -17,7 +17,6 @@ extern const u8 gUnknown_80D4828[];
extern const s32 gUnknown_80D4830[9];
// text.s
extern s32 sub_8008ED0(const u8 *);
extern s16 sub_8009614(u32, u32);
static void sub_8013134(MenuInputStruct *, u32, u32);

View File

@ -2,6 +2,7 @@
#include "code_800D090.h"
#include "code_80130A8.h"
#include "code_8092334.h"
#include "code_8097DD0.h"
#include "constants/colors.h"
#include "constants/monster.h"
#include "memory.h"
@ -39,9 +40,6 @@ extern const u8* gUnknown_810CF00; // "Range#=@.$m0 "
// system_sbin.s
extern const struct FileArchive gSystemFileArchive;
// code_8097DD0.s
extern u32 sub_8097DF0(u8 *, struct subStruct_203B240 **);
static void CopyAndResetMove(Move *, Move *);
static bool8 sub_80933D8(s32, Move *);
static s32 unk_FindMarkedMoveInLinkedSequences44(Move [MAX_MON_MOVES][MAX_MON_MOVES]);

View File

@ -8,6 +8,7 @@
#include "game_options.h"
#include "memory.h"
#include "menu_input.h"
#include "options_menu.h"
#include "text1.h"
#include "text2.h"
@ -24,7 +25,7 @@ struct unkStruct_203B25C
UnkTextStruct2 unkBC[4];
};
struct unkStruct_203B260
struct unkStruct_203B260
{
GameOptions *optionsMenu;
MenuInputStructSub unk4;
@ -42,18 +43,17 @@ extern const UnkTextStruct2 gUnknown_80DBFCC;
extern const UnkTextStruct2 gUnknown_80DC020;
extern const UnkTextStruct2 gUnknown_80DC03C;
extern u8 gWindowBGTitle[];
extern u8 gUnknown_80DC064[];
extern u8 gWindowBGGreenString[];
extern u8 gWindowBGRedString[];
extern u8 gWindowBGBlueString[];
extern const u8 gWindowBGTitle[];
extern const u8 gUnknown_80DC064[];
extern const u8 gWindowBGGreenString[];
extern const u8 gWindowBGRedString[];
extern const u8 gWindowBGBlueString[];
extern const char gOthers_MenuOption[];
extern const char gUnknown_80DBFEC[];
extern const char gOthers_GameOptions[];
extern const char gOthers_Hints[];
extern s32 sub_8008ED0(u8 *);
extern void CreateOthersMenu(void);
void CreateOptionsMenu(void);
void nullsub_38(void);
@ -98,11 +98,11 @@ enum OptionsMenuStates {
OPTIONS_MENU_CONFIRM_NEW_OPTIONS,
};
u32 sub_801DCC4(void)
bool8 sub_801DCC4(void)
{
gUnknown_203B25C = MemoryAlloc(sizeof(struct unkStruct_203B25C), 8);
SetOptionsMenuState(OPTIONS_MENU_INIT);
return 1;
return TRUE;
}
u32 sub_801DCE8(void)
@ -365,6 +365,13 @@ void HandleChangeSettingsMenu(void)
}
}
// THIS IS A NEW FILE
bool8 sub_801E198(GameOptions *optionsMenu)
{
gUnknown_203B260 = MemoryAlloc(sizeof(struct unkStruct_203B260), 8);

View File

@ -3,10 +3,11 @@
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801BEEC.h"
#include "code_801EE10.h"
#include "code_801EE10_1.h"
#include "code_801EE10_mid.h"
#include "code_8023144.h"
#include "code_8098BDC.h"
#include "common_strings.h"
#include "constants/dungeon.h"
@ -16,56 +17,25 @@
#include "memory.h"
#include "menu_input.h"
#include "moves.h"
#include "party_list_menu.h"
#include "pokemon.h"
#include "text_util.h"
#include "text1.h"
#include "text2.h"
// size: 0x280
typedef struct unkStruct_203B2B8
{
s32 state;
s32 fallbackState;
bool8 unk8;
/* 0xA */ s16 pokeSpecies;
u32 id;
/* 0x10 */ BulkItem item1;
/* 0x14 */ BulkItem item2;
PokemonStruct1 *pokeStruct;
bool8 isTeamLeader;
u32 moveIndex;
/* 0x24 */ u16 moveID;
Move moves[8];
u16 moveIDs[4]; // some list of move IDs
u32 menuAction1;
u32 menuAction2;
u32 menuAction3; // unused
MenuStruct unk7C;
MenuStruct unkCC;
MenuStruct unk11C; // unused
MenuItem unk16C[10];
MenuItem unk1BC[10];
u16 unk20C[10];
UnkTextStruct2 unk220[4];
} unkStruct_203B2B8;
// TODO: Clean this
extern u8 gUnknown_202DE58[0x58];
extern u8 gUnknown_202DEA8[0x58];
extern u8 gAvailablePokemonNames[0x58]; // 202DF98
extern u8 gUnknown_202DE58[];
extern u8 gUnknown_202DEA8[];
extern u8 gAvailablePokemonNames[]; // 202DF98
static EWRAM_DATA_2 unkStruct_203B2B8 *sUnknown_203B2B8 = {0};
#include "data/party_list_menu.h"
extern u32 sub_8026F04(PokemonStruct1 *);
extern void sub_8026074(s32);
bool8 CanTakePokemonHeldItem(PokemonStruct1 *r0);
extern PokemonStruct1 *sub_808D3F8(void);
extern PokemonStruct1 *sub_808D3BC(void);
extern s32 sub_8008ED0(u8 *);
extern u32 sub_8022860(void);
extern void sub_8022908(void);
extern u32 sub_80244E4(void);
extern bool8 sub_808D750(s16 index_);
extern void sub_808ED00(void);
bool8 sub_8026E88(PokemonStruct1 *r0);
@ -75,12 +45,10 @@ void sub_8026E08(u32 r0);
void sub_8026DAC(u32 r0, BulkItem *item);
void sub_8026FA4(void);
void sub_8026878(void);
extern void sub_80227B8(PokemonStruct1 *);
extern void sub_808D31C(PokemonStruct1 *);
void sub_802678C(void);
void sub_80264CC(void);
void sub_802608C(void);
void sub_80261D0(void);
void sub_80268CC(void);
@ -96,7 +64,10 @@ void sub_8026D0C(void);
void sub_8026D6C(void);
void sub_8026D88(void);
u32 sub_8025EF4(PokemonStruct1 *pokeStruct)
static void sub_8026074(s32 newState);
static void sub_802608C(void);
bool8 sub_8025EF4(PokemonStruct1 *pokeStruct)
{
s32 i;
@ -176,21 +147,20 @@ bool8 sub_802604C(void)
void sub_8026058(void)
{
if(sUnknown_203B2B8)
{
if (sUnknown_203B2B8) {
MemoryFree(sUnknown_203B2B8);
sUnknown_203B2B8 = NULL;
}
}
void sub_8026074(s32 newState)
static void sub_8026074(s32 newState)
{
sUnknown_203B2B8->state = newState;
sub_802608C();
sub_80261D0();
}
void sub_802608C(void)
static void sub_802608C(void)
{
s32 index;
sub_8006518(sUnknown_203B2B8->unk220);

View File

@ -12,6 +12,7 @@
#include "common_strings.h"
#include "pelipper_board.h"
#include "code_80118A4.h"
#include "wonder_mail_2_1.h"
EWRAM_DATA_2 struct unkStruct_203B308 *gPelipperBoard = {0};
@ -78,10 +79,7 @@ extern void DrawPelipperBoardJobMenu(void);
extern void CreatePelipperAcceptedStatusBox(u32);
extern void sub_803B35C(WonderMail *, unkStruct_802C39C *);
extern void sub_802DE84(unkStruct_802C39C *);
extern void InitializeJobListMenu(u32);
extern u32 sub_802C898(void);
extern void sub_802C8F4(void);
extern u32 sub_802DEE0(void);
extern void sub_802DF24(void);
extern WonderMail *GetPelipperBoardSlotInfo(u8);
@ -94,7 +92,6 @@ extern void sub_80965F4(void);
extern void sub_802C2D4(void);
extern u32 sub_802C1E4(u32);
extern u8 sub_802C26C(void);
extern u8 HasNoAcceptedJobs(void);
extern bool8 IsMailinJobSlot(WonderMail *mail);
void SetPelipperBoardState(u32);

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "code_800D090.h"
#include "code_8097DD0.h"
#include "constants/colors.h"
#include "constants/move_id.h"
#include "decompress.h"
@ -8,7 +9,6 @@
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "subStruct_203B240.h"
#include "text_util.h"
extern MonsterDataEntry *gMonsterParameters;
@ -36,7 +36,6 @@ extern u32 ReturnIntFromChar(u8 r0);
extern void sub_80943A0(void*, s32);
extern void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1*, PokemonStruct2*);
extern const u8 *DecompressMoveID(const u8 *a1, u16 *a2);
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
extern u8 GetBodySize(s16 index);

View File

@ -3,7 +3,7 @@
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "code_8094F88.h"
#include "constants/communication_error_codes.h"
#include "cpu.h"
@ -220,7 +220,6 @@ extern void sub_80151C0(u32, u8 *);
extern void sub_803092C(void);
extern s32 sub_8037B28(u32);
extern u32 sub_8030894(void);
extern u32 sub_801D008(void);
extern void sub_80306A8(u32, u32, u32, u32);
extern u8 sub_800D588(void);
extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32);
@ -1283,7 +1282,7 @@ void UpdateThankYouMailText(void)
sub_8035CF4(gUnknown_203B2C4->unk21C,3,TRUE);
break;
case 0x13:
if (sub_801D008() != 0)
if (sub_801D008() != NULL)
break;
ResetUnusedInputStruct();
sub_800641C(NULL, TRUE, TRUE);

View File

@ -2,7 +2,7 @@
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "constants/communication_error_codes.h"
#include "cpu.h"
#include "items.h"
@ -22,7 +22,6 @@ static EWRAM_DATA_2 struct TradeItemsMenu *sTradeItemsMenu = {0};
#include "data/trade_items_menu.h"
extern u32 sub_801D008();
extern s32 sub_8037B28(u32);
void sub_8036F74(void);
@ -508,7 +507,7 @@ void sub_8036B28(void)
sub_80141B4(sPleaseChooseItem,0,0,0x101);
break;
case TRADE_ITEMS_SEND_ITEM_SELECTION:
if (sub_801D008() == 0) {
if (sub_801D008() == NULL) {
ResetUnusedInputStruct();
sub_800641C(NULL, TRUE, TRUE);
{

View File

@ -3,7 +3,6 @@
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801EE10_mid.h"
#include "code_8021774.h"
#include "code_8098BDC.h"
#include "common_strings.h"
#include "constants/friend_area.h"

View File

@ -46,9 +46,7 @@ extern u32 sub_80154F0();
extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0);
extern void sub_8095274(u32);
extern void sub_80155F0();
extern u32 sub_80244E4();
extern void sub_802452C();
extern u8 sub_8024108(u32);
extern u32 sub_8031DCC();
extern void sub_8031E10();
extern void sub_8031E00();

View File

@ -116,7 +116,6 @@ extern void sub_802DE84(unkStruct_802C39C *);
extern void sub_802CBAC(void);
s32 CountAcceptedJobs(void);
bool8 HasNoAcceptedJobs(void);
s32 CountPelipperBoardSlots(void)
{

View File

@ -158,7 +158,6 @@ extern void sub_802DF24(void);
extern void SetJobListState(u32);
extern u32 sub_802DEE0(void);
extern void ResetJobSlot(u8);
extern u8 HasNoAcceptedJobs(void);
u32 sub_802C598(u8 param_1);
extern void sub_802C688(void);
extern u8 GetPelipperBoardSlotIndex(void);

View File

@ -2,7 +2,7 @@
#include "code_80118A4.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "code_801C8C4.h"
#include "code_8094F88.h"
#include "constants/communication_error_codes.h"
#include "constants/wonder_mail.h"

View File

@ -1,7 +1,7 @@
.align 2
.include "src/m4a.o"
.include "src/agb_flash.o"
.include "src/m4a.o"
.include "src/agb_flash.o"
errno: /* 203B034 */
.space 0x4
@ -17,36 +17,35 @@ gUnknown_203B03C: /* 203B03C */
gUnknown_203B040: /* 203B040 */
.space 0x30
.include "src/other_random.o"
.include "src/other_random.o"
.space 0x2
.include "src/sprite.o"
.include "src/sprite.o"
gUnknown_203B078: /* 203B078 */
gUnknown_203B078: /* 203B078 (sub_80057E8 - sub_8006438) */
.space 0x4
.include "src/random.o"
.include "src/random.o"
gUnknown_203B080: /* 203B080 */
gUnknown_203B080: /* 203B080 (sub_8053540 - sub_806806C) */
.space 0x4
gUnknown_203B084: /* 203B084 */
gUnknown_203B084: /* 203B084 (sub_8053430 - sub_806806C) */
.space 0x4
gUnknown_203B088: /* 203B088 */
gUnknown_203B088: /* 203B088 (xxx_draw_string_80144C4) */
.space 0x4
gUnknown_203B08C: /* 203B08C */
gUnknown_203B08C: /* 203B08C (xxx_draw_string_80524F0) */
.space 0x4
gUnknown_203B090: /* 203B090 */
gUnknown_203B090: /* 203B090 (InitGraphics) */
.space 0x4
.include "src/file_system.o"
.include "src/main.o"
.include "src/file_system.o"
.include "src/main.o"
gUnknown_203B099: /* 203B099 */
gUnknown_203B099: /* 203B099 (VBlankIntr - xxx_update_bg_sound_input) */
.space 0x1
gUnknown_203B09A: /* 203B09A */
@ -82,43 +81,43 @@ gUnknown_203B0B0: /* 203B0B0 */
gUnknown_203B0B2: /* 203B0B2 */
.space 0x2
.include "src/flash.o"
.include "src/flash.o"
.space 0x3
gUnknown_203B0B8: /* 203B0B8 */
gUnknown_203B0B8: /* 203B0B8 (sub_800CB20 - sub_800CB50) */
.space 0x4
gRawKeyInput: /* 203B0BC */
gRawKeyInput: /* 203B0BC (sub_800CB20 - ReadKeyInput) */
.space 0x2
gUnknown_203B0BE: /* 203B0BE */
gUnknown_203B0BE: /* 203B0BE (sub_800CDA8) */
.space 0xE
gUnknown_203B0CC: /* 203B0CC */
gUnknown_203B0CC: /* 203B0CC (sub_800DE8C - sub_800DC14) */
.space 0x4
gUnknown_203B0D0: /* 203B0D0 */
gUnknown_203B0D0: /* 203B0D0 (sub_800ED38 - sub_800EF64) */
.space 0x4
gUnknown_203B0D4: /* 203B0D4 */
gUnknown_203B0D4: /* 203B0D4 (sub_800F034 - sub_800F19C) */
.space 0x4
gDungeonPokemonSprites: /* 203B0D8 */
gDungeonPokemonSprites: /* 203B0D8 (GetDungeonPokemonSprite - sub_800F958) */
.space 0x4
gUnknown_203B0DC: /* 203B0DC */
gUnknown_203B0DC: /* 203B0DC (DrawStatusSprite) */
.space 0x8
gUnknown_203B0E4: /* 203B0E4 */
gUnknown_203B0E4: /* 203B0E4 (sub_800F990 - sub_801169C) */
.space 0x4
gUnknown_203B0E8: /* 203B0E8 */
gUnknown_203B0E8: /* 203B0E8 (sub_8010268 - sub_8010B74) */
.space 0x4
gUnknown_203B0EC: /* 203B0EC */
gUnknown_203B0EC: /* 203B0EC (sub_8010C58) */
.space 0x60
.include "src/debug.o"
.include "src/debug.o"
.space 0x2B
.include "src/save.o"
@ -127,16 +126,16 @@ gUnknown_203B0EC: /* 203B0EC */
.include "src/quick_save_read.o"
.include "src/quick_save_write.o"
gUnknown_203B198: /* 203B198 */
gUnknown_203B198: /* 203B198 (sub_8014248 - sub_8014A88) */
.space 0x60
gUnknown_203B1F8: /* 203B1F8 */
gUnknown_203B1F8: /* 203B1F8 (sub_8015080 - sub_80151A4) */
.space 0x4
gUnknown_203B1FC: /* 203B1FC */
gUnknown_203B1FC: /* 203B1FC (sub_80151C0 - sub_8015F84) */
.space 0x4
gUnknown_203B200: /* 203B200 */
gUnknown_203B200: /* 203B200 (sub_801602C - IsNameEmpty) */
.space 0x4
.include "src/felicity_bank.o"
@ -149,47 +148,23 @@ gUnknown_203B200: /* 203B200 */
.include "src/code_801AFA4.o"
.include "src/code_801B3C0.o"
.include "src/code_801B60C.o"
.include "src/code_801BEEC.o"
.include "src/code_801C244.o"
.include "src/code_801C620.o"
.include "src/code_801C8C4.o"
.include "src/code_801D014.o"
.include "src/code_801D9E4.o"
gUnknown_203B238: /* 203B238 */
gUnknown_203B25C: /* 203B25C (sub_801DCC4 - HandleChangeSettingsMenu) */
.space 0x4
gUnknown_203B23C: /* 203B23C */
gUnknown_203B260: /* 203B260 (sub_801E198 - CreateOptionsMenu) */
.space 0x4
gUnknown_203B240: /* 203B240 */
gUnknown_203B264: /* 203B264 (sub_801E3F0 - DrawHintSelectionMenu) */
.space 0x4
gUnknown_203B244: /* 203B244 */
.space 0x4
gUnknown_203B248: /* 203B248 */
.space 0x4
gUnknown_203B24C: /* 203B24C */
.space 0x2
gUnknown_203B24E: /* 203B24E */
.space 0x2
gUnknown_203B250: /* 203B250 */
.space 0x4
gUnknown_203B254: /* 203B254 */
.space 0x4
gUnknown_203B258: /* 203B258 */
.space 0x4
gUnknown_203B25C: /* 203B25C */
.space 0x4
gUnknown_203B260: /* 203B260 */
.space 0x4
gUnknown_203B264: /* 203B264 */
.space 0x4
gUnknown_203B268: /* 203B268 */
gUnknown_203B268: /* 203B268 (CreateHintDisplayScreen - DisplayChosenHint) */
.space 0x4
.include "src/gulpin_shop.o"