diff --git a/asm/code_8098BDC.s b/asm/code_8098BDC.s index 5d0b29a11..62472cb23 100644 --- a/asm/code_8098BDC.s +++ b/asm/code_8098BDC.s @@ -6068,7 +6068,7 @@ _0809C046: lsls r0, 16 asrs r0, 16 str r0, [r1] - bl CleanMakuhitaShop + bl DestroyMakuhitaShop b _0809C392 _0809C05E: ldr r0, [r6] @@ -6078,7 +6078,7 @@ _0809C05E: movs r1, 0x1 negs r1, r1 str r1, [r0] - bl CleanMakuhitaShop + bl DestroyMakuhitaShop b _0809C392 _0809C072: movs r4, 0x1 diff --git a/data/data_8115F5C.s b/data/data_8115F5C.s index e0927d5b3..daf3084b8 100644 --- a/data/data_8115F5C.s +++ b/data/data_8115F5C.s @@ -224,21 +224,21 @@ gUnknown_8116288: @ 8116288 gUnknown_8116298: @ 8116298 .byte 0x01, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 - .4byte CleanMakuhitaShop + .4byte DestroyMakuhitaShop .4byte sub_802FE58 .global gUnknown_81162A8 gUnknown_81162A8: @ 81162A8 .byte 0x01, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 - .4byte CleanMakuhitaShop + .4byte DestroyMakuhitaShop .4byte sub_802FE58 .global gUnknown_81162B8 gUnknown_81162B8: @ 81162B8 .byte 0x01, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 - .4byte CleanMakuhitaShop + .4byte DestroyMakuhitaShop .4byte sub_802FE58 .global gUnknown_81162C8 diff --git a/include/dungeon.h b/include/dungeon.h index 73a3b72fc..defd98a07 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -3,12 +3,14 @@ #include "dungeon_global_data.h" +// size: 0x8 struct DungeonName { const u8 *name1; const u8 *name2; }; +// size: 0x10 struct DungeonDataEntry { /* 0x0 */ bool8 stairDirectionUp; diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 8ac25103e..c2e281578 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -22,6 +22,7 @@ #define STAT_STAGE_ACCURACY 0 #define STAT_STAGE_EVASION 1 +// size: 0x18 struct ActionContainer { /* 0x0 */ u16 action; @@ -38,6 +39,7 @@ struct ActionContainer /* 0x14 */ struct Position itemTargetPosition; }; +// size: 0x208 struct EntityInfo { // This has different purposes for Pokémon, items, and traps. @@ -248,7 +250,7 @@ struct EntityInfo u8 unk204; }; -// Used for Pokémon, items, and traps. +// size: 0x74 | Used for Pokémon, items, and traps. struct Entity { /* 0x0 */ u32 type; @@ -295,12 +297,12 @@ struct Entity u8 fill56[0x64 - 0x56]; u32 unk64; s16 unk68; - /* 0x6A */ u8 unk6A; - /* 0x6A */ u8 unk6B; + u8 unk6A; + u8 unk6B; /* 0x6C */ u8 direction; /* 0x6D */ u8 direction2; // Duplicate of 0x6C? - /* 0x6E */ u8 unk6E; - /* 0x6F */ u8 unk6F; + u8 unk6E; + u8 unk6F; /* 0x70 */ struct EntityInfo *info; }; diff --git a/include/dungeon_global_data.h b/include/dungeon_global_data.h index 8acca082f..f218dccc1 100644 --- a/include/dungeon_global_data.h +++ b/include/dungeon_global_data.h @@ -14,11 +14,14 @@ extern struct Dungeon *gDungeon; -struct DungeonLocation { - u8 id; - u8 floor; +// size: 0x4 +struct DungeonLocation +{ + /* 0x0 */ u8 id; + /* 0x1 */ u8 floor; }; +// size: 0x4 struct Dungeon_sub { u8 unk0; @@ -26,12 +29,13 @@ struct Dungeon_sub u8 unk2; }; +// size: 0x30 struct unkDungeonGlobal_unk1CE98_sub { - /* 0x0 */ u8 buffer1[0xA]; - /* 0xA */ u8 buffer2[0xA]; - /* 0x14 */ s16 unk14; - /* 0x16 */ u8 fill16[0x2]; + /* 0x0 */ u8 buffer1[10]; + /* 0xA */ u8 buffer2[10]; + s16 unk14; + u8 fill16[0x18 - 0x16]; /* 0x18 */ struct DungeonLocation dungeonLocation; /* 0x1C */ struct Item heldItem; /* 0x20 */ u32 exp; @@ -45,19 +49,21 @@ struct unkDungeonGlobal_unk1CE98_sub /* 0x2C */ u8 spAttBoost; /* 0x2D */ u8 defBoost; /* 0x2E */ u8 spDefBoost; - u8 unk4; // speedBoost? + u8 unk2F; // speedBoost? }; +// size: 0x10 struct DungeonMusicPlayer { - u32 state; - u32 fadeOutSpeed; - u16 fadeInSpeed; - u16 songIndex; - u16 pastSongIndex; - u16 queuedSongIndex; + /* 0x0 */ u32 state; + /* 0x4 */ u32 fadeOutSpeed; + /* 0x8 */ u16 fadeInSpeed; + /* 0xA */ u16 songIndex; + /* 0xC */ u16 pastSongIndex; + /* 0xE */ u16 queuedSongIndex; }; +// size: 0x1CEDC struct Dungeon { u8 unk0; diff --git a/include/input.h b/include/input.h index 78fa7ff24..e85046f38 100644 --- a/include/input.h +++ b/include/input.h @@ -62,7 +62,7 @@ struct MenuInputStructSub s16 unkA; }; -// size: 0x2C +// size: 0x34 struct MenuInputStruct { s32 unk0; diff --git a/include/makuhita_dojo.h b/include/makuhita_dojo.h index fd4f23d3a..3bc460d39 100644 --- a/include/makuhita_dojo.h +++ b/include/makuhita_dojo.h @@ -1,16 +1,16 @@ +// size: 0xCC struct unkStruct_203B318 { - // size: 0xcc u32 unk0; u32 unk4; - s32 state; - s32 fallbackState; + /* 0x8 */ s32 state; + /* 0xC */ s32 fallbackState; s16 unk10; - s32 menuAction; + /* 0x14 */ s32 menuAction; struct MenuItem unk18[4]; - u8 fill[0x58 - 0x38]; - struct OpenedFile *faceFile; - u8 *faceData; + u8 fill38[0x58 - 0x38]; + /* 0x58 */ struct OpenedFile *faceFile; + /* 0x5C */ u8 *faceData; u16 unk60; u16 unk62; u8 unk64; diff --git a/include/map.h b/include/map.h index 9141bd6a7..4ad7ba63f 100644 --- a/include/map.h +++ b/include/map.h @@ -29,6 +29,7 @@ enum CrossableTerrain NUM_CROSSABLE_TERRAIN }; +// size: 0x18 struct Tile { // Uses the TerrainType bit flags. @@ -46,6 +47,7 @@ struct Tile /* 0x14 */ struct Entity *object; // Item or trap on the tile. }; +// size: 0x1C struct RoomData { u8 unk0; diff --git a/include/position.h b/include/position.h index 3a24df4f8..39caa4220 100644 --- a/include/position.h +++ b/include/position.h @@ -1,12 +1,14 @@ #ifndef GUARD_POSITION_H #define GUARD_POSITION_H +// size: 0x4 struct Position { s16 x; s16 y; }; +// size: 0x8 struct Position32 { s32 x; diff --git a/include/text.h b/include/text.h index f9a460ed6..9757fbedf 100644 --- a/include/text.h +++ b/include/text.h @@ -6,30 +6,40 @@ struct UnkTextStruct1 { s16 unk0; s16 unk2; - s16 unk04; + s16 unk4; s16 unk6; - u16 unk08; - u16 fillA; + u16 unk8; u32 unkC; - u8 fill04[0x36]; + u32 unk10; + u32 unk14; + u8 *unk18; + u8 *unk1C; + s32 unk20; + s32 unk24; + void *unk28; // Somewhere in VRAM + s32 unk2C; + s32 unk30; + s32 unk34; + s32 unk38; + u8 fill3C[0x45 - 0x3C]; + bool8 unk45; u8 unk46; }; // size: 0x4 struct UnkTextStruct2_sub { - u8 unk0; - u8 unk1; - u8 unk2; - u8 unk3; + u16 unk0; + u16 unk2; }; // size: 0x18 struct UnkTextStruct2 { - u8 fill00[0x04]; + u8 unk0; + u8 fill1[0x4 - 0x1]; s32 unk4; - struct UnkTextStruct2_sub unk08; + struct UnkTextStruct2_sub unk8; s16 unkC; s16 unkE; s16 unk10; diff --git a/src/adventure_log.c b/src/adventure_log.c index 2d5f7f47e..88c5c2802 100644 --- a/src/adventure_log.c +++ b/src/adventure_log.c @@ -20,7 +20,7 @@ EWRAM_DATA_2 struct AdventureLog *gAdventureLog = {0}; const struct UnkTextStruct2 gUnknown_80E1FF0 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -28,7 +28,7 @@ const struct UnkTextStruct2 gUnknown_80E1FF0 = { const struct UnkTextStruct2 gUnknown_80E2008 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x1A, 0x04, 0x06, 0x00, NULL diff --git a/src/code_801C620.c b/src/code_801C620.c index 8683dc2eb..04d392f5d 100644 --- a/src/code_801C620.c +++ b/src/code_801C620.c @@ -780,9 +780,10 @@ bool8 sub_801C8C4(s32 param_1, s32 param_2, struct UnkTextStruct2_sub *param_3, sub_8006518(gUnknown_203B244->unk4F0); gUnknown_203B244->unk4F0[gUnknown_203B244->unk4E8] = gUnknown_80DBE54; gUnknown_203B244->unk4EC->unk14 = gUnknown_203B244->unk550; - if (param_3 != NULL) { - gUnknown_203B244->unk4F0[gUnknown_203B244->unk4E8].unk08 = *param_3; - } + + if (param_3 != NULL) + gUnknown_203B244->unk4F0[gUnknown_203B244->unk4E8].unk8 = *param_3; + sub_8012D08(gUnknown_203B244->unk4EC, param_4); ResetUnusedInputStruct(); sub_800641C(gUnknown_203B244->unk4F0,1,1); diff --git a/src/code_8023144.c b/src/code_8023144.c index d61e65af9..7a5c4c72d 100644 --- a/src/code_8023144.c +++ b/src/code_8023144.c @@ -309,12 +309,12 @@ bool8 sub_8023144(s32 param_1, s32 index, struct UnkTextStruct2_sub *sub, u32 pa { u8 param_1_u8 = param_1; - if (sub_8023704(param_1_u8)) { + if (sub_8023704(param_1_u8)) return 0; - } - if (gUnknown_3001B5C == NULL) { + + if (gUnknown_3001B5C == NULL) gUnknown_3001B5C = MemoryAlloc(sizeof(struct unkStruct_3001B5C), 8); - } + gUnknown_3001B5C->unk0 = param_1_u8; gUnknown_3001B5C->unk4 = gUnknown_203B298; @@ -324,9 +324,10 @@ bool8 sub_8023144(s32 param_1, s32 index, struct UnkTextStruct2_sub *sub, u32 pa gUnknown_3001B5C->unk398[gUnknown_3001B5C->unk390] = gUnknown_80DC91C; gUnknown_3001B5C->unk394->unk14 = gUnknown_3001B5C->unk3F8; - if (sub != NULL) { - gUnknown_3001B5C->unk398[gUnknown_3001B5C->unk390].unk08 = *sub; - } + + if (sub != NULL) + gUnknown_3001B5C->unk398[gUnknown_3001B5C->unk390].unk8 = *sub; + sub_8012D08(gUnknown_3001B5C->unk394,param_4); ResetUnusedInputStruct(); sub_800641C(gUnknown_3001B5C->unk398,1,1); diff --git a/src/code_8031D70.c b/src/code_8031D70.c index 892213367..672597c8d 100644 --- a/src/code_8031D70.c +++ b/src/code_8031D70.c @@ -25,19 +25,20 @@ EWRAM_DATA_2 struct unkStruct_203B334 *gUnknown_203B334 = {0}; extern struct unkStruct_203B480 *gUnknown_203B480; const struct UnkTextStruct2 gUnknown_80E1FA8 = { - 0, 0, 0, 0, + 0, 0, 0, 0, 3, - 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0, NULL }; const u8 gUnkData_80E1FC0[4] = {0x01, 0x00, 0x0A, 0x00}; + const struct UnkTextStruct2 gUnknown_80E1FC4 = { - 0, 0, 0, 0, + 0, 0, 0, 0, 6, - 0x2, 0x0, 0x2, 0x0, + 0x2, 0x2, 0x1A, 0xA, 0xA, 0, gUnkData_80E1FC0 diff --git a/src/debug_menu.c b/src/debug_menu.c index 4ac0b2f0b..81c3dc775 100644 --- a/src/debug_menu.c +++ b/src/debug_menu.c @@ -17,7 +17,7 @@ const struct UnkTextStruct2 gUnknown_80E7D40 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -27,7 +27,7 @@ const struct UnkTextStruct2 gUnknown_80E7D58 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x09, 0x0b, 0x0b, 0x00, NULL diff --git a/src/debug_menu_1.c b/src/debug_menu_1.c index 2ada25779..025950d9a 100644 --- a/src/debug_menu_1.c +++ b/src/debug_menu_1.c @@ -10,30 +10,28 @@ extern struct unkStruct_203B3F8 *gUnknown_203B3F8; const struct UnkTextStruct2 gUnknown_80E7ED4 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80E7EEC = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x13, 0x00, 0x04, 0x00, - 0x09, 0x03, - 0x03, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x13, 0x04, + 0x09, 0x03, + 0x03, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80E7F04 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x13, 0x00, 0x0e, 0x00, - 0x06, 0x04, - 0x04, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x13, 0x0e, + 0x06, 0x04, + 0x04, 0x00, + NULL }; ALIGNED(4) const u8 gDebug_NumberText2[] = "Number?"; ALIGNED(4) const u8 gDebug_LevelText[] = "LEVEL"; diff --git a/src/debug_menu_mid.c b/src/debug_menu_mid.c index 096bccb1a..8c948a0ff 100644 --- a/src/debug_menu_mid.c +++ b/src/debug_menu_mid.c @@ -48,51 +48,46 @@ extern struct unkStruct_203B3F4 *gUnknown_203B3F4; const struct UnkTextStruct2 gUnknown_80E7E34 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80E7E4C = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x14, 0x00, 0x04, 0x00, - 0x06, 0x03, - 0x03, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x14, 0x04, + 0x06, 0x03, + 0x03, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80E7E64 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x14, 0x00, 0x0e, 0x00, - 0x06, 0x04, - 0x04, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x14, 0x0e, + 0x06, 0x04, + 0x04, 0x00, + NULL }; ALIGNED(4) const char gDebug_NumberText[] = "Number?"; ALIGNED(4) static const u8 fill0[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80E7E8C = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80E7EA4 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x15, 0x00, 0x04, 0x00, - 0x06, 0x03, - 0x03, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x15, 0x04, + 0x06, 0x03, + 0x03, 0x00, + NULL }; ALIGNED(4) const u8 gDebug_CloseText[] = "CLOSE"; ALIGNED(4) const u8 gDebug_OpenText[] = "OPEN"; diff --git a/src/felicity_bank.c b/src/felicity_bank.c index 3f1618087..3332384e8 100644 --- a/src/felicity_bank.c +++ b/src/felicity_bank.c @@ -137,17 +137,17 @@ void sub_801645C(void) switch (gFelicityBankWork->currState) { case 2: - gFelicityBankWork->unkA8[0].fill00[0] = 0x80; - gFelicityBankWork->unkA8[1].fill00[0] = 0x80; - gFelicityBankWork->unkA8[2].fill00[0] = 0x80; + gFelicityBankWork->unkA8[0].unk0 = 0x80; + gFelicityBankWork->unkA8[1].unk0 = 0x80; + gFelicityBankWork->unkA8[2].unk0 = 0x80; gFelicityBankWork->unkA8[3] = gUnknown_80DB6F4; ResetUnusedInputStruct(); sub_800641C(gFelicityBankWork->unkA8, 1, 0); break; case 8: case 11: - gFelicityBankWork->unkA8[0].fill00[0] = 0x80; - gFelicityBankWork->unkA8[1].fill00[0] = 0x80; + gFelicityBankWork->unkA8[0].unk0 = 0x80; + gFelicityBankWork->unkA8[1].unk0 = 0x80; gFelicityBankWork->unkA8[3] = gUnknown_80DB6F4; gFelicityBankWork->unkA8[2] = gUnknown_80DB70C; ResetUnusedInputStruct(); diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index 94ce64b6e..a8c874a31 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -53,7 +53,7 @@ const struct UnkTextStruct2 gUnknown_80DD6EC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -64,7 +64,7 @@ const struct UnkTextStruct2 gUnknown_80DD704 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x13, 0x00, 0x04, 0x00, + 0x13, 0x04, 0x09, 0x03, 0x03, 0x00, NULL @@ -74,7 +74,7 @@ const struct UnkTextStruct2 gUnknown_80DD71C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x14, 0x00, 0x04, 0x00, + 0x14, 0x04, 0x06, 0x03, 0x03, 0x00, NULL @@ -84,7 +84,7 @@ const struct UnkTextStruct2 gUnknown_80DD734 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x16, 0x00, 0x04, 0x00, + 0x16, 0x04, 0x06, 0x03, 0x03, 0x00, NULL @@ -94,7 +94,7 @@ const struct UnkTextStruct2 gUnknown_80DD74C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x11, 0x00, + 0x02, 0x11, 0x1A, 0x02, 0x02, 0x00, NULL diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index 827fc8318..3416e6421 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -41,39 +41,39 @@ struct unkStruct_203B2B4 EWRAM_DATA_2 struct unkStruct_203B2B4 *gUnknown_203B2B4 = {0}; const struct UnkTextStruct2 gUnknown_80DD148 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD160 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x13, 0x00, 0x04, 0x00, - 0x08, 0x03, - 0x03, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x13, 0x04, + 0x08, 0x03, + 0x03, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD178 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x14, 0x00, 0x04, 0x00, - 0x06, 0x03, - 0x03, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x14, 0x04, + 0x06, 0x03, + 0x03, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD190 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x02, 0x00, 0x11, 0x00, - 0x1A, 0x02, - 0x02, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x02, 0x11, + 0x1A, 0x02, + 0x02, 0x00, + NULL }; extern u8 gAvailablePokemonNames[]; diff --git a/src/kecleon_items_1.c b/src/kecleon_items_1.c index cbfdf8302..9878b7b88 100644 --- a/src/kecleon_items_1.c +++ b/src/kecleon_items_1.c @@ -1027,9 +1027,10 @@ u32 sub_801A5D8(u32 param_1,int param_2,struct UnkTextStruct2_sub *param_3,u32 p gUnknown_203B224->unk90[gUnknown_203B224->unk88] = gUnknown_80DB95C; gUnknown_203B224->unk8C->unk14 = gUnknown_203B224->unkF0; - if (param_3 != NULL) { - gUnknown_203B224->unk90[gUnknown_203B224->unk88].unk08 = *param_3; - } + + if (param_3 != NULL) + gUnknown_203B224->unk90[gUnknown_203B224->unk88].unk8 = *param_3; + sub_8012D08(gUnknown_203B224->unk8C,param_4); sub_8099690(1); ResetUnusedInputStruct(); diff --git a/src/load_screen.c b/src/load_screen.c index a5ce6acb0..f517a0b08 100644 --- a/src/load_screen.c +++ b/src/load_screen.c @@ -65,7 +65,7 @@ extern void sub_8007E20(s32, s32, s32, u32, u32, s32, u32); const struct UnkTextStruct2 gUnknown_80E75F8 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -74,7 +74,7 @@ const struct UnkTextStruct2 gUnknown_80E75F8 = { const struct UnkTextStruct2 gUnknown_80E7610 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x1A, 0x0B, 0x0B, 0x00, NULL @@ -85,7 +85,7 @@ const u8 gUnkData_80E7628[] = {0x20, 0x00, 0x00, 0x00}; const struct UnkTextStruct2 gUnknown_80E762C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x0F, 0x00, + 0x02, 0x0F, 0x13, 0x03, 0x03, 0x00, NULL @@ -130,7 +130,7 @@ const struct UnkTextStruct2 gUnknown_80E7784 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x17, 0x00, 0x0F, 0x00, + 0x17, 0x0F, 0x05, 0x03, 0x03, 0x00, NULL diff --git a/src/mailbox.c b/src/mailbox.c index 9eb3d5883..b604e77a4 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -13,7 +13,7 @@ const struct UnkTextStruct2 gUnknown_80E0284 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -23,7 +23,7 @@ const struct UnkTextStruct2 gUnknown_80E029C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x03, 0x00, + 0x03, 0x03, 0x07, 0x03, 0x03, 0x00, NULL @@ -33,7 +33,7 @@ const struct UnkTextStruct2 gUnknown_80E02B4 = { 0x00, 0x00, 0x00, 0x00, 0x04, - 0x15, 0x00, 0x06, 0x00, + 0x15, 0x06, 0x07, 0x03, 0x03, 0x00, NULL @@ -43,7 +43,7 @@ const struct UnkTextStruct2 gUnknown_80E02CC = { 0x00, 0x00, 0x00, 0x00, 0x04, - 0x15, 0x00, 0x0f, 0x00, + 0x15, 0x0f, 0x06, 0x03, 0x03, 0x00, NULL diff --git a/src/main_menu.c b/src/main_menu.c index 10ca9c985..cfe61e2a6 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -92,7 +92,7 @@ static const u8 sUnknown_80E6070[]; const struct UnkTextStruct2 gUnknown_80E59A8 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -103,7 +103,7 @@ static const char main_menu_fill[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80E59C8 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -112,7 +112,7 @@ const struct UnkTextStruct2 gUnknown_80E59C8 = { const struct UnkTextStruct2 gUnknown_80E59E0 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0A, 0x03, 0x03, 0x00, NULL @@ -128,7 +128,7 @@ const struct MenuItem gUnknown_80E59F8[] = const struct UnkTextStruct2 gUnknown_80E5A29 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0A, 0x02, 0x02, 0x00, NULL @@ -143,7 +143,7 @@ const struct MenuItem gUnknown_80E5A44[] = const struct UnkTextStruct2 gUnknown_80E5A60 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0A, 0x08, 0x08, 0x00, NULL @@ -152,7 +152,7 @@ const struct UnkTextStruct2 gUnknown_80E5A60 = { const struct UnkTextStruct2 gUnknown_80E5A78 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0B, 0x09, 0x09, 0x00, NULL @@ -182,7 +182,7 @@ const struct MenuItem gUnknown_80E5AFC[] = const struct UnkTextStruct2 gUnknown_80E5B34 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0A, 0x08, 0x08, 0x00, NULL @@ -212,7 +212,7 @@ const struct MenuItem gUnknown_80E5B8C[] = const struct UnkTextStruct2 gUnknown_80E5BC4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0A, 0x08, 0x08, 0x00, NULL @@ -242,7 +242,7 @@ const struct MenuItem gUnknown_80E5C18[] = const struct UnkTextStruct2 gUnknown_80E5C50 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0A, 0x03, 0x03, 0x00, NULL @@ -265,7 +265,7 @@ const struct MenuItem gUnknown_80E5C9C[] = const struct UnkTextStruct2 gUnknown_80E5CB4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x00, 0x0F, 0x00, + 0x02, 0x0F, 0x1A, 0x03, 0x03, 0x00, NULL diff --git a/src/makuhita_dojo.c b/src/makuhita_dojo.c index 8abf05cbe..d0f609bb9 100644 --- a/src/makuhita_dojo.c +++ b/src/makuhita_dojo.c @@ -15,14 +15,16 @@ ALIGNED(4) const u8 gUnknown_80E0744[] = "Dungeons"; ALIGNED(4) const u8 gUnknown_80E0750[] = {0x83, 0xC2}; ALIGNED(4) const u8 gUnknown_80E0754[] = {0x83, 0xC0}; static const u8 makuhita_dojo_fill[] = "pksdir0"; + const struct UnkTextStruct2 gUnknown_80E0760 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL }; + ALIGNED(4) const u8 gMakuhitaDojoBonslyDoll[] = _( "{CENTER_ALIGN}{COLOR_1 YELLOW_5}$n0{END_COLOR_TEXT_1} received the {COLOR_1 GREEN_2}Bonsly Doll{END_COLOR_TEXT_1}!\n" "{CENTER_ALIGN}It has been placed outside your\n" @@ -44,13 +46,14 @@ u32 CreateMakuhitaShop(u32 param_1) char *monName; struct OpenedFile *faceFile; u32 initialState; - + ResetUnusedInputStruct(); - sub_800641C(0,1,1); - gUnknown_203B318 = MemoryAlloc(sizeof(struct unkStruct_203B318),8); + sub_800641C(0, 1, 1); + gUnknown_203B318 = MemoryAlloc(sizeof(struct unkStruct_203B318), 8); gUnknown_203B318->unk10 = -1; gUnknown_203B318->unk0 = param_1; - switch(param_1) { + + switch (param_1) { case 0: initialState = 0; gUnknown_203B318->unk4 = 0; @@ -85,16 +88,17 @@ u32 CreateMakuhitaShop(u32 param_1) gUnknown_203B318->unk4 = 1; break; } - if (gUnknown_203B318->unk4 == 1) { + + if (gUnknown_203B318->unk4 == 1) gUnknown_203B318->unk68 = NULL; - } - else { + else gUnknown_203B318->unk68 = &gUnknown_203B318->faceFile; - } - CopyYellowMonsterNametoBuffer(gUnknown_202E5D8,MONSTER_MAKUHITA); - CopyYellowMonsterNametoBuffer(gUnknown_202E1C8,MONSTER_MAKUHITA); + + CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_MAKUHITA); + CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_MAKUHITA); monName = GetMonSpecies(MONSTER_MAKUHITA); strcpy(gUnknown_202E1C8 - 0x50, monName); + faceFile = GetDialogueSpriteDataPtr(MONSTER_MAKUHITA); gUnknown_203B318->faceFile = faceFile; gUnknown_203B318->faceData = faceFile->data; @@ -109,8 +113,7 @@ u32 CreateMakuhitaShop(u32 param_1) u32 sub_802FE58(void) { - - switch(gUnknown_203B318->state) { + switch (gUnknown_203B318->state) { case 0: case 1: sub_8030208(); @@ -127,7 +130,7 @@ u32 sub_802FE58(void) GotoMakuhitaFallbackState(); break; } - return 0; + return 0; } s16 sub_802FED0(void) @@ -135,10 +138,9 @@ s16 sub_802FED0(void) return gUnknown_203B318->unk10; } -void CleanMakuhitaShop(void) +void DestroyMakuhitaShop(void) { - if(gUnknown_203B318 != NULL) - { + if (gUnknown_203B318 != NULL) { CloseFile(gUnknown_203B318->faceFile); MemoryFree(gUnknown_203B318); gUnknown_203B318 = NULL; @@ -155,20 +157,20 @@ void UpdateMakuhitaState(s32 newState) void sub_802FF1C(void) { s32 index; + sub_8006518(gUnknown_203B318->unk6C); - switch(gUnknown_203B318->state) - { + + switch (gUnknown_203B318->state) { case 0: case 4: case 13: for(index = 0; index < 4; index++) - { gUnknown_203B318->unk6C[index] = gUnknown_80E0760; - } break; default: break; } + ResetUnusedInputStruct(); sub_800641C(gUnknown_203B318->unk6C, 1, 1); } diff --git a/src/makuhita_dojo_1.c b/src/makuhita_dojo_1.c index 0425c0377..de5838dc6 100644 --- a/src/makuhita_dojo_1.c +++ b/src/makuhita_dojo_1.c @@ -11,11 +11,11 @@ #include "makuhita_dojo.h" #include "menu_input.h" +// size: 0xD0 struct unkStruct_203B31C { - // Size: 0xD0 s16 unk0[NUM_DUNGEON_MAZE]; - struct MenuInputStruct input; + /* 0x30 */ struct MenuInputStruct input; u32 unk64; struct UnkTextStruct2 *unk68; struct UnkTextStruct2 unk6C[4]; @@ -30,7 +30,7 @@ static const u8 makuhita_dojo_fill[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80E07EC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -38,7 +38,7 @@ const struct UnkTextStruct2 gUnknown_80E07EC = { const struct UnkTextStruct2 gUnknown_80E0804 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0E, 0x0E, 0x0E, 0x00, NULL @@ -92,8 +92,7 @@ void DrawMakuhitaMainMenu(void) { loopMax = 0; gUnknown_203B318->unk18[loopMax].text = gMakuhitaDojoGoTrain; gUnknown_203B318->unk18[loopMax].menuAction = 2; - if(sub_80306A4()) - { + if (sub_80306A4()) { gUnknown_203B318->unk18[loopMax].menuAction = -1; gUnknown_203B318->menuAction = 1; } @@ -108,13 +107,12 @@ void DrawMakuhitaMainMenu(void) { gUnknown_203B318->unk18[loopMax].menuAction = 1; } -void sub_8030208(void) { +void sub_8030208(void) +{ s32 menuAction; - if(sub_80144A4(&menuAction) == 0) - { + if (sub_80144A4(&menuAction) == 0) { gUnknown_203B318->menuAction = menuAction; - switch(menuAction) - { + switch (menuAction) { case 2: UpdateMakuhitaState(3); break; @@ -128,9 +126,9 @@ void sub_8030208(void) { } } -void sub_8030258(void) { - switch(sub_80303AC(1)) - { +void sub_8030258(void) +{ + switch (sub_80303AC(1)) { case 3: gUnknown_203B318->unk10 = sub_8030418(); sub_8030480(); @@ -145,12 +143,11 @@ void sub_8030258(void) { case 1: break; } - } -void sub_80302A8(void) { - switch(sub_801B6AC()) - { +void sub_80302A8(void) +{ + switch (sub_801B6AC()) { case 2: case 3: sub_801B72C(); @@ -162,33 +159,30 @@ void sub_80302A8(void) { } } -void GotoMakuhitaFallbackState(void) { +void GotoMakuhitaFallbackState(void) +{ s32 temp; - if(sub_80144A4(&temp) == 0) - { + if (sub_80144A4(&temp) == 0) UpdateMakuhitaState(gUnknown_203B318->fallbackState); - } } bool8 sub_80302E8(int param_1, struct UnkTextStruct2_sub *param_2, u32 param_3) { - - if (sub_80306A4()) { - return 0; - } - else - { - if (gUnknown_203B31C == NULL) { - gUnknown_203B31C = MemoryAlloc(sizeof(struct unkStruct_203B31C),8); - } + if (sub_80306A4()) + return 0; + + if (gUnknown_203B31C == NULL) + gUnknown_203B31C = MemoryAlloc(sizeof(struct unkStruct_203B31C), 8); + gUnknown_203B31C->unk64 = param_1; gUnknown_203B31C->unk68 = &gUnknown_203B31C->unk6C[param_1]; sub_8006518(gUnknown_203B31C->unk6C); gUnknown_203B31C->unk6C[gUnknown_203B31C->unk64] = gUnknown_80E0804; gUnknown_203B31C->unk68->unk14 = gUnknown_203B31C->unkCC; - if (param_2 != NULL) { - gUnknown_203B31C->unk6C[gUnknown_203B31C->unk64].unk08 = *param_2; - } + + if (param_2 != NULL) + gUnknown_203B31C->unk6C[gUnknown_203B31C->unk64].unk8 = *param_2; + sub_8012D08(gUnknown_203B31C->unk68,param_3); ResetUnusedInputStruct(); sub_800641C(gUnknown_203B31C->unk6C,1,1); @@ -196,17 +190,16 @@ bool8 sub_80302E8(int param_1, struct UnkTextStruct2_sub *param_2, u32 param_3) sub_80304C8(); DrawDojoCourseList(); return 1; - } } u32 sub_80303AC(u8 param_1) { if (param_1 == 0) { - sub_8013660(&gUnknown_203B31C->input); - return 0; + sub_8013660(&gUnknown_203B31C->input); + return 0; } - switch(GetKeyPress(&gUnknown_203B31C->input)) - { + + switch (GetKeyPress(&gUnknown_203B31C->input)) { case INPUT_B_BUTTON: PlayMenuSoundEffect(1); return 2; @@ -224,22 +217,24 @@ u32 sub_80303AC(u8 param_1) } } -s16 sub_8030418(void) { +s16 sub_8030418(void) +{ return gUnknown_203B31C->unk0[(gUnknown_203B31C->input.unk1E * gUnknown_203B31C->input.unk1C) + gUnknown_203B31C->input.menuIndex]; } -void sub_8030444(u8 r0) { +void sub_8030444(u8 r0) +{ gUnknown_203B31C->input.unk22 = sub_8030668(); sub_8013984(&gUnknown_203B31C->input); sub_80304C8(); DrawDojoCourseList(); - if(r0) - AddMenuCursorSprite(&gUnknown_203B31C->input); + if (r0) + AddMenuCursorSprite(&gUnknown_203B31C->input); } -void sub_8030480(void) { - if(gUnknown_203B31C != NULL) - { +void sub_8030480(void) +{ + if (gUnknown_203B31C != NULL) { gUnknown_203B31C->unk6C[gUnknown_203B31C->unk64] = gUnknown_80E07EC; ResetUnusedInputStruct(); sub_800641C(gUnknown_203B31C->unk6C, 1, 1); @@ -310,36 +305,35 @@ void sub_80304C8(void) void DrawDojoCourseList(void) { - u8 dungeonIndex; - s32 mazeIndex; - s32 y; - s32 iVar6; - u32 color; - s32 index; - u8 buffer [256]; - - sub_8008C54(gUnknown_203B31C->unk64); - sub_80073B8(gUnknown_203B31C->unk64); - xxx_call_draw_string(10,0,gMakuhitaDojoHeader,gUnknown_203B31C->unk64,0); // Courses - sub_8012BC4(gUnknown_203B31C->unkCC[2] * 8 + 4,0, - gUnknown_203B31C->input.unk1E + 1,2,7,gUnknown_203B31C->unk64); - for (index = 0; index < gUnknown_203B31C->input.unk1A; index++) - { - iVar6 = gUnknown_203B31C->unk0[gUnknown_203B31C->input.unk1E * gUnknown_203B31C->input.unk1C + index]; - dungeonIndex = sub_80A2740(iVar6); + u8 dungeonIndex; + s32 mazeIndex; + s32 y; + s32 iVar6; + u32 color; + s32 index; + u8 buffer[256]; - mazeIndex = sub_80A2668(iVar6); + sub_8008C54(gUnknown_203B31C->unk64); + sub_80073B8(gUnknown_203B31C->unk64); + xxx_call_draw_string(10, 0, gMakuhitaDojoHeader,gUnknown_203B31C->unk64, 0); // Courses + sub_8012BC4(gUnknown_203B31C->unkCC[2] * 8 + 4, 0, gUnknown_203B31C->input.unk1E + 1, 2, 7, gUnknown_203B31C->unk64); - y = sub_8013800(&gUnknown_203B31C->input, index); - color = COLOR_WHITE_2; // COLOR_WHITE again? - if (IsMazeCompleted(mazeIndex)) { - xxx_call_draw_string(8,y,gUnknown_80E0824,gUnknown_203B31C->unk64,0); // Draw Star symbol - color = COLOR_GREEN; - } - sprintfStatic(buffer,gMakuhitaCoursePlaceholder,color,GetDungeonName1(dungeonIndex)); // "#c%c%s#r" - xxx_call_draw_string(0x10,y,buffer,gUnknown_203B31C->unk64,0); + for (index = 0; index < gUnknown_203B31C->input.unk1A; index++) { + iVar6 = gUnknown_203B31C->unk0[gUnknown_203B31C->input.unk1E * gUnknown_203B31C->input.unk1C + index]; + dungeonIndex = sub_80A2740(iVar6); + + mazeIndex = sub_80A2668(iVar6); + + y = sub_8013800(&gUnknown_203B31C->input, index); + color = COLOR_WHITE_2; // COLOR_WHITE again? + if (IsMazeCompleted(mazeIndex)) { + xxx_call_draw_string(8, y, gUnknown_80E0824, gUnknown_203B31C->unk64, 0); // Draw Star symbol + color = COLOR_GREEN; + } + sprintfStatic(buffer, gMakuhitaCoursePlaceholder, color, GetDungeonName1(dungeonIndex)); // "#c%c%s#r" + xxx_call_draw_string(0x10, y, buffer, gUnknown_203B31C->unk64, 0); } - sub_80073E0(gUnknown_203B31C->unk64); + sub_80073E0(gUnknown_203B31C->unk64); } s32 sub_8030668(void) @@ -349,8 +343,7 @@ s32 sub_8030668(void) counter = 0; - for(index = 0; index < NUM_DUNGEON_MAZE; index++) - { + for (index = 0; index < NUM_DUNGEON_MAZE; index++) { if (sub_8097504(index)) { gUnknown_203B31C->unk0[counter] = sub_80A26CC(index); counter++; @@ -362,5 +355,4 @@ s32 sub_8030668(void) bool8 sub_80306A4(void) { return FALSE; -} - +} \ No newline at end of file diff --git a/src/menu_input_1.c b/src/menu_input_1.c index 106d4297b..04a33b326 100644 --- a/src/menu_input_1.c +++ b/src/menu_input_1.c @@ -320,7 +320,7 @@ void sub_8013984(struct MenuInputStruct * param_1) { param_1->unkC = 0; } else { - param_1->unkC = (ptr->unk0 + ptr->unk04 + -2) * 8; + param_1->unkC = (ptr->unk0 + ptr->unk4 + -2) * 8; } param_1->unkE = ((ptr->unk2) + 1) * 8 + -2; } diff --git a/src/other_menus.c b/src/other_menus.c index 4c8a9bcca..79c5c9892 100644 --- a/src/other_menus.c +++ b/src/other_menus.c @@ -26,7 +26,7 @@ extern struct unkStruct_203B35C *gUnknown_203B35C; const struct UnkTextStruct2 gUnknown_80E653C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -34,7 +34,7 @@ const struct UnkTextStruct2 gUnknown_80E653C = { const struct UnkTextStruct2 gUnknown_80E6554 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -95,7 +95,7 @@ ALIGNED(4) const u8 sUnknown_80E669C[] = _("{CENTER_ALIGN}Wonder Mail in transmi const struct UnkTextStruct2 gUnknown_80E66BC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -118,7 +118,7 @@ ALIGNED(4) const u8 sUnknown_80E6734[] = _("{CENTER_ALIGN}{COLOR_1 LIGHT_BLUE}Su const struct UnkTextStruct2 gUnknown_80E6748 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -141,7 +141,7 @@ ALIGNED(4) const u8 sUnknown_80E67B4[] = _("{CENTER_ALIGN}#C2Communication error const struct UnkTextStruct2 gUnknown_80E67D4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -159,7 +159,7 @@ ALIGNED(4) const u8 sUnknown_80E680C[] = _("{CENTER_ALIGN}Check your communicati const struct UnkTextStruct2 gUnknown_80E6830 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -179,7 +179,7 @@ ALIGNED(4) const u8 sUnknown_80E6888[] = _("{CENTER_ALIGN}Check sum error."); const struct UnkTextStruct2 gUnknown_80E689C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -201,7 +201,7 @@ ALIGNED(4) const u8 sUnknown_80E6928[] = _("{CENTER_ALIGN}#C2Error!{END_COLOR_TE const struct UnkTextStruct2 gUnknown_80E6938 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -221,7 +221,7 @@ ALIGNED(4) const u8 sUnknown_80E6988[] = _("{CENTER_ALIGN}This {COLOR_1 LIGHT_BL const struct UnkTextStruct2 gUnknown_80E69B0 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -239,7 +239,7 @@ ALIGNED(4) const u8 sUnknown_80E69E8[] = _("{CENTER_ALIGN}This {COLOR_1 LIGHT_BL const struct UnkTextStruct2 gUnknown_80E6A10 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -257,7 +257,7 @@ ALIGNED(4) const u8 sUnknown_80E6A48[] = _("{CENTER_ALIGN}This {COLOR_1 LIGHT_BL const struct UnkTextStruct2 gUnknown_80E6A74 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -277,7 +277,7 @@ ALIGNED(4) const u8 sUnknown_80E6AC8[] = _("{CENTER_ALIGN}There is no space for const struct UnkTextStruct2 gUnknown_80E6AEC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -297,7 +297,7 @@ ALIGNED(4) const u8 sUnknown_80E6B4C[] = _("{CENTER_ALIGN}You may not go to that const struct UnkTextStruct2 gUnknown_80E6B78 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -317,7 +317,7 @@ ALIGNED(4) const u8 sUnknown_80E6BC4[] = _("{CENTER_ALIGN}There was a problem on const struct UnkTextStruct2 gUnknown_80E6BF4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -335,7 +335,7 @@ ALIGNED(4) const u8 sUnknown_80E6C2C[] = _("{CENTER_ALIGN}Your friend is not res const struct UnkTextStruct2 gUnknown_80E6C50 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -356,7 +356,7 @@ ALIGNED(4) const u8 sUnknown_80E6CA8[] = _("{CENTER_ALIGN}The item exchange with const struct UnkTextStruct2 gUnknown_80E6CD0 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -376,7 +376,7 @@ ALIGNED(4) const u8 sUnknown_80E6D2C[] = _("{CENTER_ALIGN}Please communicate onl const struct UnkTextStruct2 gUnknown_80E6D54 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL @@ -396,7 +396,7 @@ ALIGNED(4) const u8 sUnknown_80E6DB0[] = _("{CENTER_ALIGN}An incorrect number of const struct UnkTextStruct2 gUnknown_80E6DDC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x08, 0x00, + 0x03, 0x08, 0x18, 0x05, 0x05, 0x00, NULL diff --git a/src/party_list_menu.c b/src/party_list_menu.c index 9d43a2e4f..78ef0a83e 100644 --- a/src/party_list_menu.c +++ b/src/party_list_menu.c @@ -42,48 +42,48 @@ struct unkStruct_203B2B8 EWRAM_DATA_2 struct unkStruct_203B2B8 *gUnknown_203B2B8 = {0}; const struct UnkTextStruct2 gUnknown_80DD310 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD328 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x13, 0x00, 0x03, 0x00, - 0x08, 0x03, - 0x03, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x13, 0x03, + 0x08, 0x03, + 0x03, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD340 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x14, 0x00, 0x04, 0x00, - 0x06, 0x03, - 0x03, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x14, 0x04, + 0x06, 0x03, + 0x03, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD358 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x02, 0x00, 0x11, 0x00, - 0x1A, 0x02, - 0x02, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x02, 0x11, + 0x1A, 0x02, + 0x02, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DD370 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x02, 0x00, 0x03, 0x00, - 0x0F, 0x02, - 0x02, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x02, 0x03, + 0x0F, 0x02, + 0x02, 0x00, + NULL }; extern u8 gAvailablePokemonNames[0x58]; diff --git a/src/pelipper_board.c b/src/pelipper_board.c index 9ac1d2cc8..dbf80c22c 100644 --- a/src/pelipper_board.c +++ b/src/pelipper_board.c @@ -18,7 +18,7 @@ const struct UnkTextStruct2 gUnknown_80E0330 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -28,7 +28,7 @@ const struct UnkTextStruct2 gUnknown_80E0348 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x03, 0x00, + 0x03, 0x03, 0x07, 0x03, 0x03, 0x00, NULL @@ -38,7 +38,7 @@ const struct UnkTextStruct2 gUnknown_80E0360 = { 0x00, 0x00, 0x00, 0x00, 0x04, - 0x15, 0x00, 0x06, 0x00, + 0x15, 0x06, 0x07, 0x03, 0x03, 0x00, NULL @@ -48,7 +48,7 @@ const struct UnkTextStruct2 gUnknown_80E0378 = { 0x00, 0x00, 0x00, 0x00, 0x04, - 0x15, 0x00, 0x0f, 0x00, + 0x15, 0x0f, 0x06, 0x03, 0x03, 0x00, NULL diff --git a/src/personality_test.c b/src/personality_test.c index fdfe719a7..2f1919a37 100644 --- a/src/personality_test.c +++ b/src/personality_test.c @@ -37,7 +37,6 @@ enum EWRAM_DATA_2 struct PersonalityTestTracker *gPersonalityTestTracker = {0}; EWRAM_DATA_2 struct PersonalityStruct_203B404 *gUnknown_203B404 = {0}; - extern void sub_801317C(u32 *); extern void sub_8001024(u32 *); extern s32 sub_8094E4C(void); @@ -153,7 +152,6 @@ extern const struct PersonalityQuestion MiscQuest2; extern const struct PersonalityQuestion MiscQuest3; extern const struct PersonalityQuestion BraveQuest2B; - const struct PersonalityQuestion * const gPersonalityQuestionPointerTable[NUM_QUIZ_QUESTIONS + 1] = { &HardyQuest1, @@ -214,7 +212,6 @@ const struct PersonalityQuestion * const gPersonalityQuestionPointerTable[NUM_QU &BraveQuest2B }; - // NOTE: 2nd Part of Brave is included at the end so it isn't actually chosen const u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS + 1] = { @@ -279,7 +276,6 @@ const u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS + 1] = ALIGNED(4) const u8 gGenderText[] = "Are you a boy or a girl?"; const char * const gGenderTextPtr = gGenderText; - const struct MenuItem gGenderMenu[] = { {BoyText, 0}, @@ -313,7 +309,6 @@ const s16 gStarters[NUM_PERSONALITIES][2] = [QUIRKY] = {MONSTER_MEOWTH, MONSTER_TREECKO} }; - ALIGNED(4) const char gStarterReveal[] = _("\n{CENTER_ALIGN}The Pokémon {ARG_POKEMON_0}!"); const char * const gStarterRevealPtr = gStarterReveal; @@ -357,7 +352,7 @@ const struct UnkTextStruct2 gUnknown_80F4244 = { 0x00, 0x00, 0x00, 0x00, 0x05, - 0x0C, 0x00, 0x06, 0x00, + 0x0C, 0x06, 0x05, 0x05, 0x05, 0x00, NULL @@ -383,7 +378,7 @@ const struct UnkTextStruct2 gUnknown_80F4278 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -393,7 +388,7 @@ const struct UnkTextStruct2 gUnknown_80F4290 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x09, 0x0B, 0x0D, 0x00, NULL @@ -403,7 +398,7 @@ const struct UnkTextStruct2 gUnknown_80F42A8 = { 0x00, 0x00, 0x00, 0x00, 0x05, - 0x0E, 0x00, 0x04, 0x00, + 0x0E, 0x04, 0x05, 0x05, 0x05, 0x00, NULL diff --git a/src/pokemon_news.c b/src/pokemon_news.c index f171c055c..1dfc5a2e3 100644 --- a/src/pokemon_news.c +++ b/src/pokemon_news.c @@ -52,24 +52,24 @@ extern struct GameOptions *gGameOptionsRef; const struct UnkTextStruct2 gUnknown_80DFBD0 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const u8 gUnknown_80DFBE8[] = { 0x01, 0x00, 0x0C, 0x00 }; const struct UnkTextStruct2 gUnknown_80DFBEC = { - 0x00, 0x00, 0x00, 0x00, - 0x06, - 0x02, 0x00, 0x02, 0x00, - 0x18, 0x0E, - 0x0E, 0x00, - gUnknown_80DFBE8 + 0x00, 0x00, 0x00, 0x00, + 0x06, + 0x02, 0x02, + 0x18, 0x0E, + 0x0E, 0x00, + gUnknown_80DFBE8 }; ALIGNED(4) const u8 gUnknown_80DFC04[] = "News List"; @@ -77,24 +77,24 @@ ALIGNED(4) static const char wonder_mail_2_fill1[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80DFC18 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const u8 gUnkData_80DFC30[] = { 0x01, 0x00, 0x16, 0x00 }; const struct UnkTextStruct2 gUnknown_80DFC34 = { - 0x00, 0x00, 0x00, 0x00, - 0x06, - 0x02, 0x00, 0x02, 0x00, - 0x1A, 0x10, - 0x10, 0x00, - gUnkData_80DFC30 + 0x00, 0x00, 0x00, 0x00, + 0x06, + 0x02, 0x02, + 0x1A, 0x10, + 0x10, 0x00, + gUnkData_80DFC30 }; ALIGNED(4) const u8 gUnknown_80DFC4C[] = "She"; @@ -103,22 +103,22 @@ ALIGNED(4) static const char wonder_mail_2_fill2[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80DFC5C = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DFC74 = { - 0x00, 0x00, 0x00, 0x00, - 0x06, - 0x02, 0x00, 0x02, 0x00, - 0x18, 0x0E, - 0x0E, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x06, + 0x02, 0x02, + 0x18, 0x0E, + 0x0E, 0x00, + NULL }; ALIGNED(4) const u8 gMailboxText[] = "Mailbox"; @@ -126,22 +126,22 @@ ALIGNED(4) static const char wonder_mail_2_fill3[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80DFC9C = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DFCB4 = { - 0x00, 0x00, 0x00, 0x00, - 0x06, - 0x02, 0x00, 0x02, 0x00, - 0x18, 0x0E, - 0x0E, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x06, + 0x02, 0x02, + 0x18, 0x0E, + 0x0E, 0x00, + NULL }; ALIGNED(4) const u8 gBulletinBoardText[] = "Bulletin Board"; @@ -190,76 +190,66 @@ extern void PrintPokeNameToBuffer(u8 *buffer, struct PokemonStruct *pokemon); u32 sub_802B640(u32 r0, struct UnkTextStruct2_sub *r1, u32 r2) { - - if(HasNoPKMNNews()) - { + if (HasNoPKMNNews()) return 0; - } - else - { - if(gUnknown_203B2CC == NULL) - { - gUnknown_203B2CC = MemoryAlloc(sizeof(struct unkStruct_203B2CC), 8); - } - gUnknown_203B2CC->unk6C = r0; - gUnknown_203B2CC->unk70 = &gUnknown_203B2CC->unk74[r0]; - sub_8006518(gUnknown_203B2CC->unk74); + if (gUnknown_203B2CC == NULL) + gUnknown_203B2CC = MemoryAlloc(sizeof(struct unkStruct_203B2CC), 8); - gUnknown_203B2CC->unk74[gUnknown_203B2CC->unk6C] = gUnknown_80DFBEC; + gUnknown_203B2CC->unk6C = r0; + gUnknown_203B2CC->unk70 = &gUnknown_203B2CC->unk74[r0]; - if(r1 != NULL) - { - gUnknown_203B2CC->unk74[gUnknown_203B2CC->unk6C].unk08 = *r1; - } + sub_8006518(gUnknown_203B2CC->unk74); - sub_8012D08(gUnknown_203B2CC->unk70, r2); - ResetUnusedInputStruct(); - sub_800641C(gUnknown_203B2CC->unk74, 1, 1); + gUnknown_203B2CC->unk74[gUnknown_203B2CC->unk6C] = gUnknown_80DFBEC; - sub_8013818(&gUnknown_203B2CC->input, GetNumPKMNNews(), r2, r0); + if (r1 != NULL) + gUnknown_203B2CC->unk74[gUnknown_203B2CC->unk6C].unk8 = *r1; - gUnknown_203B2CC->input.menuIndex = gUnknown_203B2D0; - gUnknown_203B2CC->input.unk1E = gUnknown_203B2D2; + sub_8012D08(gUnknown_203B2CC->unk70, r2); + ResetUnusedInputStruct(); + sub_800641C(gUnknown_203B2CC->unk74, 1, 1); - sub_8013984(&gUnknown_203B2CC->input); - sub_802B880(); - CreatePKMNNewsMenu(); + sub_8013818(&gUnknown_203B2CC->input, GetNumPKMNNews(), r2, r0); - return 1; - } + gUnknown_203B2CC->input.menuIndex = gUnknown_203B2D0; + gUnknown_203B2CC->input.unk1E = gUnknown_203B2D2; + + sub_8013984(&gUnknown_203B2CC->input); + sub_802B880(); + CreatePKMNNewsMenu(); + + return 1; } u32 sub_802B720(u8 r0) { - if(r0 == 0) - { + if (r0 == 0) { sub_8013660(&gUnknown_203B2CC->input); return 0; } - else + + switch (GetKeyPress(&gUnknown_203B2CC->input)) { - switch(GetKeyPress(&gUnknown_203B2CC->input)) - { - case INPUT_B_BUTTON: - PlayMenuSoundEffect(1); - return 2; - case INPUT_A_BUTTON: - PlayMenuSoundEffect(0); - return 3; - case INPUT_START_BUTTON: - PlayMenuSoundEffect(4); - return 4; - } - if(sub_80138B8(&gUnknown_203B2CC->input, 1) != 0) - { - sub_802B880(); - CreatePKMNNewsMenu(); - return 1; - } - else - return 0; + case INPUT_B_BUTTON: + PlayMenuSoundEffect(1); + return 2; + case INPUT_A_BUTTON: + PlayMenuSoundEffect(0); + return 3; + case INPUT_START_BUTTON: + PlayMenuSoundEffect(4); + return 4; } + + if (sub_80138B8(&gUnknown_203B2CC->input, 1) != 0) + { + sub_802B880(); + CreatePKMNNewsMenu(); + return 1; + } + else + return 0; } u8 GetPokemonNewsIndex(void) @@ -277,16 +267,13 @@ void sub_802B7D0(u8 r0) sub_802B880(); CreatePKMNNewsMenu(); - if(r0 != 0) - { + if (r0 != 0) AddMenuCursorSprite(&gUnknown_203B2CC->input); - } } void sub_802B81C(void) { - if(gUnknown_203B2CC != NULL) - { + if (gUnknown_203B2CC != NULL) { gUnknown_203B2D0 = gUnknown_203B2CC->input.menuIndex; gUnknown_203B2D2 = gUnknown_203B2CC->input.unk1E; @@ -353,20 +340,20 @@ void CreatePKMNNewsMenu(void) s32 new_index; u8 mailIndex; - sub_8008C54(gUnknown_203B2CC->unk6C); sub_80073B8(gUnknown_203B2CC->unk6C); xxx_call_draw_string(0xA, 0, gUnknown_80DFC04, gUnknown_203B2CC->unk6C, 0); sub_8012BC4(((gUnknown_80DFBE8[2] << 3) + 4), 0, gUnknown_203B2CC->input.unk1E + 1, 2, 7, gUnknown_203B2CC->unk6C); - for(index = 0; index < gUnknown_203B2CC->input.unk1A; index++) - { + + for (index = 0; index < gUnknown_203B2CC->input.unk1A; index++) { y = sub_8013800(&gUnknown_203B2CC->input, index); - new_index = (gUnknown_203B2CC->input.unk1E * gUnknown_203B2CC->input.unk1C) + index; + new_index = (gUnknown_203B2CC->input.unk1E * gUnknown_203B2CC->input.unk1C) + index; mailIndex = gUnknown_203B2CC->receivedNewsletters[new_index]; sub_803B6B0(0xA, y, 6, gUnknown_203B2CC->unk6C); sub_802BC7C(); xxx_format_and_draw(0x15, y, GetPokemonMailHeadline(mailIndex), gUnknown_203B2CC->unk6C, 0); } + sub_80073E0(gUnknown_203B2CC->unk6C); } @@ -377,14 +364,13 @@ s32 GetNumPKMNNews(void) newsCount = 0; - for(index = 0; index < NUM_POKEMON_NEWS; index++) - { - if(CheckPKMNNewsSlot(index)) - { + for (index = 0; index < NUM_POKEMON_NEWS; index++) { + if (CheckPKMNNewsSlot(index)) { gUnknown_203B2CC->receivedNewsletters[newsCount] = index; newsCount++; } } + return newsCount; } @@ -392,13 +378,11 @@ bool8 HasNoPKMNNews(void) { s32 index; - for(index = 0; index < NUM_POKEMON_NEWS; index++) - { - if(CheckPKMNNewsSlot(index)) - { + for (index = 0; index < NUM_POKEMON_NEWS; index++) { + if (CheckPKMNNewsSlot(index)) return FALSE; - } } + return TRUE; } @@ -423,8 +407,7 @@ u32 sub_802B9FC(u8 mailIndex) u32 sub_802BA8C(void) { - switch(gUnknown_203B2D4->state) - { + switch (gUnknown_203B2D4->state) { case 0: sub_802BB98(); break; @@ -443,8 +426,7 @@ u32 sub_802BA8C(void) void sub_802BACC(void) { - if(gUnknown_203B2D4 != NULL) - { + if (gUnknown_203B2D4 != NULL) { gUnknown_203B2D4->unk28[gUnknown_203B2D4->unk24] = gUnknown_80DFC18; ResetUnusedInputStruct(); sub_800641C(gUnknown_203B2D4->unk28, 1, 1); @@ -461,8 +443,7 @@ void sub_802BB14(u32 newState) void sub_802BB28(void) { - switch(gUnknown_203B2D4->state) - { + switch (gUnknown_203B2D4->state) { case 0: case 1: sub_8008C54(gUnknown_203B2D4->unk24); @@ -480,17 +461,16 @@ void sub_802BB28(void) void sub_802BB98(void) { - if(gUnknown_203B2D4->unkC != 0) - { - if(gUnknown_203B2D4->unk20 & 8) + if (gUnknown_203B2D4->unkC != 0) { + if (gUnknown_203B2D4->unk20 & 8) sub_8013E54(); gUnknown_203B2D4->unk20++; } - switch(sub_8012A64(&gUnknown_203B2D4->unk88, gUnknown_203B2D4->unk24)) - { + + switch (sub_8012A64(&gUnknown_203B2D4->unk88, gUnknown_203B2D4->unk24)) { case 1: PlayMenuSoundEffect(0); - if(gUnknown_203B2D4->unkC != 0) + if (gUnknown_203B2D4->unkC != 0) sub_802BB14(1); else sub_802BB14(3); @@ -504,17 +484,16 @@ void sub_802BB98(void) void sub_802BC08(void) { - if(gUnknown_203B2D4->unk8 < gUnknown_203B2D4->unkC) - { - if(gUnknown_203B2D4->unk20 & 8) + if (gUnknown_203B2D4->unk8 < gUnknown_203B2D4->unkC) { + if (gUnknown_203B2D4->unk20 & 8) sub_8013E54(); gUnknown_203B2D4->unk20++; } - switch(sub_8012A64(&gUnknown_203B2D4->unk88, gUnknown_203B2D4->unk24)) - { + + switch (sub_8012A64(&gUnknown_203B2D4->unk88, gUnknown_203B2D4->unk24)) { case 1: PlayMenuSoundEffect(0); - if(gUnknown_203B2D4->unk8 < gUnknown_203B2D4->unkC) + if (gUnknown_203B2D4->unk8 < gUnknown_203B2D4->unkC) sub_802BB14(1); else sub_802BB14(3); @@ -529,14 +508,10 @@ void sub_802BC08(void) void sub_802BC7C(void) { PrintPokeNameToBuffer(gAvailablePokemonNames, sub_808D3BC()); - if(gGameOptionsRef->playerGender == FEMALE) - { + if (gGameOptionsRef->playerGender == FEMALE) strcpy(gAvailablePokemonNames + 0x50, gUnknown_80DFC4C); // She - } else - { strcpy(gAvailablePokemonNames + 0x50, gUnknown_80DFC50); // He - } } void sub_802BCC4(void) @@ -564,23 +539,21 @@ void sub_802BCC4(void) u32 sub_802BD14(s32 param_1, struct UnkTextStruct2_sub *param_2, u32 param_3) { + if (HasNoMailinMailbox()) + return 0; + + if (gUnknown_203B2D8 == NULL) + gUnknown_203B2D8 = MemoryAlloc(sizeof(struct unkStruct_203B2D8), 8); - if (HasNoMailinMailbox()) { - return 0; - } - else - { - if (gUnknown_203B2D8 == NULL) { - gUnknown_203B2D8 = MemoryAlloc(sizeof(struct unkStruct_203B2D8),8); - } gUnknown_203B2D8->unk38 = param_1; gUnknown_203B2D8->unk3C = &gUnknown_203B2D8->unk40[param_1]; sub_8006518(gUnknown_203B2D8->unk40); gUnknown_203B2D8->unk40[gUnknown_203B2D8->unk38] = gUnknown_80DFC74; gUnknown_203B2D8->unk3C->unk14 = gUnknown_203B2D8->unkA0; - if (param_2 != NULL) { - gUnknown_203B2D8->unk40[gUnknown_203B2D8->unk38].unk08 = *param_2; - } + + if (param_2 != NULL) + gUnknown_203B2D8->unk40[gUnknown_203B2D8->unk38].unk8 = *param_2; + sub_8012D34(gUnknown_203B2D8->unk3C,param_3); ResetUnusedInputStruct(); sub_800641C(gUnknown_203B2D8->unk40,1,1); @@ -590,18 +563,16 @@ u32 sub_802BD14(s32 param_1, struct UnkTextStruct2_sub *param_2, u32 param_3) sub_802BF30(); CreateMailMenu(); return 1; - } } u32 sub_802BDEC(u8 r0) { - if(r0 == 0) - { + if (r0 == 0) { sub_8013660(&gUnknown_203B2D8->input); return 0; } - switch(GetKeyPress(&gUnknown_203B2D8->input)) - { + + switch (GetKeyPress(&gUnknown_203B2D8->input)) { case INPUT_B_BUTTON: PlayMenuSoundEffect(1); return 2; @@ -612,8 +583,7 @@ u32 sub_802BDEC(u8 r0) PlayMenuSoundEffect(4); return 4; default: - if(sub_80138B8(&gUnknown_203B2D8->input, 1) != 0) - { + if (sub_80138B8(&gUnknown_203B2D8->input, 1) != 0) { sub_802BF30(); CreateMailMenu(); return 1; @@ -623,8 +593,9 @@ u32 sub_802BDEC(u8 r0) } } -u8 sub_802BE74(void) { - return gUnknown_203B2D8->unk0[(gUnknown_203B2D8->input.unk1E * gUnknown_203B2D8->input.unk1C) + gUnknown_203B2D8->input.menuIndex]; +u8 sub_802BE74(void) +{ + return gUnknown_203B2D8->unk0[(gUnknown_203B2D8->input.unk1E * gUnknown_203B2D8->input.unk1C) + gUnknown_203B2D8->input.menuIndex]; } void sub_802BE94(u8 r0) @@ -637,16 +608,13 @@ void sub_802BE94(u8 r0) sub_802BF30(); CreateMailMenu(); - if(r0 != 0) - { + if (r0 != 0) AddMenuCursorSprite(&gUnknown_203B2D8->input); - } } void sub_802BEDC(void) { - if(gUnknown_203B2D8 != NULL) - { + if (gUnknown_203B2D8 != NULL) { gUnknown_203B2DC = gUnknown_203B2D8->input.menuIndex; gUnknown_203B2D8->unk40[gUnknown_203B2D8->unk38] = gUnknown_80DFC5C; ResetUnusedInputStruct(); diff --git a/src/post_office_guide.c b/src/post_office_guide.c index 6f466b5a8..c70c969ec 100644 --- a/src/post_office_guide.c +++ b/src/post_office_guide.c @@ -144,7 +144,7 @@ const struct UnkTextStruct2 gUnknown_80E1EFC = { 0, 0, 0, 0, 3, - 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, NULL @@ -156,7 +156,7 @@ const struct UnkTextStruct2 gUnknown_80E1F18 = { 0, 0, 0, 0, 6, - 2, 0, 2, 0, + 2, 2, 0x14, 4, 4, 0, gUnkData_80E1F14 diff --git a/src/rescue_password_menu.c b/src/rescue_password_menu.c index c1414018a..7e4aa53f1 100644 --- a/src/rescue_password_menu.c +++ b/src/rescue_password_menu.c @@ -24,23 +24,21 @@ EWRAM_DATA_2 u32 gUnknown_203B36C = {0}; EWRAM_DATA_2 struct RescuePasswordMenu *gRescuePasswordMenu = {0}; const struct UnkTextStruct2 gUnknown_80E71E4 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80E71FC = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 Error_80E7268[]; @@ -59,13 +57,12 @@ ALIGNED(4) const u8 IncorrectPassword_80E7250[] = _("{CENTER_ALIGN}Incorrect pas ALIGNED(4) const u8 Error_80E7268[] = _("{CENTER_ALIGN}{COLOR_1 RED}Error!{END_COLOR_TEXT_1} "); const struct UnkTextStruct2 gUnknown_80E7278 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 Success_80E72D8[]; @@ -84,13 +81,12 @@ ALIGNED(4) const u8 PasswordAccept_80E72B4[] = _("{CENTER_ALIGN}The password has ALIGNED(4) const u8 Success_80E72D8[] = _("{CENTER_ALIGN}{COLOR_1 LIGHT_BLUE}Success!{END_COLOR_TEXT_1} "); const struct UnkTextStruct2 gUnknown_80E72EC = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 NotSOSMail_80E7324[]; @@ -105,13 +101,12 @@ const struct MenuItem gUnknown_80E7304[4] = { ALIGNED(4) const u8 NotSOSMail_80E7324[] = _("{CENTER_ALIGN}This is not an {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}."); const struct UnkTextStruct2 gUnknown_80E7344 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 ReceiveSOSMail_80E737C[]; @@ -126,13 +121,12 @@ const struct MenuItem gUnknown_80E735C[4] = { ALIGNED(4) const u8 ReceiveSOSMail_80E737C[] = _("{CENTER_ALIGN}This {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1} has been received already."); const struct UnkTextStruct2 gUnknown_80E73AC = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 sUnknown_80E73E4[]; @@ -147,13 +141,12 @@ const struct MenuItem gUnknown_80E73C4[4] = { ALIGNED(4) const u8 sUnknown_80E73E4[] = _("{CENTER_ALIGN}This is not an {COLOR_1 LIGHT_BLUE}A-OK Mail{END_COLOR_TEXT_1}."); const struct UnkTextStruct2 gUnknown_80E7408 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 sUnknown_80E7440[]; @@ -168,13 +161,12 @@ const struct MenuItem gUnknown_80E7420[4] = { ALIGNED(4) const u8 sUnknown_80E7440[] = _("{CENTER_ALIGN}This {COLOR_1 LIGHT_BLUE}A-OK Mail{END_COLOR_TEXT_1} cannot be used."); const struct UnkTextStruct2 gUnknown_80E7468 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 sUnknown_80E74A0[]; @@ -188,13 +180,12 @@ const struct MenuItem gUnknown_80E7480[4] = { ALIGNED(4) const u8 sUnknown_80E74A0[] = _("{CENTER_ALIGN}This is not a {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1}."); const struct UnkTextStruct2 gUnknown_80E74C8 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 sUnknown_80E7500[]; @@ -209,13 +200,12 @@ const struct MenuItem gUnknown_80E74E0[4] = { ALIGNED(4) const u8 sUnknown_80E7500[] = _("{CENTER_ALIGN}This {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1} cannot be used."); const struct UnkTextStruct2 gUnknown_80E752C = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 sUnknown_80E7564[]; @@ -229,13 +219,12 @@ const struct MenuItem gUnknown_80E7544[4] = { ALIGNED(4) const u8 sUnknown_80E7564[] = _("{CENTER_ALIGN}This is not a {COLOR_1 LIGHT_BLUE}Wonder Mail{END_COLOR_TEXT_1}."); const struct UnkTextStruct2 gUnknown_80E7588 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x03, 0x00, 0x09, 0x00, - 0x17, 0x05, - 0x05, 0x00, - NULL - + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x03, 0x09, + 0x17, 0x05, + 0x05, 0x00, + NULL }; const u8 sUnknown_80E75C0[]; diff --git a/src/save_menu.c b/src/save_menu.c index 7d941ef54..487a7a8a8 100644 --- a/src/save_menu.c +++ b/src/save_menu.c @@ -32,7 +32,7 @@ const struct UnkTextStruct2 gUnknown_80E6F20 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -42,7 +42,7 @@ const struct UnkTextStruct2 gUnknown_80E6F38 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x05, 0x00, 0x08, 0x00, + 0x05, 0x08, 0x15, 0x05, 0x05, 0x00, NULL @@ -127,8 +127,8 @@ ALIGNED(4) const u8 sUnknown_80E7134[] = _("{CENTER_ALIGN}Your adventure could n ALIGNED(4) const u8 sUnknown_80E715C[] = _("{CENTER_ALIGN}{COLOR_1 RED}Deletion failed!{END_COLOR_TEXT_1} "); ALIGNED(4) const u8 gUnknown_80E7178[] = _("{CENTER_ALIGN}The data could not be written.\n" - "{CENTER_ALIGN}Please turn off the power and remove\n" - "{CENTER_ALIGN}and reinsert the DS Card."); + "{CENTER_ALIGN}Please turn off the power and remove\n" + "{CENTER_ALIGN}and reinsert the DS Card."); ALIGNED(4) static const u8 save_menu_fill0[] = "pksdir0"; diff --git a/src/text.c b/src/text.c index 4c1d95a8c..8700102be 100644 --- a/src/text.c +++ b/src/text.c @@ -29,6 +29,7 @@ extern const struct FileArchive gSystemFileArchive; extern const u32 gUnknown_80B87C4[8]; extern const u32 gUnknown_80B87E4[8]; extern const u32 gUnknown_80B8804[4]; +extern u32 gUnknown_80B8814[]; void LoadCharmaps(void) { @@ -43,23 +44,25 @@ void LoadCharmaps(void) gCharmaps[1] = gCharmapFiles[1]->data; gUnknown_202B028[0] = 11; gUnknown_202B028[1] = 12; - for (k = 0; k < 4; k++) - { - gUnknown_2027370[k].unk04 = 0; - gUnknown_2027370[k].unk08 = 0; + + for (k = 0; k < 4; k++) { + gUnknown_2027370[k].unk4 = 0; + gUnknown_2027370[k].unk8 = 0; gUnknown_2027370[k].unk46 = 0; } + gCharacterSpacing = 0; - for (i = 0; i < 20; i++) - { + + for (i = 0; i < 20; i++) { gUnknown_202B038[0][i][0] = 0xf279; gUnknown_202B038[1][i][0] = 0xf27a; - for (j = 1; j < 32; j++) - { + + for (j = 1; j < 32; j++) { gUnknown_202B038[0][i][j] = 0; gUnknown_202B038[1][i][j] = 0xf27a; } } + gUnknown_202B034 = 1; gUnknown_202B030 = 0x88888888; gUnknown_203B078 = NULL; @@ -75,16 +78,16 @@ u32 xxx_update_some_bg_tiles(u32 a0) u32 *r4 = (u32 *)(VRAM + 0x4f40); const u32 *r2; gUnknown_20274B0 = a0; - if (a0 == 0 || a0 == 2) - { + + if (a0 == 0 || a0 == 2) { sub_800CDA8(2); r2 = gUnknown_80B87C4; } - else - { + else { sub_800CDA8(1); r2 = gUnknown_80B87E4; } + gUnknown_202B030 = 0x88888888; *r4++ = *r2++; *r4++ = *r2++; @@ -117,13 +120,11 @@ void SelectCharmap(u32 a0) void sub_80063D8(int a0) { u32 retval; - if (a0 == 0) - { + if (a0 == 0) { gUnknown_20274B0; retval = 0x88888888; } - else - { + else { retval = (a0 & 0xf) | ((a0 & 0xf) << 4); retval |= ((a0 & 0xf) << 8); retval |= ((a0 & 0xf) << 12); @@ -150,17 +151,19 @@ void sub_8006438(const struct UnkTextStruct2 *a0, u8 a1, u8 a2, u32 *a3) a0 = gUnknown_80B857C; if (a2) sub_8009388(); + sub_800898C(); - for (i = 0; i < 4; i++) - { + + for (i = 0; i < 4; i++) { gUnknown_202AFC0[i] = a0[i]; - if (a0[i].unkC) - { + + if (a0[i].unkC) { sub_8006554(gUnknown_2027370, (void *)VRAM, gUnknown_20274B4, gUnknown_202B038, gUnknown_80B8804[i], a0 + i, a1, r9, a3, 0); sub_80089AC(a0 + i, a3); r9 += a0[i].unkC * a0[i].unk10; } } + #ifdef NONMATCHING gUnknown_203B078 = gUnknown_3000E94; gUnknown_20274A5 = 1; @@ -172,4 +175,4 @@ void sub_8006438(const struct UnkTextStruct2 *a0, u8 a1, u8 a2, u32 *a3) "\tmovs r0, 0x1\n" "\tstrb r0, [r1]"); #endif -} +} \ No newline at end of file diff --git a/src/text_1.c b/src/text_1.c index 068417c26..39af0e701 100644 --- a/src/text_1.c +++ b/src/text_1.c @@ -11,10 +11,8 @@ void nullsub_152(void) void sub_8006518(struct UnkTextStruct2 *unkData) { s32 iVar2; - for(iVar2 = 0; iVar2 < 4; iVar2++) - { + for (iVar2 = 0; iVar2 < 4; iVar2++) unkData[iVar2] = gUnknown_202AFC0[iVar2]; - } } void nullsub_153(void) @@ -24,4 +22,4 @@ void nullsub_153(void) u32 sub_8006544(u32 index) { return gUnknown_80B8814[index]; -} +} \ No newline at end of file diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index 303243c45..f8d3866b0 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -56,22 +56,22 @@ extern char gAvailablePokemonNames[0x50]; const struct UnkTextStruct2 gUnknown_80DED48 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x15, 0x00, 0x04, 0x00, - 0x06, 0x05, - 0x05, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x15, 0x04, + 0x06, 0x05, + 0x05, 0x00, + NULL }; const struct UnkTextStruct2 gUnknown_80DED60 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x16, 0x00, 0x07, 0x00, - 0x06, 0x05, - 0x05, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x16, 0x07, + 0x06, 0x05, + 0x05, 0x00, + NULL }; extern const u8 SendItem_Text[]; @@ -87,12 +87,12 @@ const struct MenuItem gUnknown_80DED78[3] = // Unused const struct UnkTextStruct2 gUnknown_80DEDA0 = { - 0x00, 0x00, 0x00, 0x00, - 0x03, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00, - NULL + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL }; diff --git a/src/trade_items_menu.c b/src/trade_items_menu.c index 2d8c72e93..7e09a02f6 100644 --- a/src/trade_items_menu.c +++ b/src/trade_items_menu.c @@ -32,7 +32,7 @@ const struct UnkTextStruct2 gUnknown_80E60EC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x15, 0x00, 0x04, 0x00, + 0x15, 0x04, 0x06, 0x05, 0x05, 0x00, NULL @@ -49,7 +49,7 @@ static const struct UnkTextStruct2 unused = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x16, 0x00, 0x09, 0x00, + 0x16, 0x09, 0x05, 0x03, 0x03, 0x00, NULL @@ -66,7 +66,7 @@ const struct UnkTextStruct2 gUnknown_80E6174 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x15, 0x00, 0x0D, 0x00, + 0x15, 0x0D, 0x06, 0x04, 0x04, 0x00, NULL diff --git a/src/unk_menu_203B360.c b/src/unk_menu_203B360.c index e09236099..eeb395af0 100644 --- a/src/unk_menu_203B360.c +++ b/src/unk_menu_203B360.c @@ -30,7 +30,7 @@ extern struct unkStruct_203B360 *gUnknown_203B360; const struct UnkTextStruct2 gUnknown_80E6E7C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -39,7 +39,7 @@ const struct UnkTextStruct2 gUnknown_80E6E7C = { const struct UnkTextStruct2 gUnknown_80E6E94 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x05, 0x00, 0x09, 0x00, + 0x05, 0x09, 0x13, 0x05, 0x05, 0x00, NULL diff --git a/src/wonder_mail.c b/src/wonder_mail.c index b8557c8c5..0d03b2ae0 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -233,7 +233,7 @@ const struct UnkTextStruct2 gUnknown_80DDACC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x16, 0x00, 0x07, 0x00, + 0x16, 0x07, 0x06, 0x04, 0x04, 0x00, NULL @@ -243,7 +243,7 @@ const struct UnkTextStruct2 gUnknown_80DDAE4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x16, 0x00, 0x06, 0x00, + 0x16, 0x06, 0x06, 0x04, 0x04, 0x00, NULL diff --git a/src/wonder_mail_2_1.c b/src/wonder_mail_2_1.c index 9ad4d167f..381dfe63c 100644 --- a/src/wonder_mail_2_1.c +++ b/src/wonder_mail_2_1.c @@ -18,7 +18,7 @@ const struct UnkTextStruct2 gUnknown_80DFCE4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -28,7 +28,7 @@ const struct UnkTextStruct2 gUnknown_80DFCFC = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x18, 0x0E, 0x0E, 0x00, NULL @@ -41,7 +41,7 @@ const struct UnkTextStruct2 gUnknown_80DFD28 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -51,7 +51,7 @@ const struct UnkTextStruct2 gUnknown_80DFD40 = { 0x00, 0x00, 0x00, 0x00, 0x04, - 0x15, 0x00, 0x06, 0x00, + 0x15, 0x06, 0x07, 0x03, 0x03, 0x00, NULL @@ -61,7 +61,7 @@ const struct UnkTextStruct2 gUnknown_80DFD58 = { 0x00, 0x00, 0x00, 0x00, 0x04, - 0x15, 0x00, 0x0f, 0x00, + 0x15, 0x0f, 0x06, 0x03, 0x03, 0x00, NULL @@ -75,7 +75,7 @@ const struct UnkTextStruct2 gUnknown_80DFD8C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -85,7 +85,7 @@ const struct UnkTextStruct2 gUnknown_80DFDA4 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x18, 0x0e, 0x0e, 0x00, NULL @@ -161,7 +161,7 @@ bool8 sub_802C4C8(int param_1,struct UnkTextStruct2_sub *param_2,u32 param_3) } else { - gUnknown_203B2E8 = MemoryAlloc(sizeof(struct unkStruct_203B2E8),8); + gUnknown_203B2E8 = MemoryAlloc(sizeof(struct unkStruct_203B2E8), 8); gUnknown_203B2E8->unk3C = param_1; gUnknown_203B2E8->unk40 = &gUnknown_203B2E8->unk44[param_1]; sub_8006518(gUnknown_203B2E8->unk44); @@ -169,9 +169,10 @@ bool8 sub_802C4C8(int param_1,struct UnkTextStruct2_sub *param_2,u32 param_3) gUnknown_203B2E8->unk44[gUnknown_203B2E8->unk3C] = gUnknown_80DFCFC; gUnknown_203B2E8->unk40->unk14 = gUnknown_203B2E8->unkA4; - if (param_2 != NULL) { - gUnknown_203B2E8->unk44[gUnknown_203B2E8->unk3C].unk08 = *param_2; - } + + if (param_2 != NULL) + gUnknown_203B2E8->unk44[gUnknown_203B2E8->unk3C].unk8 = *param_2; + sub_8012D34(gUnknown_203B2E8->unk40,param_3); ResetUnusedInputStruct(); sub_800641C(gUnknown_203B2E8->unk44,1,1); diff --git a/src/wonder_mail_2_mid.c b/src/wonder_mail_2_mid.c index 1b45522e4..488a33909 100644 --- a/src/wonder_mail_2_mid.c +++ b/src/wonder_mail_2_mid.c @@ -33,7 +33,6 @@ extern u8 gBulletinBoardText[]; extern bool8 IsMailinJobSlot(struct WonderMail *); extern void CreateRescueTitle(struct unkStruct_802C39C *); - struct unkStruct_203B2D8 { // size: 0xA4 @@ -140,18 +139,19 @@ bool8 sub_802C10C(s32 param_1,struct UnkTextStruct2_sub *param_2,s32 param_3) } else { - if (gUnknown_203B2E0 == NULL) { - gUnknown_203B2E0 = MemoryAlloc(sizeof(struct unkStruct_203B2E0),8); - } + if (gUnknown_203B2E0 == NULL) + gUnknown_203B2E0 = MemoryAlloc(sizeof(struct unkStruct_203B2E0), 8); + gUnknown_203B2E0->unk3C = param_1; gUnknown_203B2E0->unk40 = &gUnknown_203B2E0->unk44[param_1]; sub_8006518(gUnknown_203B2E0->unk44); gUnknown_203B2E0->unk44[gUnknown_203B2E0->unk3C] = gUnknown_80DFCB4; gUnknown_203B2E0->unk40->unk14 = gUnknown_203B2E0->unkA4; - if (param_2 != NULL) { - gUnknown_203B2E0->unk44[gUnknown_203B2E0->unk3C].unk08 = *param_2; - } + + if (param_2 != NULL) + gUnknown_203B2E0->unk44[gUnknown_203B2E0->unk3C].unk8 = *param_2; + sub_8012D34(gUnknown_203B2E0->unk40,param_3); ResetUnusedInputStruct(); sub_800641C(gUnknown_203B2E0->unk44,1,1); diff --git a/src/wonder_mail_3.c b/src/wonder_mail_3.c index 1447180c2..dcf3c36eb 100644 --- a/src/wonder_mail_3.c +++ b/src/wonder_mail_3.c @@ -18,7 +18,7 @@ const struct UnkTextStruct2 gUnknown_80DFDD4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -29,7 +29,7 @@ const struct UnkTextStruct2 gUnknown_80DFDEC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x03, 0x00, + 0x03, 0x03, 0x07, 0x03, 0x03, 0x00, NULL @@ -39,7 +39,7 @@ const struct UnkTextStruct2 gUnknown_80DFE04 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x15, 0x00, 0x06, 0x00, + 0x15, 0x06, 0x07, 0x03, 0x03, 0x00, NULL @@ -48,7 +48,7 @@ const struct UnkTextStruct2 gUnknown_80DFE1C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x15, 0x00, 0x0f, 0x00, + 0x15, 0x0f, 0x07, 0x03, 0x03, 0x00, NULL @@ -59,7 +59,7 @@ const struct UnkTextStruct2 gUnknown_80DFE34 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x15, 0x00, 0x0f, 0x00, + 0x15, 0x0f, 0x06, 0x03, 0x03, 0x00, NULL diff --git a/src/wonder_mail_3_mid.c b/src/wonder_mail_3_mid.c index cc2b08450..89534d7db 100644 --- a/src/wonder_mail_3_mid.c +++ b/src/wonder_mail_3_mid.c @@ -146,7 +146,7 @@ const u8 *sub_80974A0(s16 index); const struct UnkTextStruct2 gUnknown_80E03C4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -154,7 +154,7 @@ const struct UnkTextStruct2 gUnknown_80E03C4 = { const struct UnkTextStruct2 gUnknown_80E03DC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x00, 0x03, 0x00, + 0x03, 0x03, 0x07, 0x03, 0x03, 0x00, NULL @@ -162,7 +162,7 @@ const struct UnkTextStruct2 gUnknown_80E03DC = { const struct UnkTextStruct2 gUnknown_80E03F4 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x15, 0x00, 0x06, 0x00, + 0x15, 0x06, 0x07, 0x03, 0x03, 0x00, NULL @@ -173,7 +173,7 @@ static const u8 wonder_mail_fill[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80E041C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -234,7 +234,7 @@ static const u8 wonder_mail_fill2[] = "pksdir0"; const struct UnkTextStruct2 gUnknown_80E06FC = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -243,7 +243,7 @@ const struct UnkTextStruct2 gUnknown_80E06FC = { const struct UnkTextStruct2 gUnknown_80E0714 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x0E, 0x0E, 0x0E, 0x00, NULL @@ -251,7 +251,7 @@ const struct UnkTextStruct2 gUnknown_80E0714 = { const struct UnkTextStruct2 gUnknown_80E072C = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x10, 0x10, 0x10, 0x00, NULL @@ -269,8 +269,6 @@ extern u8 gUnknown_80E0744[]; extern u8 gUnknown_80E0754[]; extern u8 gUnknown_80E0750[]; - - u32 sub_802EF48(void) { gUnknown_203B30C = MemoryAlloc(sizeof(struct unkStruct_203B30C), 8); @@ -715,41 +713,34 @@ void ProceedToNextRewardSceneState(void) u32 sub_802F73C(u32 r0, struct UnkTextStruct2_sub *r1, u32 r2, u8 r3) { - if(sub_802FCF0(r0)) - { + if (sub_802FCF0(r0)) return 0; - } + + if (gUnknown_203B314 == NULL) + gUnknown_203B314 = MemoryAlloc(sizeof(struct unkStruct_203B314), 8); + + gUnknown_203B314->unkB8 = r3; + gUnknown_203B314->unkF0 = r0; + gUnknown_203B314->unkF4 = &gUnknown_203B314->unkF8[gUnknown_203B314->unkF0]; + sub_8006518(gUnknown_203B314->unkF8); + + if (r3 != 0) + gUnknown_203B314->unkF8[gUnknown_203B314->unkF0] = gUnknown_80E072C; else - { - if(gUnknown_203B314 == NULL) - gUnknown_203B314 = MemoryAlloc(sizeof(struct unkStruct_203B314), 0x8); - gUnknown_203B314->unkB8 = r3; - gUnknown_203B314->unkF0 = r0; - gUnknown_203B314->unkF4 = &gUnknown_203B314->unkF8[gUnknown_203B314->unkF0]; - sub_8006518(gUnknown_203B314->unkF8); - if(r3 != 0) - { - gUnknown_203B314->unkF8[gUnknown_203B314->unkF0] = gUnknown_80E072C; - } - else - { - gUnknown_203B314->unkF8[gUnknown_203B314->unkF0] = gUnknown_80E0714; - } + gUnknown_203B314->unkF8[gUnknown_203B314->unkF0] = gUnknown_80E0714; - gUnknown_203B314->unkF4->unk14 = gUnknown_203B314->unk158; - if(r1 != 0) - { - gUnknown_203B314->unkF8[gUnknown_203B314->unkF0].unk08 = *r1; - } + gUnknown_203B314->unkF4->unk14 = gUnknown_203B314->unk158; - sub_8012D08(gUnknown_203B314->unkF4, r2); - ResetUnusedInputStruct(); - sub_800641C(gUnknown_203B314->unkF8, 1, 1); - sub_8013818(&gUnknown_203B314->input, sub_802FBF4(), r2, r0); - sub_802F9C0(); - sub_802FA50(); - return 1; - } + if (r1 != 0) + gUnknown_203B314->unkF8[gUnknown_203B314->unkF0].unk8 = *r1; + + sub_8012D08(gUnknown_203B314->unkF4, r2); + ResetUnusedInputStruct(); + sub_800641C(gUnknown_203B314->unkF8, 1, 1); + sub_8013818(&gUnknown_203B314->input, sub_802FBF4(), r2, r0); + sub_802F9C0(); + sub_802FA50(); + return 1; } u32 sub_802F848(s16 param_1) diff --git a/src/wonder_mail_4.c b/src/wonder_mail_4.c index cde0be528..efc369eb5 100644 --- a/src/wonder_mail_4.c +++ b/src/wonder_mail_4.c @@ -28,7 +28,7 @@ extern struct unkStruct_203B480 *gUnknown_203B480; const struct UnkTextStruct2 gUnknown_80E083C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -37,7 +37,7 @@ const struct UnkTextStruct2 gUnknown_80E083C = { const struct UnkTextStruct2 gUnknown_80E0854 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x18, 0x11, 0x11, 0x00, NULL @@ -74,7 +74,6 @@ ALIGNED(4) const u8 RequestList[] = "Request List"; ALIGNED(4) const u8 SOSList[] = "SOS List"; static const u8 wonder_mail_fill[] = "pksdir0"; - extern bool8 HasNoWonderMailType(u32); extern s32 sub_8030A74(void); extern void sub_80308A0(void); @@ -96,9 +95,10 @@ extern void CreateRescueTitle(struct unkStruct_802C39C *); u32 sub_80306A8(u32 wonderMailType, u32 r1, struct UnkTextStruct2_sub *r2, u32 r3) { - if(HasNoWonderMailType(wonderMailType)) + if (HasNoWonderMailType(wonderMailType)) return 0; - gUnknown_203B320 = MemoryAlloc(sizeof(struct unkStruct_203B320), 0x8); + + gUnknown_203B320 = MemoryAlloc(sizeof(struct unkStruct_203B320), 8); gUnknown_203B320->wonderMailType = wonderMailType; gUnknown_203B320->unk58 = r1; @@ -108,11 +108,8 @@ u32 sub_80306A8(u32 wonderMailType, u32 r1, struct UnkTextStruct2_sub *r2, u32 r gUnknown_203B320->unk60[gUnknown_203B320->unk58] = gUnknown_80E0854; gUnknown_203B320->unk5C->unk14 = gUnknown_203B320->unkC0; - if(r2 != 0) - { - gUnknown_203B320->unk60[gUnknown_203B320->unk58].unk08 = *r2; - } - + if (r2 != 0) + gUnknown_203B320->unk60[gUnknown_203B320->unk58].unk8 = *r2; sub_8012D08(gUnknown_203B320->unk5C, r3); ResetUnusedInputStruct(); diff --git a/src/wonder_mail_5.c b/src/wonder_mail_5.c index d6313c687..668782497 100644 --- a/src/wonder_mail_5.c +++ b/src/wonder_mail_5.c @@ -25,21 +25,21 @@ extern struct unkStruct_203B480 *gUnknown_203B480; const struct UnkTextStruct2 gUnknown_80E0900 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL }; -const u8 DATA_80E0918[] = {0x01, 0x00, 0x12, 0x00}; +const u8 gUnknown_80E0918[] = {0x01, 0x00, 0x12, 0x00}; const struct UnkTextStruct2 gUnknown_80E091C = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x1A, 0x10, 0x10, 0x00, - DATA_80E0918 + gUnknown_80E0918 }; const u8 gUnknown_80E0934[] = "ID:"; diff --git a/src/wonder_mail_6.c b/src/wonder_mail_6.c index ada123e5f..589f22a8b 100644 --- a/src/wonder_mail_6.c +++ b/src/wonder_mail_6.c @@ -47,7 +47,7 @@ const struct MenuItem gUnknown_80E0968[] = const struct UnkTextStruct2 gUnknown_80E0990 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -55,7 +55,7 @@ const struct UnkTextStruct2 gUnknown_80E0990 = { const struct UnkTextStruct2 gUnknown_80E09A8 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x13, 0x00, 0x0B, 0x00, + 0x13, 0x0B, 0x08, 0x03, 0x03, 0x00, NULL @@ -63,7 +63,7 @@ const struct UnkTextStruct2 gUnknown_80E09A8 = { const struct UnkTextStruct2 gUnknown_80E09C0 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x11, 0x00, 0x0F, 0x00, + 0x11, 0x0F, 0x07, 0x03, 0x03, 0x00, NULL diff --git a/src/wonder_mail_802DF88.c b/src/wonder_mail_802DF88.c index 7074764fe..c747bc2ec 100644 --- a/src/wonder_mail_802DF88.c +++ b/src/wonder_mail_802DF88.c @@ -50,7 +50,7 @@ const struct UnkTextStruct2 gUnknown_80E016C = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -80,7 +80,7 @@ const struct UnkTextStruct2 gUnknown_80E0248 = { 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NULL @@ -92,7 +92,7 @@ const struct UnkTextStruct2 gUnknown_80E0264 = { 0x00, 0x00, 0x00, 0x00, 0x06, - 0x02, 0x00, 0x02, 0x00, + 0x02, 0x02, 0x1A, 0x10, 0x10, 0x00, UnkData_80E0260