From 90469fd44220b0d40c1b7d0091089867cc47ef34 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Mon, 21 Nov 2022 17:45:46 -0500 Subject: [PATCH] Use pointer types instead of s32 (#1151) * pointers * remove from segment_symbols * format --- include/z64save.h | 2 -- src/code/z_sram_NES.c | 12 +++--------- .../ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c | 16 ++++++++-------- src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c | 2 +- src/overlays/actors/ovl_En_Ah/z_en_ah.c | 2 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 2 +- src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c | 2 +- .../fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c | 2 +- tools/disasm/variables.txt | 8 +++----- 10 files changed, 20 insertions(+), 30 deletions(-) diff --git a/include/z64save.h b/include/z64save.h index e6df4e67c5..d694327ff3 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -1522,10 +1522,8 @@ void func_80147198(SramContext* sramCtx); extern s32 D_801C6798[]; extern u8 gAmmoItems[]; extern s32 D_801C67C8[]; -extern s32 D_801C67E8[]; extern s32 D_801C67F0[]; extern s32 D_801C6818[]; -extern s32 D_801C6838[]; extern s32 D_801C6840[]; extern s32 D_801C6850[]; diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index 6a4210df76..80ca0a4a6f 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -268,17 +268,11 @@ u8 gAmmoItems[] = { ITEM_NONE, // SLOT_BOTTLE_6 }; -s32 D_801C67C8[] = { 0, 0x40, 0x80, 0xC0, 0x100, 0x180, 0x200, 0x280 }; +s32 D_801C67C8[] = { 0, 0x40, 0x80, 0xC0, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380 }; -s32 D_801C67E8[] = { 0x300, 0x380 }; +s32 D_801C67F0[] = { 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 1, 1 }; -s32 D_801C67F0[] = { 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80 }; - -s32 D_801C6810[] = { 1, 1 }; - -s32 D_801C6818[] = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; - -s32 D_801C6838[] = { 1, 1 }; +s32 D_801C6818[] = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 1 }; s32 D_801C6840[] = { 0x100, 0x180, 0x200, 0x280 }; diff --git a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c index a97ed6b28e..04f7f514b7 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c @@ -235,8 +235,8 @@ void BgIkanaBombwall_Init(Actor* thisx, PlayState* play) { s32 pad; BgIkanaBombwall* this = THIS; s32 sp2C = BGIKANABOMBWALL_GET_100(&this->dyna.actor); - s32 sp28; - s32 sp24; + CollisionHeader* colHeader; + ColliderCylinderInit* cylinderInit; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); @@ -248,15 +248,15 @@ void BgIkanaBombwall_Init(Actor* thisx, PlayState* play) { } if (sp2C == 0) { - sp28 = &object_ikana_obj_Colheader_000488; - sp24 = &sCylinderInit1; + colHeader = &object_ikana_obj_Colheader_000488; + cylinderInit = &sCylinderInit1; } else { - sp28 = &object_ikana_obj_Colheader_000128; - sp24 = &sCylinderInit2; + colHeader = &object_ikana_obj_Colheader_000128; + cylinderInit = &sCylinderInit2; } - DynaPolyActor_LoadMesh(play, &this->dyna, sp28); - Collider_SetCylinder(play, &this->collider, &this->dyna.actor, sp24); + DynaPolyActor_LoadMesh(play, &this->dyna, colHeader); + Collider_SetCylinder(play, &this->collider, &this->dyna.actor, cylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); if (sp2C == 0) { diff --git a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c index 047d17b902..1a1f4ae221 100644 --- a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c +++ b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c @@ -52,7 +52,7 @@ void func_80C1D458(DmAh* this) { } } -s32 func_80C1D4D0(DmAh* this, s32 arg1) { +s32 func_80C1D4D0(DmAh* this, PlayState* play) { s32 pad; Vec3f sp40; Vec3f sp34; diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 2f4e4ed039..5ea8510239 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -105,7 +105,7 @@ TexturePtr D_80BD3F14[] = { object_ah_Tex_006D70, object_ah_Tex_007570, object_ah_Tex_007D70, object_ah_Tex_007570, object_ah_Tex_008570, }; -s32 func_80BD2A30(EnAh* this, PlayState* play, u8 actorCat, s16 actorId) { +Actor* func_80BD2A30(EnAh* this, PlayState* play, u8 actorCat, s16 actorId) { Actor* tempActor; Actor* foundActor = NULL; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 9b1f45a204..4a9876c795 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -553,7 +553,7 @@ void func_809C5BA0(EnBomBowlMan* this) { void func_809C5BF4(EnBomBowlMan* this, PlayState* play) { f32 sp2C = this->skelAnime.curFrame; - s32 subCam; + Camera* subCam; if ((D_809C6104 != 0) && (this->unk_2F8 != 15)) { func_809C493C(this, 15, 1.0f); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 9d772cc289..e1250dbc67 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1816,7 +1816,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { } s32* func_80A15684(EnGo* this, PlayState* play) { - static s32 D_80A16704[] = { + static s32* D_80A16704[] = { D_80A16100, D_80A16164, }; diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index 00f0cc5d74..c8f657c13c 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -107,7 +107,7 @@ void func_8098F220(ObjMure3* this, PlayState* play) { } } -void func_8098F364(ObjMure3* this, s32 play) { +void func_8098F364(ObjMure3* this, PlayState* play) { s16 count = sRupeeCounts[OBJMURE3_PARAMS_RUPEEINDEX(&this->actor)]; s32 i; EnItem00** collectible; diff --git a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c index a3839bc400..a4b0cfa742 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c +++ b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c @@ -80,7 +80,7 @@ void TransitionWipe5_Draw(void* thisx, Gfx** gfxP) { Gfx* gfx = *gfxP; s32 width = gScreenWidth; s32 height = gScreenHeight; - s32 sp50 = D_801FBB90; + void* sp50 = D_801FBB90; TransitionWipe5* this = THIS; s32 alpha = (1.0f - this->unk_0C) * 255.0f; diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index bd716f8ef2..7581da391d 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1955,11 +1955,9 @@ 0x801C66D0:("D_801C66D0","UNK_TYPE2","",0x2), 0x801C6798:("D_801C6798","UNK_TYPE4","",0x4), 0x801C67B0:("gAmmoItems","UNK_TYPE1","",0x1), - 0x801C67C8:("D_801C67C8","s32","[8]",0x20), - 0x801C67E8:("D_801C67E8","UNK_TYPE4","",0x4), - 0x801C67F0:("D_801C67F0","s32","[8]",0x20), - 0x801C6818:("D_801C6818","UNK_TYPE1","",0x1), - 0x801C6838:("D_801C6838","UNK_TYPE4","",0x4), + 0x801C67C8:("D_801C67C8","s32","[10]",0x28), + 0x801C67F0:("D_801C67F0","s32","[10]",0x28), + 0x801C6818:("D_801C6818","s32","[10]",0x28), 0x801C6840:("D_801C6840","UNK_TYPE1","",0x1), 0x801C6850:("D_801C6850","UNK_TYPE1","",0x1), 0x801C6870:("D_801C6870","UNK_TYPE1","",0x1),