diff --git a/asmdiff.sh b/asmdiff.sh index 3b92ab5be..886d54f3f 100755 --- a/asmdiff.sh +++ b/asmdiff.sh @@ -1,10 +1,6 @@ #!/bin/bash -if [[ -d "$DEVKITARM/bin/" ]]; then - OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" -else - OBJDUMP_BIN="arm-none-eabi-objdump" -fi +OBJDUMP_BIN="arm-none-eabi-objdump" OBJDUMP="$OBJDUMP_BIN -D -bbinary -marmv4t -Mforce-thumb" diff --git a/diff.txt b/diff.txt new file mode 100644 index 000000000..e69de29bb diff --git a/include/code_8004AA0.h b/include/code_8004AA0.h index 2501b44b2..faba2f827 100644 --- a/include/code_8004AA0.h +++ b/include/code_8004AA0.h @@ -4,38 +4,38 @@ #include "file_system.h" // size: 0x4 -struct RGB +typedef struct RGB { // IDK which is R G B u8 unk0; u8 unk1; u8 unk2; -}; +} RGB; // size: 0x18 -struct unkStruct_202EE8C +typedef struct unkStruct_202EE8C { u32 unk0; u16 unk4; s16 unk6; - struct RGB *unk8; - struct RGB *unkC; - struct RGB *unk10; - struct RGB unk14; -}; + RGB *unk8; + RGB *unkC; + RGB *unk10; + RGB unk14; +} unkStruct_202EE8C; // size: Variable -struct unkDataFor8004AA4 +typedef struct unkDataFor8004AA4 { /* 0x0 */ s16 colorCount; s16 unk2; - /* 0x4 */ struct RGB colors[0]; -}; + /* 0x4 */ RGB colors[0]; +} unkDataFor8004AA4; void nullsub_6(void); -void sub_8004AA4(struct unkStruct_202EE8C *, OpenedFile *, s32); -bool8 sub_8004AF0(bool8, struct unkStruct_202EE8C *, s32, s32, s32, u8 *); -bool8 sub_8004D14(struct unkStruct_202EE8C *, s32); -bool8 sub_8004D40(struct unkStruct_202EE8C *, s32); +void sub_8004AA4(unkStruct_202EE8C *, OpenedFile *, s32); +bool8 sub_8004AF0(bool8, unkStruct_202EE8C *, s32, s32, s32, u8 *); +bool8 sub_8004D14(unkStruct_202EE8C *, s32); +bool8 sub_8004D40(unkStruct_202EE8C *, s32); #endif // GUARD_CODE_8004AA0_H \ No newline at end of file diff --git a/include/code_802C39C.h b/include/code_802C39C.h index 30e3df042..0dc2053f1 100644 --- a/include/code_802C39C.h +++ b/include/code_802C39C.h @@ -1,7 +1,14 @@ -struct unkStruct_802C39C +#ifndef GUARD_CODE_802C39C_H +#define GUARD_CODE_802C39C_H + +#include "code_8094F88.h" +#include "wonder_mail.h" + +// size: 0x58 +typedef struct unkStruct_802C39C { /* 0x0 */ u32 unk0[2]; - /* 0x8 */ struct WonderMailSub *unk8; + /* 0x8 */ WonderMailSub *unk8; /* 0xC */ u8 *playerName; /* 0x10 */ s16 clientSpecies; /* 0x12 */ s16 targetSpecies; @@ -20,5 +27,7 @@ struct unkStruct_802C39C /* 0x48 */ u32 y; /* 0x4C */ u8 *unk4C; u8 *unk50; - /* 0x54 */ struct WonderMail *mail; -}; + /* 0x54 */ WonderMail *mail; +} unkStruct_802C39C; + +#endif // GUARD_CODE_802C39C_H \ No newline at end of file diff --git a/include/code_8094F88.h b/include/code_8094F88.h index 24a92d9fc..6706343a8 100644 --- a/include/code_8094F88.h +++ b/include/code_8094F88.h @@ -6,18 +6,19 @@ #include "items.h" #include "pokemon.h" -struct WonderMailSub +// size: 0x8 +typedef struct WonderMailSub { - /* 0x4 */ DungeonLocation dungeon; - u32 seed; -}; + /* 0x0 */ DungeonLocation dungeon; + /* 0x4 */ u32 seed; +} WonderMailSub; // size: 0x30 -struct unkStruct_203B480 +typedef struct unkStruct_203B480 { /* 0x0 */ u8 mailType; /* 0x1 */ u8 missionType; - struct WonderMailSub unk4; + WonderMailSub unk4; /* 0xC */ s16 clientSpecies; /* 0xE */ s16 targetSpecies; union unk10_temp @@ -31,48 +32,48 @@ struct unkStruct_203B480 u32 unk28; /* 0x2C */ s8 rescuesAllowed; u8 unk2D; -}; +} unkStruct_203B480; // size: 0x5C -struct unkStruct_203B484 +typedef struct unkStruct_203B484 { /* 0x0 */ u32 unk0; /* 0x4 */ PokemonStruct1 unk4; -}; +} unkStruct_203B484; // size: 0x84 -struct unkStruct_203B48C +typedef struct unkStruct_203B48C { /* 0x0 */ s32 unk0; /* 0x4 */ s32 unk4[0x20]; -}; +} unkStruct_203B48C; -extern struct unkStruct_203B480 *gUnknown_203B480; -extern struct unkStruct_203B484 *gUnknown_203B484; +extern unkStruct_203B480 *gUnknown_203B480; +extern unkStruct_203B484 *gUnknown_203B484; extern u32 *gUnknown_203B488; -extern struct unkStruct_203B48C *gUnknown_203B48C; +extern unkStruct_203B48C *gUnknown_203B48C; void sub_80950BC(void); -struct unkStruct_203B480 *sub_80950F8(void); -struct unkStruct_203B484 *sub_8095100(void); +unkStruct_203B480 *sub_80950F8(void); +unkStruct_203B484 *sub_8095100(void); u32 *sub_8095108(void); -struct unkStruct_203B48C *sub_8095110(void); +unkStruct_203B48C *sub_8095110(void); void sub_8095118(void); s32 FindOpenMailSlot(void); -bool8 sub_80951BC(struct unkStruct_203B480 *mail); -bool8 sub_80951FC(struct unkStruct_203B480 *param_1); -struct unkStruct_203B480 * GetMailatIndex(u8 index); -void DeleteMailAtIndex(u8 index); -void sub_8095274(u32 param_1); -bool8 sub_8095298(s32 param_1); +bool8 sub_80951BC(unkStruct_203B480 *); +bool8 sub_80951FC(unkStruct_203B480 *); +unkStruct_203B480 * GetMailatIndex(u8); +void DeleteMailAtIndex(u8); +void sub_8095274(u32); +bool8 sub_8095298(s32); void sub_80952C4(void); -bool8 HasMail(u8 mailType, u32 param_2); -s32 CountMailType(u8 mailType); +bool8 HasMail(u8, u32); +s32 CountMailType(u8); u32 CountAllMail(void); s32 sub_8095374(void); -s32 GetMailIndex(u8 mailType, u32 param_2); -s32 GetFirstIndexofMailType(u8 mailType); -void sub_8095824(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b); -void sub_8095774(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b); +s32 GetMailIndex(u8, u32); +s32 GetFirstIndexofMailType(u8); +void sub_8095824(struct unkStruct_8094924 *, unkStruct_203B480 *); +void sub_8095774(struct unkStruct_8094924 *, unkStruct_203B480 *); #endif diff --git a/include/code_80958E8.h b/include/code_80958E8.h index b69c45161..90502cb39 100644 --- a/include/code_80958E8.h +++ b/include/code_80958E8.h @@ -13,9 +13,9 @@ struct subStruct_203B490 struct unkStruct_203B490 { // size: 0x330? - /* 0x0 */ struct WonderMail mailboxSlots[NUM_MAILBOX_SLOTS]; - /* 0x50 */ struct WonderMail pelipperBoardJobs[MAX_ACCEPTED_JOBS]; - /* 0xF0 */ struct WonderMail jobSlots[MAX_ACCEPTED_JOBS]; + /* 0x0 */ WonderMail mailboxSlots[NUM_MAILBOX_SLOTS]; + /* 0x50 */ WonderMail pelipperBoardJobs[MAX_ACCEPTED_JOBS]; + /* 0xF0 */ WonderMail jobSlots[MAX_ACCEPTED_JOBS]; u8 unk190[0x28]; u8 unk1B8[0x78]; struct subStruct_203B490 unk230[16]; diff --git a/include/friend_rescue.h b/include/friend_rescue.h index 2fac44d69..a2201a8e0 100644 --- a/include/friend_rescue.h +++ b/include/friend_rescue.h @@ -8,19 +8,19 @@ #include "menu.h" // size: 0x568 -struct WonderMailStruct_203B33C +typedef struct WonderMailStruct_203B33C { /* 0x0 */ u32 state; /* 0x4 */ u32 fallbackState; /* 0x8 */ u8 passwordBuffer[0x36]; u32 unk40; /* 0x44 */ u32 status; - struct unkStruct_203B480 unk48; - struct unkStruct_203B480 unk78; - struct WonderMailStruct_203B2C0_sub unkA8; - struct WonderMailStruct_203B2C0_sub unk130; - struct unkStruct_203B480 unk1B8; - struct unkStruct_203B480 unk1E8; + unkStruct_203B480 unk48; + unkStruct_203B480 unk78; + WonderMailStruct_203B2C0_sub unkA8; + WonderMailStruct_203B2C0_sub unk130; + unkStruct_203B480 unk1B8; + unkStruct_203B480 unk1E8; u8 unk218; MenuStruct unk21C[4]; UnkTextStruct2 unk35C[4]; @@ -36,9 +36,9 @@ struct WonderMailStruct_203B33C u32 unk530; u32 unk534; /* 0x538 */ s16 speciesNum; // A7 << 3 - struct unkStruct_802F204 unk53C; + unkStruct_802F204 unk53C; s32 unk564; -}; +} WonderMailStruct_203B33C; u32 CreateFriendRescueMenu(void); u32 UpdateFriendRescueMenu(void); diff --git a/include/ground_map.h b/include/ground_map.h new file mode 100644 index 000000000..2ac30fd40 --- /dev/null +++ b/include/ground_map.h @@ -0,0 +1,19 @@ +#ifndef GUARD_GROUND_MAP_H +#define GUARD_GROUND_MAP_H + +// size: 0x55C +typedef struct unkStruct_3001B70 +{ + u8 fill0[0x55C - 0x0]; +} unkStruct_3001B70; + +extern unkStruct_3001B70 *gUnknown_3001B70; + +void GroundMap_Reset(void); + +void sub_80A4A7C(void); +void sub_80A4AC4(void); +void sub_80A4B38(void); +void sub_80A4B54(void); + +#endif // GUARD_GROUND_MAP_H \ No newline at end of file diff --git a/include/ground_map_1.h b/include/ground_map_1.h index accd7e160..c6b26ddf8 100644 --- a/include/ground_map_1.h +++ b/include/ground_map_1.h @@ -10,6 +10,11 @@ typedef struct unkStruct_811BAF4 u8 *text; } unkStruct_811BAF4; +void GroundMap_ExecuteEnter(s16); +void GroundMap_ExecuteEvent(s16, u32); +void GroundMap_ExecuteStation(s16, s16, s8, u32); + +bool8 sub_80A4D2C(s16); bool8 sub_80A4D48(s16); #endif // GUARD_GROUND_MAP_1_H \ No newline at end of file diff --git a/include/ground_map_2.h b/include/ground_map_2.h new file mode 100644 index 000000000..1ba920a46 --- /dev/null +++ b/include/ground_map_2.h @@ -0,0 +1,30 @@ +#ifndef GUARD_GROUND_MAP_2_H +#define GUARD_GROUND_MAP_2_H + +// size: 0x24 +typedef struct unkStruct_3001B74 +{ + s16 unk0; + u8 unk2; + u32 unk4; + u32 unk8; + s32 unkC; + u32 unk10; + u32 unk14; + u32 unk18; + u32 unk1C; + u32 unk20; +} unkStruct_3001B74; + +void GroundWeather_Select(s16); +void nullsub_121(void); +void nullsub_122(void); +void nullsub_123(void); + +void sub_80A5E70(void); +void sub_80A5E8C(u8); +void sub_80A5EBC(void); +void sub_80A5EDC(u8); +void sub_80A60D8(void); + +#endif // GUARD_GROUND_MAP_2_H \ No newline at end of file diff --git a/include/ground_script.h b/include/ground_script.h index 2c71f4416..941ef6405 100644 --- a/include/ground_script.h +++ b/include/ground_script.h @@ -51,4 +51,6 @@ typedef struct GroundScript_ExecutePP_1 u8 fillE8[0x110 - 0xE8]; } GroundScript_ExecutePP_1; +bool8 GroundScript_ExecutePP(GroundScript_ExecutePP_1 *, s32 *, GroundScript_ExecutePP_3 *, const DebugLocation *); + #endif // GUARD_GROUND_SCRIPT_H \ No newline at end of file diff --git a/include/mailbox.h b/include/mailbox.h index 9e7c5ad1b..6b7d83086 100644 --- a/include/mailbox.h +++ b/include/mailbox.h @@ -13,7 +13,7 @@ struct unkStruct_203B304 u32 fallbackState; u8 mailboxIndex; u8 mailIndex; - struct unkStruct_802C39C unkC; + unkStruct_802C39C unkC; u32 menuAction1; u32 menuAction2; MenuStruct unk6C; diff --git a/include/pelipper_board.h b/include/pelipper_board.h index 7ec6159a1..bc063ac22 100644 --- a/include/pelipper_board.h +++ b/include/pelipper_board.h @@ -6,7 +6,7 @@ struct unkStruct_203B308 u32 state; u32 unk4; u8 jobIndex; - struct unkStruct_802C39C unkC; + unkStruct_802C39C unkC; u32 menuAction1; u32 menuAction2; MenuStruct unk6C; diff --git a/include/save.h b/include/save.h index 392347204..f29dfec3d 100644 --- a/include/save.h +++ b/include/save.h @@ -49,10 +49,10 @@ struct UnkStruct_sub_8011DAC { struct UnkStruct_203B184 { /* 0x0 */ TeamInventory *MoneyItems; /* 0x4 */ unkStruct_203B45C *recruitedPokemon; - /* 0x8 */ struct unkStruct_203B480 *unk8; - /* 0xC */ struct unkStruct_203B484 *unkC; + /* 0x8 */ unkStruct_203B480 *unk8; + /* 0xC */ unkStruct_203B484 *unkC; /* 0x10 */ u32 *unk10; - /* 0x14 */ struct unkStruct_203B48C *unk14; + /* 0x14 */ unkStruct_203B48C *unk14; /* 0x18 */ struct unkStruct_203B490 *mailInfo; /* 0x1C */ struct RescueTeamData *RescueTeamInfo; /* 0x20 */ struct unkStruct_203B494 *unk20; diff --git a/include/wonder_mail.h b/include/wonder_mail.h index 6a708b642..8794f94f5 100644 --- a/include/wonder_mail.h +++ b/include/wonder_mail.h @@ -1,17 +1,16 @@ #ifndef GUARD_WONDER_MAIL_H #define GUARD_WONDER_MAIL_H +#include "code_8094F88.h" +#include "constants/wonder_mail.h" #include "file_system.h" -#include "text.h" #include "items.h" #include "menu.h" #include "pokemon.h" -#include "code_8094F88.h" - -#include "constants/wonder_mail.h" +#include "text.h" // size: 0x28 -struct unkStruct_802F204 +typedef struct unkStruct_802F204 { /* 0x0 */ u8 clientName[POKEMON_NAME_LENGTH]; /* 0xA */ u8 name2[POKEMON_NAME_LENGTH]; // target name? @@ -22,34 +21,32 @@ struct unkStruct_802F204 /* 0x1F */ u8 quantity; /* 0x20 */ u8 friendAreaReward; /* 0x24 */ u32 teamRankPtsReward; -}; +} unkStruct_802F204; // size: 0x14 - -struct WonderMail +typedef struct WonderMail { /* 0x0 */ u8 mailType; // mail type /* 0x1 */ u8 missionType; // mission type u8 unk2; - /* 0x4 */ struct WonderMailSub unk4; + /* 0x4 */ WonderMailSub unk4; /* 0xC */ s16 clientSpecies; // client pokemon /* 0xE */ s16 targetSpecies; // target /* 0x10 */ u8 targetItem; // item to find/deliver /* 0x11 */ u8 rewardType; // reward type /* 0x12 */ u8 itemReward; // item reward /* 0x13 */ u8 friendAreaReward; // friend area -}; - +} WonderMail; // size: 0x88 -struct WonderMailStruct_203B2C0_sub +typedef struct WonderMailStruct_203B2C0_sub { - /* 0x0 */ struct unkStruct_203B480 mail; + /* 0x0 */ unkStruct_203B480 mail; /* 0x30 */ PokemonStruct1 pokemon; -}; +} WonderMailStruct_203B2C0_sub; // size: 0x548 -struct WonderMailStruct_203B2C0 +typedef struct WonderMailStruct_203B2C0 { /* 0x0 */ u32 fallbackState; /* 0x4 */ u32 state; @@ -57,10 +54,10 @@ struct WonderMailStruct_203B2C0 u8 unk3E; u32 unk40; /* 0x44 */ u32 linkError; - struct unkStruct_203B480 unk48; - struct unkStruct_203B480 unk78; - struct WonderMailStruct_203B2C0_sub unkA8; - struct WonderMailStruct_203B2C0_sub unk130; + unkStruct_203B480 unk48; + unkStruct_203B480 unk78; + WonderMailStruct_203B2C0_sub unkA8; + WonderMailStruct_203B2C0_sub unk130; u8 fill16A[0x218 - 0x1B8]; /* 0x218 */ u8 mailIndex; MenuStruct unk21C[4]; @@ -80,10 +77,10 @@ struct WonderMailStruct_203B2C0 u32 unk53C; /* 0x540 */ u32 mailCount; // A8 << 4 /* 0x544 */ s16 speciesNum; -}; +} WonderMailStruct_203B2C0; // size: 0x564 -struct WonderMailStruct_203B2C4 +typedef struct WonderMailStruct_203B2C4 { /* 0x0 */ u8 state; /* 0x4 */ u32 fallbackState; // wonder mail link status?? @@ -92,8 +89,8 @@ struct WonderMailStruct_203B2C4 u32 unk40; /* 0x44 */ u32 linkError; // another link status u8 filler48[0x1B8 - 0x48]; - struct unkStruct_203B480 unk1B8; - struct unkStruct_203B480 unk1E8; + unkStruct_203B480 unk1B8; + unkStruct_203B480 unk1E8; /* 0x218 */ s8 mailIndex; MenuStruct unk21C[4]; UnkTextStruct2 unk35C[4]; @@ -110,9 +107,9 @@ struct WonderMailStruct_203B2C4 /* 0x434 */ u8 formattedString[0x100]; /* 0x534 */ s32 wonderMailMethod; /* 0x538 */ u32 wonderMailMode; - struct unkStruct_802F204 unk53C; -}; + unkStruct_802F204 unk53C; +} WonderMailStruct_203B2C4; void SetFriendRescueCounterState(u32 r0); -#endif +#endif // GUARD_WONDER_MAIL_H \ No newline at end of file diff --git a/include/wonder_mail_2_1.h b/include/wonder_mail_2_1.h index 786c9ebbe..a6d10144e 100644 --- a/include/wonder_mail_2_1.h +++ b/include/wonder_mail_2_1.h @@ -16,7 +16,7 @@ struct unkStruct_203B2F0 u32 state; u8 unk8[0xC - 0x8]; u8 unkC; - struct unkStruct_802C39C unk10; + unkStruct_802C39C unk10; u32 menuAction; MenuStruct unk6C; MenuStruct unkBC; diff --git a/include/wonder_mail_3.h b/include/wonder_mail_3.h index eb4e4524c..592b0b477 100644 --- a/include/wonder_mail_3.h +++ b/include/wonder_mail_3.h @@ -1,73 +1,87 @@ +#ifndef GUARD_WONDER_MAIL_3_H +#define GUARD_WONDER_MAIL_3_H + +#include "code_802C39C.h" +#include "input.h" #include "menu.h" -struct unkStruct_203B2F4 +#include "text.h" +#include "wonder_mail.h" + +// size: 0xB4 +typedef struct unkStruct_803B344 +{ + /* 0x0 */ WonderMail mail; + u8 *unk14; + u8 *unk18; + u8 fill1C[0x3C - 0x1C]; + u8 unk3C[0xB4 - 0x3C]; +} unkStruct_803B344; + +// size: 0xA0 +typedef struct unkStruct_203B2F4 { MenuInputStruct input; u32 unk34; UnkTextStruct2 *unk38; UnkTextStruct2 unk3C[4]; u8 unk9C[4]; -}; -extern struct unkStruct_203B2F4 *gUnknown_203B2F4; +} unkStruct_203B2F4; -struct unkStruct_803B344 +// size: 0x1C +typedef struct unkSubStruct_203B2F8 { - // size: 0xB4 - struct WonderMail mail; - u8* unk14; - u8* unk18; - u8 fill1C[0x3C - 0x1C]; - u8 unk3C[0x78]; -}; + /* 0x0 */ WonderMail wonderMail; + /* 0x14 */ u8 *unk14; + /* 0x18 */ u8 *unk18; +} unkSubStruct_203B2F8; -struct unkSubStruct_203B2F8 +// size: 0x208 +typedef struct unkStruct_203B2F8 { - struct WonderMail wonderMail; - u8 *unk14; - u8 *unk18; -}; - -struct unkStruct_203B2F8 -{ - // size: 0x208 - s32 state; // state - s32 fallbackState; - u8 wonderMailAccepted; - bool8 unk9; - u8 dungeonID; + /* 0x0 */ s32 state; + /* 0x4 */ s32 fallbackState; + /* 0x8 */ u8 wonderMailAccepted; + /* 0x9 */ bool8 unk9; + /* 0xA */ u8 dungeonID; u8 unkB; - struct unkSubStruct_203B2F8 *mail; - u8 jobSlotIndex; - struct unkStruct_802C39C unk14; - u32 menuAction1; - u32 menuAction2; - u32 menuAction3; - MenuStruct unk78; - MenuStruct unkC8; + /* 0xC */ unkSubStruct_203B2F8 *mail; + /* 0x10 */ u8 jobSlotIndex; + unkStruct_802C39C unk14; + /* 0x6C */ u32 menuAction1; + /* 0x70 */ u32 menuAction2; + /* 0x74 */ u32 menuAction3; + /* 0x78 */ MenuStruct unk78; + /* 0xC8 */ MenuStruct unkC8; MenuItem unk118[8]; MenuItem unk158[8]; u16 unk198[8]; UnkTextStruct2 unk1A8[4]; - u32 unk1E4; -}; -extern struct unkStruct_203B2F8 *gUnknown_203B2F8; +} unkStruct_203B2F8; enum WonderMailRescueStates { - INITIAL_WONDER_MAIL_CHECK, + INITIAL_WONDER_MAIL_CHECK = 0, // 1 is ?? WONDER_MAIL_EXIT = 2, DUPLICATE_WONDER_MAIL = 3, - DUPLICATE_WONDER_MAIL_1, + DUPLICATE_WONDER_MAIL_1 = 4, // 5 is ?? // 6 is ?? // 7 is ?? RECEIVE_WONDER_MAIL = 8, // 9 is ?? - JOB_LIST_FULL = 0xA, - DRAW_JOB_LIST = 0xB, - DRAW_JOB_LIST_1 = 0xC, - // 0xD is ?? - // 0xE is ?? - // 0xF is ?? - // 0x10 is ?? + JOB_LIST_FULL = 10, + DRAW_JOB_LIST = 11, + DRAW_JOB_LIST_1 = 12, + // 13 is ?? + // 14 is ?? + // 15 is ?? + // 16 is ?? }; + +extern unkStruct_203B2F4 *gUnknown_203B2F4; +extern unkStruct_203B2F8 *gUnknown_203B2F8; + +u32 sub_802D098(unkSubStruct_203B2F8 *); + +#endif // GUARD_WONDER_MAIL_3_H \ No newline at end of file diff --git a/src/adventure_log.c b/src/adventure_log.c index 4e5450018..38e1917b4 100644 --- a/src/adventure_log.c +++ b/src/adventure_log.c @@ -9,7 +9,7 @@ #include "text1.h" #include "text2.h" -static EWRAM_DATA_2 struct AdventureLog *sAdventureLog = {0}; +static EWRAM_DATA_2 AdventureLog *sAdventureLog = {0}; static const UnkTextStruct2 sUnknown_80E1FF0 = { 0x00, 0x00, 0x00, 0x00, @@ -40,7 +40,7 @@ static void sub_8032084(); bool8 CreateAdventureLogScreen(u32 kind) { - sAdventureLog = MemoryAlloc(sizeof(struct AdventureLog), 8); + sAdventureLog = MemoryAlloc(sizeof(AdventureLog), 8); sAdventureLog->unk34 = kind; sAdventureLog->unk38 = &sAdventureLog->unk3C[kind]; sub_8006518(sAdventureLog->unk3C); diff --git a/src/code_8004AA0.c b/src/code_8004AA0.c index b0f5b0cbe..8e9a701f0 100644 --- a/src/code_8004AA0.c +++ b/src/code_8004AA0.c @@ -5,13 +5,13 @@ void nullsub_6(void) {} -void sub_8004AA4(struct unkStruct_202EE8C *a0, OpenedFile *a1, s32 a2) +void sub_8004AA4(unkStruct_202EE8C *a0, OpenedFile *a1, s32 a2) { - struct unkDataFor8004AA4 **data; - struct unkDataFor8004AA4 *ptr; + unkDataFor8004AA4 **data; + unkDataFor8004AA4 *ptr; s32 i; - data = (struct unkDataFor8004AA4 **)a1->data; + data = (unkDataFor8004AA4 **)a1->data; for (i = 0; i < a2; i++) { ptr = *data++; @@ -31,7 +31,7 @@ void sub_8004AA4(struct unkStruct_202EE8C *a0, OpenedFile *a1, s32 a2) } } -bool8 sub_8004AF0(bool8 a0, struct unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a5) +bool8 sub_8004AF0(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a5) { bool8 bVar3; bool8 ret; @@ -63,7 +63,7 @@ bool8 sub_8004AF0(bool8 a0, struct unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4 return ret; } -UNUSED static bool8 sub_8004B78(bool8 a0, struct unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a5) +UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a5) { bool8 bVar3; bool8 ret; @@ -95,7 +95,7 @@ UNUSED static bool8 sub_8004B78(bool8 a0, struct unkStruct_202EE8C *a1, s32 a2, return ret; } -bool8 sub_8004C00(struct unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 a3, u8 *a4, s16 *a5) +bool8 sub_8004C00(unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 a3, u8 *a4, s16 *a5) { bool8 ret; s32 i; @@ -159,7 +159,7 @@ bool8 sub_8004C00(struct unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 a3, u8 *a4, return ret; } -UNUSED static void sub_8004CFC(struct unkStruct_202EE8C *a0, s32 a1) +UNUSED static void sub_8004CFC(unkStruct_202EE8C *a0, s32 a1) { s32 i; @@ -168,7 +168,7 @@ UNUSED static void sub_8004CFC(struct unkStruct_202EE8C *a0, s32 a1) } } -bool8 sub_8004D14(struct unkStruct_202EE8C *a0, s32 a1) +bool8 sub_8004D14(unkStruct_202EE8C *a0, s32 a1) { s32 i; @@ -180,7 +180,7 @@ bool8 sub_8004D14(struct unkStruct_202EE8C *a0, s32 a1) return FALSE; } -bool8 sub_8004D40(struct unkStruct_202EE8C *a0, s32 a1) +bool8 sub_8004D40(unkStruct_202EE8C *a0, s32 a1) { s32 i; diff --git a/src/code_80118A4.c b/src/code_80118A4.c index dcc052392..339457036 100644 --- a/src/code_80118A4.c +++ b/src/code_80118A4.c @@ -21,7 +21,7 @@ extern struct GameOptions *gGameOptionsRef; struct UnkBgStruct { u8 padding[0x4c4b]; - /* 0x4C4C */ struct unkStruct_202EE8C unk4C4C[16]; + /* 0x4C4C */ unkStruct_202EE8C unk4C4C[16]; u32 unk4DCC; u32 unk4DD0; /* 0x4DD4 */ s16 xoffset; diff --git a/src/code_8031D70.c b/src/code_8031D70.c index 02e73e7bc..0ee4fd371 100644 --- a/src/code_8031D70.c +++ b/src/code_8031D70.c @@ -23,7 +23,7 @@ struct unkStruct_203B334 }; EWRAM_DATA_2 struct unkStruct_203B334 *gUnknown_203B334 = {0}; -extern struct unkStruct_203B480 *gUnknown_203B480; +extern unkStruct_203B480 *gUnknown_203B480; const UnkTextStruct2 gUnknown_80E1FA8 = { 0, 0, 0, 0, @@ -48,7 +48,7 @@ const UnkTextStruct2 gUnknown_80E1FC4 = { ALIGNED(4) const u8 gUnknown_80E1FDC[] = "Password"; ALIGNED(4) static const u8 fill0[] = "pksdir0"; -extern void sub_803D2C0(u8 *, struct unkStruct_203B480 *); +extern void sub_803D2C0(u8 *, unkStruct_203B480 *); void sub_8031E00(void); void sub_8031E58(void); @@ -114,7 +114,7 @@ void DrawSOSPasswordScreen(void) u32 color; s32 index; u8 buffer [PASSWORD_BUFFER_SIZE + 2]; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; mail = &gUnknown_203B480[gUnknown_203B334->mailIndex]; sub_80073B8(gUnknown_203B334->unk10); diff --git a/src/code_803B050.c b/src/code_803B050.c index 826bcb0e3..47992246d 100644 --- a/src/code_803B050.c +++ b/src/code_803B050.c @@ -89,16 +89,16 @@ extern PokemonStruct1 *sub_808D378(void); s32 sub_8016028(void); extern void PrintDungeonLocationtoBuffer(u8 *, void *); extern void PrintYellowDungeonNametoBuffer(u8 *, void *); -extern u8 sub_803C1D0(struct WonderMailSub *, u8); +extern u8 sub_803C1D0(WonderMailSub *, u8); extern u8 *sub_803C1F0(u8); -void sub_803D414(u8 *, struct WonderMail *); +void sub_803D414(u8 *, WonderMail *); void sub_803B6B0(s32 x, s32 y, u8 index, u32 param_4) { xxx_call_draw_string(x,y,gUnknown_80E8B94[index],param_4,0); } -void CreateRescueTitle(struct unkStruct_802C39C *param_1) +void CreateRescueTitle(unkStruct_802C39C *param_1) { char buf_1 [200]; char buf_2 [20]; @@ -197,7 +197,7 @@ void CreateRescueTitle(struct unkStruct_802C39C *param_1) xxx_call_draw_string(0xb4,param_1->y,sub_803C1F0(uVar1),param_1->unk0[0],0); } -void CreateRescueDescription(struct unkStruct_802C39C *param_1) +void CreateRescueDescription(unkStruct_802C39C *param_1) { u8 uVar3; int x; diff --git a/src/code_8094F88.c b/src/code_8094F88.c index 6c8a86205..324a53d43 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -8,16 +8,16 @@ #include "save.h" #include "text_util.h" -EWRAM_DATA_2 struct unkStruct_203B480 *gUnknown_203B480 = {0}; -EWRAM_DATA_2 struct unkStruct_203B484 *gUnknown_203B484 = {0}; +EWRAM_DATA_2 unkStruct_203B480 *gUnknown_203B480 = {0}; +EWRAM_DATA_2 unkStruct_203B484 *gUnknown_203B484 = {0}; EWRAM_DATA_2 u32 *gUnknown_203B488 = {0}; -EWRAM_DATA_2 struct unkStruct_203B48C *gUnknown_203B48C = {0}; +EWRAM_DATA_2 unkStruct_203B48C *gUnknown_203B48C = {0}; -EWRAM_DATA struct unkStruct_203B480 gUnknown_2038C88[0x20] = {0}; -EWRAM_DATA struct unkStruct_203B484 gUnknown_2039288 = {0}; +EWRAM_DATA unkStruct_203B480 gUnknown_2038C88[0x20] = {0}; +EWRAM_DATA unkStruct_203B484 gUnknown_2039288 = {0}; EWRAM_DATA UNUSED static u32 fill0 = {0}; // 203B484 is size 0x5C and I need to fill a gap of 0x4 EWRAM_DATA u32 gUnknown_20392E8[0x36] = {0}; -EWRAM_DATA struct unkStruct_203B48C gUnknown_20393C0 = {0}; +EWRAM_DATA unkStruct_203B48C gUnknown_20393C0 = {0}; extern void SaveDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); extern void RestoreDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); @@ -37,12 +37,12 @@ void sub_80950BC(void) gUnknown_203B48C = &gUnknown_20393C0; } -struct unkStruct_203B480 *sub_80950F8(void) +unkStruct_203B480 *sub_80950F8(void) { return gUnknown_2038C88; } -struct unkStruct_203B484 *sub_8095100(void) +unkStruct_203B484 *sub_8095100(void) { return &gUnknown_2039288; } @@ -52,7 +52,7 @@ u32 *sub_8095108(void) return gUnknown_20392E8; } -struct unkStruct_203B48C *sub_8095110(void) +unkStruct_203B48C *sub_8095110(void) { return &gUnknown_20393C0; } @@ -61,10 +61,10 @@ struct unkStruct_203B48C *sub_8095110(void) void sub_8095118(void) { s32 index; - struct unkStruct_203B480 *unused; + unkStruct_203B480 *unused; - MemoryFill8((u8*)gUnknown_203B480,0, 0x20 * sizeof(struct unkStruct_203B480)); - MemoryFill8((u8*)gUnknown_203B484,0, sizeof(struct unkStruct_203B484)); + MemoryFill8((u8*)gUnknown_203B480,0, 0x20 * sizeof(unkStruct_203B480)); + MemoryFill8((u8*)gUnknown_203B484,0, sizeof(unkStruct_203B484)); for(index = 0; index < 0x20; index++){ // NOTE: we use a temp variable here to force the match @@ -101,11 +101,11 @@ s32 FindOpenMailSlot(void) } // Fakematch -bool8 sub_80951BC(struct unkStruct_203B480 *mail) +bool8 sub_80951BC(unkStruct_203B480 *mail) { s32 index; - struct unkStruct_203B480 *preload; - struct unkStruct_203B480 *preload2; + unkStruct_203B480 *preload; + unkStruct_203B480 *preload2; index = FindOpenMailSlot(); @@ -122,16 +122,16 @@ bool8 sub_80951BC(struct unkStruct_203B480 *mail) } } -bool8 sub_80951FC(struct unkStruct_203B480 *param_1) +bool8 sub_80951FC(unkStruct_203B480 *param_1) { bool8 bVar1 = gUnknown_203B480[1].mailType != 0; gUnknown_203B480[1] = *param_1; return bVar1; } -struct unkStruct_203B480 * GetMailatIndex(u8 index) +unkStruct_203B480 * GetMailatIndex(u8 index) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; ptr = &gUnknown_203B480[index]; return ptr; @@ -139,9 +139,9 @@ struct unkStruct_203B480 * GetMailatIndex(u8 index) void DeleteMailAtIndex(u8 index) { - struct unkStruct_203B480 *unused; + unkStruct_203B480 *unused; - MemoryFill8((u8*)&gUnknown_203B480[index],0,sizeof(struct unkStruct_203B480)); + MemoryFill8((u8*)&gUnknown_203B480[index],0,sizeof(unkStruct_203B480)); unused = &gUnknown_203B480[index]; gUnknown_203B480[index].mailType = 0; unused = &gUnknown_203B480[index]; @@ -186,7 +186,7 @@ void sub_80952C4(void) bool8 HasMail(u8 mailType, u32 param_2) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; s32 index; for(index = 0, ptr = &gUnknown_203B480[0]; index < 0x20; ptr++, index++) @@ -198,7 +198,7 @@ bool8 HasMail(u8 mailType, u32 param_2) s32 CountMailType(u8 mailType) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; s32 total = 0; s32 index; @@ -211,7 +211,7 @@ s32 CountMailType(u8 mailType) u32 CountAllMail(void) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; u32 total = 0; s32 index; @@ -224,7 +224,7 @@ u32 CountAllMail(void) s32 sub_8095374(void) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; s32 retvar = -1; s32 index; @@ -238,7 +238,7 @@ s32 sub_8095374(void) /* With mailType and (additonal data??), search mail and return exact index */ s32 GetMailIndex(u8 mailType, u32 param_2) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; s32 index; for(index = 0, ptr = &gUnknown_203B480[0]; index < 0x20; ptr++, index++) @@ -251,7 +251,7 @@ s32 GetMailIndex(u8 mailType, u32 param_2) /* Return the index of the first mail of the requested type */ s32 GetFirstIndexofMailType(u8 mailType) { - struct unkStruct_203B480 *ptr; + unkStruct_203B480 *ptr; s32 index; for(index = 0, ptr = &gUnknown_203B480[0]; index < 0x20; ptr++, index++) @@ -273,14 +273,14 @@ s32 sub_8095400(u32 param_1) return -1; } -void sub_809542C(struct WonderMailSub *param_1) +void sub_809542C(WonderMailSub *param_1) { u32 seed; #ifndef NONMATCHING - register struct unkStruct_203B480 *preload asm("r2"); + register unkStruct_203B480 *preload asm("r2"); #else - struct unkStruct_203B480 *preload; + unkStruct_203B480 *preload; #endif u8 buffer [20]; @@ -299,11 +299,11 @@ void sub_809542C(struct WonderMailSub *param_1) gUnknown_203B480->rescuesAllowed = GetRescuesAllowed(gUnknown_203B480->unk4.dungeon.id); } -void sub_8095494(struct WonderMailSub *param_1, u8 index) +void sub_8095494(WonderMailSub *param_1, u8 index) { u32 seed; DungeonLocation dungeon; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; mail = gUnknown_203B480; mail += index; @@ -407,7 +407,7 @@ u32 sub_8095624(u8 *a, u32 b) return backup.unk8; } -void sub_8095774(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b) +void sub_8095774(struct unkStruct_8094924 * a, unkStruct_203B480 *b) { u8 temp; @@ -428,7 +428,7 @@ void sub_8095774(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b) b->unk2D = temp & 1; } -void sub_8095824(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b) +void sub_8095824(struct unkStruct_8094924 * a, unkStruct_203B480 *b) { u8 neg1; u8 zero; diff --git a/src/code_80958E8.c b/src/code_80958E8.c index 85ce8d236..00805ab02 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -17,7 +17,7 @@ extern bool8 sub_803C0DC(s16); extern void ResetMailboxSlot(u8); extern void ResetPelipperBoardSlot(u8); extern void ResetJobSlot(u8); -extern bool8 ValidateWonderMail(struct WonderMail *); +extern bool8 ValidateWonderMail(WonderMail *); EWRAM_DATA_2 struct unkStruct_203B490 *gUnknown_203B490 = {0}; EWRAM_DATA struct unkStruct_203B490 gUnknown_2039448 = {0}; @@ -63,7 +63,7 @@ void InitializeMailJobsNews(void) } } -bool8 IsValidWonderMail(struct WonderMail *WonderMailData) +bool8 IsValidWonderMail(WonderMail *WonderMailData) { // Has to equal 5 for Wonder Mail // https://web.archive.org/web/20080913124416/http://www.upokecenter.com/games/dungeon/guides/passwords.html @@ -78,7 +78,7 @@ bool8 IsValidWonderMail(struct WonderMail *WonderMailData) } } -bool8 ValidateWonderMail(struct WonderMail *data) +bool8 ValidateWonderMail(WonderMail *data) { if(data->missionType > WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM) diff --git a/src/code_80958E8_1.c b/src/code_80958E8_1.c index ca99ddb38..79be7978e 100644 --- a/src/code_80958E8_1.c +++ b/src/code_80958E8_1.c @@ -17,24 +17,24 @@ struct unkStruct_8096AF8 }; extern u8 IsJobSlotEmpty(u8); -extern struct WonderMail * GetJobSlotInfo(u8); -extern bool8 IsValidWonderMail(struct WonderMail *WonderMailData); -extern u8 sub_8095E38(struct WonderMail *, u8, u8, bool8); +extern WonderMail * GetJobSlotInfo(u8); +extern bool8 IsValidWonderMail(WonderMail *WonderMailData); +extern u8 sub_8095E38(WonderMail *, u8, u8, bool8); extern void ResetJobSlot(u8); extern void sub_8096C80(void); extern void sub_8096D24(void); extern void sub_80965F4(); extern void SortPelipperJobs(); -extern struct WonderMail *GetPelipperBoardSlotInfo(u8); +extern WonderMail *GetPelipperBoardSlotInfo(u8); u8 sub_8097318(s16 param_1); -extern bool8 GenerateMailJobInfo(struct WonderMail *); +extern bool8 GenerateMailJobInfo(WonderMail *); void SortPelipperJobs(void) { s32 index1; s32 index2; - struct WonderMail mail; + WonderMail mail; for(index1 = 0; index1 < MAX_ACCEPTED_JOBS - 1; index1++) { @@ -57,7 +57,7 @@ void SortPelipperJobs(void) void GeneratePelipperJobs(void) { s32 range; - struct WonderMail *mail; + WonderMail *mail; s32 index; range = RandRange(4,8); @@ -126,9 +126,9 @@ void GeneratePelipperJobs(void) SortPelipperJobs(); } -bool8 IsMailinJobSlot(struct WonderMail *mail) +bool8 IsMailinJobSlot(WonderMail *mail) { - struct WonderMail *jobSlot; + WonderMail *jobSlot; s32 index; for(index = 0, jobSlot = &gUnknown_203B490->jobSlots[0]; index < MAX_ACCEPTED_JOBS; jobSlot++, index++) @@ -150,7 +150,7 @@ bool8 IsMailinJobSlot(struct WonderMail *mail) return FALSE; } -bool8 sub_809693C(struct WonderMail *mail) +bool8 sub_809693C(WonderMail *mail) { u8 dungeonIndex; u8 floor; @@ -196,7 +196,7 @@ s32 GetNumAcceptedJobs(void) s32 CountJobsinDungeon(u8 dungeon) { - struct WonderMail *mail; + WonderMail *mail; s32 index; s32 count; @@ -214,7 +214,7 @@ s32 CountJobsinDungeon(u8 dungeon) bool8 sub_8096A08(u8 dungeon, u8 *param_2) { - struct WonderMail *mail; + WonderMail *mail; s32 index; u32 local_14; s32 temp; @@ -243,7 +243,7 @@ bool8 sub_8096A08(u8 dungeon, u8 *param_2) return FALSE; } -bool8 AcceptJob(struct WonderMail *mail) +bool8 AcceptJob(WonderMail *mail) { s32 index; @@ -258,7 +258,7 @@ bool8 AcceptJob(struct WonderMail *mail) return TRUE; } -struct WonderMail *GetJobSlotInfo(u8 index) +WonderMail *GetJobSlotInfo(u8 index) { return &gUnknown_203B490->jobSlots[index]; } @@ -273,7 +273,7 @@ bool8 IsJobSlotEmpty(u8 index) void sub_8096AF8(struct unkStruct_8096AF8 *param_1, u8 slotIndex,u8 dungeon) { - struct WonderMail *jobSlot; + WonderMail *jobSlot; Item *item; s32 index; @@ -314,7 +314,7 @@ void sub_8096AF8(struct unkStruct_8096AF8 *param_1, u8 slotIndex,u8 dungeon) // Unused s16 sub_8096B98(u8 dungeon) { - struct WonderMail *mail; + WonderMail *mail; s32 index; for(index = 0; index < MAX_ACCEPTED_JOBS; index++) @@ -331,7 +331,7 @@ s16 sub_8096B98(u8 dungeon) void sub_8096BD0(void) { s32 index; - struct WonderMail *mail; + WonderMail *mail; for(mail = &gUnknown_203B490->jobSlots[0], index = 0; index < MAX_ACCEPTED_JOBS; mail++, index++) { @@ -351,7 +351,7 @@ void sub_8096BD0(void) bool8 sub_8096C08(u8 *jobIndex) { s32 index; - struct WonderMail *mail; + WonderMail *mail; for(mail = &gUnknown_203B490->jobSlots[0], index = 0; index < MAX_ACCEPTED_JOBS; mail++, index++) { diff --git a/src/code_80958E8_mid.c b/src/code_80958E8_mid.c index f60e49062..ce94d5cf1 100644 --- a/src/code_80958E8_mid.c +++ b/src/code_80958E8_mid.c @@ -7,12 +7,12 @@ #include "friend_area.h" #include "code_80958E8.h" -bool8 sub_8095E38(struct WonderMail *mail, u8 dungeon, u32 floor, u8 param_4); +bool8 sub_8095E38(WonderMail *mail, u8 dungeon, u32 floor, u8 param_4); extern s32 sub_80A29B0(u8 *param_1); extern s32 GetDungeonFloorCount(u8); extern bool8 sub_809017C(DungeonLocation *); -bool8 GenerateMailJobDungeonInfo(struct WonderMail *mail) +bool8 GenerateMailJobDungeonInfo(WonderMail *mail) { s32 counter; s32 floor; @@ -92,7 +92,7 @@ bool8 GenerateMailJobDungeonInfo(struct WonderMail *mail) } while( TRUE ); } -bool8 sub_8095E38(struct WonderMail *mail, u8 dungeon, u32 floor, u8 param_4) +bool8 sub_8095E38(WonderMail *mail, u8 dungeon, u32 floor, u8 param_4) { if (mail->mailType != MAIL_TYPE_NONE) { if ((mail->missionType == WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT) && (param_4 == 1)) { diff --git a/src/code_80972F4.c b/src/code_80972F4.c index 9878198e0..c3dd182cf 100644 --- a/src/code_80972F4.c +++ b/src/code_80972F4.c @@ -26,9 +26,9 @@ extern u8 sub_80A270C(s16); extern u8 sub_80A2728(s16); extern void sub_800199C(u8, u8, u16, s32); -void SaveWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b); -void RestoreWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b); -extern s32 sub_8096EB0(struct WonderMail *); +void SaveWonderMail(struct unkStruct_8094924 *a, WonderMail *b); +void RestoreWonderMail(struct unkStruct_8094924 *a, WonderMail *b); +extern s32 sub_8096EB0(WonderMail *); extern void SaveDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); extern void RestoreDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); extern void sub_80015C0(u8, u8); @@ -37,7 +37,7 @@ extern void GeneratePelipperJobs(void); s16 sub_80A26B8(s16); extern void sub_80018D8(u8, u8, u32); -bool8 sub_8096F50(struct WonderMail *mail) +bool8 sub_8096F50(WonderMail *mail) { s32 index; s32 temp2; @@ -147,7 +147,7 @@ u32 SaveMailInfo(u8 *r0, u32 size) return backup.unk8; } -void RestoreWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b) +void RestoreWonderMail(struct unkStruct_8094924 *a, WonderMail *b) { RestoreIntegerBits(a, &b->mailType, 4); RestoreIntegerBits(a, &b->missionType, 3); @@ -162,7 +162,7 @@ void RestoreWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b) RestoreDungeonLocation(a, &b->unk4.dungeon); } -void SaveWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b) +void SaveWonderMail(struct unkStruct_8094924 *a, WonderMail *b) { SaveIntegerBits(a, &b->mailType, 4); SaveIntegerBits(a, &b->missionType, 3); diff --git a/src/credits.c b/src/credits.c index bfb86fcab..a610f4000 100644 --- a/src/credits.c +++ b/src/credits.c @@ -58,7 +58,7 @@ s32 DrawCredits(s32 creditsCategoryIndex, s32 param_2) u8 curChar; u8 buffer[128]; - gUnknown_203B340 = (struct unkCreditsStruct_203B340 *)MemoryAlloc(sizeof(struct unkCreditsStruct_203B340), 8); + gUnknown_203B340 = MemoryAlloc(sizeof(struct unkCreditsStruct_203B340), 8); gUnknown_203B340->unk60 = 0; gUnknown_203B340->unk64 = param_2; gUnknown_203B340->creditsCategoryIndex = creditsCategoryIndex; diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index e0947c4d1..bc04bcd5e 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -23,7 +23,7 @@ extern const struct FileArchive gDungeonFileArchive; extern OpenedFile *gUnknown_202F18C; extern OpenedFile *gDungeonPaletteFile; -extern struct unkStruct_202EE8C gUnknown_202EE8C[32]; +extern unkStruct_202EE8C gUnknown_202EE8C[32]; extern u8 gWalkableTileToCrossableTerrain[8]; extern u8 sub_8043CE4(u32); diff --git a/src/friend_rescue.c b/src/friend_rescue.c index e8437b5df..7a4376da7 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -169,7 +169,7 @@ extern UnkTextStruct2 gUnknown_80E2334; extern MenuItem gUnknown_80E25B4; -EWRAM_DATA_2 struct WonderMailStruct_203B33C *gUnknown_203B33C = {0}; +EWRAM_DATA_2 WonderMailStruct_203B33C *gUnknown_203B33C = {0}; extern u8 sub_8039880(void); @@ -273,7 +273,7 @@ extern u32 sub_80244E4(void); extern void sub_802453C(void); extern void sub_8024458(s16, u32); extern void sub_8035D1C(void); -extern u32 sub_8039068(u32, u8 *passwordBuffer, struct unkStruct_203B480 *r0); +extern u32 sub_8039068(u32, u8 *passwordBuffer, unkStruct_203B480 *r0); extern void sub_803084C(void); extern void sub_8031E10(void); @@ -285,7 +285,7 @@ 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(struct unkStruct_802F204 *, u32); +extern void sub_802F204(unkStruct_802F204 *, u32); extern u32 sub_80306A8(u32 wonderMailType, u32, UnkTextStruct2_sub *, u32); extern u32 sub_8030894(void); extern void sub_803092C(void); @@ -296,7 +296,7 @@ extern s32 sub_80381F4(u32, void *, void *); extern s32 CountMailType(u8 mailType); extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32); -struct unkStruct_203B480 * GetMailatIndex(u8 index); +unkStruct_203B480 * GetMailatIndex(u8 index); extern s32 GetMailIndex(u8 mailType, u32 param_2); extern char * GetMonSpecies(s16 index); extern PokemonStruct1 *GetPlayerPokemonStruct(void); @@ -311,8 +311,8 @@ u32 CreateFriendRescueMenu(void) ResetUnusedInputStruct(); sub_800641C(NULL, TRUE, TRUE); - gUnknown_203B33C = MemoryAlloc(sizeof(struct WonderMailStruct_203B33C), 8); - MemoryFill8((u8 *) gUnknown_203B33C, 0, sizeof(struct WonderMailStruct_203B33C)); + gUnknown_203B33C = MemoryAlloc(sizeof(WonderMailStruct_203B33C), 8); + MemoryFill8((u8 *) gUnknown_203B33C, 0, sizeof(WonderMailStruct_203B33C)); gUnknown_203B33C->unk530 = 0; gUnknown_203B33C->unk218 = -1; gUnknown_203B33C->speciesNum = -1; @@ -699,7 +699,7 @@ void nullsub_40(void) void sub_8032828(void) { - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; u32 temp; u8 buffer [80]; PokemonStruct1 *pokeStruct1; @@ -947,13 +947,13 @@ void sub_8032828(void) #endif //NONMATCHING switch (gUnknown_203B33C->unk40) { case 0x3: - MemoryFill8((u8*)&gUnknown_203B33C->unk48, 0, sizeof(struct unkStruct_203B480)); - MemoryFill8((u8*)&gUnknown_203B33C->unk78, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8*)&gUnknown_203B33C->unk48, 0, sizeof(unkStruct_203B480)); + MemoryFill8((u8*)&gUnknown_203B33C->unk78, 0, sizeof(unkStruct_203B480)); gUnknown_203B33C->status = sub_8037D64(gUnknown_203B33C->unk40, &gUnknown_203B33C->unk48, &gUnknown_203B33C->unk78); break; case 0x2: - MemoryFill8((u8*)&gUnknown_203B33C->unk48, 0, sizeof(struct unkStruct_203B480)); - MemoryFill8((u8*)&gUnknown_203B33C->unk78, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8*)&gUnknown_203B33C->unk48, 0, sizeof(unkStruct_203B480)); + MemoryFill8((u8*)&gUnknown_203B33C->unk78, 0, sizeof(unkStruct_203B480)); #ifdef NONMATCHING // Regswaps gUnknown_203B33C->unk48 = *GetMailatIndex(gUnknown_203B33C->unk218); @@ -966,13 +966,13 @@ void sub_8032828(void) gUnknown_203B33C->status = sub_8037D64(gUnknown_203B33C->unk40, &gUnknown_203B33C->unk48, &gUnknown_203B33C->unk78); break; case 0x5: - MemoryFill8((u8*)&gUnknown_203B33C->unkA8, 0, sizeof(struct WonderMailStruct_203B2C0_sub)); - MemoryFill8((u8*)&gUnknown_203B33C->unk130, 0, sizeof(struct WonderMailStruct_203B2C0_sub)); + MemoryFill8((u8*)&gUnknown_203B33C->unkA8, 0, sizeof(WonderMailStruct_203B2C0_sub)); + MemoryFill8((u8*)&gUnknown_203B33C->unk130, 0, sizeof(WonderMailStruct_203B2C0_sub)); gUnknown_203B33C->status = sub_8037D64(gUnknown_203B33C->unk40, &gUnknown_203B33C->unkA8, &gUnknown_203B33C->unk130); break; case 0x4: - MemoryFill8((u8*)&gUnknown_203B33C->unkA8, 0, sizeof(struct WonderMailStruct_203B2C0_sub)); - MemoryFill8((u8*)&gUnknown_203B33C->unk130, 0, sizeof(struct WonderMailStruct_203B2C0_sub)); + MemoryFill8((u8*)&gUnknown_203B33C->unkA8, 0, sizeof(WonderMailStruct_203B2C0_sub)); + MemoryFill8((u8*)&gUnknown_203B33C->unk130, 0, sizeof(WonderMailStruct_203B2C0_sub)); gUnknown_203B33C->unkA8.pokemon.speciesNum = 0; gUnknown_203B33C->unk130.pokemon.speciesNum = 0; gUnknown_203B33C->unkA8.mail = *GetMailatIndex(gUnknown_203B33C->unk218); @@ -1643,11 +1643,11 @@ void sub_8033DBC(void) { u32 return_var; u32 mailMode; - struct unkStruct_203B480 mail; - struct unkStruct_203B480 *mail2; + unkStruct_203B480 mail; + unkStruct_203B480 *mail2; return_var = sub_80154F0(); - MemoryFill8((u8 *)&mail, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&mail, 0, sizeof(unkStruct_203B480)); switch(return_var) { case 3: @@ -1697,7 +1697,7 @@ void sub_8033DBC(void) sub_80951FC(&mail); mail2 = GetMailatIndex(GetMailIndex(1, mail.unk10.unk10)); mail2->mailType = 7; - MemoryFill8((u8 *)gUnknown_203B484, 0, sizeof(struct unkStruct_203B484)); + MemoryFill8((u8 *)gUnknown_203B484, 0, sizeof(unkStruct_203B484)); SetFriendRescueMenuState(0x40); break; case 24: @@ -2539,11 +2539,11 @@ void sub_8034D54(void) void sub_8034D74(void) { u32 return_var; - struct unkStruct_203B480 mail; - struct unkStruct_203B480 *mail2; + unkStruct_203B480 mail; + unkStruct_203B480 *mail2; return_var = sub_80154F0(); - MemoryFill8((u8 *)&mail, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&mail, 0, sizeof(unkStruct_203B480)); switch(return_var) { case 3: @@ -2654,7 +2654,7 @@ void sub_8034F58(void) void sub_8034F88(void) { s32 menuAction; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; if(sub_80144A4(&menuAction) == 0) { @@ -2850,7 +2850,7 @@ void sub_80351E0(void) void sub_8035210(void) { s32 menuAction; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; if(sub_80144A4(&menuAction) == 0) { diff --git a/src/ground_main.c b/src/ground_main.c index 08f517d73..90ee67b4a 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -6,6 +6,7 @@ #include "code_80A26CC.h" #include "event_flag.h" #include "code_80118A4.h" +#include "ground_map_2.h" EWRAM_DATA u32 gUnknown_20398A8 = {0}; EWRAM_DATA u32 gUnknown_20398AC = {0}; @@ -52,7 +53,6 @@ extern void sub_80A6E80(); extern void sub_8099BE4(); extern void sub_8099744(); extern void nullsub_120(); -extern void sub_80A5E70(); extern void sub_809B638(); extern void nullsub_106(); extern void sub_80A73EC(); diff --git a/src/ground_map.c b/src/ground_map.c index cdf990a3a..54fb3c78a 100644 --- a/src/ground_map.c +++ b/src/ground_map.c @@ -1,29 +1,23 @@ #include "global.h" -#include "memory.h" #include "debug.h" +#include "ground_map.h" +#include "ground_map_2.h" #include "ground_script.h" +#include "memory.h" IWRAM_DATA GroundScript_ExecutePP_1 *gUnknown_3001B6C = {0}; -IWRAM_DATA u8 *gUnknown_3001B70 = {0}; +IWRAM_DATA unkStruct_3001B70 *gUnknown_3001B70 = {0}; -extern DebugLocation gUnknown_8117538[]; +extern const u8 gUnknown_811736C[]; +extern const DebugLocation gUnknown_8117538[]; -extern u8 gUnknown_811736C[]; - -extern void sub_809D600(void *, u8 *, u32, u32, u32); -extern void GroundMap_Reset(void); -extern void sub_80A5E8C(u32); +extern void sub_809D600(void *, const u8 *, u32, u32, u32); extern void sub_809D648(void *); -extern void sub_80A5EBC(void); - -extern void sub_80A2D00(void *); +extern void sub_80A2D00(unkStruct_3001B70 *); extern void sub_80015C0(u32, u32); -extern void sub_80A5EDC(u32); -extern void sub_809D754(GroundScript_ExecutePP_1 *, DebugLocation *); -extern void sub_80A2D68(void *); -extern void nullsub_121(void); -extern void sub_80A2D88(void *); -extern void nullsub_122(void); +extern void sub_809D754(GroundScript_ExecutePP_1 *, const DebugLocation *); +extern void sub_80A2D68(unkStruct_3001B70 *); +extern void sub_80A2D88(unkStruct_3001B70 *); void sub_80A4A7C(void) { diff --git a/src/ground_map_1.c b/src/ground_map_1.c index 61bb90043..b3cd5ae40 100644 --- a/src/ground_map_1.c +++ b/src/ground_map_1.c @@ -5,95 +5,93 @@ extern GroundScript_ExecutePP_1 *gUnknown_3001B6C; -extern unkStruct_811BAF4 gUnknown_811BAF4[10]; - -extern DebugLocation gUnknown_8117698; -extern DebugLocation gUnknown_8117644; -extern DebugLocation gUnknown_81175E0; -extern u8 gUnknown_8117594[]; -extern u8 gUnknown_81175EC[]; -extern u8 gUnknown_8117650[]; +extern const u8 gUnknown_8117594[]; +extern const u8 gUnknown_81175EC[]; +extern const DebugLocation gUnknown_81175E0; +extern const DebugLocation gUnknown_8117644; +extern const u8 gUnknown_8117650[]; +extern const DebugLocation gUnknown_8117698; +extern const unkStruct_811BAF4 gUnknown_811BAF4[10]; extern void GroundMap_GetStationScript(GroundScript_ExecutePP_3 *, s16, u32, u32); -bool8 GroundScript_ExecutePP(GroundScript_ExecutePP_1 *param_1, s32 *param_2, GroundScript_ExecutePP_3 *param_3, DebugLocation *unused); extern u8 sub_809D678(void *); extern void sub_809D710(u8 *, GroundScript_ExecutePP_3 *, s32); extern bool8 sub_809D968(void *, s32); -void sub_80A4BE8(GroundScript_ExecutePP_3 *script, s16 r1) +static void sub_80A4BE8(GroundScript_ExecutePP_3 *script, s16 r1) { GroundMap_GetStationScript(script, r1, 0, 0); } void GroundMap_ExecuteEvent(s16 scriptIndex, u32 param_2) { - GroundScript_ExecutePP_3 script; - s32 index_s32; - u8 iVar2; + GroundScript_ExecutePP_3 script; + s32 index_s32; + u8 iVar2; - index_s32 = scriptIndex; - iVar2 = param_2; - - Log(0,gUnknown_8117594,index_s32,iVar2); // "GroundMap ExecuteEvent %3d %d - sub_809D710(NULL, &script, index_s32); - if (iVar2 != 0) { - script.scriptType = 5; - } - GroundScript_ExecutePP(gUnknown_3001B6C,0,&script,&gUnknown_81175E0); + index_s32 = scriptIndex; + iVar2 = param_2; + + Log(0,gUnknown_8117594, index_s32, iVar2); // "GroundMap ExecuteEvent %3d %d + sub_809D710(NULL, &script, index_s32); + if (iVar2 != 0) + script.scriptType = 5; + + GroundScript_ExecutePP(gUnknown_3001B6C, 0, &script, &gUnknown_81175E0); } void GroundMap_ExecuteStation(s16 param_1, s16 param_2, s8 param_3, u32 param_4) { - GroundScript_ExecutePP_3 script; - s32 iVar1; - s32 iVar2; - s32 iVar3; - u8 iVar4; + GroundScript_ExecutePP_3 script; + s32 iVar1; + s32 iVar2; + s32 iVar3; + u8 iVar4; - iVar1 = param_1; - iVar2 = param_2; - iVar3 = param_3; - iVar4 = param_4; - - Log(0,gUnknown_81175EC,iVar1,iVar2,iVar3,iVar4); // GroundMap ExecuteStation %3d %3d %3d %d - GroundMap_GetStationScript(&script,iVar1,iVar2,iVar3); - if (iVar4 != 0) { - script.scriptType = 5; - } - GroundScript_ExecutePP(gUnknown_3001B6C,0,&script,&gUnknown_8117644); + iVar1 = param_1; + iVar2 = param_2; + iVar3 = param_3; + iVar4 = param_4; + + Log(0, gUnknown_81175EC, iVar1, iVar2, iVar3, iVar4); // GroundMap ExecuteStation %3d %3d %3d %d + GroundMap_GetStationScript(&script, iVar1, iVar2, iVar3); + if (iVar4 != 0) + script.scriptType = 5; + + GroundScript_ExecutePP(gUnknown_3001B6C, 0, &script, &gUnknown_8117644); } void GroundMap_ExecuteEnter(s16 param_1) { - GroundScript_ExecutePP_3 script; - s32 iVar1; + GroundScript_ExecutePP_3 script; + s32 iVar1; - iVar1 = param_1; - - Log(0,gUnknown_8117650,iVar1); // GroundMap ExecuteEnter %3d - sub_80A4BE8(&script, iVar1); - script.scriptType = 2; - script.unk6 = 0; - script.unk8 = 0; - GroundScript_ExecutePP(gUnknown_3001B6C,0,&script,&gUnknown_8117698); + iVar1 = param_1; + + Log(0, gUnknown_8117650, iVar1); // GroundMap ExecuteEnter %3d + sub_80A4BE8(&script, iVar1); + script.scriptType = 2; + script.unk6 = 0; + script.unk8 = 0; + GroundScript_ExecutePP(gUnknown_3001B6C, 0, &script, &gUnknown_8117698); } -u8 sub_80A4D14(void) +UNUSED static u8 sub_80A4D14(void) { - return sub_809D678(gUnknown_3001B6C); + return sub_809D678(gUnknown_3001B6C); } bool8 sub_80A4D2C(s16 param_1) { - s32 iVar1 = param_1; - return sub_809D968(gUnknown_3001B6C,iVar1); + s32 iVar1 = param_1; + return sub_809D968(gUnknown_3001B6C, iVar1); } bool8 sub_80A4D48(s16 index) { - if (index == -1) return TRUE; - else if(gUnknown_811BAF4[index].unk0 == 5) return FALSE; - else if(gUnknown_811BAF4[index].unk0 != 8) return TRUE; - else return FALSE; -} + if (index == -1) return TRUE; + if (gUnknown_811BAF4[index].unk0 == 5) return FALSE; + if (gUnknown_811BAF4[index].unk0 != 8) return TRUE; + return FALSE; +} \ No newline at end of file diff --git a/src/ground_map_2.c b/src/ground_map_2.c index 458b89541..3819de6a1 100644 --- a/src/ground_map_2.c +++ b/src/ground_map_2.c @@ -1,87 +1,72 @@ #include "global.h" #include "memory.h" #include "debug.h" - -struct unkStruct_3001B74 -{ - // size: 0x24 - s16 unk0; - u8 unk2; - u32 unk4; - u32 unk8; - s32 unkC; - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - u32 unk20; -}; - -IWRAM_DATA struct unkStruct_3001B74 *gUnknown_3001B74 = {0}; // iwram +#include "ground_map.h" +#include "ground_map_2.h" extern u16 gUnknown_2026E4E; -// size: 0x55C -IWRAM_DATA u8 *gUnknown_3001B78 = {0}; // iwram +IWRAM_DATA unkStruct_3001B74 *gUnknown_3001B74 = {0}; +IWRAM_DATA unkStruct_3001B70 *gUnknown_3001B78 = {0}; -extern u8 gUnknown_8117784[]; -extern s16 gUnknown_811E5F4[][2]; -extern u8 gGroundWeatherSelect[]; -extern u8 *gUnknown_3001B70; -extern s32 gUnknown_81177BC[]; +extern const u8 gUnknown_8117784[]; +extern const s16 gUnknown_811E5F4[][2]; +extern const u8 gGroundWeatherSelect[]; +extern const s32 gUnknown_81177BC[]; -extern void sub_80A3BB0(void* , u32); +extern void sub_80A3BB0(unkStruct_3001B70 *, u32); extern void sub_80018D8(u8, u8, u32); -extern void sub_80A2D00(void *); -extern void sub_80A2B40(void *, u8 *); -extern void sub_80A2FBC(void *, u32); -extern void sub_80A49E8(void *); -extern void sub_80A456C(void *, u32, s32 *); -extern void sub_80A4580(void *, u32, s32 *); +extern void sub_80A2D00(unkStruct_3001B70 *); +extern void sub_80A2B40(unkStruct_3001B70 *, const u8 *); +extern void sub_80A2FBC(unkStruct_3001B70 *, u32); +extern void sub_80A49E8(unkStruct_3001B70 *); +extern void sub_80A456C(unkStruct_3001B70 *, u32, const s32 *); +extern void sub_80A4580(unkStruct_3001B70 *, u32, s32 *); extern void sub_80A56C0(s32 *); -extern void sub_80A4764(void *); +extern void sub_80A4764(unkStruct_3001B70 *); -void sub_80A62D0(void); -void sub_80A5EDC(u8 param_1); +static void sub_80A62D0(void); void sub_80A5E70(void) { - if (gUnknown_3001B70 != NULL) { - sub_80A49E8(gUnknown_3001B70); - } - sub_80A62D0(); + if (gUnknown_3001B70 != NULL) + sub_80A49E8(gUnknown_3001B70); + + sub_80A62D0(); } void sub_80A5E8C(u8 param_1) { - gUnknown_3001B74 = MemoryAlloc(sizeof(struct unkStruct_3001B74), 6); - gUnknown_3001B74->unk0 = -1; - gUnknown_3001B74->unk2 = 0; - sub_80A5EDC(param_1); + gUnknown_3001B74 = MemoryAlloc(sizeof(unkStruct_3001B74), 6); + gUnknown_3001B74->unk0 = -1; + gUnknown_3001B74->unk2 = 0; + sub_80A5EDC(param_1); } void sub_80A5EBC(void) { - sub_80A5EDC(0); - MemoryFree(gUnknown_3001B74); - gUnknown_3001B74 = NULL; + sub_80A5EDC(0); + MemoryFree(gUnknown_3001B74); + gUnknown_3001B74 = NULL; } void sub_80A5EDC(u8 param_1) { - sub_80018D8(0, 0x1b, -1); - gUnknown_3001B74->unk0 = -1; - gUnknown_3001B74->unk2 = param_1; - if (gUnknown_3001B78 != NULL) { - sub_80A2D00(gUnknown_3001B78); - MemoryFree(gUnknown_3001B78); - gUnknown_3001B78 = NULL; - } - if (param_1 != 0) { - gUnknown_3001B78 = MemoryAlloc(0x55c,6); - sub_80A2B40(gUnknown_3001B78,gUnknown_8117784); - sub_80A2FBC(gUnknown_3001B78,-1); - } + sub_80018D8(0, 27, -1); + gUnknown_3001B74->unk0 = -1; + gUnknown_3001B74->unk2 = param_1; + + if (gUnknown_3001B78 != NULL) { + sub_80A2D00(gUnknown_3001B78); + MemoryFree(gUnknown_3001B78); + gUnknown_3001B78 = NULL; + } + + if (param_1) { + gUnknown_3001B78 = MemoryAlloc(sizeof(unkStruct_3001B70), 6); + sub_80A2B40(gUnknown_3001B78, gUnknown_8117784); + sub_80A2FBC(gUnknown_3001B78, -1); + } } void nullsub_121(void) @@ -92,44 +77,50 @@ void nullsub_122(void) void GroundWeather_Select(s16 param_1) { - s32 iVar2; - s32 iVar3; - s16 *pVar1; - - iVar2 = param_1; - iVar3 = iVar2; - Log(0,gGroundWeatherSelect,iVar2,gUnknown_3001B74->unk2); - sub_80018D8(0,0x1b,iVar2); - gUnknown_3001B74->unk0 = iVar2; - if (gUnknown_3001B74->unk2 != 0) { + s32 iVar2; + s32 iVar3; + const s16 *pVar1; + + iVar2 = param_1; + iVar3 = iVar2; + Log(0, gGroundWeatherSelect, iVar2, gUnknown_3001B74->unk2); + sub_80018D8(0, 27, iVar2); + gUnknown_3001B74->unk0 = iVar2; + + if (gUnknown_3001B74->unk2 == 0) + return; + if (iVar2 == -1) { - sub_80A2FBC(gUnknown_3001B78, -1); + sub_80A2FBC(gUnknown_3001B78, -1); + return; } - else { - pVar1 = gUnknown_811E5F4[iVar3]; - sub_80A2FBC(gUnknown_3001B78, pVar1[1]); - gUnknown_3001B74->unk4 = 0; - gUnknown_3001B74->unk8 = 0; - gUnknown_3001B74->unkC = 0; - gUnknown_3001B74->unk10 = 0; - gUnknown_3001B74->unk20 = 0; - gUnknown_3001B74->unk1C = 0; - gUnknown_3001B74->unk18 = 0; - gUnknown_3001B74->unk14 = 0; - switch(gUnknown_3001B74->unk0) { + + pVar1 = gUnknown_811E5F4[iVar3]; + sub_80A2FBC(gUnknown_3001B78, pVar1[1]); + + gUnknown_3001B74->unk4 = 0; + gUnknown_3001B74->unk8 = 0; + gUnknown_3001B74->unkC = 0; + gUnknown_3001B74->unk10 = 0; + gUnknown_3001B74->unk20 = 0; + gUnknown_3001B74->unk1C = 0; + gUnknown_3001B74->unk18 = 0; + gUnknown_3001B74->unk14 = 0; + + switch (gUnknown_3001B74->unk0) { case 9: - sub_80A3BB0(gUnknown_3001B78,1); + sub_80A3BB0(gUnknown_3001B78, 1); gUnknown_2026E4E = 0x40c; break; case 7: gUnknown_2026E4E = 0x808; break; - case 0xe: - sub_80A3BB0(gUnknown_3001B78,1); + case 14: + sub_80A3BB0(gUnknown_3001B78, 1); gUnknown_2026E4E = 0x1010; break; - case 0xf: - sub_80A3BB0(gUnknown_3001B78,1); + case 15: + sub_80A3BB0(gUnknown_3001B78, 1); gUnknown_2026E4E = 0x40c; break; case 0: @@ -140,17 +131,15 @@ void GroundWeather_Select(s16 param_1) gUnknown_2026E4E = 0x1010; break; default: - if (pVar1[0] == 1) { - sub_80A3BB0(gUnknown_3001B78,1); - } + if (pVar1[0] == 1) + sub_80A3BB0(gUnknown_3001B78, 1); + gUnknown_2026E4E = 0x1000; break; - } } - } } -s16 sub_80A60C4(void) +UNUSED static s16 sub_80A60C4(void) { return gUnknown_3001B74->unk0; } @@ -160,108 +149,111 @@ void nullsub_123(void) void sub_80A60D8(void) { - s32 r0; + s32 r0; #ifndef NONMATCHING register s32 r1 asm("r1"); #else s32 r1; #endif - s32 r3; - s32 r4; + s32 r3; + s32 r4; - s32 local_00[2]; // sp 0x0 - s32 local_08[2]; // sp 0x8 - s32 local_10[2]; // sp 0x10 - s32 local_18[2]; // sp 0x18 - s32 local_20[2]; // sp 0x20 - s16 *puVar1; - - if (gUnknown_3001B74->unk2 == 0) { - return; - } - switch((s16)(gUnknown_3001B74->unk0 + 1)) { - case 10: - r1 = gUnknown_3001B74->unk4; - r0 = r1 + 2; - gUnknown_3001B74->unk4 = r0; - r4 = gUnknown_3001B74->unk8; - r3 = r4 + 1; - gUnknown_3001B74->unk8 = r3; - if (r0 < 0) { - r0 = r1 + 5; - } - gUnknown_3001B74->unkC += (r0 >> 2); - r1 = r3; - if (r1 < 0) { - r1 = r4 + 4; - } - gUnknown_3001B74->unk10 += (r1 >> 2); - sub_80A4580(gUnknown_3001B78,0,&gUnknown_3001B74->unkC); - gUnknown_3001B74->unk4 &= 3; - gUnknown_3001B74->unk8 &= 3; - sub_80A56C0(local_00); - local_00[0] -= gUnknown_3001B74->unkC; - local_00[1] += gUnknown_3001B74->unk10; - sub_80A4580(gUnknown_3001B78,0,local_00); - sub_80A456C(gUnknown_3001B78,0,local_00); - break; - case 0xb: - case 0xc: - case 0xd: - case 0xe: - sub_80A56C0(local_08); - sub_80A456C(gUnknown_3001B78,0,local_08); - break; - case 0xf: - r1 = gUnknown_3001B74->unk4 ; - r0 = r1 + 1; - gUnknown_3001B74->unk4 = r0; - if (r0 < 0) { - r0 = r1 + 4; - } - gUnknown_3001B74->unkC += (r0 >> 2); - sub_80A4580(gUnknown_3001B78,0,&gUnknown_3001B74->unkC); - gUnknown_3001B74->unk4 &= 3; - sub_80A56C0(local_10); - local_10[0] -= gUnknown_3001B74->unkC; - local_10[1] = 0; - sub_80A4580(gUnknown_3001B78,0,local_10); - sub_80A456C(gUnknown_3001B78,0,local_10); - break; - case 0x10: - r1 = gUnknown_3001B74->unk4; - r0 = r1 + 2; - gUnknown_3001B74->unk4 = r0; - if (r0 < 0) { - r0 = r1 + 5; - } - gUnknown_3001B74->unkC += (r0 >> 2); - sub_80A4580(gUnknown_3001B78,0,&gUnknown_3001B74->unkC); - gUnknown_3001B74->unk4 &= 3; - sub_80A56C0(local_18); - local_18[0] -= gUnknown_3001B74->unkC; - local_18[1] = 0; - sub_80A4580(gUnknown_3001B78,0,local_18); - sub_80A456C(gUnknown_3001B78,0,local_18); - break; - default: - puVar1 = gUnknown_811E5F4[gUnknown_3001B74->unk0]; - if (puVar1[0] == 0) { - sub_80A56C0(local_20); - sub_80A456C(gUnknown_3001B78,0,local_20); + s32 local_00[2]; // sp 0x0 + s32 local_08[2]; // sp 0x8 + s32 local_10[2]; // sp 0x10 + s32 local_18[2]; // sp 0x18 + s32 local_20[2]; // sp 0x20 + const s16 *puVar1; + + if (gUnknown_3001B74->unk2 == 0) + return; + + switch ((s16)(gUnknown_3001B74->unk0 + 1)) { + case 10: + r1 = gUnknown_3001B74->unk4; + r0 = r1 + 2; + gUnknown_3001B74->unk4 = r0; + + r4 = gUnknown_3001B74->unk8; + r3 = r4 + 1; + gUnknown_3001B74->unk8 = r3; + + if (r0 < 0) + r0 = r1 + 5; + + gUnknown_3001B74->unkC += (r0 >> 2); + r1 = r3; + if (r1 < 0) + r1 = r4 + 4; + + gUnknown_3001B74->unk10 += (r1 >> 2); + sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC); + gUnknown_3001B74->unk4 &= 3; + gUnknown_3001B74->unk8 &= 3; + sub_80A56C0(local_00); + local_00[0] -= gUnknown_3001B74->unkC; + local_00[1] += gUnknown_3001B74->unk10; + sub_80A4580(gUnknown_3001B78, 0, local_00); + sub_80A456C(gUnknown_3001B78, 0, local_00); break; - } - // NOTE: Fallthrough needed here.. - case 0: - sub_80A456C(gUnknown_3001B78,0,gUnknown_81177BC); - break; - } - sub_80A4764(gUnknown_3001B78); + case 11: + case 12: + case 13: + case 14: + sub_80A56C0(local_08); + sub_80A456C(gUnknown_3001B78,0,local_08); + break; + case 15: + r1 = gUnknown_3001B74->unk4 ; + r0 = r1 + 1; + gUnknown_3001B74->unk4 = r0; + + if (r0 < 0) + r0 = r1 + 4; + + gUnknown_3001B74->unkC += (r0 >> 2); + sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC); + gUnknown_3001B74->unk4 &= 3; + sub_80A56C0(local_10); + local_10[0] -= gUnknown_3001B74->unkC; + local_10[1] = 0; + sub_80A4580(gUnknown_3001B78, 0, local_10); + sub_80A456C(gUnknown_3001B78, 0, local_10); + break; + case 16: + r1 = gUnknown_3001B74->unk4; + r0 = r1 + 2; + gUnknown_3001B74->unk4 = r0; + if (r0 < 0) + r0 = r1 + 5; + + gUnknown_3001B74->unkC += (r0 >> 2); + sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC); + gUnknown_3001B74->unk4 &= 3; + sub_80A56C0(local_18); + local_18[0] -= gUnknown_3001B74->unkC; + local_18[1] = 0; + sub_80A4580(gUnknown_3001B78, 0, local_18); + sub_80A456C(gUnknown_3001B78, 0, local_18); + break; + default: + puVar1 = gUnknown_811E5F4[gUnknown_3001B74->unk0]; + if (puVar1[0] == 0) { + sub_80A56C0(local_20); + sub_80A456C(gUnknown_3001B78,0,local_20); + break; + } + // NOTE: Fallthrough needed here.. + case 0: + sub_80A456C(gUnknown_3001B78, 0, gUnknown_81177BC); + break; + } + + sub_80A4764(gUnknown_3001B78); } -void sub_80A62D0(void) +static void sub_80A62D0(void) { - if (gUnknown_3001B74->unk2 != 0) { - sub_80A49E8(gUnknown_3001B78); - } -} + if (gUnknown_3001B74->unk2 != 0) + sub_80A49E8(gUnknown_3001B78); +} \ No newline at end of file diff --git a/src/ground_script.c b/src/ground_script.c index d344deb2c..b4b71328d 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -82,7 +82,7 @@ bool8 sub_809D770(GroundScript_ExecutePP_1 *param_1, DebugLocation *unused) return TRUE; } -bool8 GroundScript_ExecutePP(GroundScript_ExecutePP_1 *param_1, s32 *param_2, GroundScript_ExecutePP_3 *param_3, DebugLocation *unused) +bool8 GroundScript_ExecutePP(GroundScript_ExecutePP_1 *param_1, s32 *param_2, GroundScript_ExecutePP_3 *param_3, const DebugLocation *unused) { if ((param_3 == NULL) || (param_3->scriptPointer == NULL)) { return FALSE; diff --git a/src/load_screen.c b/src/load_screen.c index e7cf32158..6585cba12 100644 --- a/src/load_screen.c +++ b/src/load_screen.c @@ -38,7 +38,7 @@ EWRAM_DATA_2 MenuItem gUnknown_203B378[2] = {0}; EWRAM_DATA_2 u32 gUnknown_203B388[12] = {0}; EWRAM_DATA_2 u32 gUnknown_203B3B8[12] = {0}; -extern struct unkStruct_203B484 *gUnknown_203B484; +extern unkStruct_203B484 *gUnknown_203B484; u8 IsQuickSave(void); void DrawLoadScreenText(void); @@ -265,7 +265,7 @@ void DrawLoadScreenText(void) u32 minutes; u32 seconds; PokemonStruct1 *playerInfo; - struct unkStruct_203B484 *temp2; + unkStruct_203B484 *temp2; u8 *r2; iVar2 = sub_8011FA8(); diff --git a/src/mailbox.c b/src/mailbox.c index d09ba0f8d..cae1ba2d5 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -63,7 +63,7 @@ static const u8 mailbox_fill[] = "pksdir0"; extern u8 *gUnknown_80D4990[]; extern u8 *gUnknown_80D4970[]; -extern bool8 IsMailinJobSlot(struct WonderMail *mail); +extern bool8 IsMailinJobSlot(WonderMail *mail); void sub_802E578(void); void HandleMailActionMenu(void); @@ -82,8 +82,8 @@ extern void sub_802BD14(u32, u32, u32); extern void sub_802BE94(u32); extern void CreateMailMenu(void); extern void CreateMailAcceptedStatusBox(u32); -extern void sub_803B35C(struct WonderMail *, struct unkStruct_802C39C *); -extern void sub_802DE84(struct unkStruct_802C39C *); +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); @@ -97,10 +97,10 @@ extern u32 sub_802C898(void); extern void sub_802C8F4(void); extern u32 sub_802DEE0(void); extern void sub_802DF24(void); -extern struct WonderMail *GetMailboxSlotInfo(u8); +extern WonderMail *GetMailboxSlotInfo(u8); extern u8 HasNoMailinMailbox(void); extern u32 sub_802BDEC(u32); -extern void AcceptJob(struct WonderMail *); +extern void AcceptJob(WonderMail *); extern void sub_8096C80(void); extern void sub_8096D24(void); extern void ResetMailboxSlot(u8); @@ -305,7 +305,7 @@ void CreateMailboxMenu(void) void CreateMailActionMenu(void) { s32 index; - struct WonderMail *mail; + WonderMail *mail; s32 loopMax = 0; mail = GetMailboxSlotInfo(gUnknown_203B304->mailboxIndex); if(mail->mailType == 1) @@ -390,7 +390,7 @@ void HandleMailboxMenu(void) void sub_802E578(void) { - struct WonderMail *mail; + WonderMail *mail; switch(sub_802BDEC(1)) { @@ -424,7 +424,7 @@ void sub_802E578(void) void HandleMailActionMenu(void) { s32 menuAction = 0; - struct WonderMail *mail; + WonderMail *mail; sub_802BDEC(0); diff --git a/src/mailbox_8095F8C.c b/src/mailbox_8095F8C.c index 95c25528f..5e3ff99f5 100644 --- a/src/mailbox_8095F8C.c +++ b/src/mailbox_8095F8C.c @@ -22,7 +22,7 @@ s32 CountFilledMailboxSlots(void) } // Unused -bool8 sub_8095FB0(struct WonderMail *mail) +bool8 sub_8095FB0(WonderMail *mail) { s32 index; @@ -37,7 +37,7 @@ bool8 sub_8095FB0(struct WonderMail *mail) return TRUE; } -struct WonderMail *GetMailboxSlotInfo(u8 index) +WonderMail *GetMailboxSlotInfo(u8 index) { return &gUnknown_203B490->mailboxSlots[index]; } diff --git a/src/other_menus.c b/src/other_menus.c index 388a21e1d..e0d08b5c8 100644 --- a/src/other_menus.c +++ b/src/other_menus.c @@ -28,13 +28,13 @@ struct unkStruct_203B35C MenuStruct unk1C[4]; UnkTextStruct2 unk15C[4]; struct unkStruct_8035D94 unk1BC[2]; - struct unkStruct_203B480 unk1CC; - struct unkStruct_203B480 unk1FC; - struct unkStruct_203B480 unk22C; - struct unkStruct_203B480 unk25C; - struct unkStruct_203B480 unk28C; + unkStruct_203B480 unk1CC; + unkStruct_203B480 unk1FC; + unkStruct_203B480 unk22C; + unkStruct_203B480 unk25C; + unkStruct_203B480 unk28C; PokemonStruct1 unk2BC; - struct unkStruct_203B480 unk314; + unkStruct_203B480 unk314; PokemonStruct1 unk344; u8 unk39C[0xB4]; u8 unk450[0xB4]; diff --git a/src/other_menus_1.c b/src/other_menus_1.c index 398204b0c..e5db8299c 100644 --- a/src/other_menus_1.c +++ b/src/other_menus_1.c @@ -69,11 +69,11 @@ void sub_8037C44(s32 mode, void *data) case 3: case 6: case 7: - sub_800D59C(data, sizeof(struct unkStruct_203B480)); + sub_800D59C(data, sizeof(unkStruct_203B480)); break; case 4: case 5: - sub_800D59C(data, sizeof(struct WonderMailStruct_203B2C0_sub)); + sub_800D59C(data, sizeof(WonderMailStruct_203B2C0_sub)); break; case 9: case 10: @@ -95,13 +95,13 @@ void sub_8037CC4(s32 mode, void *param_2, void *param_3) case 3: case 6: case 7: - sub_800D670(0, param_2, sizeof(struct unkStruct_203B480)); - sub_800D670(1, param_3, sizeof(struct unkStruct_203B480)); + sub_800D670(0, param_2, sizeof(unkStruct_203B480)); + sub_800D670(1, param_3, sizeof(unkStruct_203B480)); break; case 4: case 5: - sub_800D670(0, param_2, sizeof(struct WonderMailStruct_203B2C0_sub)); - sub_800D670(1, param_3, sizeof(struct WonderMailStruct_203B2C0_sub)); + sub_800D670(0, param_2, sizeof(WonderMailStruct_203B2C0_sub)); + sub_800D670(1, param_3, sizeof(WonderMailStruct_203B2C0_sub)); break; case 9: case 10: @@ -196,7 +196,7 @@ void sub_8037E38(struct unkStruct_8035D94 *param_1,struct unkStruct_8035D94 *par } } -void sub_8037E90(struct unkStruct_203B480 *param_1, struct unkStruct_203B480 *param_2) +void sub_8037E90(unkStruct_203B480 *param_1, unkStruct_203B480 *param_2) { if(sub_800D588() == 0) { @@ -210,9 +210,9 @@ void sub_8037E90(struct unkStruct_203B480 *param_1, struct unkStruct_203B480 *pa void nullsub_53(void *param_1, void *param_2) {} -void sub_8037EBC(struct WonderMailStruct_203B2C0_sub *param_1, struct WonderMailStruct_203B2C0_sub *param_2) { - struct unkStruct_203B480 *mail; - struct WonderMailStruct_203B2C0_sub *puVar2; +void sub_8037EBC(WonderMailStruct_203B2C0_sub *param_1, WonderMailStruct_203B2C0_sub *param_2) { + unkStruct_203B480 *mail; + WonderMailStruct_203B2C0_sub *puVar2; if(sub_800D588() == 0) { @@ -237,14 +237,14 @@ void sub_8037EBC(struct WonderMailStruct_203B2C0_sub *param_1, struct WonderMai } else { - MemoryFill8((u8 *)gUnknown_203B484, 0, sizeof(struct unkStruct_203B484)); + MemoryFill8((u8 *)gUnknown_203B484, 0, sizeof(unkStruct_203B484)); gUnknown_203B484->unk4.speciesNum = MONSTER_NONE; } } -void sub_8037F4C(struct unkStruct_203B480 *param_1, struct unkStruct_203B480 *param_2) +void sub_8037F4C(unkStruct_203B480 *param_1, unkStruct_203B480 *param_2) { - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; struct MainMenu *mainMenu; if(sub_800D588() == 0) @@ -316,7 +316,7 @@ s32 sub_8038014(struct unkStruct_8035D94 *param_1,struct unkStruct_8035D94 *para return linkStatus; } -s32 sub_8038078(struct unkStruct_203B480 *param_1,struct unkStruct_203B480 *param_2) +s32 sub_8038078(unkStruct_203B480 *param_1,unkStruct_203B480 *param_2) { u32 uVar2; u32 uVar3; @@ -339,10 +339,10 @@ s32 sub_8038078(struct unkStruct_203B480 *param_1,struct unkStruct_203B480 *para } } -s32 sub_80380C4(struct unkStruct_203B480 *param_1,struct unkStruct_203B480 *param_2) +s32 sub_80380C4(unkStruct_203B480 *param_1,unkStruct_203B480 *param_2) { u32 uVar2; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; if (sub_800D588() == 0) { mail = param_1; @@ -369,7 +369,7 @@ s32 sub_80380C4(struct unkStruct_203B480 *param_1,struct unkStruct_203B480 *para } } -s32 sub_803812C(struct unkStruct_203B480 *param_1, struct unkStruct_203B480 *param_2) +s32 sub_803812C(unkStruct_203B480 *param_1, unkStruct_203B480 *param_2) { if (sub_800D588() == 0) { param_2 = param_1; diff --git a/src/pelipper_board.c b/src/pelipper_board.c index 1326bfb6c..06f041ad5 100644 --- a/src/pelipper_board.c +++ b/src/pelipper_board.c @@ -76,26 +76,26 @@ extern void sub_802C10C(u32, u32, u32); extern void sub_802C28C(u32); extern void DrawPelipperBoardJobMenu(void); extern void CreatePelipperAcceptedStatusBox(u32); -extern void sub_803B35C(struct WonderMail *, struct unkStruct_802C39C *); -extern void sub_802DE84(struct unkStruct_802C39C *); +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 struct WonderMail *GetPelipperBoardSlotInfo(u8); +extern WonderMail *GetPelipperBoardSlotInfo(u8); extern u8 HasNoPelipperBoardJobs(void); extern void sub_8096C80(void); extern void sub_8096D24(void); -extern void AcceptJob(struct WonderMail*); +extern void AcceptJob(WonderMail*); extern void ResetPelipperBoardSlot(u8); 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(struct WonderMail *mail); +extern bool8 IsMailinJobSlot(WonderMail *mail); extern u8 *gUnknown_80D4990[]; extern u8 *gUnknown_80D4970[]; @@ -363,7 +363,7 @@ void sub_802ED4C(void) void sub_802EDBC(void) { - struct WonderMail *mail; + WonderMail *mail; s32 menuAction = 0; sub_802C1E4(0); diff --git a/src/post_office_guide.c b/src/post_office_guide.c index b9ae7f512..e78e4e890 100644 --- a/src/post_office_guide.c +++ b/src/post_office_guide.c @@ -184,7 +184,7 @@ extern u8 *GetCurrentMissionText(s16 r0); extern u8 *sub_80975DC(u32 r0); extern u8 sub_8099360(u8 *); extern u8 sub_8099394(volatile u8 *); -extern struct WonderMail *GetJobSlotInfo(u8); +extern WonderMail *GetJobSlotInfo(u8); extern void sub_803B6B0(u32, u32, u32, u32); extern s16 sub_80A2688(u8 r0); extern u8 sub_80992E0(s16 *, s16 *); @@ -586,8 +586,8 @@ void DisplayMissionObjectives(void) { s32 yCoord; s32 jobSlotIdx; - struct unkStruct_203B480 *mail; - struct WonderMail *jobInfo; + unkStruct_203B480 *mail; + WonderMail *jobInfo; u8 buffer [100]; volatile u8 local_94; u8 buffer1 [100]; diff --git a/src/rescue_password_menu.c b/src/rescue_password_menu.c index 11ef2f1b6..60ed4594b 100644 --- a/src/rescue_password_menu.c +++ b/src/rescue_password_menu.c @@ -19,7 +19,7 @@ EWRAM_DATA s32 gCommsTimeout = {0}; EWRAM_DATA u8 gRescuePasswordBuffer[RESCUE_PASSWORD_SIZE] = {0}; -extern struct unkStruct_203B484 *gUnknown_203B484; +extern unkStruct_203B484 *gUnknown_203B484; EWRAM_DATA_2 u8 gUnknown_203B368 = {0}; EWRAM_DATA_2 u32 gUnknown_203B36C = {0}; @@ -255,14 +255,14 @@ extern void xxx_draw_string_80144C4(void); void DisplayRescuePasswordError(u32 error); void sub_8039174(void); void DisplayPasswordAcceptScreen(void); -u32 sub_8039068(u32, u8 *passwordBuffer, struct unkStruct_203B480 *r0); +u32 sub_8039068(u32, u8 *passwordBuffer, unkStruct_203B480 *r0); void sub_80391F8(void); -bool8 sub_803D204(u8 *, struct unkStruct_203B480 *); +bool8 sub_803D204(u8 *, unkStruct_203B480 *); u32 ConvertMenutoRescuePasswordState(u32); void CreateRescuePasswordMenu(u32 currMenu) { - struct unkStruct_203B480 *temp; + unkStruct_203B480 *temp; s32 counter; if(gRescuePasswordMenu == NULL) @@ -302,7 +302,7 @@ void CreateRescuePasswordMenu(u32 currMenu) break; case MENU_DISPLAY_RESCUE_PASSWORD: temp = GetMailatIndex(0x1F); - MemoryFill8((u8 *)temp, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)temp, 0, sizeof(unkStruct_203B480)); temp->mailType = 2; temp->item.id = ITEM_NOTHING; sub_8031D70(0x1F, 0); @@ -344,12 +344,12 @@ static inline s32 UpdateRescuePasswordMenu_sub(s32 otherMenu) s32 UpdateRescuePasswordMenu(void) { - struct unkStruct_203B480 *mailPtr1; - struct unkStruct_203B480 *mailPtr2; + unkStruct_203B480 *mailPtr1; + unkStruct_203B480 *mailPtr2; u32 iVar7; struct MainMenu *mainMenuPtr; s32 nextMenu; - struct unkStruct_203B480 mail; + unkStruct_203B480 mail; u32 menuAction; u32 subtract; @@ -365,7 +365,7 @@ s32 UpdateRescuePasswordMenu(void) case 3: case 5: iVar7 = sub_80154F0(); - MemoryFill8((u8 *)&mail, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&mail, 0, sizeof(unkStruct_203B480)); switch(iVar7) { case 1: @@ -432,7 +432,7 @@ s32 UpdateRescuePasswordMenu(void) sub_80951FC(&mail); mailPtr1 = GetMailatIndex(GetMailIndex(1, mail.unk10.unk10)); mailPtr1->mailType = WONDER_MAIL_TYPE_OKD; - MemoryFill8((u8 *)&gUnknown_203B484, 0, sizeof(struct unkStruct_203B484)); + MemoryFill8((u8 *)&gUnknown_203B484, 0, sizeof(unkStruct_203B484)); break; case PASSWORD_ENTRY_NOT_THANK_YOU_MAIL: nextMenu = PASSWORD_ENTRY_NOT_THANK_YOU_MAIL; @@ -632,7 +632,7 @@ u32 ConvertMenutoRescuePasswordState(u32 unused) return state; } -u32 sub_8039068(u32 mailMode, u8 *passwordBuffer, struct unkStruct_203B480 *param_3) +u32 sub_8039068(u32 mailMode, u8 *passwordBuffer, unkStruct_203B480 *param_3) { if ( (!sub_803D204(passwordBuffer, param_3)) || (WONDER_MAIL_TYPE_OKD < param_3->mailType) || (param_3->unk4.dungeon.floor >= GetDungeonFloorCount(param_3->unk4.dungeon.id)) || diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index f53a59019..18dbb6539 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -20,7 +20,7 @@ #include "cpu.h" #include "code_80118A4.h" -extern struct WonderMailStruct_203B2C4 *gUnknown_203B2C4; +extern WonderMailStruct_203B2C4 *gUnknown_203B2C4; #define THANK_YOU_MAIL_MAIN_MENU 0 #define ANYTHING_ELSE_THANK_YOU_MAIN_MENU 1 @@ -215,7 +215,7 @@ extern void sub_8031E10(); extern void sub_802F2C0(); extern void SetThankYouMailMenuState(u32); extern PokemonStruct1 *GetPlayerPokemonStruct(void); -extern void sub_802F204(struct unkStruct_802F204 *, u32); +extern void sub_802F204(unkStruct_802F204 *, u32); extern void sub_80151C0(u32, u8 *); extern void sub_803092C(void); extern s32 sub_8037B28(u32); @@ -231,7 +231,7 @@ extern void sub_8031D70(u8, u32); extern void sub_803092C(void); extern void sub_8011C28(u32); extern u32 sub_80154F0(void); -extern u32 sub_8039068(u32, u8 *r1, struct unkStruct_203B480 *r0); +extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0); u32 CreateThankYouMailPelipper(void) @@ -240,12 +240,12 @@ u32 CreateThankYouMailPelipper(void) OpenedFile *faceFile; s32 index; int counter; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; ResetUnusedInputStruct(); sub_800641C(NULL, TRUE, TRUE); - gUnknown_203B2C4 = MemoryAlloc(sizeof(struct WonderMailStruct_203B2C4), 8); - MemoryFill8((u8 *)gUnknown_203B2C4, 0, sizeof(struct WonderMailStruct_203B2C4)); + gUnknown_203B2C4 = MemoryAlloc(sizeof(WonderMailStruct_203B2C4), 8); + MemoryFill8((u8 *)gUnknown_203B2C4, 0, sizeof(WonderMailStruct_203B2C4)); CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_PELIPPER); monName = GetMonSpecies(MONSTER_PELIPPER); @@ -798,12 +798,12 @@ void AdvanceToThankYouPasswordProcessing(void) void HandleThankYouMailPasswordMenu(void) { u8 mailIndex; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; u32 return_var; - struct unkStruct_203B480 mail1; + unkStruct_203B480 mail1; return_var = sub_80154F0(); - MemoryFill8((u8 *)&mail1, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&mail1, 0, sizeof(unkStruct_203B480)); switch(return_var) { case 3: @@ -930,7 +930,7 @@ void sub_802A75C(void) void HandleConfirmItemtoSendMenu(void) { s32 menuAction; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; if(sub_80144A4(&menuAction) == 0) { switch(menuAction) @@ -1113,7 +1113,7 @@ void sub_802A9FC(void) void HandleMailCommunicationMenu(void) { s32 menuAction; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; if(sub_80144A4(&menuAction) == 0) { switch(menuAction) @@ -1254,7 +1254,7 @@ void UpdateThankYouMailText(void) PokemonStruct1 *pokeStruct; PokemonStruct1 *pokeStruct2; s32 linkStatus; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; switch(gUnknown_203B2C4->state) { case 5: @@ -1310,13 +1310,13 @@ void UpdateThankYouMailText(void) switch(gUnknown_203B2C4->unk40) { case 6: - MemoryFill8((u8 *)&gUnknown_203B2C4->unk1B8,0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&gUnknown_203B2C4->unk1B8,0, sizeof(unkStruct_203B480)); gUnknown_203B2C4->unk1B8 = *GetMailatIndex(gUnknown_203B2C4->mailIndex); gUnknown_203B2C4->linkError = sub_8037D64(gUnknown_203B2C4->unk40,&gUnknown_203B2C4->unk1B8,&gUnknown_203B2C4->unk1E8); break; case 7: - MemoryFill8((u8 *)&gUnknown_203B2C4->unk1B8,0, sizeof(struct unkStruct_203B480)); - MemoryFill8((u8 *)&gUnknown_203B2C4->unk1E8,0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&gUnknown_203B2C4->unk1B8,0, sizeof(unkStruct_203B480)); + MemoryFill8((u8 *)&gUnknown_203B2C4->unk1E8,0, sizeof(unkStruct_203B480)); gUnknown_203B2C4->linkError = sub_8037D64(gUnknown_203B2C4->unk40,&gUnknown_203B2C4->unk1B8,&gUnknown_203B2C4->unk1E8); break; } diff --git a/src/wonder_mail.c b/src/wonder_mail.c index fb2b83e58..3b4c65268 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -17,7 +17,7 @@ #include "cpu.h" #include "code_80118A4.h" -extern struct WonderMailStruct_203B2C0 *gUnknown_203B2C0; +extern WonderMailStruct_203B2C0 *gUnknown_203B2C0; extern void sub_8011C28(u32); @@ -42,7 +42,7 @@ extern void sub_8030DE4(void); extern void sub_803092C(void); extern u32 sub_80154F0(); -extern u32 sub_8039068(u32, u8 *r1, struct unkStruct_203B480 *r0); +extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0); extern void sub_8095274(u32); extern void sub_80155F0(); extern void sub_8024458(s16, u32); @@ -273,8 +273,8 @@ u32 sub_8027F88(void) ResetUnusedInputStruct(); sub_800641C(NULL, TRUE, TRUE); - gUnknown_203B2C0 = MemoryAlloc(sizeof(struct WonderMailStruct_203B2C0), 8); - MemoryFill8((u8 *)gUnknown_203B2C0, 0, sizeof(struct WonderMailStruct_203B2C0)); + gUnknown_203B2C0 = MemoryAlloc(sizeof(WonderMailStruct_203B2C0), 8); + MemoryFill8((u8 *)gUnknown_203B2C0, 0, sizeof(WonderMailStruct_203B2C0)); gUnknown_203B2C0->unk53C = 0; gUnknown_203B2C0->mailIndex = -1; gUnknown_203B2C0->speciesNum = -1; @@ -601,13 +601,13 @@ void sub_8028348(void) switch(gUnknown_203B2C0->unk40) { case 3: - MemoryFill8((u8 *)&gUnknown_203B2C0->unk48, 0, sizeof(struct unkStruct_203B480)); - MemoryFill8((u8 *)&gUnknown_203B2C0->unk78, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&gUnknown_203B2C0->unk48, 0, sizeof(unkStruct_203B480)); + MemoryFill8((u8 *)&gUnknown_203B2C0->unk78, 0, sizeof(unkStruct_203B480)); gUnknown_203B2C0->linkError = sub_8037D64(gUnknown_203B2C0->unk40, &gUnknown_203B2C0->unk48, &gUnknown_203B2C0->unk78); break; case 4: - MemoryFill8((u8 *)&gUnknown_203B2C0->unkA8, 0, sizeof(struct WonderMailStruct_203B2C0_sub)); - MemoryFill8((u8 *)&gUnknown_203B2C0->unk130, 0, sizeof(struct WonderMailStruct_203B2C0_sub)); + MemoryFill8((u8 *)&gUnknown_203B2C0->unkA8, 0, sizeof(WonderMailStruct_203B2C0_sub)); + MemoryFill8((u8 *)&gUnknown_203B2C0->unk130, 0, sizeof(WonderMailStruct_203B2C0_sub)); gUnknown_203B2C0->unkA8.pokemon.speciesNum = 0; gUnknown_203B2C0->unk130.pokemon.speciesNum = 0; gUnknown_203B2C0->unkA8.mail = *GetMailatIndex(gUnknown_203B2C0->mailIndex); @@ -1152,7 +1152,7 @@ void sub_8028FC0() void sub_8028FDC(void) { s32 menuChoice; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; if(sub_80144A4(&menuChoice) != 0) { @@ -1439,10 +1439,10 @@ void sub_80293D8(void) void sub_80293F4(void) { u32 return_var; - struct unkStruct_203B480 mail; + unkStruct_203B480 mail; return_var = sub_80154F0(); - MemoryFill8((u8 *)&mail, 0, sizeof(struct unkStruct_203B480)); + MemoryFill8((u8 *)&mail, 0, sizeof(unkStruct_203B480)); switch(return_var) { case 3: diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index baa153485..b8b7400af 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -30,7 +30,7 @@ struct unkStruct_203B2C8 /* 0x13 */ u8 unk13; /* 0x14 */ u8 teamName[4]; // Figure out size of this buffer u8 fill18[0x114 - 0x18]; - struct unkStruct_802F204 unk114; + unkStruct_802F204 unk114; u32 fill13C; }; @@ -50,7 +50,7 @@ extern void sub_802B5B8(void); extern void sub_802B5FC(void); extern void sub_802B624(void); -extern void sub_802F204(struct unkStruct_802F204 *, u32); +extern void sub_802F204(unkStruct_802F204 *, u32); extern void sub_803C37C(DungeonLocation *, u32, u8 *); extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32); @@ -148,7 +148,7 @@ void nullsub_132(void) void sub_802B3E0(void) { - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; char *monName; char teamNameBuffer[40]; @@ -230,7 +230,7 @@ void sub_802B57C(void) void sub_802B5B8(void) { u32 uVar2; - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; s32 temp; if (sub_80144A4(&temp) == 0) { diff --git a/src/wonder_mail_2_1.c b/src/wonder_mail_2_1.c index d9c8adcf2..f5536f54d 100644 --- a/src/wonder_mail_2_1.c +++ b/src/wonder_mail_2_1.c @@ -98,9 +98,9 @@ static const u8 wonder_mail_fill1[] = "pksdir0"; extern void sub_802CAA4(void); extern u8 IsJobSlotEmpty(u8); -extern struct WonderMail* GetJobSlotInfo(u8); -extern void sub_803B35C(struct WonderMail *, struct unkStruct_802C39C *); -extern void CreateRescueTitle(struct unkStruct_802C39C *); +extern WonderMail* GetJobSlotInfo(u8); +extern void sub_803B35C(WonderMail *, unkStruct_802C39C *); +extern void CreateRescueTitle(unkStruct_802C39C *); extern void sub_802C6DC(void); extern void DrawJobListMenu(void); @@ -112,7 +112,7 @@ extern void sub_802CD38(void); extern void sub_802CDB8(void); extern void sub_802C928(void); extern void sub_802C9D8(void); -extern void sub_802DE84(struct unkStruct_802C39C *); +extern void sub_802DE84(unkStruct_802C39C *); extern void sub_802CBAC(void); s32 CountAcceptedJobs(void); @@ -297,11 +297,11 @@ void sub_802C6DC(void) void DrawJobListMenu(void) { - struct WonderMail *mail; + WonderMail *mail; int index; s32 r4; s32 r5; - struct unkStruct_802C39C local; + unkStruct_802C39C local; sub_8008C54(gUnknown_203B2E8->unk3C); sub_80073B8(gUnknown_203B2E8->unk3C); diff --git a/src/wonder_mail_2_mid.c b/src/wonder_mail_2_mid.c index fb11873b8..f230f0ae9 100644 --- a/src/wonder_mail_2_mid.c +++ b/src/wonder_mail_2_mid.c @@ -18,11 +18,11 @@ extern void sub_802C328(void); extern void DrawPelipperBoardJobMenu(void); extern u8 HasNoPelipperBoardJobs(void); -extern struct WonderMail *GetPelipperBoardSlotInfo(u32); -extern void sub_803B35C(struct WonderMail *, u32 *); +extern WonderMail *GetPelipperBoardSlotInfo(u32); +extern void sub_803B35C(WonderMail *, u32 *); extern u8 gBulletinBoardText[]; -extern bool8 IsMailinJobSlot(struct WonderMail *); -extern void CreateRescueTitle(struct unkStruct_802C39C *); +extern bool8 IsMailinJobSlot(WonderMail *); +extern void CreateRescueTitle(unkStruct_802C39C *); struct unkStruct_203B2D8 { @@ -54,7 +54,7 @@ extern UnkTextStruct2 gUnknown_80DFC9C; extern u16 gUnknown_203B2E4; -extern struct WonderMail *GetMailboxSlotInfo(u8); +extern WonderMail *GetMailboxSlotInfo(u8); extern PokemonStruct1 *GetPlayerPokemonStruct(void); extern u8 gMailboxText[]; extern u8 gAvailablePokemonNames[]; @@ -63,10 +63,10 @@ extern void sub_803B6B0(u32, u32, u32, u32); void CreateMailMenu(void) { - struct WonderMail *mail; + WonderMail *mail; s32 y; s32 index; - struct unkStruct_802C39C local; + unkStruct_802C39C local; u8 buffer [128]; sub_8008C54(gUnknown_203B2D8->unk38); @@ -279,11 +279,11 @@ void sub_802C328(void) void DrawPelipperBoardJobMenu(void) { u32 slotIndex; - struct WonderMail *mail; + WonderMail *mail; s32 iVar4; s32 x; s32 index; - struct unkStruct_802C39C local; + unkStruct_802C39C local; sub_8008C54(gUnknown_203B2E0->unk3C); sub_80073B8(gUnknown_203B2E0->unk3C); diff --git a/src/wonder_mail_3.c b/src/wonder_mail_3.c index 1db9b18f7..5a40912a6 100644 --- a/src/wonder_mail_3.c +++ b/src/wonder_mail_3.c @@ -127,16 +127,16 @@ extern void sub_802D1B8(); extern void sub_802D2A8(); -extern bool8 IsMailinJobSlot(struct WonderMail *); -extern u8 sub_8096F50(struct WonderMail *); +extern bool8 IsMailinJobSlot(WonderMail *); +extern u8 sub_8096F50(WonderMail *); extern u8 sub_802DAA8(void); extern u8 sub_802DADC(void); extern u8 *sub_8096DD8(void); extern u8 sub_8096C08(u8 *); extern void DrawJobListMenu(void); -extern struct WonderMail* GetJobSlotInfo(u8); -extern void sub_803B35C(struct WonderMail *, struct unkStruct_802C39C*); -extern void sub_802DE84(struct unkStruct_802C39C *); +extern WonderMail* GetJobSlotInfo(u8); +extern void sub_803B35C(WonderMail *, unkStruct_802C39C*); +extern void sub_802DE84(unkStruct_802C39C *); extern void sub_802D73C(void); extern void sub_802C640(u32); extern void sub_802C4C8(u32, u32, u32); @@ -145,9 +145,9 @@ extern void sub_802D690(void); extern void sub_8096C80(void); extern void sub_8096D24(void); extern u8 *sub_8096DE8(void); -extern void AcceptJob(struct unkSubStruct_203B2F8 *); -struct unkStruct_803B344 *sub_803B344(u8); -extern void CreateRescueTitle(struct unkStruct_802C39C *); +extern void AcceptJob(unkSubStruct_203B2F8 *); +unkStruct_803B344 *sub_803B344(u8); +extern void CreateRescueTitle(unkStruct_802C39C *); extern u8 gUnknown_80DFDBC[]; extern void sub_802CF5C(void); extern void sub_802CFD0(void); @@ -173,12 +173,12 @@ extern u8 *gUnknown_80D4970[]; extern u8 gUnknown_80DFD70[]; extern u8 gUnknown_80DFD7C[]; -extern bool8 sub_809693C(struct WonderMail *); +extern bool8 sub_809693C(WonderMail *); extern bool8 sub_80A2824(u8); void sub_802CAA4(void) { s32 loopMax; - struct WonderMail *mail; + WonderMail *mail; s32 index; loopMax = 0; @@ -266,8 +266,8 @@ void sub_802CC00(void) void sub_802CC70(void) { s32 menuAction; - struct WonderMail *mail; - struct WonderMail *mail2; + WonderMail *mail; + WonderMail *mail2; menuAction = 0; sub_802C598(0); @@ -350,7 +350,7 @@ bool8 sub_802CDD4(u32 r0) { if(gUnknown_203B2F4 == NULL) { - gUnknown_203B2F4 = MemoryAlloc(sizeof(struct unkStruct_203B2F4), 8); + gUnknown_203B2F4 = MemoryAlloc(sizeof(unkStruct_203B2F4), 8); } gUnknown_203B2F4->unk34 = r0; gUnknown_203B2F4->unk38 = &gUnknown_203B2F4->unk3C[gUnknown_203B2F4->unk34]; @@ -488,8 +488,8 @@ void sub_802CF5C(void) void sub_802CFD0(void) { - struct unkStruct_802C39C local; - struct unkStruct_803B344 *iVar1; + unkStruct_802C39C local; + unkStruct_803B344 *iVar1; s32 r5; s32 r4; @@ -514,13 +514,13 @@ void sub_802CFD0(void) sub_80073E0(gUnknown_203B2F4->unk34); } -u32 sub_802D098(struct unkSubStruct_203B2F8 *mail) +u32 sub_802D098(unkSubStruct_203B2F8 *mail) { - gUnknown_203B2F8 = MemoryAlloc(0x208,8); + gUnknown_203B2F8 = MemoryAlloc(sizeof(unkStruct_203B2F8),8); gUnknown_203B2F8->menuAction1 = 0; gUnknown_203B2F8->menuAction2 = 0; gUnknown_203B2F8->menuAction3 = 0; - gUnknown_203B2F8->mail = mail; + gUnknown_203B2F8->mail = mail; gUnknown_203B2F8->wonderMailAccepted = FALSE; gUnknown_203B2F8->unk9 = sub_8099328(&gUnknown_203B2F8->dungeonID); if (sub_8011C1C() != 2) { @@ -915,7 +915,7 @@ void sub_802D8CC(void) void sub_802D940(void) { - struct WonderMail *mail; + WonderMail *mail; s32 menuAction; menuAction = 0; @@ -1001,7 +1001,7 @@ void AdvancetoFallbackWonderMailRescueState(void) bool8 sub_802DAA8(void) { - struct WonderMail *mail; + WonderMail *mail; mail = GetJobSlotInfo(gUnknown_203B2F8->jobSlotIndex); if (!gUnknown_203B2F8->unk9) { @@ -1016,7 +1016,7 @@ bool8 sub_802DAA8(void) bool8 sub_802DADC(void) { u8 mailType; - struct WonderMail *mail; + WonderMail *mail; s32 counter; if (!gUnknown_203B2F8->unk9) { diff --git a/src/wonder_mail_3_mid.c b/src/wonder_mail_3_mid.c index 0254e3189..81207f6f8 100644 --- a/src/wonder_mail_3_mid.c +++ b/src/wonder_mail_3_mid.c @@ -12,25 +12,16 @@ #include "code_802C39C.h" #include "code_80130A8.h" #include "code_80118A4.h" +#include "wonder_mail_3.h" -struct unkStruct_803B344 -{ - // size: 0xB4 - struct WonderMail mail; - u8* unk14; - u8* unk18; - u8 fill1C[0x3C - 0x1C]; - u8 unk3C[0x78]; -}; - -extern struct unkStruct_803B344 *sub_803B344(u8); +extern unkStruct_803B344 *sub_803B344(u8); struct unkStruct_203B30C { // size: 0x150 s32 state; u8 unk4; - struct unkStruct_802C39C unk8; + unkStruct_802C39C unk8; MenuStruct unk60; MenuItem unkB0[8]; UnkTextStruct2 unkF0[4]; @@ -45,7 +36,7 @@ struct unkStruct_203B310 /* 0x8 */ bool8 displayClientDialogueSprite; // true to display the dialogue sprite for the client /* 0x9 */ u8 currTeamRank; // team rank /* 0xC */ s32 itemRewardIndex; - struct unkStruct_802F204 *unk10; + unkStruct_802F204 *unk10; /* 0x14 */ OpenedFile *faceFile; /* 0x18 */ u8 *faceData; s16 unk1C; @@ -108,8 +99,8 @@ extern void sub_802F088(); extern void sub_801B72C(void); extern u32 sub_801B6AC(void); extern void sub_802F108(void); -extern void sub_803B35C(struct WonderMail*, struct unkStruct_802C39C *); -extern void sub_802DE84(struct unkStruct_802C39C *); +extern void sub_803B35C(WonderMail*, unkStruct_802C39C *); +extern void sub_802DE84(unkStruct_802C39C *); extern void sub_802CDD4(u32); extern void sub_802CED8(u32); extern void sub_802CFD0(void); @@ -329,7 +320,7 @@ void sub_802F004(void) void sub_802F088(void) { - struct unkStruct_803B344 *temp; + unkStruct_803B344 *temp; switch(gUnknown_203B30C->state) { @@ -428,7 +419,7 @@ void sub_802F1E8(void) -u32 sub_802F204(struct unkStruct_802F204 *r0, bool8 displayClientSprite) +u32 sub_802F204(unkStruct_802F204 *r0, bool8 displayClientSprite) { struct unkStruct_203B310 *preload; diff --git a/src/wonder_mail_4.c b/src/wonder_mail_4.c index e10aacd67..f7759654a 100644 --- a/src/wonder_mail_4.c +++ b/src/wonder_mail_4.c @@ -25,7 +25,7 @@ struct unkStruct_203B320 }; extern struct unkStruct_203B320 *gUnknown_203B320; -extern struct unkStruct_203B480 *gUnknown_203B480; +extern unkStruct_203B480 *gUnknown_203B480; const UnkTextStruct2 gUnknown_80E083C = { 0x00, 0x00, 0x00, 0x00, @@ -81,7 +81,7 @@ extern s32 sub_8030A74(void); extern void sub_80308A0(void); extern void sub_803092C(void); -extern void CreateRescueTitle(struct unkStruct_802C39C *); +extern void CreateRescueTitle(unkStruct_802C39C *); u32 sub_80306A8(u32 wonderMailType, u32 r1, UnkTextStruct2_sub *r2, u32 r3) { @@ -245,11 +245,11 @@ void sub_80308A0(void) void sub_803092C(void) { - struct unkStruct_203B480 *mail; + unkStruct_203B480 *mail; s32 r4; s32 r5; s32 index; - struct unkStruct_802C39C local; + unkStruct_802C39C local; sub_8008C54(gUnknown_203B320->unk58); sub_80073B8(gUnknown_203B320->unk58); @@ -306,7 +306,7 @@ s32 sub_8030A74(void) case WONDER_MAIL_TYPE_NONE: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType != WONDER_MAIL_TYPE_NONE) { gUnknown_203B320->unk0[count] = index; count++; @@ -316,7 +316,7 @@ s32 sub_8030A74(void) case WONDER_MAIL_TYPE_COMPLETED: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == WONDER_MAIL_TYPE_COMPLETED) { gUnknown_203B320->unk0[count] = index; count++; @@ -326,7 +326,7 @@ s32 sub_8030A74(void) case 1: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == 1) { gUnknown_203B320->unk0[count] = index; count++; @@ -336,7 +336,7 @@ s32 sub_8030A74(void) case 2: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == 2) { gUnknown_203B320->unk0[count] = index; count++; @@ -346,7 +346,7 @@ s32 sub_8030A74(void) case WONDER_MAIL_TYPE_AOK: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == WONDER_MAIL_TYPE_AOK) { gUnknown_203B320->unk0[count] = index; count++; @@ -356,7 +356,7 @@ s32 sub_8030A74(void) case 3: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == 3) { gUnknown_203B320->unk0[count] = index; count++; @@ -366,7 +366,7 @@ s32 sub_8030A74(void) case WONDER_MAIL_TYPE_THANK_YOU: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == WONDER_MAIL_TYPE_THANK_YOU) { gUnknown_203B320->unk0[count] = index; count++; @@ -377,7 +377,7 @@ s32 sub_8030A74(void) case WONDER_MAIL_TYPE_OKD: for (index = 0; index < 0x20; index++) { - struct unkStruct_203B480 *p = gUnknown_203B480 + index; + unkStruct_203B480 *p = gUnknown_203B480 + index; if (p->mailType == WONDER_MAIL_TYPE_OKD) { gUnknown_203B320->unk0[count] = index; count++; diff --git a/src/wonder_mail_5.c b/src/wonder_mail_5.c index 962f2e75e..f32e097b6 100644 --- a/src/wonder_mail_5.c +++ b/src/wonder_mail_5.c @@ -22,7 +22,7 @@ struct unkStruct_203B324 UnkTextStruct2 unk18[4]; }; extern struct unkStruct_203B324 *gUnknown_203B324; -extern struct unkStruct_203B480 *gUnknown_203B480; +extern unkStruct_203B480 *gUnknown_203B480; const UnkTextStruct2 gUnknown_80E0900 = { @@ -50,7 +50,7 @@ const u8 gUnknown_80E0938[] = "%-4d"; static const u8 wonder_mail_fill[] = "pksdir0"; extern void sub_8030DD4(void); -extern void CreateRescueDescription(struct unkStruct_802C39C *); +extern void CreateRescueDescription(unkStruct_802C39C *); void sub_8030E2C(void); void sub_8030E48(void); @@ -110,8 +110,8 @@ void sub_8030E2C(void) void sub_8030E48(void) { u16 uVar2; - struct unkStruct_203B480 *mail; - struct unkStruct_802C39C stack; + unkStruct_203B480 *mail; + unkStruct_802C39C stack; u8 buffer [256]; mail = &gUnknown_203B480[gUnknown_203B324->mailIndex]; diff --git a/src/wonder_mail_6.c b/src/wonder_mail_6.c index 64b3f0278..dd0e47f98 100644 --- a/src/wonder_mail_6.c +++ b/src/wonder_mail_6.c @@ -27,7 +27,7 @@ struct unkStruct_203B328 u32 wonderMailType; }; extern struct unkStruct_203B328 *gUnknown_203B328; -extern struct unkStruct_203B480 *gUnknown_203B480; +extern unkStruct_203B480 *gUnknown_203B480; const MenuItem gUnknown_80E0948[] = { @@ -294,7 +294,7 @@ void sub_80313D8(u32 state) { s32 index; s32 local_10; - struct unkStruct_203B480 *unused; + unkStruct_203B480 *unused; local_10 = 0; sub_8030768(0); diff --git a/src/wonder_mail_802DF88.c b/src/wonder_mail_802DF88.c index d019d867c..6fa775551 100644 --- a/src/wonder_mail_802DF88.c +++ b/src/wonder_mail_802DF88.c @@ -14,9 +14,9 @@ struct unkStruct_203B2FC // size: 0xA8 /* 0x0 */ u32 state; /* 0x4 */ u32 fallbackState; - struct unkStruct_802F204 unk8; + unkStruct_802F204 unk8; u8 jobSlotIndex; - struct WonderMail *jobInfo; + WonderMail *jobInfo; OpenedFile *faceFile; u8 *faceData; u16 unk40; @@ -34,7 +34,7 @@ struct unkStruct_203B300 { // size: 0x7C MenuInputStructSub unk0; - struct unkStruct_802C39C *mail; + unkStruct_802C39C *mail; u32 unk10; UnkTextStruct2 *unk14; UnkTextStruct2 unk18[4]; @@ -100,18 +100,18 @@ const UnkTextStruct2 gUnknown_80E0264 = static const u8 wonder_mail_802DF88_fill1[] = "pksdir0"; -extern void CreateRescueDescription(struct unkStruct_802C39C *); +extern void CreateRescueDescription(unkStruct_802C39C *); extern void sub_802DC28(u32); extern void sub_802F2C0(void); extern void sub_802DC28(u32); extern u32 sub_802F298(void); -extern void sub_802F204(struct unkStruct_802F204*, u32); +extern void sub_802F204(unkStruct_802F204*, u32); extern void sub_802DC40(void); extern void sub_802DC9C(void); -struct WonderMail *GetJobSlotInfo(u8); +WonderMail *GetJobSlotInfo(u8); extern void sub_8096AF8(u8 *, u32, u32); extern void sub_8096EEC(void); -extern void sub_803C21C(struct WonderMail *, struct unkStruct_802F204*); +extern void sub_803C21C(WonderMail *, unkStruct_802F204*); extern u32 sub_802C598(s32); extern void sub_802C688(void); extern void sub_8096C80(void); @@ -302,7 +302,7 @@ void sub_802DE60(void) } } -u32 sub_802DE84(struct unkStruct_802C39C *mail) +u32 sub_802DE84(unkStruct_802C39C *mail) { gUnknown_203B300 = MemoryAlloc(sizeof(struct unkStruct_203B300), 8); gUnknown_203B300->mail = mail; diff --git a/src/wonder_mail_main_menu.c b/src/wonder_mail_main_menu.c index 1fab819c0..b9418262a 100644 --- a/src/wonder_mail_main_menu.c +++ b/src/wonder_mail_main_menu.c @@ -13,6 +13,7 @@ #include "code_801B3C0.h" #include "cpu.h" #include "code_80118A4.h" +#include "wonder_mail_3.h" #define SELECT_WONDER_MAIL_MODE_MAIN_SCREEN 0 #define SEND_WONDER_MAIL_MAIN_SCREEN 1 @@ -81,17 +82,6 @@ ALIGNED(4) const char Yes_80E7D2C[] = "Yes"; ALIGNED(4) const char wonder_mail_main_fill1[] = "pksdir0"; ALIGNED(4) const char wonder_mail_main_fill2[] = "pksdir0"; - -struct unkStruct_803B344 -{ - // size: 0xB4 - struct WonderMail mail; - u8* unk14; - u8* unk18; - u8 fill1C[0x3C - 0x1C]; - u8 unk3C[0x78]; -}; - struct unkStruct_203B3E8 { // size: 0x49C @@ -99,7 +89,7 @@ struct unkStruct_203B3E8 u8 PasswordEntryBuffer[PASSWORD_BUFFER_SIZE]; // Wonder Mail Buffer... union UNK38 { - struct WonderMail decodedMail; // 0x14 + WonderMail decodedMail; // 0x14 u8 unk38_u8[0x30]; // idk why it fills to 0x30 instead... } UNK38; u8 fill68[0x1EC - 0x68]; @@ -107,15 +97,15 @@ struct unkStruct_203B3E8 u32 unk24C; u32 wonderMailStatus; - struct unkStruct_803B344 unk254; + unkStruct_803B344 unk254; - struct unkStruct_803B344 unk308; + unkStruct_803B344 unk308; u8 unk3BC; u8 fill3BD[0x3C0 - 0x3BD]; - struct unkStruct_803B344 unk3C0; + unkStruct_803B344 unk3C0; - struct WonderMail unk474; + WonderMail unk474; u8 **unk488; u8 *unk48C; s32 wonderMailMethod; @@ -137,10 +127,9 @@ extern s32 sub_8037D64(u32, void *, void *); extern s32 sub_80381F4(u32, void *, void *); extern void sub_80151C0(u32, u8 *); extern void sub_802EF48(void); -extern void sub_802D098(struct WonderMail *); -extern struct unkStruct_803B344 *sub_803B344(u8); +extern unkStruct_803B344 *sub_803B344(u8); @@ -151,8 +140,8 @@ extern bool8 GetWonderMailAccepted(); extern void sub_802D184(); extern s32 sub_80154F0(); -extern bool8 DecodeWonderMailPassword(u8 *, struct WonderMail *); -extern bool8 IsValidWonderMail(struct WonderMail *WonderMailData); +extern bool8 DecodeWonderMailPassword(u8 *, WonderMail *); +extern bool8 IsValidWonderMail(WonderMail *WonderMailData); void PrintWonderMailMainMenuError(u32); void HandleWonderMailMainScreen(void); @@ -531,7 +520,7 @@ void nullsub_54(void) void WonderMailMainMenuCallback(void) { int linkStatus; - struct unkStruct_803B344 *temp; + unkStruct_803B344 *temp; switch(gUnknown_203B3E8->state) { case SELECT_WONDER_MAIL_MODE_MAIN_SCREEN: @@ -560,7 +549,7 @@ void WonderMailMainMenuCallback(void) gUnknown_203B3E8->unk488 = NULL; gUnknown_203B3E8->unk48C = NULL; } - sub_802D098(&gUnknown_203B3E8->unk474); + sub_802D098((unkSubStruct_203B2F8 *)&gUnknown_203B3E8->unk474); break; case PREPARE_SAVE: if(gUnknown_203B3E8->wonderMailAccepted)