"int" + "register" cleanup

This commit is contained in:
Kermalis 2025-12-02 10:23:38 -05:00
parent 560be7c106
commit 7894c3a3e9
62 changed files with 160 additions and 159 deletions

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -138,7 +138,7 @@ void sub_801F690(void)
void sub_801F700(void)
{
u32 y;
int index;
s32 index;
u8 buffer2 [48];
u8 buffer1 [128];

View File

@ -108,7 +108,7 @@ void sub_8031E58(void)
void DrawSOSPasswordScreen(void)
{
int rowIndex;
s32 rowIndex;
u32 x;
u32 y;
u32 color;

View File

@ -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++) {

View File

@ -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(&param_1->dungeonSeed.location,param_1->missionType);

View File

@ -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;

View File

@ -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;

View File

@ -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++)
{

View File

@ -400,7 +400,7 @@ _increase:
static void HandleSnore(void)
{
int index;
s32 index;
s32 moveIndex;
Move *move;
EntityInfo *info;

View File

@ -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++) {

View File

@ -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)
{

View File

@ -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);

View File

@ -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)

View File

@ -306,7 +306,7 @@ static void MoltresScreenFlash2(s32 xArg, s32 yArg)
static void MoltresScreenFlash3(void)
{
int iVar1;
s32 iVar1;
PlaySoundEffect(0x1ed);
iVar1 = 0xfa;

View File

@ -234,7 +234,7 @@ void ZapdosPostStoryPreFightDialogue(void)
static void ZapdosDropInEffect(Entity *zapdosEntity)
{
int iVar1;
s32 iVar1;
GetEntInfo(zapdosEntity)->unk15C = 1;
GetEntInfo(zapdosEntity)->unk15E = 0;

View File

@ -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];
}

View File

@ -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];

View File

@ -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 &&

View File

@ -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)) {

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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++)

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -213,7 +213,7 @@ void AllocGroundLives(void)
void DeleteGroundLives(void)
{
int i;
s32 i;
struct GroundLive *iVar4;
iVar4 = &gGroundLives->array[0];

View File

@ -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);

View File

@ -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;

View File

@ -225,7 +225,7 @@ static void sub_8018280(void)
static void BuildKangaskhanStorage2MainMenu(void)
{
int index;
s32 index;
s32 loopMax;
loopMax = 0;

View File

@ -225,7 +225,7 @@ void sub_802E1AC(void)
void CreateMailboxMenu(void)
{
int index;
s32 index;
s32 loopMax;
loopMax = 0;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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];

View File

@ -212,7 +212,7 @@ void sub_802EA58(void)
void CreatePelipperBoardMenu(void)
{
int index;
s32 index;
s32 loopMax;
loopMax = 0;

View File

@ -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);

View File

@ -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) {

View File

@ -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++;

View File

@ -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) {

View File

@ -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;

View File

@ -58,7 +58,7 @@ void sub_807E5AC(void)
void sub_807E5E4(u8 weather)
{
int index;
s32 index;
u8 *preload;
gDungeon->weather.unkE265 = weather;