From 955fac34cbd1e1bc4e67f99ab07d9bef6c6eba6d Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 9 Sep 2023 19:53:10 -0400 Subject: [PATCH] I DID IT --- include/adventure_log.h | 2 +- include/bg_palette_buffer.h | 6 +-- include/code_800558C.h | 4 +- include/code_801AFA4.h | 2 +- include/code_801B60C.h | 2 +- include/code_801C620.h | 6 +-- include/code_801EE10.h | 2 +- include/code_801EE10_1.h | 2 +- include/code_801EE10_mid.h | 4 +- include/code_803B050.h | 2 +- include/code_805D8C8.h | 4 +- include/code_806CD90.h | 22 ++++----- include/code_80869E4.h | 19 ++++---- include/code_8092334.h | 11 +++-- include/code_8094F88.h | 16 +++---- include/code_80972F4.h | 4 +- include/code_8098BDC.h | 1 + include/code_80A26CC.h | 16 +++---- include/debug.h | 8 ++-- include/decompress.h | 10 ++-- include/dungeon.h | 14 +++--- include/dungeon_leader.h | 4 +- include/file_system.h | 12 ++--- include/game_options.h | 39 ++++++++------- include/ground_map_1.h | 4 +- include/ground_script.h | 2 +- include/gulpin_shop_801FB50.h | 2 +- include/items.h | 10 ++-- include/kecleon_bros2.h | 2 +- include/kecleon_bros3.h | 4 +- include/kecleon_bros4.h | 4 +- include/makuhita_dojo1.h | 2 +- include/moves.h | 90 +++++++++++++++++------------------ include/pokemon.h | 8 ++-- include/pokemon_mid.h | 2 +- include/post_office_guide1.h | 2 +- include/post_office_guide2.h | 2 +- include/quick_save_read.h | 2 +- include/save.h | 2 +- include/save_write.h | 2 +- include/wonder_mail_3.h | 2 +- src/bg_palette_buffer.c | 8 ++-- src/code_800558C.c | 4 +- src/code_8057824_1.c | 2 +- src/code_805D8C8.c | 2 +- src/code_80869E4.c | 2 +- src/dungeon_leader.c | 5 +- src/items.c | 2 +- src/kecleon_bros1.c | 10 ++-- src/kecleon_bros2.c | 4 +- src/kecleon_bros3.c | 6 +-- src/moves.c | 16 +++---- 52 files changed, 209 insertions(+), 206 deletions(-) diff --git a/include/adventure_log.h b/include/adventure_log.h index 60577f053..adc46347b 100644 --- a/include/adventure_log.h +++ b/include/adventure_log.h @@ -15,7 +15,7 @@ typedef struct AdventureLog } AdventureLog; void CleanAdventureLogScreen(void); -bool8 CreateAdventureLogScreen(u32); +bool8 CreateAdventureLogScreen(u32 kind); u32 HandleAdventureLogInput(u8); #endif // GUARD_ADVENTURE_LOG_H \ No newline at end of file diff --git a/include/bg_palette_buffer.h b/include/bg_palette_buffer.h index f9992fb06..2173fdcab 100644 --- a/include/bg_palette_buffer.h +++ b/include/bg_palette_buffer.h @@ -2,8 +2,8 @@ #define GUARD_BG_PALETTE_BUFFER_H void InitBGPaletteBuffer(void); -void nullsub_4(s32, u8 *, s32, u8 *); -void SetBGPaletteBufferColorArray(s32, u8 *); -void SetBGPaletteBufferColorRGB(s32, u8 *, s32, u8 *); +void nullsub_4(s32 index, u8 *colorArray, s32, u8 *); +void SetBGPaletteBufferColorArray(s32 index, u8 *colorArray); +void SetBGPaletteBufferColorRGB(s32 index, u8 *colorArray, s32, u8 *); #endif // GUARD_BG_PALETTE_BUFFER_H \ No newline at end of file diff --git a/include/code_800558C.h b/include/code_800558C.h index 78b2b3954..e10e7a450 100644 --- a/include/code_800558C.h +++ b/include/code_800558C.h @@ -21,9 +21,9 @@ void nullsub_12(void); void nullsub_13(void); void nullsub_14(void); void sub_8005610(OpenedFile *, s32, s32, u8 *); -void sub_8005770(s32, u8 *, s32, u8 *); +void sub_8005770(s32, u8 *colorArray, s32, u8 *); void sub_80057E8(void); -void sub_8005838(s32 *, u8); +void sub_8005838(s32 *, u8 kind); void sub_80060EC(void); #endif // GUARD_CODE_800558C_H \ No newline at end of file diff --git a/include/code_801AFA4.h b/include/code_801AFA4.h index 46f892013..91ae271db 100644 --- a/include/code_801AFA4.h +++ b/include/code_801AFA4.h @@ -22,7 +22,7 @@ typedef struct unkStruct_203B22C /* 0x64 */ MenuItem menuItems[8]; } unkStruct_203B22C; -bool8 sub_801AFA4(u32); +bool8 sub_801AFA4(u32 index); u32 sub_801B00C(void); void sub_801B048(void); diff --git a/include/code_801B60C.h b/include/code_801B60C.h index 0127b1023..78920cea8 100644 --- a/include/code_801B60C.h +++ b/include/code_801B60C.h @@ -23,7 +23,7 @@ typedef struct unkStruct_203B234 UnkTextStruct2 unkF4[4]; } unkStruct_203B234; -bool8 sub_801B60C(u32, u8, u8); +bool8 sub_801B60C(u32, u8 id, u8 quantity); u32 sub_801B6AC(void); void sub_801B72C(void); diff --git a/include/code_801C620.h b/include/code_801C620.h index 797b00e31..99060bddd 100644 --- a/include/code_801C620.h +++ b/include/code_801C620.h @@ -3,11 +3,11 @@ #include "text.h" -bool8 sub_801BEEC(s16); +bool8 sub_801BEEC(s16 species); u32 sub_801BF48(void); void sub_801BF98(void); bool8 sub_801C8C4(s32, s32, UnkTextStruct2_sub *, u32); -extern u32 sub_801CA08(bool8); +u32 sub_801CA08(bool8); u8 sub_801CB24(void); void sub_801CB5C(bool8); void sub_801CBB8(void); @@ -16,6 +16,6 @@ bool8 sub_801CF14(s32); bool8 sub_801CF50(s32); void sub_801CF94(void); s32 sub_801CFB8(void); -u32 sub_801CFE0(u8); +u32 sub_801CFE0(u8 index); #endif // GUARD_CODE_801C620_H \ No newline at end of file diff --git a/include/code_801EE10.h b/include/code_801EE10.h index f7c2526ad..ec613bf49 100644 --- a/include/code_801EE10.h +++ b/include/code_801EE10.h @@ -26,7 +26,7 @@ typedef struct unkStruct_203B270 const u8 *text; } unkStruct_203B270; -u8 sub_801EE10(u32, s16, Move *, u32, const u8 *, u32); +u8 sub_801EE10(u32, s16 species, Move *moves, u32, const u8 *text, u32); // code_801EE10.s extern u32 sub_801EF38(u32); diff --git a/include/code_801EE10_1.h b/include/code_801EE10_1.h index f3bc754d7..3aee11c67 100644 --- a/include/code_801EE10_1.h +++ b/include/code_801EE10_1.h @@ -1,7 +1,7 @@ #ifndef GUARD_CODE_801EE10_1_H #define GUARD_CODE_801EE10_1_H -bool8 sub_8024458(s16, s32); +bool8 sub_8024458(s16 speciesNum, s32); void sub_802453C(void); // code_801EE10_1.s diff --git a/include/code_801EE10_mid.h b/include/code_801EE10_mid.h index c92f5661a..ef3d3eb6e 100644 --- a/include/code_801EE10_mid.h +++ b/include/code_801EE10_mid.h @@ -1,13 +1,13 @@ #ifndef GUARD_CODE_801EE10_MID_H #define GUARD_CODE_801EE10_MID_H -bool8 sub_801F428(s16, s32); +bool8 sub_801F428(s16 index, s32); u32 sub_801F520(u8); u16 sub_801F5B4(void); void sub_801F5F0(bool8); void sub_801F63C(void); void sub_801F700(void); -bool8 sub_801F808(u16 *); +bool8 sub_801F808(u16 *moveIDs); u32 sub_801F890(void); void sub_801F8D0(void); diff --git a/include/code_803B050.h b/include/code_803B050.h index 6e0c8e021..be065c35f 100644 --- a/include/code_803B050.h +++ b/include/code_803B050.h @@ -18,6 +18,6 @@ typedef struct unkStruct_80E9F8C /* 0x8 */ u8 *text2; } unkStruct_80E9F8C; -void sub_803B6B0(s32, s32, u8, u32); +void sub_803B6B0(s32 x, s32 y, u8 index, u32); #endif // GUARD_CODE_803B050_H \ No newline at end of file diff --git a/include/code_805D8C8.h b/include/code_805D8C8.h index f3ede26b4..7a4d93f87 100644 --- a/include/code_805D8C8.h +++ b/include/code_805D8C8.h @@ -7,7 +7,7 @@ void CloseAllSpriteFiles(void); void sub_8068768(void); void sub_80687AC(void); -extern OpenedFile *sub_80687D0(s16); -void sub_8068838(s16, bool32); +OpenedFile *sub_80687D0(s16 species); +void sub_8068838(s16 id, bool32); #endif // GUARD_CODE_805D8C8_H \ No newline at end of file diff --git a/include/code_806CD90.h b/include/code_806CD90.h index 72d30dd87..3a172ea7b 100644 --- a/include/code_806CD90.h +++ b/include/code_806CD90.h @@ -5,18 +5,18 @@ void sub_806CC10(void); void sub_806CC70(void); -void sub_806CCB4(Entity *, u8); +void sub_806CCB4(Entity *entity, u8); void sub_806CD90(void); -void sub_806CDD4(Entity *, u8, u32); -void sub_806CDFC(Entity *, u8, u32); -void sub_806CE34(Entity *, u32); -void sub_806CE68(Entity *, u32); -void sub_806CE94(Entity *, u32); -u8 sub_806CEBC(Entity *); -void sub_806CEFC(Entity *, u32); -void sub_806CF18(Entity *); -u8 sub_806CF54(Entity *); +void sub_806CDD4(Entity *entity, u8, u32); +void sub_806CDFC(Entity *entity, u8, u32); +void sub_806CE34(Entity *entity, u32 newDir); +void sub_806CE68(Entity *entity, u32 newDir); +void sub_806CE94(Entity *entity, u32 newDir); +u8 sub_806CEBC(Entity *entity); +void sub_806CEFC(Entity *entity, u32 newDir); +void sub_806CF18(Entity *entity); +u8 sub_806CF54(Entity *entity); void sub_806CF60(void); -u32 sub_806CF98(Entity *); +u32 sub_806CF98(Entity *entity); #endif // GUARD_CODE_806CD90_H \ No newline at end of file diff --git a/include/code_80869E4.h b/include/code_80869E4.h index 4c7dd7587..3aad7eed3 100644 --- a/include/code_80869E4.h +++ b/include/code_80869E4.h @@ -3,7 +3,8 @@ #include "dungeon_entity.h" -struct unkStruct_202F3D0 +// size: 0x8 +typedef struct unkStruct_202F3D0 { u8 unk0; u8 unk1; @@ -11,10 +12,10 @@ struct unkStruct_202F3D0 u8 unk3; u8 unk4; u8 unk5; -}; +} unkStruct_202F3D0; -void SpriteLookAroundEffect(Entity *); -void SpriteShockEffect(Entity *); +void SpriteLookAroundEffect(Entity *entity); +void SpriteShockEffect(Entity *entity); void sub_8086448(void); void sub_8086500(void); @@ -23,18 +24,18 @@ void sub_8086598(void); void sub_80865E8(void); void sub_808663C(void); void sub_8086690(void); -void sub_80866C4(const u8 *); +void sub_80866C4(const u8 *dialogue); void sub_8086738(void); void sub_8086764(void); void sub_8086794(void); void sub_80867F4(void); void sub_808680C(void); void sub_808682C(void); -void sub_8086838(u8, u8, u8); -void sub_8086848(u8, u8); +void sub_8086838(u8 entity, u8, u8); +void sub_8086848(u8 entity, u8); void sub_8086854(void); -void sub_80868F4(Entity *); -void sub_8086910(Entity *); +void sub_80868F4(Entity *entity); +void sub_8086910(Entity *entity); void sub_808692C(void); void sub_80869E4(Entity *, s32, u8, s8); diff --git a/include/code_8092334.h b/include/code_8092334.h index 0bcfb6d94..b07336fbb 100644 --- a/include/code_8092334.h +++ b/include/code_8092334.h @@ -10,11 +10,12 @@ typedef struct unkStruct_8094924 u32 unkC; } unkStruct_8094924; -void xxx_init_struct_8094924_save_809486C(unkStruct_8094924 *, u8 *, s32); void nullsub_102(unkStruct_8094924 *); -void SaveIntegerBits(unkStruct_8094924 *, void *, s32); -void xxx_init_struct_8094924_restore_809485C(unkStruct_8094924 *, u8 *, s32); -void sub_80948E4(unkStruct_8094924 *, u8 *, s32); -void RestoreIntegerBits(unkStruct_8094924 *, void *, s32); +void RestoreIntegerBits(unkStruct_8094924 *, void *, s32 size); +void SaveIntegerBits(unkStruct_8094924 *, void *, s32 size); +void xxx_init_struct_8094924_restore_809485C(unkStruct_8094924 *, u8 *, s32 size); +void xxx_init_struct_8094924_save_809486C(unkStruct_8094924 *, u8 *, s32 size); + +void sub_80948E4(unkStruct_8094924 *, u8 *, s32 size); #endif // GUARD_CODE_8092334_H \ No newline at end of file diff --git a/include/code_8094F88.h b/include/code_8094F88.h index e4563104e..726599afc 100644 --- a/include/code_8094F88.h +++ b/include/code_8094F88.h @@ -62,18 +62,18 @@ void sub_8095118(void); s32 FindOpenMailSlot(void); bool8 sub_80951BC(unkStruct_203B480 *mail); bool8 sub_80951FC(unkStruct_203B480 *); -unkStruct_203B480 * GetMailatIndex(u8); -void DeleteMailAtIndex(u8); +unkStruct_203B480 * GetMailatIndex(u8 index); +void DeleteMailAtIndex(u8 index); void sub_8095274(u32); bool8 sub_8095298(s32); void sub_80952C4(void); -bool8 HasMail(u8, u32); -s32 CountMailType(u8); +bool8 HasMail(u8 mailType, u32); +s32 CountMailType(u8 mailType); u32 CountAllMail(void); s32 sub_8095374(void); -s32 GetMailIndex(u8, u32); -s32 GetFirstIndexofMailType(u8); -void sub_8095824(struct unkStruct_8094924 *, unkStruct_203B480 *); -void sub_8095774(struct unkStruct_8094924 *, unkStruct_203B480 *); +s32 GetMailIndex(u8 mailType, u32); +s32 GetFirstIndexofMailType(u8 mailType); +void sub_8095824(struct unkStruct_8094924 *a, unkStruct_203B480 *b); +void sub_8095774(struct unkStruct_8094924 *a, unkStruct_203B480 *b); #endif // GUARD_CODE_8094F88_H \ No newline at end of file diff --git a/include/code_80972F4.h b/include/code_80972F4.h index c589b0e4b..0df6cbe31 100644 --- a/include/code_80972F4.h +++ b/include/code_80972F4.h @@ -11,11 +11,11 @@ typedef struct MissionText u8 unk7; } MissionText; -const u8 *GetCurrentMissionText(s16); +const u8 *GetCurrentMissionText(s16 index); // TODO: this should probably be bool8 but can't get a match just yet bool32 IsMazeCompleted(s16 mazeIndex); -bool8 sub_8097504(s16); +bool8 sub_8097504(s16 mazeIndex); const u8 *sub_80975DC(u32); // These two are definitely bool8 but can't get them to match with it yet diff --git a/include/code_8098BDC.h b/include/code_8098BDC.h index 4bc9b8e06..1567849af 100644 --- a/include/code_8098BDC.h +++ b/include/code_8098BDC.h @@ -1,6 +1,7 @@ #ifndef GUARD_CODE_8098BDC_H #define GUARD_CODE_8098BDC_H +// code_8098DBC.s extern void sub_80993D8(void); extern void sub_80993E4(void); extern void sub_8099690(u32); diff --git a/include/code_80A26CC.h b/include/code_80A26CC.h index 788422a4f..6ece6742b 100644 --- a/include/code_80A26CC.h +++ b/include/code_80A26CC.h @@ -23,20 +23,20 @@ void sub_80A2558(s32, s16 *); void sub_80A2584(s16, s16); void sub_80A2598(s16, s16); u32 sub_80A25AC(u16); -const unkStruct_80A2608 *sub_80A2608(s16); -const unkStruct_80A2608 *sub_80A2620(s16); -s16 sub_80A2654(s16); +const unkStruct_80A2608 *sub_80A2608(s16 index); +const unkStruct_80A2608 *sub_80A2620(s16 index); +s16 sub_80A2654(s16 index); s16 sub_80A2668(u32); s16 sub_80A2688(u8); s16 sub_80A26B8(s16); s16 sub_80A26CC(s16); -u8 sub_80A270C(s16); -u8 sub_80A2728(s16); -u8 sub_80A2740(s32); +u8 sub_80A270C(s16 index); +u8 sub_80A2728(s16 index); +u8 sub_80A2740(s32 index); s16 sub_80A2750(s16); bool8 sub_80A27CC(s16); -bool8 sub_80A2824(u8); -bool8 sub_80A28F0(u8); +bool8 sub_80A2824(u8 index); +bool8 sub_80A28F0(u8 index); s32 sub_80A29B0(u8 *); const u8 *sub_80A2B18(s16); diff --git a/include/debug.h b/include/debug.h index e00485be4..3e71b7fa7 100644 --- a/include/debug.h +++ b/include/debug.h @@ -11,7 +11,7 @@ typedef struct DebugLocation /* 0x8 */ u8 *func; } DebugLocation; -void Log(u8, const u8 *, ...); +void Log(u8 num, const u8 *text, ...); void NDS_DebugInit(void); void nullsub_25(void); void nullsub_26(void); @@ -23,10 +23,10 @@ void nullsub_31(void); void nullsub_32(void); void nullsub_137(void); void nullsub_199(void); -void PrintFuncFileLine(u8 *, DebugLocation *, const u8 *); -void PrintMessageWithFuncFileLine(u8 *, DebugLocation *, const u8 *, ...); +void PrintFuncFileLine(u8 *buf, DebugLocation *loc, const u8 *prefix); +void PrintMessageWithFuncFileLine(u8 *buffer, DebugLocation *debug, const u8 *text, ...); void sub_8011B08(void); -void sub_8011B88(const u8 *, ...); +void sub_8011B88(const u8 *text, ...); u32 sub_8011BA4(void); u32 sub_8011BA8(void); const u8 *sub_8011BAC(void); diff --git a/include/decompress.h b/include/decompress.h index 306a01545..4a1956111 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -3,12 +3,12 @@ #include "file_system.h" -u32 DecompressAT(u8 *, s32, const u8 *); -u32 DecompressATFile(u8 *, s32, OpenedFile *); -u32 DecompressATGlobalFile(u32 *, s32, OpenedFile *); -u8 *GetSiroPtr(OpenedFile *); +u32 DecompressAT(u8 *result, s32 resultLength, const u8 *compressedData); +u32 DecompressATFile(u8 *result, s32 resultLength, OpenedFile *file); +u32 DecompressATGlobalFile(u32 *result, s32 resultLength, OpenedFile *file); +u8 *GetSiroPtr(OpenedFile *openedFile); void nullsub_16(void); -bool8 sub_800B2D4(char *, char *, s32); +bool8 sub_800B2D4(char *, char *, s32 length); #endif // GUARD_DECOMPRESS_H \ No newline at end of file diff --git a/include/dungeon.h b/include/dungeon.h index e22098d1c..f1ed51a9b 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -35,14 +35,16 @@ typedef struct DungeonDataEntry extern DungeonDataEntry gDungeons[]; extern DungeonName gDungeonNames[]; + +s32 GetDungeonFloorCount(u8 dungeon); const u8 *GetDungeonName1(u8 dungeon); -u32 sub_80908D8(DungeonLocation *dungeon); -u8 sub_8090910(DungeonLocation *dungeon, u32 param_2); -bool8 sub_809095C(u8 dungeon); u32 GetMaxItemsAllowed(u8 dungeon); s8 GetRescuesAllowed(u8 dungeon); bool8 HasCheckpoint(u8 dungeon); -s32 GetDungeonFloorCount(u8 dungeon); -void PrintYellowDungeonNametoBuffer(u8 *, DungeonLocation *); +void PrintYellowDungeonNametoBuffer(u8 *buffer, DungeonLocation *dungeonLocation); -#endif //GUARD_DUNGEON_H +u32 sub_80908D8(DungeonLocation *dungeon); +u8 sub_8090910(DungeonLocation *dungeon, u32 param_2); +bool8 sub_809095C(u8 dungeon); + +#endif // GUARD_DUNGEON_H \ No newline at end of file diff --git a/include/dungeon_leader.h b/include/dungeon_leader.h index 57c378e00..a7cdf8598 100644 --- a/include/dungeon_leader.h +++ b/include/dungeon_leader.h @@ -3,7 +3,7 @@ #include "dungeon_entity.h" -Entity* GetLeader(); +Entity* GetLeader(void); EntityInfo* GetLeaderInfo(void); -#endif +#endif // GUARD_DUNGEON_LEADER_H \ No newline at end of file diff --git a/include/file_system.h b/include/file_system.h index ab71482ac..2f41b630c 100644 --- a/include/file_system.h +++ b/include/file_system.h @@ -37,13 +37,13 @@ typedef struct UnkFileStruct /* 0x4 */ u32 unk4; } UnkFileStruct; -OpenedFile *Call_OpenFileAndGetFileDataPtr(const u8 *, const FileArchive *); -void CloseFile(OpenedFile *); -u8 *GetFileDataPtr(OpenedFile *, s32); +OpenedFile *Call_OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc); +void CloseFile(OpenedFile *openedFile); +u8 *GetFileDataPtr(OpenedFile *openedFile, s32 unused); void InitFileSystem(void); -OpenedFile *OpenFile(const u8 *, const FileArchive *); -OpenedFile *OpenFileAndGetFileDataPtr(const u8 *, const FileArchive *); +OpenedFile *OpenFile(const u8 *filename, const FileArchive *arc); +OpenedFile *OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc); -u32 sub_800A8F8(u32); +u32 sub_800A8F8(u32 value); #endif //GUARD_FILE_SYSTEM_H diff --git a/include/game_options.h b/include/game_options.h index bf4e22100..cae7a7638 100644 --- a/include/game_options.h +++ b/include/game_options.h @@ -1,23 +1,6 @@ #ifndef GUARD_GAME_OPTIONS_H #define GUARD_GAME_OPTIONS_H -typedef struct GameOptions -{ - // TODO: find where Controls/Touch Screen are in this structure in PMD Blue - - /* 0x0 */ u8 dungeonSpeed; - /* 0x1 */ u8 FarOffPals; - /* 0x2 */ bool8 damageTurn; - /* 0x3 */ bool8 gridEnable; - /* 0x4 */ u8 mapOption; - /* 0x5 */ u8 fill5[3]; - /* 0x8 */ u8 windowColor; - /* 0x9 */ u8 unk9; // maybe Controls? - /* 0xA */ u8 unkA; // maybe Touch Screen? - /* 0xB */ u8 playerGender; - /* 0xC */ u8 unkC; -} GameOptions; - enum DungeonSpeed { DUNGEON_SPEED_SLOW, @@ -59,10 +42,26 @@ enum windowColor NUM_WINDOW_COLORS, }; +typedef struct GameOptions +{ + // TODO: find where Controls/Touch Screen are in this structure in PMD Blue + + /* 0x0 */ u8 dungeonSpeed; + /* 0x1 */ u8 FarOffPals; + /* 0x2 */ bool8 damageTurn; + /* 0x3 */ bool8 gridEnable; + /* 0x4 */ u8 mapOption; + /* 0x5 */ u8 fill5[3]; + /* 0x8 */ u8 windowColor; + /* 0x9 */ u8 unk9; // maybe Controls? + /* 0xA */ u8 unkA; // maybe Touch Screen? + /* 0xB */ u8 playerGender; + /* 0xC */ u8 unkC; +} GameOptions; + void LoadGameOptions(void); GameOptions * GetGameOptions(void); void InitializeGameOptions(bool8 initializeGender); -bool8 GameOptionsNotChange(GameOptions *r0); +bool8 GameOptionsNotChange(GameOptions *); - -#endif +#endif // GUARD_GAME_OPTIONS_H \ No newline at end of file diff --git a/include/ground_map_1.h b/include/ground_map_1.h index 0607fc832..47ca59213 100644 --- a/include/ground_map_1.h +++ b/include/ground_map_1.h @@ -2,10 +2,10 @@ #define GUARD_GROUND_MAP_1_H void GroundMap_ExecuteEnter(s16); -void GroundMap_ExecuteEvent(s16, u32); +void GroundMap_ExecuteEvent(s16 scriptIndex, u32); void GroundMap_ExecuteStation(s16, s16, s8, u32); bool8 sub_80A4D2C(s16); -bool8 sub_80A4D48(s16); +bool8 sub_80A4D48(s16 index); #endif // GUARD_GROUND_MAP_1_H \ No newline at end of file diff --git a/include/ground_script.h b/include/ground_script.h index 941ef6405..f3090ad09 100644 --- a/include/ground_script.h +++ b/include/ground_script.h @@ -51,6 +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 *); +bool8 GroundScript_ExecutePP(GroundScript_ExecutePP_1 *, s32 *, GroundScript_ExecutePP_3 *, const DebugLocation *unused); #endif // GUARD_GROUND_SCRIPT_H \ No newline at end of file diff --git a/include/gulpin_shop_801FB50.h b/include/gulpin_shop_801FB50.h index 081235d48..68bc30ff6 100644 --- a/include/gulpin_shop_801FB50.h +++ b/include/gulpin_shop_801FB50.h @@ -44,7 +44,7 @@ typedef struct unkStruct_203B27C UnkTextStruct2 unk180[4]; } unkStruct_203B27C; -bool8 sub_801FB50(u32); +bool8 sub_801FB50(u32 mode); u32 sub_801FC40(void); void sub_801FD7C(void); diff --git a/include/items.h b/include/items.h index f081e7326..764025f98 100644 --- a/include/items.h +++ b/include/items.h @@ -109,7 +109,7 @@ u32 GetItemActionType(u8 id); u32 GetSpawnAmountRange(u8 id, u32 r1); u8 *GetItemDescription(u8 id); bool8 GetItemAIFlag(u8 id, u32 r1); -void BufferItemName(u8 *, u8, unkStruct_8090F58 *); +void BufferItemName(u8 *, u8 id, unkStruct_8090F58 *); void sub_8090E14(u8 *ext_buffer, Item *slot, unkStruct_8090F58 *); bool8 AddItemToInventory(const Item* slot); void ConvertMoneyItemToMoney(); @@ -148,15 +148,15 @@ void RestoreHeldItem(unkStruct_8094924 *, BulkItem *); void SaveHeldItem(unkStruct_8094924 *, BulkItem *); void RestoreItemSlot(unkStruct_8094924 *, Item *); void SaveItemSlot(unkStruct_8094924 *, Item *); -s32 RestoreTeamInventory(u8 *, u32); -s32 SaveTeamInventory(u8 *, u32); +s32 RestoreTeamInventory(u8 *, u32 size); +s32 SaveTeamInventory(u8 *, u32 size); -s32 sub_8090FEC(s32, u8 *, u8); -u32 sub_80913E0(Item *, u32, struct subStruct_203B240 **); +s32 sub_8090FEC(s32, u8 *strbuf, u8); +u32 sub_80913E0(Item *slot, u32, struct subStruct_203B240 **); #endif // GUARD_ITEMS_H \ No newline at end of file diff --git a/include/kecleon_bros2.h b/include/kecleon_bros2.h index 0c72df25d..ac806b8c8 100644 --- a/include/kecleon_bros2.h +++ b/include/kecleon_bros2.h @@ -15,7 +15,7 @@ typedef struct unkStruct_203B214 } unkStruct_203B214; bool8 sub_8019E40(u32); -u32 sub_8019EDC(u8); +u32 sub_8019EDC(bool8); u8 sub_8019FB0(void); void sub_8019FCC(bool8); void sub_801A010(void); diff --git a/include/kecleon_bros3.h b/include/kecleon_bros3.h index 797e7d555..8bfaf7218 100644 --- a/include/kecleon_bros3.h +++ b/include/kecleon_bros3.h @@ -15,9 +15,9 @@ typedef struct unkStruct_203B21C } unkStruct_203B21C; u8 sub_801A20C(u32); -u32 sub_801A2A8(u8); +u32 sub_801A2A8(bool8); u8 sub_801A37C(void); -void sub_801A398(u8); +void sub_801A398(bool8); void sub_801A3DC(void); void sub_801A4A4(void); diff --git a/include/kecleon_bros4.h b/include/kecleon_bros4.h index fcd754231..473169fac 100644 --- a/include/kecleon_bros4.h +++ b/include/kecleon_bros4.h @@ -27,7 +27,7 @@ void sub_801AD34(u32); bool8 sub_801ADA0(s32); void sub_801AE84(void); s32 sub_801AEA8(void); -s32 sub_801AED0(s32); -void sub_801AEE4(s32, s32); +s32 sub_801AED0(s32 index); +void sub_801AEE4(s32 index, s32 value); #endif // GUARD_KECLEON_BROS4_H \ No newline at end of file diff --git a/include/makuhita_dojo1.h b/include/makuhita_dojo1.h index 0e7d61f73..ea9495d1c 100644 --- a/include/makuhita_dojo1.h +++ b/include/makuhita_dojo1.h @@ -41,7 +41,7 @@ typedef struct MakuhitaDojoWork1 } MakuhitaDojoWork1; void MakuhitaDojo_Delete(void); -bool8 MakuhitaDojo_New(u32); +bool8 MakuhitaDojo_New(u32 mode); u32 sub_802FE58(void); s16 sub_802FED0(void); diff --git a/include/moves.h b/include/moves.h index c9e10b66c..9301f937b 100644 --- a/include/moves.h +++ b/include/moves.h @@ -22,71 +22,71 @@ typedef struct MoveDataFile } MoveDataFile; bool8 CanBeSnatched(u16 moveID); -void CopyAndResetMoves(Move *, Move *); -void CopyBareMoveData(Move *, Move *); +void CopyAndResetMoves(Move *destMoves, Move *srcMoves); +void CopyBareMoveData(Move *destMoves, Move *srcMoves); bool8 DoesMoveCharge(u16 move); bool8 FailsWhileMuzzled(u16 moveID); const u8 *GetHMTMMoves(s16 species); const u8 *GetLevelUpMoves(s16 species); -s32 GetLinkedSequence(s32, Move *, u16 *); +s32 GetLinkedSequence(s32 index, Move *moves, u16 *sequenceMoveIDs); s32 GetMoveAccuracyOrAIChance(Move *move, u32 accuracyType); -u8 GetMoveAIWeight(Move *); -s32 GetMoveBasePower(Move *); -u32 GetMoveBasePP(Move *); -u32 GetMoveCritChance(Move *); -u32 GetMoveMaxUpgradeLevel(Move *); -u32 GetMoveNumberOfChainedHits(Move *); +u8 GetMoveAIWeight(Move *move); +s32 GetMoveBasePower(Move *move); +u32 GetMoveBasePP(Move *move); +u32 GetMoveCritChance(Move *move); +u32 GetMoveMaxUpgradeLevel(Move *move); +u32 GetMoveNumberOfChainedHits(Move *move); s16 GetMoveTargetAndRange(Move *move, bool32 isAI); u8 *GetMoveUseText(u16 moveID); -u8 GetMoveType(Move *); +u8 GetMoveType(Move *move); void InitPokemonMove(Move *move, u16 moveID); void InitZeroedPPPokemonMove(Move *move, u16 moveID); -bool8 IsAnyMoveLinked(s32, Move *); +bool8 IsAnyMoveLinked(s32 unused, Move *moves); bool8 IsMoveEnabled(s32 index, Move *moves); bool8 IsMoveSet(s32 index, Move *moves); bool8 IsNextMoveLinked(s32 index, Move *moves); bool8 IsReflectedByMagicCoat(u16 moveID); -bool8 IsSoundMove(Move *); +bool8 IsSoundMove(Move *move); void LoadWazaParameters(void); -bool8 MoveCannotHitFrozen(Move *); -bool8 MoveIgnoresTaunted(Move *); -void RemoveLinkSequenceFromMoves8(Move *, s32); -void RestorePokemonMoves(struct unkStruct_8094924 *, Move *); -void SavePokemonMoves(struct unkStruct_8094924 *, Move *); +bool8 MoveCannotHitFrozen(Move *move); +bool8 MoveIgnoresTaunted(Move *move); +void RemoveLinkSequenceFromMoves8(Move *moves, s32 index); +void RestorePokemonMoves(struct unkStruct_8094924 *, Move *moveSet); +void SavePokemonMoves(struct unkStruct_8094924 *, Move *moveSet); bool8 ToggleMoveEnabled(s32 index, Move *moves); bool8 ToggleSetMove(s32 index, Move *moves); bool8 TryLinkMovesAfter(s32 index, Move *moves); -void unk_CopyMoves4To8(Move *, Move *); -void unk_CopyMoves4To8AndClearFlag2Unk4(Move *, Move *); -s32 unk_FindMoveEnabledForAIAfter4(Move *, s32); -s32 unk_FindMoveEnabledForAIAfter8(Move *, s32); -s32 unk_FindMoveEnabledForAIAfter8_v2(Move *, s32); -s32 unk_FindMoveEnabledForAIBefore8(Move *, s32); -s32 unk_FindMoveEnabledForAIBefore8_v2(Move *, s32); -void unk_FixLinkedMovesSetEnabled4(Move *); -void unk_FixLinkedMovesSetEnabled8(Move *); -void unk_FixLinkedMovesSetEnabled8_v2(Move *); -s32 unk_MoveIDPrintMoveDescription(s32, u16, s32, struct subStruct_203B240 **); -s32 unk_PrintMoveDescription(s32, Move *, s32, struct subStruct_203B240 **); -s32 unk_SetMoveToFirstInLinkedSequence4(Move *, s32); -s32 unk_SetMoveToFirstInLinkedSequence8_v2(Move *, s32); -s32 unk_SetMoveToLastInLinkedSequence4(Move *, s32); -s32 unk_SetMoveToLastInLinkedSequence8_v2(Move *, s32); +void unk_CopyMoves4To8(Move *destMoves, Move *srcMoves); +void unk_CopyMoves4To8AndClearFlag2Unk4(Move *destMoves, Move *srcMoves); +s32 unk_FindMoveEnabledForAIAfter4(Move *moves, s32 index); +s32 unk_FindMoveEnabledForAIAfter8(Move *moves, s32 index); +s32 unk_FindMoveEnabledForAIAfter8_v2(Move *moves, s32 index); +s32 unk_FindMoveEnabledForAIBefore8(Move *moves, s32 index); +s32 unk_FindMoveEnabledForAIBefore8_v2(Move *moves, s32 index); +void unk_FixLinkedMovesSetEnabled4(Move *moves); +void unk_FixLinkedMovesSetEnabled8(Move *moves); +void unk_FixLinkedMovesSetEnabled8_v2(Move *moves); +s32 unk_MoveIDPrintMoveDescription(s32, u16 moveID, s32, struct subStruct_203B240 **); +s32 unk_PrintMoveDescription(s32 x, Move *move, s32, struct subStruct_203B240 **); +s32 unk_SetMoveToFirstInLinkedSequence4(Move *moves, s32 index); +s32 unk_SetMoveToFirstInLinkedSequence8_v2(Move *moves, s32 index); +s32 unk_SetMoveToLastInLinkedSequence4(Move *moves, s32 index); +s32 unk_SetMoveToLastInLinkedSequence8_v2(Move *moves, s32 index); bool8 UnlinkMovesAfter(s32 index, Move *moves); void UnSetMove(s32 index, Move *moves); -u8 sub_809287C(Move *); -void sub_80928A0(u8 *, Move *, const unkStruct_80928C0 *); -void sub_80928C0(u8 *, Move *, const unkStruct_80928C0 *); -void sub_8092AA8(Move *, u16); -void sub_8092C84(u8 *, u16); -s32 sub_8092DB8(Move *, s32); -s32 sub_8092F4C(Move *, s32); -bool8 sub_8093318(s32, Move *); -bool8 sub_809333C(s32, Move *); -s32 sub_80935B8(Move *, s32); -void sub_8094060(Move *, Move *); +u8 sub_809287C(Move *move); +void sub_80928A0(u8 *buffer, Move *move, const unkStruct_80928C0 *); +void sub_80928C0(u8 *buffer, Move *move, const unkStruct_80928C0 *); +void sub_8092AA8(Move *move, u16 moveID); +void sub_8092C84(u8 *buffer, u16 moveID); +s32 sub_8092DB8(Move *moves, s32 index); +s32 sub_8092F4C(Move *moves, s32 index); +bool8 sub_8093318(s32, Move *moves); +bool8 sub_809333C(s32, Move *moves); +s32 sub_80935B8(Move *moves, s32 index); +void sub_8094060(Move *srcMoves, Move *destMoves); void sub_8094184(struct unkStruct_8094924 *, struct unkStruct_8094184 *); void sub_80941FC(struct unkStruct_8094924 *, struct unkStruct_8094184 *); -#endif // GUARD_MOVES_H +#endif // GUARD_MOVES_H \ No newline at end of file diff --git a/include/pokemon.h b/include/pokemon.h index bcd909324..dfa51fe6c 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -203,7 +203,7 @@ void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index); void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum); void sub_808D930(u8 *buffer, s32 index); void sub_808D9DC(u8 *buffer, PokemonStruct2 *, s32 colorNum); -void sub_808DA0C(u8 *, PokemonStruct2 *); +void sub_808DA0C(u8 *buffer, PokemonStruct2 *); void PeekPokemonItem(s16 index_, BulkItem* item); void GivePokemonItem(s16 index_, BulkItem* item); bool8 IsPokemonRenamed(PokemonStruct1* pokemon); @@ -240,11 +240,11 @@ OpenedFile *OpenPokemonDialogueSpriteFile(s16 index); OpenedFile *GetDialogueSpriteDataPtr(s16 index); s32 GetUnownIndex(s16 index); void sub_808E6F4(unkStruct_808E6F4 *); -s32 GetEvolutionSequence(PokemonStruct1 *, EvolveStage *); +s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *); void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32); -void SavePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *); +void SavePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *pokemon); void RestorePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *); -s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *); +s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon); // pokemon.s extern PokemonStruct1 *GetPlayerPokemonStruct(void); diff --git a/include/pokemon_mid.h b/include/pokemon_mid.h index aa858db9e..2e638ea81 100644 --- a/include/pokemon_mid.h +++ b/include/pokemon_mid.h @@ -3,7 +3,7 @@ #include "pokemon.h" -void PrintPokeNameToBuffer(u8 *, PokemonStruct1 *); +void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon); bool8 sub_808DA44(s32, u32); diff --git a/include/post_office_guide1.h b/include/post_office_guide1.h index 43122fca4..b80e89dbb 100644 --- a/include/post_office_guide1.h +++ b/include/post_office_guide1.h @@ -18,7 +18,7 @@ typedef struct PostOfficeWork } PostOfficeWork; void CleanHelperPelipper(void); -bool8 CreateHelperPelipperMenu(s16); +bool8 CreateHelperPelipperMenu(s16 speciesID); u32 HelperPelipperCallback(void); #endif // GUARD_POST_OFFICE_GUIDE1_H \ No newline at end of file diff --git a/include/post_office_guide2.h b/include/post_office_guide2.h index 62f03c9f3..06b1a6f46 100644 --- a/include/post_office_guide2.h +++ b/include/post_office_guide2.h @@ -15,7 +15,7 @@ typedef struct unkStruct_203B330 UnkTextStruct2 unk18[4]; } unkStruct_203B330; -bool8 sub_80319A4(u8, u8, s32); +bool8 sub_80319A4(u8, u8 dungeon, s32); u32 sub_80319F8(void); void sub_8031A3C(void); diff --git a/include/quick_save_read.h b/include/quick_save_read.h index a1a262a64..5d6c2bd7f 100644 --- a/include/quick_save_read.h +++ b/include/quick_save_read.h @@ -12,7 +12,7 @@ typedef struct QuickSaveRead void FinishQuickSaveRead(void); bool8 IsQuickSaveValid(void); -void PrepareQuickSaveRead(u8 *, u32); +void PrepareQuickSaveRead(u8 *dest, u32 size); bool8 ReadQuickSave(void); #endif // GUARD_QUICK_SAVE_READ_H \ No newline at end of file diff --git a/include/save.h b/include/save.h index 91c11b2c3..f351fccfe 100644 --- a/include/save.h +++ b/include/save.h @@ -98,7 +98,7 @@ u32 WriteSaveSector(s32 *a, u8 *src, s32 size); void CalculateChecksum(u8 *out, u32 size); bool8 ValidateChecksum(u8 *in, u32 size); -s32 sub_80121D4(s32 *, u8 *, s32); +s32 sub_80121D4(s32 *a, u8 *src, s32 size); u32 sub_80121E0(u32); #endif // GUARD_SAVE_H \ No newline at end of file diff --git a/include/save_write.h b/include/save_write.h index 4452ec63b..8fa8be3ef 100644 --- a/include/save_write.h +++ b/include/save_write.h @@ -22,7 +22,7 @@ typedef struct SavePakWrite void FinishWriteSavePak(void); u32 GetSavePakStatus(void); -void PrepareSavePakWrite(s16); +void PrepareSavePakWrite(s16 pokemonID); bool8 WriteSavePak(void); #endif // GUARD_SAVE_WRITE_H \ No newline at end of file diff --git a/include/wonder_mail_3.h b/include/wonder_mail_3.h index 592b0b477..9bc3bc55c 100644 --- a/include/wonder_mail_3.h +++ b/include/wonder_mail_3.h @@ -82,6 +82,6 @@ enum WonderMailRescueStates extern unkStruct_203B2F4 *gUnknown_203B2F4; extern unkStruct_203B2F8 *gUnknown_203B2F8; -u32 sub_802D098(unkSubStruct_203B2F8 *); +u32 sub_802D098(unkSubStruct_203B2F8 *mail); #endif // GUARD_WONDER_MAIL_3_H \ No newline at end of file diff --git a/src/bg_palette_buffer.c b/src/bg_palette_buffer.c index 78f6941d9..6cdc3c333 100644 --- a/src/bg_palette_buffer.c +++ b/src/bg_palette_buffer.c @@ -70,7 +70,7 @@ void InitBGPaletteBuffer(void) #ifndef NONMATCHING NAKED #endif -void SetBGPaletteBufferColorRGB(s32 index, u8 *RGBArray, s32 a1, u8 *a2) +void SetBGPaletteBufferColorRGB(s32 index, u8 *colorArray, s32 a1, u8 *a2) { #ifdef NONMATCHING if (a1 < 0) { @@ -81,11 +81,11 @@ void SetBGPaletteBufferColorRGB(s32 index, u8 *RGBArray, s32 a1, u8 *a2) } gBGPaletteUsed[index / 16] = 1; if (!a2) { - gBGPaletteBuffer[index] = ((RGBArray[2] * a1 / 256 & 0x1F) << 10) | ((RGBArray[1] * a1 / 256 & 0x1F) << 5) | (RGBArray[0] * a1 / 256 & 0x1F); + gBGPaletteBuffer[index] = ((colorArray[2] * a1 / 256 & 0x1F) << 10) | ((colorArray[1] * a1 / 256 & 0x1F) << 5) | (colorArray[0] * a1 / 256 & 0x1F); } else { - gBGPaletteBuffer[index] = ((a2[4 * RGBArray[2] + 2] * a1 / 256 & 0x1F) << 10) | ((a2[4 * RGBArray[1] + 1] * a1 / 256 & 0x1F) << 5) | (a2[4 * RGBArray[0]] * a1 / 256 & 0x1F); + gBGPaletteBuffer[index] = ((a2[4 * colorArray[2] + 2] * a1 / 256 & 0x1F) << 10) | ((a2[4 * colorArray[1] + 1] * a1 / 256 & 0x1F) << 5) | (a2[4 * colorArray[0]] * a1 / 256 & 0x1F); } #else asm_unified("\tpush {r4-r7,lr}\n" @@ -211,7 +211,7 @@ void SetBGPaletteBufferColor(s32 index, u16 *color) gBGPaletteBuffer[index] = *color; } -void nullsub_4(s32 index, u8 *RGBArray, s32 a1, u8 *a2) +void nullsub_4(s32 index, u8 *colorArray, s32 a1, u8 *a2) { } void nullsub_5(void) diff --git a/src/code_800558C.c b/src/code_800558C.c index cd5340232..922a8b21d 100644 --- a/src/code_800558C.c +++ b/src/code_800558C.c @@ -158,12 +158,12 @@ UNUSED static void sub_8005764(s32 a0, OpenedFile *file, s32 a2, u8 *a3) sub_8005770(a0, file->data, a2, a3); } -void sub_8005770(s32 param_1, u8 *RGBArray, s32 a1, u8 *a2) +void sub_8005770(s32 param_1, u8 *colorArray, s32 a1, u8 *a2) { s32 i; for (i = 0; i < 16; i++) - SetBGPaletteBufferColorRGB((param_1 + 0x10) * 0x10 + i, &RGBArray[i * 4], a1, a2); + SetBGPaletteBufferColorRGB((param_1 + 0x10) * 0x10 + i, &colorArray[i * 4], a1, a2); } // Maybe Position diff --git a/src/code_8057824_1.c b/src/code_8057824_1.c index 5d04f776b..b449246f4 100644 --- a/src/code_8057824_1.c +++ b/src/code_8057824_1.c @@ -7,6 +7,7 @@ #include "constants/weather.h" #include "dungeon_global_data.h" #include "dungeon_entity.h" +#include "dungeon_leader.h" #include "dungeon_map_access.h" #include "dungeon_music.h" #include "dungeon_random.h" @@ -385,7 +386,6 @@ extern u8 sub_80860A8(u32); extern void sub_8049ED4(); extern void sub_8052D44(s16 *, Entity *, Entity *); extern void SetMessageArgument(u8 *, Entity *, u32); -extern Entity *GetLeader(); extern void sub_80421C0(Entity *, u32); extern void sub_8046D20(); extern void sub_808B1CC(u8); diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index 1356d9263..5e22c7704 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -100,7 +100,7 @@ void sub_8068838(s16 id, bool32 a1) s32 id_s32 = id; bool8 param_2 = a1; - if (param_2 == 0 && + if (!param_2 && (id_s32 == MONSTER_DEOXYS_NORMAL || id_s32 == MONSTER_DEOXYS_ATTACK || id_s32 == MONSTER_DEOXYS_DEFENSE || id_s32 == MONSTER_DEOXYS_SPEED)) { sub_80688B0(); } diff --git a/src/code_80869E4.c b/src/code_80869E4.c index bdcb85c2c..027ec7546 100644 --- a/src/code_80869E4.c +++ b/src/code_80869E4.c @@ -11,7 +11,7 @@ // ??? extern u32 gUnknown_202EDC8; -EWRAM_DATA struct unkStruct_202F3D0 gUnknown_202F3D0; +EWRAM_DATA unkStruct_202F3D0 gUnknown_202F3D0 = {0}; // data_8107010.s extern u32 gUnknown_8107314[]; diff --git a/src/dungeon_leader.c b/src/dungeon_leader.c index 3f87b3ecb..0082bba4b 100644 --- a/src/dungeon_leader.c +++ b/src/dungeon_leader.c @@ -1,12 +1,11 @@ #include "global.h" -#include "dungeon_leader.h" - #include "dungeon_global_data.h" +#include "dungeon_leader.h" #include "dungeon_util.h" extern Entity *gLeaderPointer; -Entity* GetLeader() +Entity* GetLeader(void) { Entity *leader = gLeaderPointer; if (leader == NULL) diff --git a/src/items.c b/src/items.c index 537b54c0a..ed121b076 100644 --- a/src/items.c +++ b/src/items.c @@ -414,7 +414,7 @@ static void sub_8090F58(u8* a1, u8 *a2, Item *slot, struct unkStruct_8090F58* a4 } } -s32 sub_8090FEC(s32 a1, u8* strbuf, u8 a3) +s32 sub_8090FEC(s32 a1, u8 *strbuf, u8 a3) { s32 i, count; s32 cond = 0; diff --git a/src/kecleon_bros1.c b/src/kecleon_bros1.c index e7b99ac53..9954cf7e9 100644 --- a/src/kecleon_bros1.c +++ b/src/kecleon_bros1.c @@ -317,7 +317,7 @@ static void UpdateKecleonStoreDialogue(void) if (sKecleonBrosWork1->isKecleonItemShop) sub_8019FCC(TRUE); else - sub_801A398(1); + sub_801A398(TRUE); sub_801AD34(0); DrawTeamMoneyBox(1); @@ -685,9 +685,9 @@ static void sub_80199CC(void) BulkItem *item; if (sKecleonBrosWork1->isKecleonItemShop) - menuAction = sub_8019EDC(1); + menuAction = sub_8019EDC(TRUE); else - menuAction = sub_801A2A8(1); + menuAction = sub_801A2A8(TRUE); switch (menuAction) { case 3: @@ -771,9 +771,9 @@ static void sub_8019BBC(void) menuAction = 0; if (sKecleonBrosWork1->isKecleonItemShop) - sub_8019EDC(0); + sub_8019EDC(FALSE); else - sub_801A2A8(0); + sub_801A2A8(FALSE); if (sub_8012FD8(&sKecleonBrosWork1->menu) == 0 && (sub_8013114(&sKecleonBrosWork1->menu, &menuAction), menuAction != 1)) sKecleonBrosWork1->menuAction3 = menuAction; diff --git a/src/kecleon_bros2.c b/src/kecleon_bros2.c index ae50a2a8d..1aca68aaf 100644 --- a/src/kecleon_bros2.c +++ b/src/kecleon_bros2.c @@ -37,12 +37,12 @@ bool8 sub_8019E40(u32 r0) return TRUE; } -u32 sub_8019EDC(u8 r0) +u32 sub_8019EDC(bool8 r0) { Item slot; BulkItem *item; - if (r0 == 0) { + if (!r0) { sub_8013660(&gUnknown_203B214->input); return 0; } diff --git a/src/kecleon_bros3.c b/src/kecleon_bros3.c index 633619d52..eae57a0ae 100644 --- a/src/kecleon_bros3.c +++ b/src/kecleon_bros3.c @@ -37,12 +37,12 @@ u8 sub_801A20C(u32 r0) return TRUE; } -u32 sub_801A2A8(u8 r0) +u32 sub_801A2A8(bool8 r0) { Item slot; BulkItem *item; - if (r0 == 0) { + if (!r0) { sub_8013660(&gUnknown_203B21C->input); return 0; } @@ -80,7 +80,7 @@ u8 sub_801A37C(void) return (gUnknown_203B21C->input.unk1E * gUnknown_203B21C->input.unk1C) + gUnknown_203B21C->input.menuIndex; } -void sub_801A398(u8 r0) +void sub_801A398(bool8 r0) { ResetUnusedInputStruct(); sub_800641C(gUnknown_203B21C->unk3C, FALSE, FALSE); diff --git a/src/moves.c b/src/moves.c index b5e46ce2a..e690dc13f 100644 --- a/src/moves.c +++ b/src/moves.c @@ -727,30 +727,30 @@ bool8 IsMoveEnabled(s32 index, Move *moves) return FALSE; } -bool8 sub_8093318(s32 param_1, Move *src_struct) +bool8 sub_8093318(s32 param_1, Move *moves) { Move dest_struct[MAX_MON_MOVES * 2]; - MemoryCopy8((void *)dest_struct, (void *)src_struct, sizeof(Move) * MAX_MON_MOVES * 2); + MemoryCopy8((void *)dest_struct, (void *)moves, sizeof(Move) * MAX_MON_MOVES * 2); return TryLinkMovesAfter(param_1, dest_struct); } -bool8 sub_809333C(s32 param_1, Move *src_struct) +bool8 sub_809333C(s32 param_1, Move *moves) { Move dest_struct[MAX_MON_MOVES * 2]; - MemoryCopy8((void *)dest_struct, (void *)src_struct, sizeof(Move) * MAX_MON_MOVES * 2); + MemoryCopy8((void *)dest_struct, (void *)moves, sizeof(Move) * MAX_MON_MOVES * 2); return UnlinkMovesAfter(param_1, dest_struct); } -UNUSED static bool8 sub_8093360(s32 param_1, Move *src_struct) +UNUSED static bool8 sub_8093360(s32 param_1, Move *moves) { Move dest_struct[MAX_MON_MOVES * 2]; - MemoryCopy8((void *)dest_struct, (void *)src_struct, sizeof(Move) * MAX_MON_MOVES * 2); + MemoryCopy8((void *)dest_struct, (void *)moves, sizeof(Move) * MAX_MON_MOVES * 2); return sub_80933D8(param_1, dest_struct); } -UNUSED static bool8 IsMoveNotSet(s32 index, Move* struct_ptr) +UNUSED static bool8 IsMoveNotSet(s32 index, Move* moves) { - if (struct_ptr[index].moveFlags & MOVE_FLAG_SET) + if (moves[index].moveFlags & MOVE_FLAG_SET) return FALSE; return TRUE; }