From edb1db5bc410951637e2ec3063a823660085acd8 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:24:28 -0400 Subject: [PATCH] Stuff --- asm/code_800DAC0.s | 3 +++ asm/code_8041AD0.s | 8 +++++++ asm/code_80848F0.s | 2 ++ data/data_80F4468.s | 16 +++++++++----- data/data_80F59C8.s | 8 ++++--- include/axdata.h | 2 +- include/dungeon_pokemon_sprites.h | 2 +- include/structs/str_dungeon.h | 5 +++-- src/code_80118A4.c | 6 ++++-- src/code_8041AD0.c | 36 +++++++++++++++---------------- src/code_80428A0.c | 16 +++++++------- src/code_8044CC8.c | 4 ++-- src/code_80521D0.c | 6 +++--- src/code_8057824_1.c | 4 ++-- src/code_8069E0C.c | 8 +++---- src/code_80718D8.c | 4 ++-- src/code_8072B78.c | 4 ++-- src/dungeon_items.c | 4 ++-- src/status.c | 6 +++--- src/status_actions.c | 4 ++-- src/trap.c | 8 +++---- 21 files changed, 90 insertions(+), 66 deletions(-) diff --git a/asm/code_800DAC0.s b/asm/code_800DAC0.s index 958a5a452..1ce672a62 100644 --- a/asm/code_800DAC0.s +++ b/asm/code_800DAC0.s @@ -1700,6 +1700,7 @@ _0800E994: _0800E9A4: .4byte gUnknown_203B0CC thumb_func_end sub_800E970 +@ https://decomp.me/scratch/K8Xny (kermalis 100%) `bool8 sub_800E9A8(s32)` thumb_func_start sub_800E9A8 sub_800E9A8: push {lr} @@ -3880,6 +3881,7 @@ _0800F950: _0800F954: .4byte gDungeonPokemonSprites thumb_func_end DeletePokemonDungeonSprite +@ https://decomp.me/scratch/0YVWD (kermalis 100%) `void sub_800F958(s32 dungeonSpriteID, Position *pos, Position *statusOffsets, u32 a3)` thumb_func_start sub_800F958 sub_800F958: push {r4-r7,lr} @@ -6556,6 +6558,7 @@ _08010EE8: .4byte 0x00004dd6 _08010EEC: .4byte 0x00004a30 thumb_func_end sub_8010DA4 +@ https://decomp.me/scratch/xe9WG (kermalis 100%) `void sub_8010EF0(void)` thumb_func_start sub_8010EF0 sub_8010EF0: push {r4,lr} diff --git a/asm/code_8041AD0.s b/asm/code_8041AD0.s index dbdd7a4ba..8e842f258 100644 --- a/asm/code_8041AD0.s +++ b/asm/code_8041AD0.s @@ -356,6 +356,7 @@ _08042518: bx r0 thumb_func_end sub_804245C +@ https://decomp.me/scratch/nTem0 (kermalis 89.31%) `s32 sub_8042520(Entity *)` thumb_func_start sub_8042520 sub_8042520: push {r4-r7,lr} @@ -527,6 +528,8 @@ _08042668: bx r1 thumb_func_end sub_8042520 +@ This func plays the appropriate ascend/descend SFX for stairs depending on the direction +@ https://decomp.me/scratch/Soyeh (kermalis 100%) `void sub_804267C(void)` thumb_func_start sub_804267C sub_804267C: push {r4,lr} @@ -565,6 +568,7 @@ _080426C0: .4byte 0x00000644 _080426C4: .4byte 0x00000155 thumb_func_end sub_804267C +@ https://decomp.me/scratch/vilX5 (kermalis 100%) `void sub_80426C8(u32, u32)` thumb_func_start sub_80426C8 sub_80426C8: push {r4,r5,lr} @@ -616,6 +620,7 @@ _08042712: bx r0 thumb_func_end sub_80426C8 +@ https://decomp.me/scratch/AJFhQ (kermalis 100%) `void sub_8042730(Entity *, void *)` thumb_func_start sub_8042730 sub_8042730: push {r4,r5,lr} @@ -648,6 +653,7 @@ _08042760: bx r0 thumb_func_end sub_8042730 +@ https://decomp.me/scratch/2oNpD (kermalis 100%) `bool8 sub_8042768(Entity *)` thumb_func_start sub_8042768 sub_8042768: push {lr} @@ -687,6 +693,7 @@ _080427A6: bx r1 thumb_func_end sub_8042768 +@ https://decomp.me/scratch/uuAnf (kermalis 100%) `void sub_80427AC(void)` thumb_func_start sub_80427AC sub_80427AC: push {r4-r6,lr} @@ -739,6 +746,7 @@ _08042810: .4byte gAvailablePokemonNames _08042814: .4byte gPtrFeralFoundItemMessage thumb_func_end sub_80427AC +@ https://decomp.me/scratch/hzCAZ (kermalis 100%) `void sub_8042818(u8 a0, bool8 a1)` thumb_func_start sub_8042818 sub_8042818: push {r4-r7,lr} diff --git a/asm/code_80848F0.s b/asm/code_80848F0.s index 61632dfa1..03ea894cd 100644 --- a/asm/code_80848F0.s +++ b/asm/code_80848F0.s @@ -5,6 +5,7 @@ .text +@ https://decomp.me/scratch/67fVt (kermalis 92.38%) thumb_func_start sub_808529C sub_808529C: push {lr} @@ -136,6 +137,7 @@ _08085370: bx r1 thumb_func_end sub_808529C +@ https://decomp.me/scratch/verq3 (kermalis 97.1%) thumb_func_start sub_8085374 sub_8085374: push {r4-r7,lr} diff --git a/data/data_80F4468.s b/data/data_80F4468.s index 260e81480..71072e5da 100644 --- a/data/data_80F4468.s +++ b/data/data_80F4468.s @@ -2,7 +2,7 @@ .global gUnknown_80F4468 gUnknown_80F4468: @ 80F4468 - @ replacing .incbin "baserom.gba", 0x000f4468, 0x130 + @ Position[76] .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00 .byte 0x01, 0x00, 0x01, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0xff, 0xff .byte 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00 @@ -16,7 +16,7 @@ gUnknown_80F4468: @ 80F4468 .global gUnknown_80F4598 gUnknown_80F4598: @ 80F4598 - @ replacing .incbin "baserom.gba", 0x000f4598, 0x72c + @ Position[158] .byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x00, 0x00 .byte 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xff, 0xff .byte 0xfe, 0xff, 0x01, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x01, 0x00 @@ -37,8 +37,10 @@ gUnknown_80F4598: @ 80F4598 .byte 0x02, 0x00, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00 .byte 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 .byte 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x63, 0x00, 0x63, 0x00 + .global gUnknown_80F4810 - gUnknown_80F4810: +gUnknown_80F4810: + @ Position[99] .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00 .byte 0x01, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, 0x02, 0x00, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00 .byte 0x01, 0x00, 0x04, 0x00, 0xff, 0xff, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0xfe, 0xff, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0xfd, 0xff, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x05, 0x00 @@ -53,8 +55,10 @@ gUnknown_80F4598: @ 80F4598 .byte 0x01, 0x00, 0x0a, 0x00, 0xff, 0xff, 0x0a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0xfe, 0xff, 0x0a, 0x00, 0x03, 0x00, 0x0a, 0x00, 0xfd, 0xff, 0x0a, 0x00, 0x04, 0x00, 0x0a, 0x00, 0xfc, 0xff, 0x0a, 0x00 .byte 0x05, 0x00, 0x0a, 0x00, 0xfb, 0xff, 0x0a, 0x00, 0x06, 0x00, 0x0a, 0x00, 0xfa, 0xff, 0x0a, 0x00, 0x07, 0x00, 0x0a, 0x00, 0xf9, 0xff, 0x0a, 0x00, 0x08, 0x00, 0x0a, 0x00, 0xf8, 0xff, 0x0a, 0x00 .byte 0x63, 0x00, 0x63, 0x00 + .global gUnknown_80F499C - gUnknown_80F499C: +gUnknown_80F499C: + @ Position[101] .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, 0x01, 0x00 .byte 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0xfe, 0xff, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0xfd, 0xff .byte 0x04, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0xff, 0xff, 0x05, 0x00, 0x01, 0x00, 0x05, 0x00, 0xfe, 0xff, 0x05, 0x00, 0x02, 0x00, 0x05, 0x00, 0xfd, 0xff, 0x05, 0x00, 0x03, 0x00 @@ -68,8 +72,10 @@ gUnknown_80F4598: @ 80F4598 .byte 0x09, 0x00, 0xf8, 0xff, 0x09, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, 0x0a, 0x00, 0x01, 0x00, 0x0a, 0x00, 0xfe, 0xff, 0x0a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0xfd, 0xff .byte 0x0a, 0x00, 0x03, 0x00, 0x0a, 0x00, 0xfc, 0xff, 0x0a, 0x00, 0x04, 0x00, 0x0a, 0x00, 0xfb, 0xff, 0x0a, 0x00, 0x05, 0x00, 0x0a, 0x00, 0xfa, 0xff, 0x0a, 0x00, 0x06, 0x00, 0x0a, 0x00, 0xf9, 0xff .byte 0x0a, 0x00, 0x07, 0x00, 0x0a, 0x00, 0xf8, 0xff, 0x0a, 0x00, 0x08, 0x00, 0x0a, 0x00, 0xf7, 0xff, 0x0a, 0x00, 0x09, 0x00, 0x63, 0x00, 0x63, 0x00 + .global gUnknown_80F4B30 - gUnknown_80F4B30: +gUnknown_80F4B30: + @ Position[101] .byte 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00 .byte 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00 .byte 0x04, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x04, 0x00 diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s index c2d9677fa..7c67b13c1 100644 --- a/data/data_80F59C8.s +++ b/data/data_80F59C8.s @@ -797,29 +797,31 @@ gStatusSpriteMasks_MuzzledStatus: @ 80F67D4 .global gUnknown_80F67DC gUnknown_80F67DC: @ 80F67DC +@ u16[4]. They are sound effect IDs .byte 0xD8, 0x00, 0xD9, 0x00 .byte 0xD9, 0x00, 0x73, 0x01 .global gUnknown_80F67E4 gUnknown_80F67E4: @ 80F67E4 +@ u16[4]. They are sound effect IDs .byte 0xDA, 0x00, 0xDB, 0x00 .byte 0xDB, 0x00, 0x74, 0x01 .global gUnknown_80F67EC gUnknown_80F67EC: @ 80F67EC -@ replacing .incbin "baserom.gba", 0xF67EC, 0x20 +@ s32[8] .byte 0xff, 0xff, 0xff, 0xff, 0x4b, 0x01, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff .byte 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x00, 0x00 .global gUnknown_80F680C gUnknown_80F680C: @ 80F680C -@ replacing .incbin "baserom.gba", 0xF680C, 0x20 +@ u32[8] .byte 0xff, 0xff, 0xff, 0xff, 0x4b, 0x01, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff .byte 0xb8, 0x01, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x00, 0x00 .global gUnknown_80F682C gUnknown_80F682C: @ 80F682C -@ replacing .incbin "baserom.gba", 0xF682C, 0x10 +@ u16[8] .byte 0xe5, 0x03, 0xe5, 0x03, 0xe5, 0x03, 0xa9, 0x01, 0xe5, 0x03, 0xe5, 0x03, 0xaa, 0x01, 0xe5, 0x03 .global gUnknown_80F683C diff --git a/include/axdata.h b/include/axdata.h index f7b0309f8..05c9eb88f 100644 --- a/include/axdata.h +++ b/include/axdata.h @@ -80,7 +80,7 @@ typedef struct axmain struct axPokemon { /* 0x0 */ axdata axdata; - /* 0x3C */ OpenedFile *spriteFile; + /* 0x3C */ OpenedFile *spriteFile; // This might be a unkStruct_202EE8C instead and unkStruct_202EE8C.unk0 might be a OpenedFile* etc. See sub_8010F28 u16 unk40_maybeAnimTimer; u8 unk42_animId1; u8 unk43_animId2; diff --git a/include/dungeon_pokemon_sprites.h b/include/dungeon_pokemon_sprites.h index 79fbcc670..781c8af1b 100644 --- a/include/dungeon_pokemon_sprites.h +++ b/include/dungeon_pokemon_sprites.h @@ -34,7 +34,7 @@ typedef struct DungeonPokemonSprite typedef struct DungeonPokemonSprites { /* 0x0 */ u32 frame; - /* 0x4 */ struct DungeonPokemonSprites sprites[22]; + /* 0x4 */ DungeonPokemonSprite sprites[22]; } DungeonPokemonSprites; extern DungeonPokemonSprites *gDungeonPokemonSprites; diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index beb041540..126ae203f 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -133,8 +133,9 @@ typedef struct Dungeon u8 fill698; u8 unk699; u8 fill69A[0x69C - 0x69A]; - /* 0x69C */ EntityInfo unk69C[4]; - u8 fillEBC[0x363C - 0xEBC]; + EntityInfo unk69C[4]; + EntityInfo unkEBC[1]; // Unsure about the size... See sub_8082A08() + u8 fill10C4[0x363C - 0x10C4]; /* 0x363C */ u8 expYieldRankings[NUM_MONSTERS]; u8 fill37D9[0x37F0 - 0x37D9]; /* 0x37F0 */ u32 unk37F0; diff --git a/src/code_80118A4.c b/src/code_80118A4.c index 475acf55e..c8a994aae 100644 --- a/src/code_80118A4.c +++ b/src/code_80118A4.c @@ -15,12 +15,14 @@ #include "game_options.h" #include "sprite.h" #include "event_flag.h" +#include "file_system.h" // size: 0x4DD8 struct UnkBgStruct { - u8 padding[0x4c4b]; - /* 0x4C4C */ unkStruct_202EE8C unk4C4C[16]; + OpenedFile *unk0[5]; + u8 padding[0x4C4C - 0x14]; + unkStruct_202EE8C unk4C4C[16]; u32 unk4DCC; u32 unk4DD0; /* 0x4DD4 */ s16 xoffset; diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 935e46f66..c972f9f1e 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -9,6 +9,7 @@ #include "dungeon_util.h" #include "items.h" +// size: 0xC struct unkStruct_80420E8 { u32 unk0; @@ -16,6 +17,7 @@ struct unkStruct_80420E8 u32 unk8; }; +// size: 0x1C typedef struct unkStruct_80416E0 { s32 unk0; @@ -47,7 +49,7 @@ extern u32 gStatusSpriteMasks_MuzzledStatus[]; extern void sub_803ED30(u8, Entity *pokemon, u8, u8); extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2); -extern u8 sub_8042768(Entity *pokemon); +extern bool8 sub_8042768(Entity *pokemon); extern u32 sub_806F62C(u32); extern void PlaySoundEffect(u32); extern u8 sub_803F428(Position *pos); @@ -67,13 +69,13 @@ extern void sub_8042E98(void); extern void sub_803E46C(u32); extern void sub_800EE5C(u32); extern void sub_800EF64(void); -extern u8 sub_800E9A8(u32); +extern bool8 sub_800E9A8(s32); extern u32 sub_800E890(unkStruct_80416E0 *); -u32 sub_8041764(unkStruct_80416E0 *param_1, u8 param_2); -s32 sub_80416E0(Position32 *pos, u32 param_2, u8 param_3); +u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2); +s32 sub_80416E0(Position32 *pos, u32 param_2, bool8 param_3); -s32 sub_80416A4(Position *pos_1, u32 param_2, u8 param_3) +s32 sub_80416A4(Position *pos_1, u32 param_2, bool8 param_3) { Position32 pos; @@ -82,7 +84,7 @@ s32 sub_80416A4(Position *pos_1, u32 param_2, u8 param_3) return sub_80416E0(&pos, param_2, param_3); } -s32 sub_80416E0(Position32 *pos, u32 param_2, u8 param_3) +s32 sub_80416E0(Position32 *pos, u32 param_2, bool8 param_3) { int counter; s32 ret; @@ -101,10 +103,10 @@ s32 sub_80416E0(Position32 *pos, u32 param_2, u8 param_3) auStack_10.unk12 = 0; auStack_10.unk18 = 0xffff; sub_8004E8C(&auStack_18); - ret = sub_8041764(&auStack_10,0); - if (param_3 != 0) { + ret = sub_8041764(&auStack_10, FALSE); + if (param_3) { counter = 0; - while ((counter < 100 && (sub_800E9A8(ret) != 0))) { + while ((counter < 100 && (sub_800E9A8(ret)))) { sub_803E46C(0x42); counter++; } @@ -113,7 +115,7 @@ s32 sub_80416E0(Position32 *pos, u32 param_2, u8 param_3) return ret; } -u32 sub_8041764(unkStruct_80416E0 *param_1, u8 param_2) +u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2) { sub_800EE5C(param_1->unk0); sub_800EF64(); @@ -519,11 +521,10 @@ void nullsub_81(void) void sub_8041D5C(Entity *pokemon) { - if(sub_8042768(pokemon) == 0) - { + if (!sub_8042768(pokemon)) return; - } - sub_803ED30(pokemon->info->stockpileStage, pokemon, 1, 0xB); + + sub_803ED30(pokemon->info->stockpileStage, pokemon, 1, 11); } void sub_8041D84(Entity *pokemon) @@ -874,7 +875,7 @@ void sub_804218C(Entity *pokemon, Entity *target) void sub_804219C(Position32 *pos) { - sub_80416E0(pos, 0x90, 1); + sub_80416E0(pos, 0x90, TRUE); } void sub_80421AC(Entity *pokemon, Entity * target) @@ -884,10 +885,9 @@ void sub_80421AC(Entity *pokemon, Entity * target) void sub_80421C0(Entity *pokemon, u16 r1) { - if(pokemon == NULL) + if (pokemon == NULL) PlaySoundEffect(r1); - else - if(sub_8042768(pokemon) != 0) + else if (sub_8042768(pokemon)) PlaySoundEffect(r1); } diff --git a/src/code_80428A0.c b/src/code_80428A0.c index 6d605ee95..86d85ec50 100644 --- a/src/code_80428A0.c +++ b/src/code_80428A0.c @@ -4,9 +4,9 @@ extern void sub_804151C(Entity *r0, u32 r1, u8 r2); extern void sub_803E708(u32 r0, u32 r1); -extern void sub_80416A4(Position *r0, u32 r1, u32 r2); +extern void sub_80416A4(Position *r0, u32 r1, bool8 r2); extern void sub_80421C0(Entity *r0, u16 r1); -extern u8 sub_8042768(Entity *pokemon); +extern bool8 sub_8042768(Entity *pokemon); extern void sub_804178C(u32); extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2); extern void sub_803E46C(u32); @@ -111,13 +111,13 @@ void sub_80429E8(Entity *r0) void sub_80429FC(Position *r0) { - sub_80416A4(r0, 0xCF << 1, 1); + sub_80416A4(r0, 0x19E, TRUE); sub_80421C0(NULL, 0xD4); } void sub_8042A14(Position *r0) { - sub_80416A4(r0, 0x36, 1); + sub_80416A4(r0, 0x36, TRUE); } void sub_8042A24(Entity *r0) @@ -127,7 +127,7 @@ void sub_8042A24(Entity *r0) void sub_8042A34(Position *r0) { - sub_80416A4(r0, 0x9F << 1, 0); + sub_80416A4(r0, 0x13E, FALSE); } void sub_8042A44(Entity *r0) @@ -137,12 +137,12 @@ void sub_8042A44(Entity *r0) void sub_8042A54(Position *r0) { - sub_80416A4(r0, 0x37, 1); + sub_80416A4(r0, 0x37, TRUE); } void sub_8042A64(Position *r0) { - sub_80416A4(r0, 0x29, 1); + sub_80416A4(r0, 0x29, TRUE); } void sub_8042A74(Entity *r0) @@ -160,7 +160,7 @@ void sub_8042A84(s16 param_1, Entity *entity, u32 param_3) param_1_s16 = param_1; r6 = 0x200; - if (sub_8042768(entity) != 0) { + if (sub_8042768(entity)) { sub_804151C(entity,param_1_s16,0); sub_803E708(param_3,0x42); do { diff --git a/src/code_8044CC8.c b/src/code_8044CC8.c index 1c8d3b1d2..4123af9d2 100644 --- a/src/code_8044CC8.c +++ b/src/code_8044CC8.c @@ -21,7 +21,7 @@ extern s32 gUnknown_202EE6C; bool8 sub_80461C8(Position *, u32); void sub_80460F8(Position *, Item *, u32); extern u8 sub_8043D10(void); -extern u8 sub_8045888(Entity *); +extern bool8 sub_8045888(Entity *); struct unkStruct_202EE44 { @@ -240,7 +240,7 @@ bool8 IsNotAttacking(Entity *param_1, bool8 param_2) info = param_1->info; action = &(info->action).action; - if ((param_2 == 0) || (sub_8045888(param_1) != 0)) + if ((param_2 == 0) || (sub_8045888(param_1))) { if(*action == ACTION_NOTHING) return TRUE; diff --git a/src/code_80521D0.c b/src/code_80521D0.c index e88d78bde..4dc39762e 100644 --- a/src/code_80521D0.c +++ b/src/code_80521D0.c @@ -2,7 +2,7 @@ #include "code_80521D0.h" extern void sub_80526D0(u8 r0); -extern u8 sub_8045888(Entity *r0); +extern bool8 sub_8045888(Entity *r0); extern void sub_80523A8(Entity *r0, const char r1[], u8 r2); extern u8 sub_8052DC0(Entity *); extern u8 sub_803F428(Position *); @@ -14,14 +14,14 @@ void sub_805229C(void) void SendMessage(Entity *pokemon, const char message[]) { - if (sub_8045888(pokemon) != 0){ + if (sub_8045888(pokemon)){ sub_80523A8(pokemon, message, 1); } } void sub_80522C8(Entity *r0, const char r1[]) { - if (sub_8045888(r0) != 0){ + if (sub_8045888(r0)){ sub_80523A8(r0, r1, 0); } } diff --git a/src/code_8057824_1.c b/src/code_8057824_1.c index 62a41552b..78dfbb615 100644 --- a/src/code_8057824_1.c +++ b/src/code_8057824_1.c @@ -312,7 +312,7 @@ extern const u8 gUnknown_81058A8[]; extern const u8 gUnknown_81074FC[]; -extern u8 sub_800E9A8(u32); +extern bool8 sub_800E9A8(s32); extern void sub_800DC14(u32); extern void sub_8086A3C(Entity *r0); @@ -3803,7 +3803,7 @@ void JirachiWishGrantDialogue(Entity *jirachiEntity) uVar2 = sub_80861F8(0x68,jirachiEntity,0); // Taaaaaaaah! DisplayDungeonDialogue(gUnknown_81058C4); - if (sub_800E9A8(uVar2) != 0) { + if (sub_800E9A8(uVar2)) { sub_800DC14(uVar2); } sub_803E708(10,0x46); diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 685d44d5a..0d31920a5 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -37,7 +37,7 @@ extern void sub_8042900(Entity *r0); extern void sub_8042968(Entity *r0); extern void sub_806ABAC(Entity *, Entity *); void sub_8041BBC(Entity *r0); -extern u8 sub_8045888(Entity *); +extern bool8 sub_8045888(Entity *); extern void sub_806A2BC(Entity *, u8); extern void sub_804178C(u32); extern void sub_803F508(Entity *); @@ -245,7 +245,7 @@ void sub_806A1E8(Entity *pokemon) if (gGameOptionsRef->FarOffPals == '\0') { bVar3 = FALSE; } - if (bVar3 && (sub_8045888(pokemon) == '\0')) { + if (bVar3 && (!sub_8045888(pokemon))) { sub_806A2BC(pokemon,1); } } @@ -262,7 +262,7 @@ void sub_806A240(Entity *pokemon, Entity *target) entityInfo = pokemon->info; isNotTeamMember = (!entityInfo->isNotTeamMember); } - if (isNotTeamMember && (sub_8045888(pokemon) == '\0')) { + if (isNotTeamMember && (!sub_8045888(pokemon))) { sub_806A2BC(pokemon,1); return; } @@ -270,7 +270,7 @@ void sub_806A240(Entity *pokemon, Entity *target) entityInfo = target->info; isNotTeamMember = (!entityInfo->isNotTeamMember); } - if (isNotTeamMember && (sub_8045888(target) == '\0')) { + if (isNotTeamMember && (!sub_8045888(target))) { sub_806A2BC(target,1); } } diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 1ec5cae06..f233244ef 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -25,7 +25,7 @@ extern s16 gUnknown_80F4DAC; extern u8 *gUnknown_80FED68[]; extern void SetMessageArgument(char[], struct Entity*, u32); -extern void sub_806B7F8(struct unkStruct_806B7F8 *, u32); +extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); extern void sub_805239C(struct Entity *r0, const char r1[]); extern void sub_8042920(struct Entity *r0); extern s16 sub_803D970(u32); @@ -125,7 +125,7 @@ void sub_8071B48(void) local_2c.unk4 = 0; } local_2c.unk10 = 0; - sub_806B7F8(&local_2c, 0); + sub_806B7F8(&local_2c, FALSE); } } } diff --git a/src/code_8072B78.c b/src/code_8072B78.c index b3ee2bfc1..955c1aca2 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -26,7 +26,7 @@ struct unkStruct_806B7F8 u8 unk10; }; -extern void sub_806B7F8(struct unkStruct_806B7F8 *, u32); +extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); extern void sub_806BFC0(EntityInfo *, u32); void sub_8069E0C(Entity *pokemon); void sub_80522F4(Entity *r0, Entity *r1, const char r2[]); @@ -138,7 +138,7 @@ void sub_8072B78(Entity *pokemon, Entity *target, s16 id) local_2c.pos.y = gAdjacentTileOffsets[index].y + target->pos.y; local_2c.unk4 = 0; local_2c.unk10 = 0; - sub_806B7F8(&local_2c,1); + sub_806B7F8(&local_2c, TRUE); } } } diff --git a/src/dungeon_items.c b/src/dungeon_items.c index baab94f97..d24b4c009 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -21,7 +21,7 @@ extern s32 sub_8052B8C(u32, u8 *, u32); extern void sub_80861A8(void); extern void PrintFieldMessage(u32, u8 *, u32); extern void sub_803E708(u32, u32); -extern void sub_80416E0(Position32 *r0, u32, u32); +extern void sub_80416E0(Position32 *r0, u32, bool8); extern void SetMessageArgument(u8 *r0, Entity *r1, u32); extern void sub_80421C0(Entity *, u32); extern void sub_80855E4(void *); @@ -164,7 +164,7 @@ void MusicBoxCreation(void) sub_803E708(0x3c,0x41); PrintFieldMessage(0,*gUnknown_8105360,1); sub_80869E4(entity,4,10,0); - sub_80416E0(&entity->pixelPos,0x10c,0); + sub_80416E0(&entity->pixelPos,0x10c,FALSE); sub_80421C0(entity,0xd7); sub_803E708(0x3c,0x41); SetMessageArgument(gAvailablePokemonNames,entity,0); diff --git a/src/status.c b/src/status.c index dcbf5a560..d282df391 100644 --- a/src/status.c +++ b/src/status.c @@ -147,7 +147,7 @@ extern void sub_803F580(u32); extern void sub_8040A84(void); extern void sub_8041CA8(Entity *); extern void sub_8041C94(Entity *); -extern u8 sub_8045888(Entity *r0); +extern bool8 sub_8045888(Entity *r0); extern void sub_803ED30(s32, Entity *r0, u8, s32); extern void sub_8041BF8(Entity *); extern void sub_8041BE8(Entity *); @@ -685,13 +685,13 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo { r8 = 0; if (maxHPStat != 0) { - if (sub_8045888(target) != 0) { + if (sub_8045888(target)) { r8 = maxHPStat; } sub_80522F4(pokemon,target,*gUnknown_80FB240); // m0$'s max HP rose by {ARG_VALUE_1} } if (HP != 0) { - if (sub_8045888(target) != 0) { + if (sub_8045888(target)) { r8 = HP; } if (param_3 != 0) { diff --git a/src/status_actions.c b/src/status_actions.c index 907bb7621..02ba38bb0 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -57,7 +57,7 @@ extern void HandleLuminousOrbAction(Entity *pokemon); extern void sub_807D510(Entity *, Entity *); extern void sub_807DA14(Entity *, Entity *, s32); extern s16 sub_803D970(u32); -extern u8 sub_806AA0C(s32, u32); +extern bool8 sub_806AA0C(s32, u32); extern void sub_806BB6C(Entity *, s32); extern void sub_807E254(Entity *, Entity *, u32); extern u32 sub_8055640(Entity *, Entity *, Move *, u32, u32); @@ -935,7 +935,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ { for (r6 = 0; r6 < 0x1E; r6++) { targetID = sub_803D970(0); - if ((sub_806AA0C(targetID,0) != 0) && (oldID != targetID)) { + if ((sub_806AA0C(targetID,0)) && (oldID != targetID)) { if (GetBodySize(oldID) == GetBodySize(targetID)) break; } } diff --git a/src/trap.c b/src/trap.c index 355c8bf76..dd89627ff 100644 --- a/src/trap.c +++ b/src/trap.c @@ -59,13 +59,13 @@ struct unkStruct_806B7F8 struct Position pos; u8 unk10; }; -extern u32 sub_806B7F8(struct unkStruct_806B7F8 *, u32); +extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); void sub_806A9B4(Entity *, u32); void sub_8079E34(Entity *param_1, Entity *param_2, u32); s16 sub_803D970(u32); -u8 sub_806AA0C(s32, s32); +bool8 sub_806AA0C(s32, s32); void sub_80421EC(Position *, u32); bool8 sub_8045888(Entity *); @@ -617,14 +617,14 @@ void HandleSummonTrap(Entity *pokemon,Position *pos) species = sub_803D970(0); direction &= DIRECTION_MASK; stack.species = species; - if (sub_806AA0C(stack.species,0) != 0) { + if (sub_806AA0C(stack.species,0)) { stack.level = 0; stack.unk2 = 0; stack.pos.x = pos->x + gAdjacentTileOffsets[direction].x; stack.pos.y = pos->y + gAdjacentTileOffsets[direction].y; stack.unk4 = 0; stack.unk10 = 0; - if (sub_806B7F8(&stack,1) != 0) { + if (sub_806B7F8(&stack, TRUE) != NULL) { pokemonSummonCount++; } }