From 7894c3a3e9906e579c41b1e997cfffecdc0b1b54 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 2 Dec 2025 10:23:38 -0500 Subject: [PATCH] "int" + "register" cleanup --- include/dungeon_action.h | 2 +- include/dungeon_damage.h | 2 +- include/dungeon_misc.h | 2 +- include/structs/str_ground_bg.h | 23 ++++++++++++----------- include/structs/str_stat_index.h | 2 +- include/trap.h | 6 +++--- src/blow_away.c | 16 ++++++++-------- src/code_801EE10.c | 4 ++-- src/code_801F428.c | 2 +- src/code_8031D70.c | 2 +- src/code_803B344.c | 4 ++-- src/code_803C1B4.c | 2 +- src/code_80958E8.c | 12 ++++++------ src/dungeon_8041AD0.c | 2 +- src/dungeon_action.c | 8 ++++---- src/dungeon_action_execution.c | 2 +- src/dungeon_cutscene.c | 2 +- src/dungeon_cutscene_articuno.c | 6 +++--- src/dungeon_cutscene_groudon.c | 2 +- src/dungeon_cutscene_mewtwo.c | 2 +- src/dungeon_cutscene_moltres.c | 2 +- src/dungeon_cutscene_zapdos.c | 2 +- src/dungeon_damage.c | 2 +- src/dungeon_entity_movement.c | 2 +- src/dungeon_info.c | 2 +- src/dungeon_item_action.c | 2 +- src/dungeon_items.c | 2 +- src/dungeon_jobs.c | 4 ++-- src/dungeon_leveling.c | 8 ++++---- src/dungeon_map_access.c | 6 +++--- src/dungeon_menu_items.c | 2 +- src/dungeon_misc.c | 8 ++++---- src/dungeon_mon_recruit.c | 6 +++--- src/dungeon_move_util.c | 4 ++-- src/dungeon_projectile_throw.c | 6 +++--- src/dungeon_tilemap.c | 4 ++-- src/effect_main.c | 2 +- src/effect_sub_1.c | 2 +- src/explosion.c | 6 +++--- src/expose_trap.c | 4 ++-- src/friend_area_action_menu.c | 4 ++-- src/friend_list_menu.c | 4 ++-- src/friend_rescue.c | 4 ++-- src/ground_bg.c | 32 ++++++++++++++++---------------- src/ground_lives.c | 2 +- src/ground_map.c | 8 ++++---- src/ground_object.c | 10 +++++----- src/kangaskhan_storage2.c | 2 +- src/mailbox.c | 2 +- src/mission_reward.c | 2 +- src/move_orb_actions_2.c | 4 ++-- src/move_orb_actions_3.c | 6 +++--- src/move_orb_actions_5.c | 4 ++-- src/move_orb_effects_2.c | 2 +- src/moves.c | 8 ++++---- src/pelipper_board.c | 2 +- src/save.c | 6 +++--- src/script_item.c | 4 ++-- src/text_util.c | 2 +- src/thank_you_wonder_mail.c | 6 +++--- src/trap.c | 24 ++++++++++++------------ src/weather.c | 2 +- 62 files changed, 160 insertions(+), 159 deletions(-) diff --git a/include/dungeon_action.h b/include/dungeon_action.h index 19b2ebb1f..f0b8b26a4 100644 --- a/include/dungeon_action.h +++ b/include/dungeon_action.h @@ -23,7 +23,7 @@ Item *sub_8044D90(Entity *entity, s32 index, s32 unused); Entity *sub_8044DA4(Entity *entity, s32 index); u16 sub_8044DC8(Item *param_1); void sub_8044DF0(Entity *entity, s32 index, u32 unused); -void sub_8044E24(Entity *entity,int index,u32 unused); +void sub_8044E24(Entity *entity,s32 index,u32 unused); const u8 *GetDungeonSubMenuItemString(s32 param_1); bool8 CanSubMenuItemBeChosen(s32 itemId); void AddActionToDungeonSubMenu(u16 actionId, u8 param_2); diff --git a/include/dungeon_damage.h b/include/dungeon_damage.h index 96598e315..65bb6864b 100644 --- a/include/dungeon_damage.h +++ b/include/dungeon_damage.h @@ -13,6 +13,6 @@ void sub_806F370_Async(Entity *pokemon, Entity *target, s32 dmg, s32 giveExp, bo void SetShopkeeperAggression(Entity *pokemon, Entity *target); void sub_806F480(Entity *pokemon, bool8 attackEnemies); u8 sub_806F4A4(Entity *pokemon, u8 type); -s32 sub_806F62C(int param_1); +s32 sub_806F62C(s32 param_1); #endif diff --git a/include/dungeon_misc.h b/include/dungeon_misc.h index 66eb306d2..bcffbe01c 100644 --- a/include/dungeon_misc.h +++ b/include/dungeon_misc.h @@ -37,7 +37,7 @@ void sub_8068F28(void); void sub_8068F80(void); void HandleFaint_Async(Entity *entity, s32 dungeonExitReason, Entity *param_3); void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4); -void sub_80695EC(Entity *param_1,int x,int y); +void sub_80695EC(Entity *param_1,s32 x,s32 y); Entity * sub_8069660(Entity *target); Entity * sub_80696A8(Entity *target); Entity * sub_80696FC(Entity *target); diff --git a/include/structs/str_ground_bg.h b/include/structs/str_ground_bg.h index 31658978f..5804080c2 100644 --- a/include/structs/str_ground_bg.h +++ b/include/structs/str_ground_bg.h @@ -63,23 +63,24 @@ typedef struct MapRender PixelPos bgRegOffsets; // Either bg2 or bg3 } MapRender; +// Size: 0xC typedef struct BmaHeader { // Map width/height that the camera in game will travel in tiles. Also the width/height of the collision and unknown data layers! For most maps (Map Width Chunks) * (Tiling Width) = (Map Width Camera). - u8 mapWidthTiles; - u8 mapHeightTiles; + /* 0x0 */ u8 mapWidthTiles; + /* 0x1 */ u8 mapHeightTiles; // Width/Height of chunks in tiles. Always 3, the value is ignored for these. - u8 tilingWidth; - u8 tilingHeight; + /* 0x2 */ u8 tilingWidth; + /* 0x3 */ u8 tilingHeight; // Map width/height in chunks. Also the width/height of the chunk mappings. - u8 mapWidthChunks; - u8 mapHeightChunks; + /* 0x4 */ u8 mapWidthChunks; + /* 0x5 */ u8 mapHeightChunks; - u16 numLayers; // Number of layers in this map. Must match BPC layer size. Allowed values are only 1 or 2. - u16 hasDataLayer; // Seems to be a boolean flag (0 or 1). If >0, the Unknown Data Layer exists. - u16 hasCollision; // Number of Collision layers. 0, 1 or 2. + /* 0x6 */ u16 numLayers; // Number of layers in this map. Must match BPC layer size. Allowed values are only 1 or 2. + /* 0x8 */ s16 hasDataLayer; // Seems to be a boolean flag (0 or 1). If >0, the Unknown Data Layer exists. + /* 0xA */ u16 hasCollision; // Number of Collision layers. 0, 1 or 2. } BmaHeader; // size: 0x18? @@ -95,7 +96,7 @@ typedef struct SubStruct_52C s16 unkE; // 0x53A s16 unk10; // 0x53C s16 unk12; // 0x53E - void (*unk14)(void *, const void *, BmaHeader *, s32); // TODO: fix void * to proper ptr types 0x540 + u8* (*unk14)(void *, const u8 *, BmaHeader *, s32); // TODO: fix void * to proper ptr types 0x540 } SubStruct_52C; typedef struct LayerSpecs @@ -144,7 +145,7 @@ typedef struct GroundBg BmaHeader bmaHeader; LayerSpecs layerSpecs; BplHeader bplHeader; - const void *unk468; + const u8 *decompressedBMAData; const AnimationSpecification *animationSpecifications; u8 unk470; u8 unk471; diff --git a/include/structs/str_stat_index.h b/include/structs/str_stat_index.h index 1f3fa8400..dad739314 100644 --- a/include/structs/str_stat_index.h +++ b/include/structs/str_stat_index.h @@ -9,7 +9,7 @@ // Needed to match in Blue/Sky. I wonder what was the reason for making it a struct as opposed to a simple int... typedef struct StatIndex { - int id; + s32 id; } StatIndex; #endif // GUARD_STR_STAT_INDEX_X diff --git a/include/trap.h b/include/trap.h index 87c0e59fe..dd15cf64e 100644 --- a/include/trap.h +++ b/include/trap.h @@ -10,10 +10,10 @@ void sub_807FC3C(DungeonPos *pos, u32 trapID, u32 param_3); bool8 CanLayTrap(DungeonPos *pos); bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3); bool8 sub_807FD84(Entity *entity); -bool8 sub_807FE04(DungeonPos *pos, char param_2); -bool8 sub_807FE44(DungeonPos *pos, char param_2); +bool8 sub_807FE04(DungeonPos *pos, u8 param_2); +bool8 sub_807FE44(DungeonPos *pos, u8 param_2); void GetTrapName(u8 *buffer, u8 trapIndex); -void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4); +void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, s32 param_3, u8 param_4); void HandleMudTrap(Entity *pokemon, Entity *target); void HandleStickyTrap(Entity *pokemon, Entity *target); void HandleGrimyTrap(Entity *pokemon, Entity *target); diff --git a/src/blow_away.c b/src/blow_away.c index ab5360b9c..1a733e2ea 100644 --- a/src/blow_away.c +++ b/src/blow_away.c @@ -143,16 +143,16 @@ void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction) void sub_807D068(Entity *pokemon, DungeonPos *pos) { - int pixelX; - int posY; - int pixelY; - int posX; - int counter; - int iVar8; + s32 pixelX; + s32 posY; + s32 pixelY; + s32 posX; + s32 counter; + s32 iVar8; s32 diff; PixelPos local_34; - int incrementX; - int incrementY; + s32 incrementX; + s32 incrementY; posX = X_POS_TO_PIXELPOS(pos->x); posY = Y_POS_TO_PIXELPOS(pos->y); diff --git a/src/code_801EE10.c b/src/code_801EE10.c index f15f72af5..be0af66af 100644 --- a/src/code_801EE10.c +++ b/src/code_801EE10.c @@ -272,7 +272,7 @@ void sub_801F214(void) void sub_801F280(bool8 param_1) { - int i; + s32 i; u8 buffer[20]; CallPrepareTextbox_8008C54(gUnknown_203B270->unk50); @@ -331,7 +331,7 @@ void sub_801F280(bool8 param_1) s32 sub_801F3F8(void) { Move *move; - int index; + s32 index; s32 counter; counter = 0; diff --git a/src/code_801F428.c b/src/code_801F428.c index 3ba1fe1f1..a7dc1948c 100644 --- a/src/code_801F428.c +++ b/src/code_801F428.c @@ -138,7 +138,7 @@ void sub_801F690(void) void sub_801F700(void) { u32 y; - int index; + s32 index; u8 buffer2 [48]; u8 buffer1 [128]; diff --git a/src/code_8031D70.c b/src/code_8031D70.c index 418ce8b6c..cfffd0b80 100644 --- a/src/code_8031D70.c +++ b/src/code_8031D70.c @@ -108,7 +108,7 @@ void sub_8031E58(void) void DrawSOSPasswordScreen(void) { - int rowIndex; + s32 rowIndex; u32 x; u32 y; u32 color; diff --git a/src/code_803B344.c b/src/code_803B344.c index 7bb814da8..f56a0d9f8 100644 --- a/src/code_803B344.c +++ b/src/code_803B344.c @@ -244,7 +244,7 @@ static s32 sub_803B600(WonderMail *mail) s32 sub_803B628(WonderMail *param_1) { const unkStruct_80E9F8C *ptr; - int i; + s32 i; ptr = &gUnknown_80E9F8C[0]; for (i = 0; i < ARRAY_COUNT_INT(gUnknown_80E9F8C); ptr++, i++) { @@ -260,7 +260,7 @@ s32 sub_803B628(WonderMail *param_1) s32 sub_803B66C(WonderMail *param_1) { const struct PokemonPair *ptr; - int i; + s32 i; ptr = &gUnknown_80E8168[0]; for (i = 0; i < ARRAY_COUNT_INT(gUnknown_80E8168); ptr++, i++) { diff --git a/src/code_803C1B4.c b/src/code_803C1B4.c index 2d3103d83..476e5d751 100644 --- a/src/code_803C1B4.c +++ b/src/code_803C1B4.c @@ -45,7 +45,7 @@ u32 GetDungeonTeamRankPts(DungeonLocation *dungeon, u8 r1) void sub_803C21C(WonderMail *param_1, unkStruct_802F204 *param_2) { - int index; + s32 index; u32 uVar2; uVar2 = sub_803C1D0(¶m_1->dungeonSeed.location,param_1->missionType); diff --git a/src/code_80958E8.c b/src/code_80958E8.c index b291c62c9..96b7167ee 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -487,8 +487,8 @@ void ResetMailboxSlot(u8 index) void ShiftMailboxSlotsDown(void) { - int counter1; // r5 - int counter2; + s32 counter1; // r5 + s32 counter2; counter1 = 0; @@ -787,8 +787,8 @@ void ResetPelipperBoardSlot(u8 index) void ShiftPelipperJobsDown(void) { - int counter1; // r5 - int counter2; + s32 counter1; // r5 + s32 counter2; counter1 = 0; @@ -1165,8 +1165,8 @@ void ResetJobSlot(u8 index) void ShiftJobSlotsDown(void) { - int counter1; // r5 - int counter2; + s32 counter1; // r5 + s32 counter2; counter1 = 0; diff --git a/src/dungeon_8041AD0.c b/src/dungeon_8041AD0.c index 393a24be8..ba3166272 100644 --- a/src/dungeon_8041AD0.c +++ b/src/dungeon_8041AD0.c @@ -259,7 +259,7 @@ static s32 sub_80416A4(DungeonPos *pos_1, u32 param_2, bool8 param_3) s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3) { - int counter; + s32 counter; s32 ret; unkStruct_80416E0 auStack_10; diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 8d989608d..d58648ee5 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -199,7 +199,7 @@ void sub_8044DF0(Entity *entity, s32 index, u32 unused) } } -void sub_8044E24(Entity *entity,int index,u32 unused) +void sub_8044E24(Entity *entity,s32 index,u32 unused) { Item *itemPtr; EntityInfo *info; @@ -257,7 +257,7 @@ bool8 CanSubMenuItemBeChosen(s32 itemId) void AddActionToDungeonSubMenu(u16 actionId, u8 param_2) { - int index; + s32 index; if (gDungeonSubMenuItemsCount < 10) { for(index = 0; index < gDungeonSubMenuItemsCount; index++) @@ -275,7 +275,7 @@ void AddActionToDungeonSubMenu(u16 actionId, u8 param_2) s32 ActionToDungeonSubMenuId(u16 actionId) { - int index; + s32 index; for(index = 0; index < gDungeonSubMenuItemsCount; index++) { @@ -288,7 +288,7 @@ s32 ActionToDungeonSubMenuId(u16 actionId) void SetActionUnusableInDungeonSubMenu(u16 actionId) { - int index; + s32 index; for(index = 0; index < gDungeonSubMenuItemsCount; index++) { diff --git a/src/dungeon_action_execution.c b/src/dungeon_action_execution.c index 4e2908f64..d3a8d3168 100644 --- a/src/dungeon_action_execution.c +++ b/src/dungeon_action_execution.c @@ -400,7 +400,7 @@ _increase: static void HandleSnore(void) { - int index; + s32 index; s32 moveIndex; Move *move; EntityInfo *info; diff --git a/src/dungeon_cutscene.c b/src/dungeon_cutscene.c index f1d195919..f38c1d2c4 100644 --- a/src/dungeon_cutscene.c +++ b/src/dungeon_cutscene.c @@ -1181,7 +1181,7 @@ void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3) bool8 sub_8085B80(struct_8085B80 *a0) { s16 *unkCPtr; - int i; + s32 i; bool8 ret = FALSE; for (i = 0; i < gUnknown_202F3D8; i++) { diff --git a/src/dungeon_cutscene_articuno.c b/src/dungeon_cutscene_articuno.c index bacdb23b5..aaef27458 100644 --- a/src/dungeon_cutscene_articuno.c +++ b/src/dungeon_cutscene_articuno.c @@ -239,7 +239,7 @@ void ArticunoPostStoryPreFightDialogue(void) static void sub_8088484(Entity *param_1) { - int iVar1; + s32 iVar1; GetEntInfo(param_1)->unk15C = 1; GetEntInfo(param_1)->unk15E = 0; @@ -254,7 +254,7 @@ static void sub_8088484(Entity *param_1) static void ArticunoScreenFlash(void) { - int iVar1; + s32 iVar1; PlaySoundEffect(0x2ad); for(iVar1 = 250; iVar1 > 0x95; iVar1 -= 10) @@ -280,7 +280,7 @@ static void ArticunoScreenFlash(void) static void sub_8088574(void) { - int iVar1; + s32 iVar1; for(iVar1 = 0; iVar1 <= 80; iVar1 += 8) { diff --git a/src/dungeon_cutscene_groudon.c b/src/dungeon_cutscene_groudon.c index 5f9a2ebc4..86be3904d 100644 --- a/src/dungeon_cutscene_groudon.c +++ b/src/dungeon_cutscene_groudon.c @@ -275,7 +275,7 @@ void GroudonPostStoryPreFightDialogue(void) // Moves Groudon down in a walking fashion static void SceneGroudonMovement(Entity * groudonEntity) { - int iVar1; + s32 iVar1; sub_8086848(0x18,0x10); sub_806CDD4(groudonEntity,0,DIRECTION_SOUTH); diff --git a/src/dungeon_cutscene_mewtwo.c b/src/dungeon_cutscene_mewtwo.c index 8ea6d23d0..c7a76c84a 100644 --- a/src/dungeon_cutscene_mewtwo.c +++ b/src/dungeon_cutscene_mewtwo.c @@ -162,7 +162,7 @@ static void MewtwoDropInEffect(Entity *mewtwoEntity) static void MewtwoScreenFlash(void) { - int iVar1; + s32 iVar1; PlaySoundEffect(0x1f6); for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) diff --git a/src/dungeon_cutscene_moltres.c b/src/dungeon_cutscene_moltres.c index 02fa8b0dc..8f56eef3a 100644 --- a/src/dungeon_cutscene_moltres.c +++ b/src/dungeon_cutscene_moltres.c @@ -306,7 +306,7 @@ static void MoltresScreenFlash2(s32 xArg, s32 yArg) static void MoltresScreenFlash3(void) { - int iVar1; + s32 iVar1; PlaySoundEffect(0x1ed); iVar1 = 0xfa; diff --git a/src/dungeon_cutscene_zapdos.c b/src/dungeon_cutscene_zapdos.c index ab48a5136..45b68124f 100644 --- a/src/dungeon_cutscene_zapdos.c +++ b/src/dungeon_cutscene_zapdos.c @@ -234,7 +234,7 @@ void ZapdosPostStoryPreFightDialogue(void) static void ZapdosDropInEffect(Entity *zapdosEntity) { - int iVar1; + s32 iVar1; GetEntInfo(zapdosEntity)->unk15C = 1; GetEntInfo(zapdosEntity)->unk15E = 0; diff --git a/src/dungeon_damage.c b/src/dungeon_damage.c index ee92e4ad3..ad4b70a07 100644 --- a/src/dungeon_damage.c +++ b/src/dungeon_damage.c @@ -1559,7 +1559,7 @@ static void sub_806F500(void) static const s32 gUnknown_8106F7C[] = {0, 0, 0, 1}; -s32 sub_806F62C(int param_1) +s32 sub_806F62C(s32 param_1) { return gUnknown_8106F7C[param_1]; } diff --git a/src/dungeon_entity_movement.c b/src/dungeon_entity_movement.c index 46a2b1929..2f7f7f0fa 100644 --- a/src/dungeon_entity_movement.c +++ b/src/dungeon_entity_movement.c @@ -315,7 +315,7 @@ bool8 DisplayActions_Async(Entity *a0) void sub_8075680(bool8 unused) { u32 direction; - int i; + s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { Entity *entity = gDungeon->activePokemon[i]; diff --git a/src/dungeon_info.c b/src/dungeon_info.c index 1adbe113b..2c633dc93 100644 --- a/src/dungeon_info.c +++ b/src/dungeon_info.c @@ -2452,7 +2452,7 @@ s16 GetRandomMovementChance(u8 dungeon) bool8 sub_809017C(DungeonLocation* a1) { DungeonLocation location; - int i; + s32 i; GeneralizeMazeDungeonLoc(&location, a1); for (i = 0; i < 999 && gUnknown_8107828[i].id != DUNGEON_OUT_ON_RESCUE; ++i) { if (location.id == gUnknown_8107828[i].id && diff --git a/src/dungeon_item_action.c b/src/dungeon_item_action.c index 32991adcc..997771dd3 100644 --- a/src/dungeon_item_action.c +++ b/src/dungeon_item_action.c @@ -696,7 +696,7 @@ bool8 sub_8048950(Entity *param_1,Item *item) Entity *entity2; Entity *entity; EntityInfo *entityInfo; - int index; + s32 index; moveID = GetItemMoveID(item->id); if ((item->flags & ITEM_FLAG_STICKY)) { diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 07c46294e..d4cc36bf4 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -145,7 +145,7 @@ void CreateFloorItems(void) void TryLeaderItemPickUp_Async(struct DungeonPos *pos, bool8 printMsg) { Item *tileItem; - int inventoryIds[INVENTORY_SIZE + 1]; + s32 inventoryIds[INVENTORY_SIZE + 1]; Item *inventoryItems[INVENTORY_SIZE + 1]; Entity *leader = GetLeader(); EntityInfo *leaderInfo = GetEntInfo(leader); diff --git a/src/dungeon_jobs.c b/src/dungeon_jobs.c index 84581c485..2ab52e799 100644 --- a/src/dungeon_jobs.c +++ b/src/dungeon_jobs.c @@ -82,7 +82,7 @@ void sub_8084424(void) void sub_8084448(Entity *pokemon) { - int i; + s32 i; const u8 *str; EntityInfo *entInfo = GetEntInfo(pokemon); @@ -144,7 +144,7 @@ void sub_8084448(Entity *pokemon) void sub_80845E0(Entity *pokemon) { - int i; + s32 i; EntityInfo *info1 = GetEntInfo(pokemon); Entity *entity = NULL; EntityInfo *info2 = NULL; diff --git a/src/dungeon_leveling.c b/src/dungeon_leveling.c index 5297a8945..9d719922c 100644 --- a/src/dungeon_leveling.c +++ b/src/dungeon_leveling.c @@ -69,7 +69,7 @@ void AddExpPoints(Entity *pokemon, Entity *target, s32 exp) void EnemyEvolution(Entity *entity) { - int counter; + s32 counter; s16 *id; Entity EStack_f4; u8 tacticsBuffer1[NUM_TACTICS]; @@ -737,8 +737,8 @@ void sub_8072AC8(s16 *param_1, s32 species, s32 param_3) static void sub_8072B24(Entity *entity, Move *moves) { - int index; - int count; + s32 index; + s32 count; count = 0; for(index = 0; index < 8; index++) @@ -766,7 +766,7 @@ static void sub_8072B78(Entity *pokemon, Entity *target, s16 id) { OpenedFile *file; const Tile *tile; - int index; + s32 index; s32 id_s32; EntityInfo *entityInfo; LevelData levelData; diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index fea8faaee..fd5541f71 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -167,7 +167,7 @@ void sub_80498A8(s32 x,s32 y) volatile u32 sp_0x1C; u32 r1; u16 sp_0x20; // sp 0x20 - int r4; + s32 r4; s32 r7; // r7 if (x < 0) { @@ -956,8 +956,8 @@ void sub_804AAD4(void) struct RoomData *room1; struct RoomData *room2; s32 roomIndex; - int x; - int y; + s32 x; + s32 y; s32 maxRooms; s32 index; diff --git a/src/dungeon_menu_items.c b/src/dungeon_menu_items.c index 17270847a..342c9fa5c 100644 --- a/src/dungeon_menu_items.c +++ b/src/dungeon_menu_items.c @@ -306,7 +306,7 @@ bool8 ShowDungeonItemsMenu(Entity * a0, struct UnkMenuBitsStruct *a1) if (inputAction != 1 || var_30 != 0) { if (a0Info->action.action == ACTION_TAKE_ITEM || a0Info->action.action == ACTION_USE_ITEM || a0Info->action.action == ACTION_UNK3E) { // Hm... - int newAction = sUnknownActionUnk4.actionUseIndex - 0x90; + s32 newAction = sUnknownActionUnk4.actionUseIndex - 0x90; a0Info->action.actionParameters[0].actionUseIndex = newAction; sub_803EAF0(0, NULL); inputAction = 0; diff --git a/src/dungeon_misc.c b/src/dungeon_misc.c index 2e7729549..477c67f06 100644 --- a/src/dungeon_misc.c +++ b/src/dungeon_misc.c @@ -184,8 +184,8 @@ void CloseAllSpriteFiles(void) void SetDungeonMonsFromTeam(void) { - int index; - int recruitedId; + s32 index; + s32 recruitedId; index = 0; for (recruitedId = 0; recruitedId < NUM_MONSTERS; recruitedId++) { @@ -685,7 +685,7 @@ void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4) return; } -void sub_80695EC(Entity *param_1,int x,int y) +void sub_80695EC(Entity *param_1,s32 x,s32 y) { EntityInfo *info; @@ -788,7 +788,7 @@ Entity * sub_806977C(Entity *target) void SetMonSummaryInfoFromEntity(struct MonSummaryInfo *param_1, Entity *target) { - int index; + s32 index; u8 *atkPtr; u8 *spAtkPtr; u8 *defPtr; diff --git a/src/dungeon_mon_recruit.c b/src/dungeon_mon_recruit.c index 3b9820641..ed474c7f3 100644 --- a/src/dungeon_mon_recruit.c +++ b/src/dungeon_mon_recruit.c @@ -155,7 +155,7 @@ static void nullsub_96(Entity *pokemon,Entity *target) static void sub_806F910(void) { s32 i, j; - int totalSize; + s32 totalSize; s32 unkMaybeTimer; totalSize = 0; @@ -225,7 +225,7 @@ bool8 IsMonsterRecruitable(s32 species) bool8 MonsterJoinSequence_Async(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *param_3) { DungeonMon *dungeonMon; - int pokeIndex; + s32 pokeIndex; Entity *local_2c; s32 i; @@ -367,7 +367,7 @@ bool8 HandleSpecialEntityJoinSequence(Entity *entity1,Entity *entity2,Entity **e { u8 friendArea; DungeonMon *dungeonMon; - int index; + s32 index; struct unkStruct_8069D4C local_74; Entity *local_2c; s32 i; diff --git a/src/dungeon_move_util.c b/src/dungeon_move_util.c index 5884eede7..dbad1fcaf 100644 --- a/src/dungeon_move_util.c +++ b/src/dungeon_move_util.c @@ -1083,7 +1083,7 @@ bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) else { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - int i = 0; + s32 i = 0; u8 *bideClassStatusPointer = &pokemonInfo->bideClassStatus.status; u8 *bideClassStatusPointer2; u8 chargeStatus = STATUS_CHARGING; @@ -1114,7 +1114,7 @@ bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) u32 sub_8057144(Entity * pokemon) { Move *moveStack[80]; - int i, j, nMoves; + s32 i, j, nMoves; nMoves = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) diff --git a/src/dungeon_projectile_throw.c b/src/dungeon_projectile_throw.c index 0eb7af0fe..2793e67dd 100644 --- a/src/dungeon_projectile_throw.c +++ b/src/dungeon_projectile_throw.c @@ -31,10 +31,10 @@ struct ProjectileHitEntry void HandleStraightProjectileThrow(Entity *thrower, Item *item, DungeonPos *pos, s32 dir, struct ProjectileThrowInfo *a4) { const Tile *tile; - int i; + s32 i; u32 stepResult; - int remainingSteps; - int count; + s32 remainingSteps; + s32 count; bool8 hallucinating = gDungeon->unk181e8.hallucinating; struct ProjectileHitEntry hitList[64]; bool8 lockOnActive; diff --git a/src/dungeon_tilemap.c b/src/dungeon_tilemap.c index dab23d3b7..7f3912adc 100644 --- a/src/dungeon_tilemap.c +++ b/src/dungeon_tilemap.c @@ -693,8 +693,8 @@ static void sub_803FF18(s32 a0, u16 *a1, bool8 a2) void HandleLuminousOrbAction(Entity *pokemon) { - int XCoord; - int YCoord; + s32 XCoord; + s32 YCoord; gDungeon->unk181e8.allTilesRevealed = TRUE; diff --git a/src/effect_main.c b/src/effect_main.c index de4f96b00..44a3583dc 100644 --- a/src/effect_main.c +++ b/src/effect_main.c @@ -81,7 +81,7 @@ extern s16 gUnknown_2026E4E; extern void sub_8009BE4(void); -extern void sub_809971C(u16 a0, const RGB_Struct *a1, int a2); +extern void sub_809971C(u16 a0, const RGB_Struct *a1, s32 a2); static s32 sub_800E900(s32 a0); static s32 sub_800E2C0(s32); diff --git a/src/effect_sub_1.c b/src/effect_sub_1.c index 76f761d4a..5eabb9b72 100644 --- a/src/effect_sub_1.c +++ b/src/effect_sub_1.c @@ -38,7 +38,7 @@ struct unkStruct_203B0D0 { static EWRAM_INIT struct unkStruct_203B0D0 *gUnknown_203B0D0 = NULL; -extern void sub_809971C(u16 a0, const RGB_Struct *a1, int a2); +extern void sub_809971C(u16 a0, const RGB_Struct *a1, s32 a2); void sub_800ED38(s32 r0) { diff --git a/src/explosion.c b/src/explosion.c index ce0355f70..ae6d9109f 100644 --- a/src/explosion.c +++ b/src/explosion.c @@ -87,9 +87,9 @@ void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 para Tile *tile; Entity * entity1; Entity *entity2; - int x; - int y; - int index; + s32 x; + s32 y; + s32 index; DungeonPos pos; u32 dungeonExitReason; diff --git a/src/expose_trap.c b/src/expose_trap.c index b5988ea14..45cbc999e 100644 --- a/src/expose_trap.c +++ b/src/expose_trap.c @@ -29,8 +29,8 @@ void sub_807D3CC(Entity *param_1) { u32 room; u8 flag; - int x; - int y; + s32 x; + s32 y; s32 range; RoomData *roomData; diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index 9952a4054..a54f0a4fc 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -234,7 +234,7 @@ void sub_8027274(void) void CreateFriendActionMenu(void) { - int index; + s32 index; s32 loopMax; Pokemon *pokeStruct; @@ -324,7 +324,7 @@ void CreateFriendActionMenu(void) void sub_80276A8(void) { - int index; + s32 index; s32 loopMax; loopMax = 0; diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index 9672c5f7a..50f794f77 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -316,7 +316,7 @@ static void sub_8025518(void) static void sub_8025728(void) { - int index; + s32 index; Pokemon *pokeStruct; s32 loopMax = 0; @@ -389,7 +389,7 @@ static void sub_8025728(void) static void sub_802591C(void) { - int index; + s32 index; s32 loopMax = 0; diff --git a/src/friend_rescue.c b/src/friend_rescue.c index e670e7277..43e757041 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -589,8 +589,8 @@ extern bool8 sub_8031D70(u32 mailIndex, s32); u32 CreateFriendRescueMenu(void) { - char *monName; - int counter; + u8 *monName; + s32 counter; ResetUnusedInputStruct(); ShowWindows(NULL, TRUE, TRUE); diff --git a/src/ground_bg.c b/src/ground_bg.c index e966f4d92..556bb148b 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -20,7 +20,7 @@ extern const FileArchive gGroundFileArchive; static void CloseOpenedFiles(GroundBg *groundBg); static void CallMapTilemapRenderFunc(MapRender *mapRender); -static const u8 *BmaLayerNrlDecompressor(u16 **dstArray, const void *bmaData, SubStruct_52C *a2, BmaHeader *bmaHeader); +static const u8 *BmaLayerNrlDecompressor(u16 **dstArray, const u8 *bmaData, SubStruct_52C *a2, BmaHeader *bmaHeader); static void CopyBpcTilesToVram(void *vramDst, const u16 *src_, SubStruct_52C *a2, LayerSpecs *a3); static void _UncompressCell(void * a0, u16 *a1, const void * a2, SubStruct_52C *a3, LayerSpecs *a4); static void InitMapTilemapRenderContext(MapRender *mapRender, GroundBg *groundBg, s32 a2, s32 numBgs, bool8 a4); @@ -68,7 +68,7 @@ void GroundBg_Init(GroundBg *groundBg, const SubStruct_52C *a1) groundBg->unk440 = NULL; groundBg->unk52A = 0; groundBg->mapFileId = -1; - groundBg->unk468 = 0; + groundBg->decompressedBMAData = NULL; groundBg->bmaHeader.mapWidthTiles = 0; groundBg->bmaHeader.mapHeightTiles = 0; groundBg->bmaHeader.tilingWidth = 0; @@ -134,7 +134,7 @@ void sub_80A2D88(GroundBg *groundBg) if (groundBg->unk52C.unk14 != NULL) { BmaHeader *bmaHeader = &groundBg->bmaHeader; groundBg->unk544 = MemoryAlloc(groundBg->unk52C.unkE * 256, 6); - groundBg->unk52C.unk14(groundBg->unk544, groundBg->unk468, bmaHeader, groundBg->unk52C.unkE); + groundBg->unk52C.unk14(groundBg->unk544, groundBg->decompressedBMAData, bmaHeader, groundBg->unk52C.unkE); } } @@ -222,7 +222,7 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) BplHeader *bplHeader; LayerSpecs *layerSpecs; const u16 *bpcData; - const void *bmaData; + const u8 *bmaData; const void *bplData; BmaHeader *bmaHeader; RGB_Array str2; @@ -266,15 +266,15 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) } layerSpecs->numChunks = *bpcData++; - bmaHeader->mapWidthTiles = *(u8 *)(bmaData); bmaData += 1; - bmaHeader->mapHeightTiles = *(u8 *)(bmaData); bmaData += 1; - bmaHeader->tilingWidth = *(u8 *)(bmaData); bmaData += 1; - bmaHeader->tilingHeight = *(u8 *)(bmaData); bmaData += 1; - bmaHeader->mapWidthChunks = *(u8 *)(bmaData); bmaData += 1; - bmaHeader->mapHeightChunks = *(u8 *)(bmaData); bmaData += 1; - bmaHeader->numLayers = *(u8 *)(bmaData); bmaData += 2; - bmaHeader->hasDataLayer = *(u8 *)(bmaData); bmaData += 2; - bmaHeader->hasCollision = *(u8 *)(bmaData); bmaData += 2; + bmaHeader->mapWidthTiles = *bmaData; bmaData += 1; + bmaHeader->mapHeightTiles = *bmaData; bmaData += 1; + bmaHeader->tilingWidth = *bmaData; bmaData += 1; + bmaHeader->tilingHeight = *bmaData; bmaData += 1; + bmaHeader->mapWidthChunks = *bmaData; bmaData += 1; + bmaHeader->mapHeightChunks = *bmaData; bmaData += 1; + bmaHeader->numLayers = *bmaData; bmaData += 2; + bmaHeader->hasDataLayer = *bmaData; bmaData += 2; + bmaHeader->hasCollision = *bmaData; bmaData += 2; rgbPal = bplData; r5 = groundBg->unk52C.unk0 * 16; @@ -299,7 +299,7 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) CopyBpcTilesToVram((void *)(VRAM + 0x8000 + groundBg->unk52C.unk4 * 32), bpcData, &groundBg->unk52C, &groundBg->layerSpecs); _UncompressCell(groundBg->tileMappings, &groundBg->chunkDimensions, bpcData + ((layerSpecs->numTiles - 1) * 16), &groundBg->unk52C, &groundBg->layerSpecs); bmaData = BmaLayerNrlDecompressor(groundBg->chunkMappings, bmaData, &groundBg->unk52C, &groundBg->bmaHeader); - groundBg->unk468 = bmaData; + groundBg->decompressedBMAData = bmaData; if (groundBg->unk544 != NULL) { groundBg->unk52C.unk14(groundBg->unk544, bmaData, bmaHeader, groundBg->unk52C.unkE); } @@ -457,7 +457,7 @@ void sub_80A3440(GroundBg *groundBg, s32 mapFileId_, const DungeonLocation *dung unkPtrArray[0] = groundBg->unk544; unkPtrArray[1] = NULL; bmaData = BmaLayerNrlDecompressor(unkPtrArray, bmaData, &groundBg->unk52C, &groundBg->bmaHeader); - groundBg->unk468 = bmaData; + groundBg->decompressedBMAData = bmaData; sub_80ADD9C(&groundBg->unk43C, &groundBg->unk440, (void *)(VRAM + 0x8000), groundBg->tileMappings, groundBg->chunkMappings[0], dungLoc, a3, 0x40, bmaHeader->mapHeightChunks, groundBg->unk544, 0); // Unused return values GetFileDataPtr(groundBg->unk43C, 0); @@ -599,7 +599,7 @@ static void _UncompressCell(void *dst_, u16 *chunkDimensions, const void *src_, } } -static const u8 *BmaLayerNrlDecompressor(u16 **dstArray, const void *bmaData, SubStruct_52C *a2, BmaHeader *bmaHeader) +static const u8 *BmaLayerNrlDecompressor(u16 **dstArray, const u8 *bmaData, SubStruct_52C *a2, BmaHeader *bmaHeader) { s32 i, k, j, l; const u8 *src = bmaData; diff --git a/src/ground_lives.c b/src/ground_lives.c index 07eb72c6f..c95683d69 100644 --- a/src/ground_lives.c +++ b/src/ground_lives.c @@ -213,7 +213,7 @@ void AllocGroundLives(void) void DeleteGroundLives(void) { - int i; + s32 i; struct GroundLive *iVar4; iVar4 = &gGroundLives->array[0]; diff --git a/src/ground_map.c b/src/ground_map.c index b462cf33f..fb6423952 100644 --- a/src/ground_map.c +++ b/src/ground_map.c @@ -18,7 +18,7 @@ IWRAM_INIT GroundMapAction *gGroundMapAction = {NULL}; IWRAM_INIT GroundBg *gGroundMapDungeon_3001B70 = {NULL}; -static void sub_80A5204(void *, const void *, BmaHeader *, s32); +static u8* sub_80A5204(void *, const u8 *, BmaHeader *, s32); static void sub_80A56D8(const PixelPos *pos); static const SubStruct_52C gUnknown_8117324 = { @@ -535,7 +535,7 @@ void GroundMap_SelectDungeon(s32 mapId_, const DungeonLocation *loc, u32 param_2 } NAKED -static void sub_80A5204(void *a, const void *b, BmaHeader *c, s32 d) +static u8* sub_80A5204(void *a, const u8 *b, BmaHeader *c, s32 d) { asm_unified( " push {r4-r7,lr} \n" @@ -1305,7 +1305,7 @@ bool8 sub_80A579C(PixelPos *pos1, PixelPos *pos2) bool8 CheckMapCollision_80A585C(PixelPos *pixPos1, PixelPos *boundary) { u8 *currPtr; - int i, j; + s32 i, j; u8 *ptr; ptr = (void *)gGroundMapDungeon_3001B70->unk544 + ((pixPos1->y * 256) + pixPos1->x + 0x405); @@ -1329,7 +1329,7 @@ bool8 CheckMapCollision_80A585C(PixelPos *pixPos1, PixelPos *boundary) bool8 sub_80A58C8(PixelPos *pixPos1, PixelPos *boundary) { u8 *currPtr; - int i, j; + s32 i, j; u8 *ptr; ptr = (void *)gGroundMapDungeon_3001B70->unk544 + ((pixPos1->y * 256) + pixPos1->x + 0x405); diff --git a/src/ground_object.c b/src/ground_object.c index cbbd5e53f..98476e1d5 100644 --- a/src/ground_object.c +++ b/src/ground_object.c @@ -271,12 +271,12 @@ s32 GroundObject_Add(s32 id_, const GroundObjectData *objectData, s32 group_, s3 s32 sVar3; s32 sVar4; - int index; + s32 index; s32 kind; GroundObject *parent; - register s32 id; - register s32 group; - register s32 sector; + s32 id; + s32 group; + s32 sector; bool8 bVar12; struct GroundObjectTypeData *typeDataPtr; @@ -953,7 +953,7 @@ void GroundObject_Action(void) void sub_80ACAD4(void) { GroundObject *objectPtr; - int i; + s32 i; // s16 memes s32 minus1; diff --git a/src/kangaskhan_storage2.c b/src/kangaskhan_storage2.c index 361c63581..dc6928017 100644 --- a/src/kangaskhan_storage2.c +++ b/src/kangaskhan_storage2.c @@ -225,7 +225,7 @@ static void sub_8018280(void) static void BuildKangaskhanStorage2MainMenu(void) { - int index; + s32 index; s32 loopMax; loopMax = 0; diff --git a/src/mailbox.c b/src/mailbox.c index c5afd52e6..3a34a447e 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -225,7 +225,7 @@ void sub_802E1AC(void) void CreateMailboxMenu(void) { - int index; + s32 index; s32 loopMax; loopMax = 0; diff --git a/src/mission_reward.c b/src/mission_reward.c index e11c699e8..4e7475bc0 100644 --- a/src/mission_reward.c +++ b/src/mission_reward.c @@ -192,7 +192,7 @@ void sub_802F300(void) void HandleMissionReward(void) { - int moneyReward; + s32 moneyReward; const u8 *rankString; u8 itemID; struct unkStruct_8090F58 local_20; diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c index 26174fe1c..c449ae6b0 100644 --- a/src/move_orb_actions_2.c +++ b/src/move_orb_actions_2.c @@ -224,8 +224,8 @@ bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, s32 item bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - int iVar2; - int iVar3; + s32 iVar2; + s32 iVar3; bool8 flag; flag = FALSE; diff --git a/src/move_orb_actions_3.c b/src/move_orb_actions_3.c index 70ee38f35..92467e230 100644 --- a/src/move_orb_actions_3.c +++ b/src/move_orb_actions_3.c @@ -563,9 +563,9 @@ static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, bool8 SplashMoveAction(Entity * pokemon, Entity * target, Move *move, s32 itemId) { - int x; - int y; - int counter; + s32 x; + s32 y; + s32 counter; DungeonPos *r9; DungeonPos pos1; Move stackMove; diff --git a/src/move_orb_actions_5.c b/src/move_orb_actions_5.c index d789e679b..45bdbc13d 100644 --- a/src/move_orb_actions_5.c +++ b/src/move_orb_actions_5.c @@ -23,9 +23,9 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 itemId) { Tile *tileToFill; EntityInfo *targetInfo; - int y; + s32 y; bool8 filledInTile; - int x; + s32 x; DungeonPos tileCoords; filledInTile = FALSE; diff --git a/src/move_orb_effects_2.c b/src/move_orb_effects_2.c index 05109214d..d94d86329 100644 --- a/src/move_orb_effects_2.c +++ b/src/move_orb_effects_2.c @@ -650,7 +650,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target) void EncoreStatusTarget(Entity *pokemon,Entity *target) { Move *movePtr; - int index; + s32 index; EntityInfo *EntityInfo; EntityInfo = GetEntInfo(target); diff --git a/src/moves.c b/src/moves.c index 2b9be4c56..19803cc67 100644 --- a/src/moves.c +++ b/src/moves.c @@ -581,8 +581,8 @@ UNUSED static s32 unk_SetMoveToFirstInLinkedSequence8(Move *moves, s32 index) Move* move; Move linkedSequence[8][8]; s32 startIndex, prevIndex; - int result; - int i; + s32 result; + s32 i; result = index; @@ -1137,8 +1137,8 @@ static void unk_GetLinkedSequences8_v2(Move *moves, Move linkedSequences[8][8]) // instead of [4][4] linkedSequences static void unk_LinkedSequencesToMoves8(Move *moves, Move linkedSequences[8][8]) { - int i, j; - int movesCopied; + s32 i, j; + s32 movesCopied; bool8 moveFlags8[8]; bool8 moveFlags4[8]; diff --git a/src/pelipper_board.c b/src/pelipper_board.c index 94125eee8..e12653356 100644 --- a/src/pelipper_board.c +++ b/src/pelipper_board.c @@ -212,7 +212,7 @@ void sub_802EA58(void) void CreatePelipperBoardMenu(void) { - int index; + s32 index; s32 loopMax; loopMax = 0; diff --git a/src/save.c b/src/save.c index 22b3ca4cb..9bdbf4b13 100644 --- a/src/save.c +++ b/src/save.c @@ -314,9 +314,9 @@ bool8 IsSaveCorrupted(void) u32 WriteSavetoPak(s32 *param_1, u32 param_2) { struct UnkStruct_sub_8011DAC *playerSave; - const char *gameName; - int saveStatus1; - int saveStatus2; + const u8 *gameName; + s32 saveStatus1; + s32 saveStatus2; u8 *array_ptr; playerSave = MemoryAlloc(sizeof(struct UnkStruct_sub_8011DAC),5); diff --git a/src/script_item.c b/src/script_item.c index 497009b62..bdd876197 100644 --- a/src/script_item.c +++ b/src/script_item.c @@ -79,10 +79,10 @@ static const struct ItemWithQuantity sScriptItemsTable[] = { static bool8 TryAddItemWithText(const struct ItemWithQuantity *itemToAdd, const u8 *maxMoneyStr, const u8 *noItemSpaceStr, const u8 *itemGivenStr) { - char buffer[80]; + u8 buffer[80]; if (itemToAdd->id == ITEM_POKE) { - int newMoneyAmount; + s32 newMoneyAmount; sprintfStatic(buffer,_("{COLOR CYAN_G}%d{RESET} %s"),itemToAdd->quantity,gItemParametersData[ITEM_POKE].name); newMoneyAmount = gTeamInventoryRef->teamMoney + itemToAdd->quantity; if (newMoneyAmount > MAX_TEAM_MONEY) { diff --git a/src/text_util.c b/src/text_util.c index cf9b1ce59..5f1576de9 100644 --- a/src/text_util.c +++ b/src/text_util.c @@ -70,7 +70,7 @@ void BoundedCopyStringtoBuffer(u8 *buffer, u8 *string, s32 size) *buffer = '\0'; // append a terminating char and break break; } - // NOTE: *buffer++ = *string++ cases register flip + // NOTE: *buffer++ = *string++ causes register flip *buffer = *string; buffer++; string++; diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index 9313ec08a..9a71bde7b 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -225,10 +225,10 @@ extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0); bool8 CreateThankYouMailPelipper(void) { - char *monName; + u8 *monName; OpenedFile *faceFile; s32 index; - int counter; + s32 counter; unkStruct_203B480 *mail; ResetUnusedInputStruct(); @@ -845,7 +845,7 @@ void sub_802A68C(void) void sub_802A6B4(void) { - int saveStatus; + s32 saveStatus; u32 temp; if (sub_80144A4(&temp) == 0) { diff --git a/src/trap.c b/src/trap.c index b78eb0e6c..3a78e6d7c 100644 --- a/src/trap.c +++ b/src/trap.c @@ -153,7 +153,7 @@ bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3) { Tile *tile; Entity *entity; - int counter; + s32 counter; u16 terrainFlags; tile = GetTileMut(pos->x, pos->y); @@ -214,7 +214,7 @@ bool8 sub_807FD84(Entity *entity) return flag; } -bool8 sub_807FE04(DungeonPos *pos, char param_2) +bool8 sub_807FE04(DungeonPos *pos, u8 param_2) { Tile *tile; @@ -232,7 +232,7 @@ bool8 sub_807FE04(DungeonPos *pos, char param_2) } } -bool8 sub_807FE44(DungeonPos *pos, char param_2) +bool8 sub_807FE44(DungeonPos *pos, u8 param_2) { const Tile *tile; @@ -254,7 +254,7 @@ void GetTrapName(u8 *buffer, u8 trapIndex) strcpy(buffer, gTrapNames[trapIndex]); } -void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) +void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, s32 param_3, u8 param_4) { Tile *tile; bool8 flag1; @@ -402,7 +402,7 @@ void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) void HandleMudTrap(Entity *pokemon, Entity *target) { - int rand, randDef; + s32 rand, randDef; if (target == NULL) return; @@ -426,9 +426,9 @@ void HandleMudTrap(Entity *pokemon, Entity *target) void HandleStickyTrap(Entity *pokemon,Entity *target) { EntityInfo *info; - int index; - int itemCount; - int newIndex; + s32 index; + s32 itemCount; + s32 newIndex; Item *itemStack[21]; info = GetEntInfo(target); @@ -516,10 +516,10 @@ void HandleGrimyTrap(Entity *pokemon, Entity *target) { Item *item; Item *heldItem; - int counter; - int index; + s32 counter; + s32 index; EntityInfo *info; - int badFoodCount; + s32 badFoodCount; Item *itemStack [22]; badFoodCount = 0; @@ -613,7 +613,7 @@ void HandleSummonTrap(Entity *pokemon,DungeonPos *pos) { s32 r4; u32 direction; - int pokemonSummonCount; + s32 pokemonSummonCount; s16 species; struct MonSpawnInfo stack; s32 i; diff --git a/src/weather.c b/src/weather.c index 0ecf0ded7..4bdd8d4e4 100644 --- a/src/weather.c +++ b/src/weather.c @@ -58,7 +58,7 @@ void sub_807E5AC(void) void sub_807E5E4(u8 weather) { - int index; + s32 index; u8 *preload; gDungeon->weather.unkE265 = weather;