From 23b235b85f601db91ecce8a4ab197f0865a6c027 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 18 Nov 2025 12:51:01 +0100 Subject: [PATCH 1/2] some stuff --- include/dungeon_cutscenes.h | 2 +- include/effect_main.h | 12 +++-------- src/code_800D090.c | 9 +++----- src/code_8040094_1.c | 23 +++----------------- src/effect_main.c | 26 +++++++++++------------ src/ground_bg.c | 42 ++++++++++++++++++------------------- src/ground_main.c | 6 ++---- src/random.c | 2 +- 8 files changed, 47 insertions(+), 75 deletions(-) diff --git a/include/dungeon_cutscenes.h b/include/dungeon_cutscenes.h index 36ca6ef9c..175306b38 100644 --- a/include/dungeon_cutscenes.h +++ b/include/dungeon_cutscenes.h @@ -55,7 +55,7 @@ void ZapdosReFightDialogue(void); void nullsub_100(u8, u8, u8); void sub_8086B14(void); void sub_8086B94(void); -void sub_8086BDC(u8, s32); // TODO: should be u8 +void sub_8086BDC(u8, u8); void sub_8086E40(void); void sub_8086E9C(void); void sub_8086F00(void); diff --git a/include/effect_main.h b/include/effect_main.h index 77a0cbbd6..84135747b 100644 --- a/include/effect_main.h +++ b/include/effect_main.h @@ -17,12 +17,6 @@ typedef struct unkStruct_80416E0 unkStruct_2039DB0 spriteMasks; } unkStruct_80416E0; -typedef struct unkStruct_800EA44 -{ - s16 unk0; - s16 unk2; -} unkStruct_800EA44; - struct UnkStruct_8040094 { u16 unk0; @@ -47,8 +41,8 @@ s32 sub_800E6D8(s32 a0); s32 sub_800E700(s32 a0); s32 sub_800E710(s32 species, s32 moveId); s32 sub_800E790(s32 a0_, s32 a1); -bool8 sub_800E7D0(u16 *param_1); -bool8 sub_800E838(u16 *param_1, s32 param_2); +bool8 sub_800E7D0(struct UnkStruct_8040094 *param_1); +bool8 sub_800E838(struct UnkStruct_8040094 *param_1, s32 param_2); s32 sub_800E890(unkStruct_80416E0 *param_1); void sub_800E8AC(s32 a0, DungeonPos *a1, DungeonPos *a2, s32 a3, unkStruct_2039DB0 *a4); bool8 sub_800E90C(DungeonPos *param_1); @@ -56,7 +50,7 @@ void sub_800E970(void); bool8 sub_800E9A8(s32 a0); bool8 sub_800E9E4(u32 param_1); bool8 sub_800E9FC(u8 a0); -u8 sub_800EA44(unkStruct_800EA44 param_1, s32 param_2); +u8 sub_800EA44(s32 monsterId_, s32 param_2); s32 sub_800EA84(struct UnkStruct_8040094 *a0); void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, s32 r5, s32 r4); s32 sub_800EBC8(struct UnkStruct_8040094 *a0); diff --git a/src/code_800D090.c b/src/code_800D090.c index b39a41cfa..b9309b2a9 100644 --- a/src/code_800D090.c +++ b/src/code_800D090.c @@ -11,8 +11,7 @@ void Hang(void) } } -// Unused -void sub_800D098(void) +UNUSED static void sub_800D098(void) { u32 dispcnt_save; u32 ie_store; @@ -71,8 +70,7 @@ void sprintfStatic(char *buffer, const char *text, ...) va_end(vArgv); } -// Unused -void sub_800D16C(const char *text, ...) +UNUSED static void sub_800D16C(const char *text, ...) { char buffer[1024]; va_list vArgv; @@ -81,8 +79,7 @@ void sub_800D16C(const char *text, ...) va_end(vArgv); } -// Unused -void sub_800D10A(const char *r0, u32 r1, u32 r2, u32 r3, ...) +UNUSED static void sub_800D10A(const char *r0, u32 r1, u32 r2, u32 r3, ...) { } diff --git a/src/code_8040094_1.c b/src/code_8040094_1.c index e671e6dea..c9f236d94 100644 --- a/src/code_8040094_1.c +++ b/src/code_8040094_1.c @@ -13,43 +13,26 @@ #include "dungeon_info.h" #include "dungeon_message.h" #include "dungeon_move.h" +#include "dungeon_move_util.h" #include "dungeon_music.h" #include "dungeon_random.h" #include "dungeon_util.h" +#include "dungeon_logic.h" #include "sprite.h" #include "weather.h" #include "dungeon_map_access.h" #include "dungeon_strings.h" #include "dungeon_mon_sprite_render.h" #include "dungeon_8041AD0.h" - -struct UnkStruct_8040094 -{ - u16 unk0; - u16 unk2; - DungeonPos unk4; - DungeonPos unk8; - s32 unkC; - s32 unk10; -}; +#include "effect_main.h" extern u8 sub_800EC94(s32 param_1); -extern s32 sub_800E710(s32 species, u16 moveId); extern void sub_800EEC8(u16 r0); -extern u8 sub_800EA44(s32 species, u16 a2); -extern s32 sub_800E790(s32 species, u16 a2); -extern s32 sub_800E52C(struct UnkStruct_8040094 *a0); -extern s32 sub_800EA84(struct UnkStruct_8040094 *a0); -extern bool8 sub_800E838(struct UnkStruct_8040094 *a0, s32 a1); extern bool8 sub_800E9A8(s32 a0); extern void sub_800EEF8(u16 a0); extern bool8 sub_803F428(DungeonPos *pos); extern void sub_800EEE0(u16 a0); -extern s32 sub_800EBC8(struct UnkStruct_8040094 *a0); -extern bool8 sub_800E7D0(struct UnkStruct_8040094 *a0); extern bool8 EffectiveMoveHasSineWobble(s32 moveId); -extern bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move); -extern bool8 IsMonsterSleeping(Entity *pokemon); extern const s32 gUnknown_8106A8C[]; diff --git a/src/effect_main.c b/src/effect_main.c index cb786cc81..dd3e245ed 100644 --- a/src/effect_main.c +++ b/src/effect_main.c @@ -925,16 +925,16 @@ s32 sub_800E790(s32 species_, s32 moveId) return unkPtr1->soundEffectId; } -bool8 sub_800E7D0(u16 *param_1) +bool8 sub_800E7D0(struct UnkStruct_8040094 *param_1) { s32 local_1c[4]; s32 index; bool8 flag = FALSE; - local_1c[0] = sub_800ECB8(*param_1)->unk0; - local_1c[1] = sub_800ECB8(*param_1)->unk2; - local_1c[2] = sub_800ECB8(*param_1)->unk4; - local_1c[3] = sub_800ECB8(*param_1)->unk6; + local_1c[0] = sub_800ECB8(param_1->unk0)->unk0; + local_1c[1] = sub_800ECB8(param_1->unk0)->unk2; + local_1c[2] = sub_800ECB8(param_1->unk0)->unk4; + local_1c[3] = sub_800ECB8(param_1->unk0)->unk6; for (index = 0; index < 4; index++) { flag = (sub_800ECA4(local_1c[index])->animType == 4); if (flag) @@ -943,14 +943,14 @@ bool8 sub_800E7D0(u16 *param_1) return flag; } -bool8 sub_800E838(u16 *param_1, s32 param_2) +bool8 sub_800E838(struct UnkStruct_8040094 *param_1, s32 param_2) { s32 local_1c[4]; - local_1c[0] = sub_800ECB8(*param_1)->unk0; - local_1c[1] = sub_800ECB8(*param_1)->unk2; - local_1c[2] = sub_800ECB8(*param_1)->unk4; - local_1c[3] = sub_800ECB8(*param_1)->unk6; + local_1c[0] = sub_800ECB8(param_1->unk0)->unk0; + local_1c[1] = sub_800ECB8(param_1->unk0)->unk2; + local_1c[2] = sub_800ECB8(param_1->unk0)->unk4; + local_1c[3] = sub_800ECB8(param_1->unk0)->unk6; return sub_800ECA4(local_1c[param_2])->animType == 4; } @@ -1065,15 +1065,15 @@ bool8 sub_800E9FC(u8 a0) return FALSE; } -u8 sub_800EA44(unkStruct_800EA44 param_1, s32 param_2) +u8 sub_800EA44(s32 monsterId_, s32 param_2) { s32 i; - s32 a = param_1.unk0; + s32 monsterId = (s16) monsterId_; const unkStruct_80BDBC4 *ret = sub_800ECB8(param_2); const unkStruct_80C183C *unkStruct2 = sub_800ECD0(ret->unk20); for (i = 0; i < ret->unk1C; i++, unkStruct2++) { - if (unkStruct2->species == a) { + if (unkStruct2->species == monsterId) { return unkStruct2->unk2; } } diff --git a/src/ground_bg.c b/src/ground_bg.c index 312f0150d..9bb2a8204 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -11,6 +11,7 @@ #include "debug.h" #include "bg_control.h" #include "unk_dungeon_load.h" +#include "palette_fade_util.h" #include "constants/dungeon.h" // This file most likely deals with map loading and writing to VRAM. It even has a custom decompression function. @@ -32,7 +33,6 @@ static void ClearDoubleBgTilemaps(MapRender *mapRender); static void RenderChunksToBgTilemaps_2x2(MapRender *mapRender); static void RenderChunksToBgTilemaps_3x3(MapRender *mapRender); -extern void sub_8003810(u16 param_1, RGB_Union param_2); extern void sub_809971C(u16 idx, const RGB_Array *strPtrs, s32 n); static const PixelPos sPositionZero = {0, 0}; @@ -199,8 +199,8 @@ void sub_80A2E64(GroundBg *groundBg) r6 = groundBg->unk52C.unk0 * 16; for (i = 0; i < groundBg->unk52C.unk2; i++) { - RGB_Union str1 = {0}; - RGB_Union str2 = {0xFF, 0xFF, 0xFF, 0}; + RGB_Array str1 = {0}; + RGB_Array str2 = {0xFF, 0xFF, 0xFF, 0}; sub_8003810(r6++, str1); for (j = 0; j < 15; j++) { @@ -225,8 +225,8 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) const void *bmaData; const void *bplData; BmaHeader *bmaHeader; - RGB_Union str2; - RGB_Union str1; + RGB_Array str2; + RGB_Array str1; const RGB_Array *rgbPal; s32 unk0Id; s32 id; @@ -278,11 +278,11 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) rgbPal = bplData; r5 = groundBg->unk52C.unk0 * 16; - str2 = (RGB_Union) {0}; - str1.asArr.c[0] = 0xff; - str1.asArr.c[1] = 0xff; - str1.asArr.c[2] = 0xff; - str1.asArr.c[3] = 0; + str2 = (RGB_Array) {0}; + str1.c[0] = 0xff; + str1.c[1] = 0xff; + str1.c[2] = 0xff; + str1.c[3] = 0; for (i = 0; i < bplHeader->numPalettes && i < groundBg->unk52C.unk2; i++) { sub_8003810(r5++, str2); sub_809971C(r5, rgbPal, 15); @@ -474,21 +474,21 @@ void sub_80A3440(GroundBg *groundBg, s32 mapFileId_, const DungeonLocation *dung groundBg->bplHeader.hasPalAnimations = FALSE; if (groundBg->unk43C != NULL) { s32 i, j; - const RGB_Union *strPtr = groundBg->unk43C->data; + const RGB_Array *strPtr = groundBg->unk43C->data; u16 r7 = 0; - RGB_Union str0 = {0}; - RGB_Union str1; + RGB_Array str0 = {0}; + RGB_Array str1; - str1.asArr.c[0] = 0xff; - str1.asArr.c[1] = 0xff; - str1.asArr.c[2] = 0xff; - str1.asArr.c[3] = 0; + str1.c[0] = 0xff; + str1.c[1] = 0xff; + str1.c[2] = 0xff; + str1.c[3] = 0; for (i = 0; i < 12 && i < groundBg->unk52C.unk2; i++) { sub_8003810(r7++, str0); strPtr++; for (j = 0; j < 15; j++) { - RGB_Union str2 = {strPtr->asArr.c[0], strPtr->asArr.c[1], strPtr->asArr.c[2], strPtr->asArr.c[3]}; + RGB_Array str2 = {strPtr->c[0], strPtr->c[1], strPtr->c[2], strPtr->c[3]}; sub_8003810(r7++, str2); strPtr++; } @@ -1360,7 +1360,7 @@ void sub_80A4764(GroundBg *groundBg) } if (sub0Ptr->unk8 != NULL) { - RGB_Union empty = {0}; + RGB_Array empty = {0}; sub_8003810(r6, empty); sub_809971C(r6 + 1, sub0Ptr->unk8, 15); sub0Ptr->unk8 += 60; @@ -1376,7 +1376,7 @@ void sub_80A4764(GroundBg *groundBg) s32 r6 = 160; for (i = 0; i < 32; i++, unkE0Ptr++, r6++) { - RGB_Union color; + RGB_Array color; if (sub_8004D14(unkE0Ptr, 1) && !sub_8004D40(unkE0Ptr, 1) && --unkE0Ptr->unk6 <= 0) { unkE0Ptr->unk6 = unkE0Ptr->unk4; @@ -1384,7 +1384,7 @@ void sub_80A4764(GroundBg *groundBg) unkE0Ptr->unkC = unkE0Ptr->unk8; } unkE0Ptr->unk14 = *unkE0Ptr->unkC++; - color = (RGB_Union) {unkE0Ptr->unk14.r, unkE0Ptr->unk14.g, unkE0Ptr->unk14.b, unkE0Ptr->unk14.unk4}; + color = (RGB_Array) {unkE0Ptr->unk14.r, unkE0Ptr->unk14.g, unkE0Ptr->unk14.b, unkE0Ptr->unk14.unk4}; sub_8003810(r6, color); } } diff --git a/src/ground_main.c b/src/ground_main.c index 63bc905ec..093c5c70f 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -33,6 +33,7 @@ #include "code_809D148.h" #include "adventure_info.h" #include "palette_util.h" +#include "code_800558C.h" EWRAM_DATA u32 gUnknown_20398A8 = {0}; EWRAM_DATA s32 gUnknown_20398AC = {0}; @@ -59,8 +60,6 @@ extern void nullsub_106(); extern void sub_80A73EC(); extern void sub_8095494(DungeonMailSeed *param_1, u8 index); -extern u16 gUnknown_2026E4E; - // TODO: Move these externs to headers extern s16 sub_80A2654(s16 r0); extern bool8 sub_80048BC(void); @@ -76,7 +75,6 @@ extern void sub_80060EC(void); extern void sub_809977C(void); extern void UpdateFadeInTile(s32); extern void sub_8001D88(void); -extern void sub_8005838(s32, s32); static s16 sub_8098FCC(u32 unused); @@ -271,7 +269,7 @@ u32 xxx_script_related_8098468(s32 param_1) GroundMap_ExecuteEvent(0x66,0); } GroundMap_Action(); - sub_8005838(0,0); + sub_8005838(NULL,0); sub_80060EC(); xxx_call_update_bg_sound_input(); while ( 1 ) { diff --git a/src/random.c b/src/random.c index 9ee169816..fd2bf240e 100644 --- a/src/random.c +++ b/src/random.c @@ -46,4 +46,4 @@ void SetRNGSeed(s32 state) { sPRNGState = state; sPRNGState = Rand32Bit(); -} \ No newline at end of file +} From fbbaee3c7f6e116fe58521052881a4853cf40c61 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 18 Nov 2025 13:41:32 +0100 Subject: [PATCH 2/2] more externs --- include/code_800D090_1.h | 5 +++- include/code_803C1B4.h | 9 +++++++ include/friend_list.h | 1 + include/m4a.h | 4 ++-- include/mailbox.h | 5 ++-- include/pelipper_board.h | 3 +++ include/thank_you_wonder_mail.h | 2 ++ src/code_800D090_1.c | 42 ++++++++++++++++----------------- src/code_803C1B4.c | 2 +- src/code_80958E8.c | 3 +-- src/friend_rescue.c | 6 ++--- src/m4a.c | 3 ++- src/mailbox.c | 2 +- src/pelipper_board.c | 4 ++-- src/save.c | 4 +--- src/textbox.c | 6 ++--- src/thank_you_wonder_mail.c | 6 ++--- src/wonder_mail.c | 3 +-- src/wonder_mail_2.c | 4 +--- 19 files changed, 63 insertions(+), 51 deletions(-) create mode 100644 include/code_803C1B4.h diff --git a/include/code_800D090_1.h b/include/code_800D090_1.h index e35e3b4d9..1a5707a42 100644 --- a/include/code_800D090_1.h +++ b/include/code_800D090_1.h @@ -2,5 +2,8 @@ #define GUARD_CODE_800D090_1_H bool8 sub_800DAAC(void); +bool8 sub_800DAB0(u16 sector, u8* dest, s32 size); +bool8 sub_800DAB4(u16 sector, u8* src, s32 size); +bool8 sub_800DAB8(void); -#endif // GUARD_CODE_800D090_1_H \ No newline at end of file +#endif // GUARD_CODE_800D090_1_H diff --git a/include/code_803C1B4.h b/include/code_803C1B4.h new file mode 100644 index 000000000..62e2295ef --- /dev/null +++ b/include/code_803C1B4.h @@ -0,0 +1,9 @@ +#ifndef GUARD_CODE_803C1B4_H +#define GUARD_CODE_803C1B4_H + +#include "structs/str_dungeon_location.h" + +void sub_803C37C(DungeonLocation *location, u8 r1, u8 *itemReward); +u32 GetDungeonTeamRankPts(DungeonLocation *dungeon, u8 r1); + +#endif // GUARD_CODE_803C1B4_H diff --git a/include/friend_list.h b/include/friend_list.h index b65491433..8b6c7e8e9 100644 --- a/include/friend_list.h +++ b/include/friend_list.h @@ -26,6 +26,7 @@ u32 FriendList_HandleInput(bool8); s32 FriendList_GetCurrId(void); void sub_8023B7C(bool8 addCursor); void FriendList_Free(void); +struct unkStruct_3001B60 *FriendList_GetPtr(void); void FriendList_ShowWindow(void); bool8 sub_8024108(s32); diff --git a/include/m4a.h b/include/m4a.h index 0bc7988ff..ac4caba7d 100644 --- a/include/m4a.h +++ b/include/m4a.h @@ -13,7 +13,7 @@ void m4aSongNumStartOrChange(u16 n); void m4aSongNumStop(u16 n); void m4aMPlayAllStop(void); void m4aMPlayContinue(struct MusicPlayerInfo *mplayInfo); -void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u32 speed); +void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayImmInit(struct MusicPlayerInfo *mplayInfo); @@ -21,7 +21,7 @@ void m4aMPlayStop(struct MusicPlayerInfo *mplayInfo); void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); void m4aSoundVSync(void); -extern struct MusicPlayerInfo gMPlayInfo_BGM; // BGM?? +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_Fanfare; extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; diff --git a/include/mailbox.h b/include/mailbox.h index 138537de5..44b89edda 100644 --- a/include/mailbox.h +++ b/include/mailbox.h @@ -1,5 +1,5 @@ #ifndef GUARD_MAILBOX_H -#define GUARD_MAILBOX_H +#define GUARD_MAILBOX_H #include "structs/menu.h" #include "structs/str_text.h" @@ -22,7 +22,8 @@ struct unkStruct_203B304 WindowTemplates unk10C; }; -extern void SetMailboxState(u32); +u8 sub_802DFB0(void); +void SetMailboxState(u32); enum MailBoxStates { diff --git a/include/pelipper_board.h b/include/pelipper_board.h index b1f31c58e..a33221a7d 100644 --- a/include/pelipper_board.h +++ b/include/pelipper_board.h @@ -41,4 +41,7 @@ enum PelipperBoardActions PELIPPER_BOARD_ACCEPT, PELIPPER_BOARD_INFO, }; + +bool8 sub_802E864(void); + #endif // GUARD_PELIPPER_BOARD_H diff --git a/include/thank_you_wonder_mail.h b/include/thank_you_wonder_mail.h index 5898cccad..4dea1d84f 100644 --- a/include/thank_you_wonder_mail.h +++ b/include/thank_you_wonder_mail.h @@ -33,4 +33,6 @@ typedef struct WonderMailStruct_203B2C4 unkStruct_802F204 unk53C; } WonderMailStruct_203B2C4; +bool8 CreateThankYouMailPelipper(void); + #endif // GUARD_THANK_YOU_WONDER_MAIL_H diff --git a/src/code_800D090_1.c b/src/code_800D090_1.c index 9e900775e..ba5124666 100644 --- a/src/code_800D090_1.c +++ b/src/code_800D090_1.c @@ -1,46 +1,46 @@ #include "global.h" #include "code_800D090_1.h" -void nullsub_189(void) +UNUSED static void nullsub_189(void) {} -void nullsub_190(void) +UNUSED static void nullsub_190(void) {} -void nullsub_191(void) +UNUSED static void nullsub_191(void) {} -void nullsub_192(void) +UNUSED static void nullsub_192(void) {} -void nullsub_193(void) +UNUSED static void nullsub_193(void) {} -void nullsub_194(void) +UNUSED static void nullsub_194(void) {} -void nullsub_195(void) +UNUSED static void nullsub_195(void) {} -u32 sub_800DA94(void) { +UNUSED static u32 sub_800DA94(void) { return 0; } -u32 sub_800DA98(void) { +UNUSED static u32 sub_800DA98(void) { return 0; } -u32 sub_800DA9C(void) { +UNUSED static u32 sub_800DA9C(void) { return 0; } -void nullsub_196(void) +UNUSED static void nullsub_196(void) {} -void nullsub_197(void) +UNUSED static void nullsub_197(void) {} -void nullsub_198(void) +UNUSED static void nullsub_198(void) {} bool8 sub_800DAAC(void) @@ -48,18 +48,18 @@ bool8 sub_800DAAC(void) return FALSE; } -u32 sub_800DAB0(void) { - return 0; +bool8 sub_800DAB0(u16 sector, u8* dest, s32 size) { + return FALSE; } -u32 sub_800DAB4(void) { - return 0; +bool8 sub_800DAB4(u16 sector, u8* src, s32 size) { + return FALSE; } -u32 sub_800DAB8(void) { - return 0; +bool8 sub_800DAB8(void) { + return FALSE; } -u32 sub_800DABC(void) { - return 0; +UNUSED static bool8 sub_800DABC(void) { + return FALSE; } diff --git a/src/code_803C1B4.c b/src/code_803C1B4.c index a24dbb409..0fe615b57 100644 --- a/src/code_803C1B4.c +++ b/src/code_803C1B4.c @@ -1,4 +1,5 @@ #include "global.h" +#include "code_803C1B4.h" #include "structs/str_wonder_mail.h" #include "dungeon_info.h" #include "event_flag.h" @@ -6,7 +7,6 @@ extern u8 *gMissionRankText[]; extern s32 gUnknown_80E80A0[]; -void sub_803C37C(DungeonLocation *, u8, u8 *); s32 sub_803C1B4(DungeonLocation *dungeon, u8 missionType) { diff --git a/src/code_80958E8.c b/src/code_80958E8.c index c0baa86fa..4185a68b2 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -17,8 +17,7 @@ #include "pokemon_mail.h" #include "event_flag.h" #include "rescue_team_info.h" - -extern void sub_803C37C(struct DungeonLocation *, u8, u8 *); +#include "code_803C1B4.h" bool8 sub_8095E38(WonderMail *mail, u8 dungeon, u32 floor, u8 param_4); u8 sub_8095F28(u8 param_1); diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 7e53bc290..25d703b92 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -28,6 +28,7 @@ #include "wonder_mail_4.h" #include "wonder_mail_5.h" #include "naming_screen.h" +#include "code_803C1B4.h" extern void SetFriendRescueMenuState(u32); @@ -584,11 +585,8 @@ extern u32 sub_8039068(u32, u8 *passwordBuffer, unkStruct_203B480 *r0); extern void sub_8031E10(void); extern u8 sub_800D588(void); -extern u32 FriendList_GetPtr(void); extern bool8 sub_8031D70(u32 mailIndex, s32); -extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32); - u32 CreateFriendRescueMenu(void) { char *monName; @@ -1174,7 +1172,7 @@ void sub_8032828(void) CreateDialogueBoxAndPortrait(&gUnknown_80E2C48[0], 0, 0, 0x101); break; case 0x26: - if (FriendList_GetPtr() != 0) + if (FriendList_GetPtr() != NULL) FriendList_Free(); ResetUnusedInputStruct(); ShowWindows(NULL, TRUE, TRUE); diff --git a/src/m4a.c b/src/m4a.c index a6ec3fc20..64eef566a 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -1,4 +1,5 @@ #include "global.h" +#include "m4a.h" #include "gba/m4a_internal.h" extern const u8 gCgb3Vol[]; @@ -7,7 +8,7 @@ IWRAM_DATA ALIGNED(4) char SoundMainRAM_Buffer[0x400] = {0}; EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE4 = {0}; EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE5 = {0}; -EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_BGM = {0}; // BGM?? +EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_BGM = {0}; EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE6 = {0}; EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_Fanfare = {0}; EWRAM_DATA struct MusicPlayerInfo gMPlayInfo_SE1 = {0}; diff --git a/src/mailbox.c b/src/mailbox.c index 6d991ceae..c5afd52e6 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -82,7 +82,7 @@ void CreateMailboxMenu(void); void CreateMailActionMenu(void); void CreateMailAcceptedStatusBox(u32); -u32 sub_802DFB0(void) +u8 sub_802DFB0(void) { gUnknown_203B304 = MemoryAlloc(sizeof(struct unkStruct_203B304), 8); gUnknown_203B304->menuAction1 = 0; diff --git a/src/pelipper_board.c b/src/pelipper_board.c index e3d3bbb36..94125eee8 100644 --- a/src/pelipper_board.c +++ b/src/pelipper_board.c @@ -79,14 +79,14 @@ static void sub_802EC10(void); static void CreatePelipperAcceptedStatusBox(u32); static void SetPelipperBoardState(u32); -u32 sub_802E864(void) +bool8 sub_802E864(void) { gPelipperBoard = MemoryAlloc(sizeof(struct unkStruct_203B308), 8); gPelipperBoard->menuAction1 = 0; gPelipperBoard->menuAction2 = 0; gPelipperBoard->unk4 = 0; SetPelipperBoardState(INITIALIZE_PELIPPER_BOARD); - return 1; + return TRUE; } u32 sub_802E890(void) diff --git a/src/save.c b/src/save.c index 81a732a6f..b3f541dff 100644 --- a/src/save.c +++ b/src/save.c @@ -15,6 +15,7 @@ #include "adventure_save.h" #include "training_maze.h" #include "rescue_scenario.h" +#include "code_800D090_1.h" // size: 0x800 struct unk_struct @@ -38,9 +39,6 @@ ALIGNED(4) static const char fill_save0[] = _("pksdir0"); ALIGNED(4) static const char fill_save1[] = _("pksdir0"); ALIGNED(4) static const char fill_save2[] = _("pksdir0"); -extern bool8 sub_800DAB0(u16, u8*, s32); -extern bool8 sub_800DAB4(u16, u8*, s32); -extern bool8 sub_800DAB8(void); extern u32 sub_80954CC(void* a, s32 b); extern u32 sub_8095624(u8 *, u32); extern u32 RestoreMailInfo(void* a, s32 b); diff --git a/src/textbox.c b/src/textbox.c index 07cee1211..433da7dfd 100644 --- a/src/textbox.c +++ b/src/textbox.c @@ -48,8 +48,11 @@ #include "wonder_mail.h" #include "naming_screen.h" #include "dungeon_list_menu.h" +#include "thank_you_wonder_mail.h" #include "game_options.h" +#include "pelipper_board.h" #include "script_item.h" +#include "mailbox.h" #include "structs/menu.h" #include "structs/str_file_system.h" #include "structs/str_mon_portrait.h" @@ -139,9 +142,6 @@ u32 sub_802E90C(); void sub_802E918(); u32 sub_80282DC(u8 *r0); void sub_80282FC(void); -extern u8 CreateThankYouMailPelipper(void); -extern u8 sub_802E864(void); -extern u8 sub_802DFB0(void); extern void CleanThankYouMailPelipper(void); extern void CleanHelperPelipper(void); extern void sub_802E06C(void); diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index 40b7731f9..9d8d72a20 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -25,6 +25,7 @@ #include "wonder_mail_4.h" #include "wonder_mail_5.h" #include "naming_screen.h" +#include "code_803C1B4.h" static EWRAM_INIT WonderMailStruct_203B2C4 *sUnknown_203B2C4 = {NULL}; @@ -216,14 +217,13 @@ extern void sub_802A850(); extern void sub_8031E10(); extern void SetThankYouMailMenuState(u32); extern u8 sub_800D588(void); -extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32); extern void sub_8031D70(u8, u32); extern void sub_8011C28(u32); extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0); -u32 CreateThankYouMailPelipper(void) +bool8 CreateThankYouMailPelipper(void) { char *monName; OpenedFile *faceFile; @@ -270,7 +270,7 @@ u32 CreateThankYouMailPelipper(void) SetThankYouMailMenuState(THANK_YOU_MAIL_MAIN_MENU); } sUnknown_203B2C4->fallbackState = 0x2b; - return 1; + return TRUE; } u32 ThankYouMailPelipperCallback(void) diff --git a/src/wonder_mail.c b/src/wonder_mail.c index 1b2527b66..9f2a84130 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -40,7 +40,6 @@ extern void sub_8031E10(); extern void sub_8031E00(); extern void sub_8031E10(void); extern void sub_8031D70(u8, u32); -extern u32 FriendList_GetPtr(void); extern void sub_8030F58(u32); extern void sub_8029B34(void); extern void sub_8029AD8(void); @@ -454,7 +453,7 @@ void sub_8028348(void) CreateDialogueBoxAndPortrait(gUnknown_80DDCBC, 0, 0,0x101); break; case SELECT_HELPER_POKEMON: - if(FriendList_GetPtr() == 0) + if (FriendList_GetPtr() == NULL) { ResetUnusedInputStruct(); ShowWindows(NULL, TRUE, TRUE); diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index 06a519edf..e9c7e81e8 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -19,6 +19,7 @@ #include "string_format.h" #include "text_1.h" #include "ground_main.h" +#include "code_803C1B4.h" struct unkStruct_203B2C8 { @@ -48,9 +49,6 @@ extern void sub_802B5B8(void); extern void sub_802B5FC(void); extern void sub_802B624(void); -extern void sub_803C37C(DungeonLocation *, u32, u8 *); -extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32); - ALIGNED(4) const char gRescueTeamNamePlaceholder[] = "????"; ALIGNED(4) const char gUnknown_80DF9F8[] = _(