diff --git a/data/z_en_a_keep.data.s b/data/z_en_a_keep.data.s deleted file mode 100644 index f68f8a28ef..0000000000 --- a/data/z_en_a_keep.data.s +++ /dev/null @@ -1,19 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -glabel D_80115440 - .incbin "baserom.z64", 0xB8C5E0, 0x2C - -glabel D_8011546C - .incbin "baserom.z64", 0xB8C60C, 0x18 - -glabel D_80115484 - .incbin "baserom.z64", 0xB8C624, 0x3C diff --git a/include/functions.h b/include/functions.h index 603d788793..274e4fc560 100644 --- a/include/functions.h +++ b/include/functions.h @@ -445,8 +445,8 @@ void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbD void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2); void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3); void Actor_Noop(Actor* actor, GlobalContext* globalCtx); -void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist); -void Gfx_DrawDListXlu(GlobalContext* globalCtx, u32 dlist); +void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist); +void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist); Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range); s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5); void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3); @@ -556,11 +556,11 @@ s32 func_8003DF10(CollisionContext*, Vec3f*, Vec3f*, Vec3f*, CollisionPoly**, u3 // ? func_8003E934(?); // ? func_8003E954(?); // ? func_8003E9A0(?); -void func_8003EBF8(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, u32 dynaPolyId); -void func_8003EC50(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, u32 dynaPolyId); -u32 DynaPolyInfo_RegisterActor(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, Actor* actor, u32 arg3); -DynaPolyActor* DynaPolyInfo_GetActor(CollisionContext* colCtx, u32 dynaPolyId); -void DynaPolyInfo_Free(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, u32 dynaPolyId); +void func_8003EBF8(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, UNK_TYPE dynaPolyId); +void func_8003EC50(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, UNK_TYPE dynaPolyId); +u32 DynaPolyInfo_RegisterActor(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, Actor* actor, UNK_TYPE arg3); +DynaPolyActor* DynaPolyInfo_GetActor(CollisionContext* colCtx, UNK_TYPE dynaPolyId); +void DynaPolyInfo_Free(GlobalContext* globalCtx, DynaCollisionContext* dynaColCtx, UNK_TYPE dynaPolyId); // ? func_8003EE80(?); // ? func_8003F8EC(?); // ? func_8003F984(?); @@ -578,7 +578,7 @@ void DynaPolyInfo_Free(GlobalContext* globalCtx, DynaCollisionContext* dynaColCt // ? func_80041510(?); // ? func_80041648(?); // ? func_800417A0(?); -void DynaPolyInfo_Alloc(u32 collision, void* collisionPtr); +void DynaPolyInfo_Alloc(UNK_PTR arg0, UNK_PTR arg1); // ? func_80041978(?); // ? func_800419B0(?); // ? func_80041A28(?); diff --git a/spec b/spec index 37c0ceb1c5..92ffc62333 100644 --- a/spec +++ b/spec @@ -270,7 +270,6 @@ beginseg name "code" address 0x8001CE60 include "build/src/code/z_en_a_keep.o" - include "build/data/z_en_a_keep.data.o" include "build/src/code/z_en_item00.o" include "build/data/z_en_item00.data.o" include "build/data/z_en_item00.bss.o" diff --git a/src/code/z_cheap_proc.c b/src/code/z_cheap_proc.c index 3b83d1b71d..f899bab69d 100644 --- a/src/code/z_cheap_proc.c +++ b/src/code/z_cheap_proc.c @@ -1,7 +1,7 @@ #include #include -void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist) { +void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; @@ -15,7 +15,7 @@ void Gfx_DrawDListOpa(GlobalContext* globalCtx, u32 dlist) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219); } -void Gfx_DrawDListXlu(GlobalContext* globalCtx, u32 dlist) { +void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 2e7266d05d..3d2a6b1fe2 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -65,10 +65,20 @@ const ActorInit En_A_Obj_InitVars = { (ActorFunc)EnAObj_Draw, }; -// TODO: Define this section of .data here and rename the symbols -extern ColliderCylinderInit D_80115440; -extern u32 D_8011546C[]; -extern u32 D_80115484[]; +static ColliderCylinderInit sCylinderInit = { + { COLTYPE_UNK10, 0x00, 0x39, 0x39, 0x20, COLSHAPE_CYLINDER }, + { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { 25, 60, 0, { 0, 0, 0 } }, +}; + +static UNK_PTR D_8011546C[] = { + 0x040394B0, 0x040394B0, 0x0403A120, 0x0403A480, 0x0403A7F0, 0x06000730, +}; + +static Gfx* D_80115484[] = { + 0x04039C00, 0x04039C00, 0x04039C00, 0x0403A2D0, 0x0403A2D0, 0x0403A630, + 0x06000210, 0x0403AB80, 0x0403A9B0, 0x0403C050, 0x0403C5B0, 0x0400D340, +}; void EnAObj_SetupAction(EnAObj* this, EnAObjActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -153,7 +163,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_178 = 45.0f; func_8001D234(this, thisx->params); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, thisx, &D_80115440); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); thisx->colChkInfo.mass = 0xFF; thisx->unk_1F = 0; break; diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 871102f56c..54f7bfe5f4 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -74,8 +74,8 @@ const ActorInit En_Item00_InitVars = { }; // TODO: Define this section of .data here and rename the symbols -extern ColliderCylinderInit D_801154E0; -extern InitChainEntry D_8011550C[]; +extern ColliderCylinderInit D_801154E0; // rename to sCylinderInit when data is moved +extern InitChainEntry D_8011550C[]; // rename to sInitChain when data is moved extern Color_RGB8 D_80115510; extern Color_RGB8 D_80115514; extern UNK_TYPE D_80115518; diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 1d7110ae3e..31151ad930 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -1,11 +1,10 @@ /* * File: z_arrow_fire.c * Overlay: ovl_Arrow_Fire - * Description: Fire Arrow actor. Spawned by and attached to a normal arrow. + * Description: Fire Arrow. Spawned by and attached to a normal arrow. */ #include "z_arrow_fire.h" - #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #define FLAGS 0x02000010 @@ -35,7 +34,7 @@ const ActorInit Arrow_Fire_InitVars = { (ActorFunc)ArrowFire_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), }; @@ -46,7 +45,7 @@ void ArrowFire_SetupAction(ArrowFire* this, ArrowFireActionFunc actionFunc) { void ArrowFire_Init(Actor* thisx, GlobalContext* globalCtx) { ArrowFire* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); this->radius = 0; this->unk_158 = 1.0f; ArrowFire_SetupAction(&this->actor, ArrowFire_Charge); @@ -240,11 +239,11 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 666), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 255 - (stateFrames * 2) % 256, 0, 64, 32, 1, 255 - stateFrames % 256, 511 - (stateFrames * 10) % 512, 64, 64)); - gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sVertexDL); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_fire.c", 682); } } diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire_gfx.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire_gfx.c index 0b6990d9fc..d434dbe7ce 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire_gfx.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire_gfx.c @@ -146,7 +146,7 @@ static UNK_TYPE vertices2[] = { 0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF, }; -static Gfx textureDL[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -162,7 +162,7 @@ static Gfx textureDL[] = { gsSPEndDisplayList(), }; -static Gfx vertexDL[] = { +static Gfx sVertexDL[] = { gsSPVertex(vertices1, 32, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 12e92d20ac..189b5a89a5 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -1,7 +1,7 @@ /* * File: z_arrow_ice.c * Overlay: ovl_Arrow_Ice - * Description: Ice Arrow actor. Spawned by and attached to a normal arrow. + * Description: Ice Arrow. Spawned by and attached to a normal arrow. */ #include "z_arrow_ice.h" @@ -35,7 +35,7 @@ const ActorInit Arrow_Ice_InitVars = { (ActorFunc)ArrowIce_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), }; @@ -46,7 +46,7 @@ void ArrowIce_SetupAction(ArrowIce* this, ArrowIceActionFunc actionFunc) { void ArrowIce_Init(Actor* thisx, GlobalContext* globalCtx) { ArrowIce* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); this->radius = 0; this->unk_160 = 1.0f; ArrowIce_SetupAction(this, ArrowIce_Charge); @@ -240,11 +240,11 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 660), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1, 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16)); - gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sVertexDL); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_ice.c", 676); } } diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice_gfx.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice_gfx.c index 85836388a3..6ade81b98b 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice_gfx.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice_gfx.c @@ -146,7 +146,7 @@ static UNK_TYPE vertices2[] = { 0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF, }; -static Gfx textureDL[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -162,7 +162,7 @@ static Gfx textureDL[] = { gsSPEndDisplayList(), }; -static Gfx vertexDL[] = { +static Gfx sVertexDL[] = { gsSPVertex(vertices1, 32, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index c76dc8fa2c..b498d5c5a8 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -1,7 +1,7 @@ /* * File: z_arrow_light.c * Overlay: ovl_Arrow_Light - * Description: Light Arrow actor. Spawned by and attached to a normal arrow. + * Description: Light Arrow. Spawned by and attached to a normal arrow. */ #include "z_arrow_light.h" @@ -35,7 +35,7 @@ const ActorInit Arrow_Light_InitVars = { (ActorFunc)ArrowLight_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), }; @@ -46,7 +46,7 @@ void ArrowLight_SetupAction(ArrowLight* this, ArrowLightActionFunc actionFunc) { void ArrowLight_Init(Actor* thisx, GlobalContext* globalCtx) { ArrowLight* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); this->radius = 0; this->unk_160 = 1.0f; ArrowLight_SetupAction(this, ArrowLight_Charge); @@ -240,11 +240,11 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_light.c", 648), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1, 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 30) % 512, 8, 16)); - gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sVertexDL); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_arrow_light.c", 664); } } diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light_gfx.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light_gfx.c index 3f6dfd7cef..a9580f0ecc 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light_gfx.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light_gfx.c @@ -146,7 +146,7 @@ static UNK_TYPE vertices2[] = { 0x000002BC, 0x00000000, 0x07000800, 0x007800FF, 0xFFA30271, 0x00000000, 0x080006C2, 0xA95200FF, }; -static Gfx textureDL[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -162,7 +162,7 @@ static Gfx textureDL[] = { gsSPEndDisplayList(), }; -static Gfx vertexDL[] = { +static Gfx sVertexDL[] = { gsSPVertex(vertices1, 32, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 98d3f660e7..79a75b8cc2 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -24,7 +24,7 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx); -void func_8086C868(BgBdanObjects* this, GlobalContext* globalCtx); +void BgBdanObjects_DoNothing(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx); @@ -44,24 +44,24 @@ const ActorInit Bg_Bdan_Objects_InitVars = { (ActorFunc)BgBdanObjects_Draw, }; -static ColliderCylinderInit D_8086CD70 = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 }, { 0x00BB, 0x0050, 0x0000, { 0 } }, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_STOP), }; -static u32 D_8086CDA0[] = { +static Gfx* D_8086CDA0[] = { 0x06008618, 0x06004BE8, 0x060038E8, 0x06005200, }; -extern UNK_TYPE D_060038E8; +extern Gfx D_060038E8[]; extern UNK_TYPE D_06005048; extern UNK_TYPE D_06005580; extern UNK_TYPE D_06008CE0; @@ -101,7 +101,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; s32 localC = 0; - Actor_ProcessInitChain(this, initChain); + Actor_ProcessInitChain(this, sInitChain); DynaPolyInfo_SetActorMove(this, 1); this->unk_168 = (thisx->params >> 8) & 0x3F; thisx->params &= 0xFF; @@ -114,7 +114,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == 0) { DynaPolyInfo_Alloc(&D_06008CE0, &localC); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, this, &D_8086CD70); + Collider_SetCylinder(globalCtx, &this->collider, this, &sCylinderInit); thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f); if (Flags_GetClear(globalCtx, thisx->room)) { Flags_SetSwitch(globalCtx, this->unk_168); @@ -144,7 +144,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { } else { DynaPolyInfo_Alloc(&D_06005580, &localC); if (Flags_GetSwitch(globalCtx, this->unk_168)) { - this->actionFunc = func_8086C868; + this->actionFunc = BgBdanObjects_DoNothing; thisx->posRot.pos.y = thisx->initPosRot.pos.y - 400.0f; } else { this->actionFunc = func_8086CB10; @@ -312,6 +312,7 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) { s32 cond = Math_ApproxUpdateScaledS(&this->dyna.actor.shape.rot.y, this->dyna.actor.initPosRot.rot.y, 0x200); + if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -125.0f, 3.0f)) { if (cond) { this->actionFunc = func_8086C76C; @@ -332,13 +333,13 @@ void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx) { if (Math_SmoothScaleMaxMinF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) < 0.01f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); - this->actionFunc = func_8086C868; + this->actionFunc = BgBdanObjects_DoNothing; } else { func_8002F974(&this->dyna.actor, 0x208F); } } -void func_8086C868(BgBdanObjects* this, GlobalContext* globalCtx) { +void BgBdanObjects_DoNothing(BgBdanObjects* this, GlobalContext* globalCtx) { } void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) { @@ -423,7 +424,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f); if (this->unk_16A == 0) { Audio_PlayActorSound2(this, NA_SE_EV_BUYOSTAND_STOP_U); - this->actionFunc = func_8086C868; + this->actionFunc = BgBdanObjects_DoNothing; func_800C078C(globalCtx, 0, -1); } else { func_8002F974(&this->dyna.actor, 0x2090); @@ -449,7 +450,7 @@ void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx) { } if (thisx->params == 2) { - Gfx_DrawDListXlu(globalCtx, &D_060038E8); + Gfx_DrawDListXlu(globalCtx, D_060038E8); } else { Gfx_DrawDListOpa(globalCtx, D_8086CDA0[thisx->params]); } diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index b3d7cea582..159c6eb84c 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -1,7 +1,7 @@ /* * File: z_bg_bdan_switch.c * Overlay: Bg_Bdan_Switch - * Description: Switches (Inside Lord Jabu-Jabu) + * Description: Switches Inside Lord Jabu-Jabu */ #include "z_bg_bdan_switch.h" @@ -56,23 +56,23 @@ const ActorInit Bg_Bdan_Switch_InitVars = { }; extern UNK_PTR D_06005CF8; -extern UNK_PTR D_060061A0; -extern UNK_PTR D_06005A20; +extern Gfx D_060061A0[]; +extern Gfx D_06005A20[]; -static ColliderJntSphItemInit colliderItemsInit[] = { +static ColliderJntSphItemInit sJntSphItemsInit[] = { { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 }, }, }; -static ColliderJntSphInit colliderInit = { +static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, 1, - &colliderItemsInit, + &sJntSphItemsInit, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F4, 1400, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP), @@ -97,7 +97,7 @@ void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision, void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) { Actor* actor = &this->actor; Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, actor, &colliderInit, &this->colliderItems); + Collider_SetJntSph(globalCtx, &this->collider, actor, &sJntSphInit, &this->colliderItems); } void func_8086D0EC(BgBdanSwitch* this) { @@ -131,7 +131,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { s32 flag; type = this->actor.params & 0xFF; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { this->actor.scale.z = 0.05f; this->actor.scale.x = 0.05f; @@ -490,11 +490,11 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } -void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, UNK_TYPE arg2) { +void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) { func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->unk_1D0), this->actor.posRot.pos.z, &this->actor.shape.rot); Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY); - Gfx_DrawDListOpa(globalCtx, arg2); + Gfx_DrawDListOpa(globalCtx, dlist); } void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index bc4dd484bb..1fec36cb0e 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -1,13 +1,11 @@ /* * File: z_bg_bom_guard.c * Overlay: Bg_Bom_Guard - * Description: Bombchu Bowling Alley Game + * Description: Bombchu Bowling Alley Walls */ #include "z_bg_bom_guard.h" - #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" - #include #define FLAGS 0x00000010 @@ -32,7 +30,7 @@ const ActorInit Bg_Bom_Guard_InitVars = { NULL, }; -extern u32 D_06001C40; +extern UNK_TYPE D_06001C40; void BgBomGuard_SetupAction(BgBomGuard* this, BgBomGuardActionFunc actionFunc) { this->actionFunc = actionFunc; diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index 5a753c9c8d..d2232ef1fe 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -1,7 +1,7 @@ /* * File: z_bg_ddan_kd.c * Overlay: ovl_Bg_Ddan_Kd - * Description: Stone stairs in Dodongo's Cavern + * Description: Falling stairs in Dodongo's Cavern */ #include "z_bg_ddan_kd.h" @@ -31,13 +31,13 @@ const ActorInit Bg_Ddan_Kd_InitVars = { (ActorFunc)BgDdanKd_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER }, { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 245, 180, -400, { 0, 0, 0 } }, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 32767, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 32767, ICHAIN_CONTINUE), @@ -49,7 +49,7 @@ static f32 D_80871904[] = { 0.0f }; static f32 D_80871908[] = { 0.0f, -0.45f, 0.0f, 0.0f, 0.0f, 0.0f }; extern UNK_TYPE D_06004F30; -extern UNK_TYPE D_060048A8; +extern Gfx D_060048A8[]; void BgDdanKd_SetupAction(BgDdanKd* this, BgDdanKdActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -62,10 +62,10 @@ void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) { this->previousCollidingExplosion = NULL; - Actor_ProcessInitChain(&this->dyna.actor, &initChain); + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyInfo_SetActorMove(&this->dyna.actor, 1); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &cylinderInit); + Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); DynaPolyInfo_Alloc(&D_06004F30, &sp24); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp24); diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index f5f9f65f2d..361fd0a3a1 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -5,7 +5,6 @@ */ #include "z_bg_gate_shutter.h" - #include #define FLAGS 0x00000000 @@ -35,7 +34,7 @@ const ActorInit Bg_Gate_Shutter_InitVars = { }; extern Gfx D_06001CD0[]; -extern Gfx D_06001DA8[]; +extern UNK_TYPE D_06001DA8; void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) { BgGateShutter* this = THIS; @@ -136,7 +135,7 @@ void BgGateShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 328), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001CD0); + gSPDisplayList(gfxCtx->polyOpa.p++, D_06001CD0); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_gate_shutter.c", 333); } diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 7d7c854386..46f033590f 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -31,14 +31,14 @@ const ActorInit Bg_Gjyo_Bridge_InitVars = { (ActorFunc)BgGjyoBridge_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern UNK_TYPE D_06000600; +extern Gfx D_06000600[]; extern UNK_TYPE D_06000DB8; -extern UNK_TYPE D_02002640; +extern CutsceneData D_02002640[]; void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) { BgGjyoBridge* this = THIS; @@ -47,7 +47,7 @@ void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) { local_c = 0; - Actor_ProcessInitChain(thisx, &initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_Alloc(&D_06000DB8, &local_c); @@ -121,7 +121,7 @@ void BgGjyoBridge_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gjyo_bridge.c", 281), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, &D_06000600); + gSPDisplayList(gfxCtx->polyXlu.p++, D_06000600); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_gjyo_bridge.c", 285); } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index 23b0778cff..d5b06777bc 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -1,7 +1,7 @@ /* * File: z_bg_gnd_nisekabe.c * Overlay: ovl_Bg_Gnd_Nisekabe - * Description: 2D Stone Wall + * Description: Ganon's Castle Fake Wall */ #include "z_bg_gnd_nisekabe.h" @@ -27,7 +27,7 @@ const ActorInit Bg_Gnd_Nisekabe_InitVars = { (ActorFunc)BgGndNisekabe_Draw, }; -static u32 segmentAddr[] = { 0x06009230, 0x0600A390, 0x0600B4A0 }; +static Gfx* sDLists[] = { 0x06009230, 0x0600A390, 0x0600B4A0 }; void BgGndNisekabe_Init(Actor* thisx, GlobalContext* globalCtx) { BgGndNisekabe* this = THIS; @@ -54,8 +54,8 @@ void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx) { u32 index = this->actor.params & 0xFF; if ((this->actor.flags & 0x80) == 0x80) { - Gfx_DrawDListXlu(globalCtx, segmentAddr[index]); + Gfx_DrawDListXlu(globalCtx, sDLists[index]); } else { - Gfx_DrawDListOpa(globalCtx, segmentAddr[index]); + Gfx_DrawDListOpa(globalCtx, sDLists[index]); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 76f0a6629f..f31025122e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -17,7 +17,7 @@ void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx); void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx); -void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx); +void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Megane_InitVars = { ACTOR_BG_HAKA_MEGANE, @@ -31,26 +31,26 @@ const ActorInit Bg_Haka_Megane_InitVars = { NULL, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static UNK_TYPE collisions[] = { +static UNK_PTR sDynaAllocArg0[] = { 0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780, 0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000, }; -static UNK_TYPE dlists[] = { +static Gfx* sDLists[] = { 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, }; -extern UNK_TYPE D_06001250; +extern Gfx D_06001250[]; void BgHakaMegane_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaMegane* this = THIS; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_SetActorMove(&this->dyna, 0); if (thisx->params < 3) { @@ -74,7 +74,7 @@ void BgHakaMegane_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { s32 localC; - UNK_TYPE collision; + UNK_TYPE arg0; if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { this->dyna.actor.objBankIndex = this->objBankIndex; @@ -82,20 +82,21 @@ void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, &this->dyna.actor); if (globalCtx->roomCtx.curRoom.showInvisActors) { this->actionFunc = func_8087DBF0; - collision = collisions[this->dyna.actor.params]; - if (collision != 0) { - DynaPolyInfo_Alloc(collision, &localC); + arg0 = sDynaAllocArg0[this->dyna.actor.params]; + if (arg0 != 0) { + DynaPolyInfo_Alloc(arg0, &localC); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localC); } } else { - this->actionFunc = func_8087DC64; + this->actionFunc = BgHakaMegane_DoNothing; } } } void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (globalCtx->actorCtx.unk_03 != 0) { thisx->flags |= 0x80; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); @@ -105,7 +106,7 @@ void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { } } -void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) { +void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx) { } void BgHakaMegane_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -118,12 +119,12 @@ void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx) { BgHakaMegane* this = THIS; if ((thisx->flags & 0x80) == 0x80) { - Gfx_DrawDListXlu(globalCtx, dlists[thisx->params]); + Gfx_DrawDListXlu(globalCtx, sDLists[thisx->params]); } else { - Gfx_DrawDListOpa(globalCtx, dlists[thisx->params]); + Gfx_DrawDListOpa(globalCtx, sDLists[thisx->params]); } if (thisx->params == 0) { - Gfx_DrawDListXlu(globalCtx, &D_06001250); + Gfx_DrawDListXlu(globalCtx, D_06001250); } } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 9d394338aa..088e6aab47 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -1,7 +1,7 @@ /* * File: z_bg_hidan_firewall.c * Overlay: ovl_Bg_Hidan_Firewall - * Description: Proximity Flame Wall + * Description: Proximity Triggered Flame Wall */ #include "z_bg_hidan_firewall.h" @@ -36,13 +36,13 @@ const ActorInit Bg_Hidan_Firewall_InitVars = { NULL, }; -static ColliderCylinderInit cylinderInitData = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, { 30, 83, 0, { 0 } }, }; -static CollisionCheckInfoInit colChkInfoInit = { +static CollisionCheckInfoInit sColChkInfoInit = { 0x01, 0x0050, 0x0064, @@ -63,11 +63,11 @@ void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_150 = 0; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->collider.dim.pos.y = this->actor.posRot.pos.y; - func_80061ED4(&this->actor.colChkInfo, NULL, &colChkInfoInit); + func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actionFunc = BgHidanFirewall_Wait; } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index 7d40b260b2..1aa8193a29 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -1,7 +1,7 @@ /* * File: z_bg_hidan_fslift.c * Overlay: Bg_Hidan_Fslift - * Description: + * Description: Hookshot Elevator */ #include "z_bg_hidan_fslift.h" @@ -19,8 +19,8 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx); void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx); void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx); -extern u32 D_0600B630; -extern u32 D_0600E1E8; +extern Gfx D_0600B630[]; +extern UNK_TYPE D_0600E1E8; const ActorInit Bg_Hidan_Fslift_InitVars = { ACTOR_BG_HIDAN_FSLIFT, @@ -34,7 +34,7 @@ const ActorInit Bg_Hidan_Fslift_InitVars = { (ActorFunc)BgHidanFslift_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 300, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 350, ICHAIN_CONTINUE), @@ -47,7 +47,7 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) { s32 local_c = 0; s32 pad2; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_SetActorMove(thisx, 1); DynaPolyInfo_Alloc(&D_0600E1E8, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); @@ -83,23 +83,23 @@ void func_80886FB4(BgHidanFslift* this) { } void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { - UNK_TYPE somebool; + s32 heightBool; Actor* thisx = &this->dyna.actor; DECR(this->unk_168); if (this->unk_168 == 0) { - somebool = 0; + heightBool = false; if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) { - somebool = 1; + heightBool = true; } if (func_80043590(thisx)) { - if (somebool) { + if (heightBool) { this->actionFunc = func_808870D8; return; } } - if (!somebool) { + if (!heightBool) { this->actionFunc = func_8088706C; } } @@ -142,9 +142,7 @@ void BgHidanFslift_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_16A = 3; } func_8005A77C(globalCtx->cameraPtrs[0], 0x30); - return; - } - if (func_8004356C(thisx) == 0) { + } else if (func_8004356C(thisx) == 0) { if (this->unk_16A != 0) { func_8005A77C(globalCtx->cameraPtrs[0], 3); } @@ -153,5 +151,5 @@ void BgHidanFslift_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHidanFslift_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_0600B630); + Gfx_DrawDListOpa(globalCtx, D_0600B630); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 12eb9bc5e2..2cea8c6e45 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -22,11 +22,7 @@ void func_80889C18(BgHidanKousi* this, GlobalContext* globalCtx); void func_80889C90(BgHidanKousi* this, GlobalContext* globalCtx); void func_80889D28(BgHidanKousi* this, GlobalContext* globalCtx); -f32 D_80889E40[] = { - 120.0f, - 150.0f, - 150.0f, -}; +f32 D_80889E40[] = { 120.0f, 150.0f, 150.0f }; const ActorInit Bg_Hidan_Kousi_InitVars = { ACTOR_BG_HIDAN_KOUSI, @@ -40,22 +36,24 @@ const ActorInit Bg_Hidan_Kousi_InitVars = { (ActorFunc)BgHidanKousi_Draw, }; -static InitChainEntry D_80889E6C[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -u32 D_80889E70[] = { +UNK_PTR D_80889E70[] = { 0x0600E2CC, 0x0600E380, 0x0600E430, }; + s16 D_80889E7C[] = { 0x4000, 0xC000, 0xC000, 0x0000, }; -u32 D_80889E84[] = { + +Gfx* D_80889E84[] = { 0x0600C798, 0x0600BFA8, 0x0600BB58, @@ -75,7 +73,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF, ((s32)thisx->params >> 8) & 0xFF); - Actor_ProcessInitChain(thisx, D_80889E6C); + Actor_ProcessInitChain(thisx, sInitChain); if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) { osSyncPrintf("arg_data おかしい 【格子】\n"); } @@ -149,6 +147,7 @@ void func_80889D28(BgHidanKousi* this, GlobalContext* globalCtx) { void BgHidanKousi_Update(Actor* thisx, GlobalContext* globalCtx) { BgHidanKousi* this = THIS; + this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index 0941b82a58..3467b3f876 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -31,19 +31,19 @@ const ActorInit Bg_Hidan_Syoku_InitVars = { (ActorFunc)BgHidanSyoku_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern UNK_PTR D_0600A7E0; -extern UNK_PTR D_0600E568; +extern Gfx D_0600A7E0[]; +extern UNK_TYPE D_0600E568; void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) { BgHidanSyoku* this = THIS; s32 pad; u32 local_c = 0; - Actor_ProcessInitChain(&this->dyna.actor, initChain); + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyInfo_SetActorMove(&this->dyna, 1); DynaPolyInfo_Alloc(&D_0600E568, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); @@ -117,9 +117,7 @@ void BgHidanSyoku_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_168 = 3; } func_8005A77C(globalCtx->cameraPtrs[0], 0x30); - return; - } - if (!func_8004356C(&this->dyna.actor)) { + } else if (!func_8004356C(&this->dyna.actor)) { if (this->unk_168 != 0) { func_8005A77C(globalCtx->cameraPtrs[0], 3); } @@ -128,5 +126,5 @@ void BgHidanSyoku_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHidanSyoku_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_0600A7E0); + Gfx_DrawDListOpa(globalCtx, D_0600A7E0); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 1cba043387..9c193a38e3 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -1,7 +1,7 @@ /* * File: z_bg_jya_amishutter.c * Overlay: Bg_Jya_Amishutter - * Description: Circular Metal Grate (Spirit Temple) + * Description: Circular metal grate. Lifts up when you get close to it. */ #include "z_bg_jya_amishutter.h" @@ -36,7 +36,7 @@ const ActorInit Bg_Jya_Amishutter_InitVars = { (ActorFunc)BgJyaAmishutter_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 200, ICHAIN_CONTINUE), @@ -44,7 +44,7 @@ static InitChainEntry initChain[] = { }; extern UNK_TYPE D_0600C4C8; -extern UNK_TYPE D_0600C0A0; +extern Gfx D_0600C0A0[]; void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { s16 pad1; @@ -64,7 +64,7 @@ void BgJyaAmishutter_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaAmishutter* this = THIS; func_808932C0(this, globalCtx, &D_0600C4C8, 0); - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); func_808933BC(this); } @@ -129,5 +129,5 @@ void BgJyaAmishutter_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_0600C0A0); + Gfx_DrawDListOpa(globalCtx, D_0600C0A0); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 06e8a21bae..ef99e8032b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -33,23 +33,23 @@ const ActorInit Bg_Jya_Kanaami_InitVars = { (ActorFunc)BgJyaKanaami_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 700, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), }; -extern u32 D_0600F000; -extern u32 D_0600F208; +extern Gfx D_0600F000[]; +extern UNK_TYPE D_0600F208; -void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) { +void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, UNK_TYPE arg2, DynaPolyMoveFlag flag) { s32 pad; s32 local_c = 0; s32 pad2; DynaPolyInfo_SetActorMove(&this->actor, flag); - DynaPolyInfo_Alloc(collision, &local_c); + DynaPolyInfo_Alloc(arg2, &local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); if (this->dynaPolyId == 0x32) { osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145, @@ -61,7 +61,7 @@ void BgJyaKanaami_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaKanaami* this = THIS; func_80899740(this, globalCtx, &D_0600F208, 0); - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { func_80899A08(this); } else { @@ -127,5 +127,5 @@ void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_0600F000); + Gfx_DrawDListOpa(globalCtx, D_0600F000); } diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c index 1438092855..5ba66801c2 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c @@ -27,19 +27,19 @@ const ActorInit Bg_Menkuri_Kaiten_InitVars = { (ActorFunc)BgMenkuriKaiten_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern u32 D_060038D0; -extern u32 D_060042D8; +extern Gfx D_060038D0[]; +extern UNK_TYPE D_060042D8; void BgMenkuriKaiten_Init(Actor* thisx, GlobalContext* globalCtx) { BgMenkuriKaiten* this = THIS; s32 pad; u32 local_c = 0; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); DynaPolyInfo_SetActorMove(&this->actor, 3); DynaPolyInfo_Alloc(&D_060042D8, &local_c); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); @@ -61,5 +61,5 @@ void BgMenkuriKaiten_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_060038D0); + Gfx_DrawDListOpa(globalCtx, D_060038D0); } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index 1b7ea15d34..2c1f83a522 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -27,13 +27,13 @@ const ActorInit Bg_Mizu_Uzu_InitVars = { (ActorFunc)BgMizuUzu_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F8, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern u32 D_060074EC; +extern UNK_TYPE D_060074EC; void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx); @@ -43,7 +43,7 @@ void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx) { s32 local_c = 0; s32 pad2; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_SetActorMove(thisx, 0); DynaPolyInfo_Alloc(&D_060074EC, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index 08b0f8fedb..b947f0648a 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -30,20 +30,21 @@ const ActorInit Bg_Mjin_InitVars = { NULL, }; -extern u32 D_06000000; -extern u32 D_06000140; -extern u32 D_06000330; -extern u32 D_06000658; +extern UNK_TYPE D_06000000; +extern Gfx D_06000140[]; +extern Gfx D_06000330[]; +extern UNK_TYPE D_06000330_; +extern UNK_TYPE D_06000658; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 4000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 400, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 400, ICHAIN_STOP), }; -static s16 objectTbl[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME, - OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND }; +static s16 sObjectIDs[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME, + OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND }; void BgMjin_SetupAction(BgMjin* this, BgMjinActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -53,7 +54,7 @@ void BgMjin_Init(Actor* thisx, GlobalContext* globalCtx) { BgMjin* this = THIS; s8 objBankIndex; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); objBankIndex = Object_GetIndex(&globalCtx->objectCtx, (thisx->params != 0 ? OBJECT_MJIN : OBJECT_MJIN_OKA)); this->objBankIndex = objBankIndex; if (objBankIndex < 0) { @@ -71,7 +72,7 @@ void BgMjin_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_808A0850(BgMjin* this, GlobalContext* globalCtx) { u32 local_c; - u32 collision; + UNK_TYPE arg0; if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { local_c = 0; @@ -79,8 +80,8 @@ void func_808A0850(BgMjin* this, GlobalContext* globalCtx) { this->dyna.actor.objBankIndex = this->objBankIndex; Actor_SetObjectDependency(globalCtx, &this->dyna.actor); DynaPolyInfo_SetActorMove(&this->dyna.actor, 0); - collision = this->dyna.actor.params != 0 ? &D_06000658 : &D_06000330; - DynaPolyInfo_Alloc(collision, &local_c); + arg0 = this->dyna.actor.params != 0 ? &D_06000658 : &D_06000330_; + DynaPolyInfo_Alloc(arg0, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); BgMjin_SetupAction(this, func_808A0920); @@ -106,14 +107,14 @@ void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_mjin.c", 250); if (thisx->params != 0) { - objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[thisx->params - 1]); + objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[thisx->params - 1]); if (objBankIndex >= 0) { gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objBankIndex].segment); } gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06000000)); - dlist = &D_06000330; + dlist = D_06000330; } else { - dlist = &D_06000140; + dlist = D_06000140; } func_80093D18(globalCtx->state.gfxCtx); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mjin.c", 285), diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index 1ff2862d70..9aceee02ad 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -29,10 +29,10 @@ const ActorInit Bg_Pushbox_InitVars = { (ActorFunc)BgPushbox_Draw, }; -extern u32 D_06000000; -extern u32 D_06000350; +extern Gfx D_06000000[]; +extern UNK_TYPE D_06000350; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; @@ -46,7 +46,7 @@ void BgPushbox_Init(Actor* thisx, GlobalContext* globalCtx) { u32 local_c = 0; s32 pad2; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_Alloc(&D_06000350, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index 1568a2263e..c38bd4eb9e 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -27,24 +27,24 @@ const ActorInit Bg_Spot00_Break_InitVars = { (ActorFunc)BgSpot00Break_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F8, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -extern D_06000AF0; // segmented address: 0x06000AF0 -extern D_06000908; // segmented address: 0x06000908 -extern D_06000980; // segmented address: 0x06000980 -extern D_06000440; // segmented address: 0x06000440 +extern UNK_TYPE D_06000AF0; +extern UNK_TYPE D_06000908; +extern Gfx D_06000980[]; +extern Gfx D_06000440[]; void BgSpot00Break_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot00Break* this = THIS; s32 pad; u32 local_c = 0; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); DynaPolyInfo_SetActorMove(&this->actor, 0); if (this->actor.params == 1) { @@ -73,8 +73,8 @@ void BgSpot00Break_Draw(Actor* thisx, GlobalContext* globalCtx) { BgSpot00Break* this = THIS; if (this->actor.params == 1) { - Gfx_DrawDListOpa(globalCtx, &D_06000980); + Gfx_DrawDListOpa(globalCtx, D_06000980); } else { - Gfx_DrawDListOpa(globalCtx, &D_06000440); + Gfx_DrawDListOpa(globalCtx, D_06000440); } } diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index 3f8a4c23e7..e0f7788891 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -29,14 +29,14 @@ const ActorInit Bg_Spot01_Fusya_InitVars = { (ActorFunc)BgSpot01Fusya_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 12800, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 1300, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1300, ICHAIN_STOP), }; -extern u32 D_06000100; +extern Gfx D_06000100[]; void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, BgSpot01FusyaActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -45,7 +45,7 @@ void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, BgSpot01FusyaActionFunc acti void BgSpot01Fusya_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot01Fusya* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); this->unk_154 = 100.0f; this->unk_158 = 100.0f; this->unk_15C = 0.5f; @@ -86,7 +86,7 @@ void BgSpot01Fusya_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot01_fusya.c", 214), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_06000100); + gSPDisplayList(gfxCtx->polyOpa.p++, D_06000100); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot01_fusya.c", 219); } diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index a059324dcc..c958ef4231 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -1,7 +1,7 @@ /* * File: z_bg_spot01_idosoko.c * Overlay: Bg_Spot01_Idosoko - * Description: Stone blocking entrance to Bottom of the Well + * Description: Stone that blocks the entrance to Bottom of the Well */ #include "z_bg_spot01_idosoko.h" @@ -29,11 +29,11 @@ const ActorInit Bg_Spot01_Idosoko_InitVars = { (ActorFunc)BgSpot01Idosoko_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern u32 D_06003C64; +extern UNK_TYPE D_06003C64; void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, BgSpot01IdosokoActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -46,7 +46,7 @@ void BgSpot01Idosoko_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad2; DynaPolyInfo_SetActorMove(thisx, 1); - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_Alloc(&D_06003C64, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); if (LINK_IS_CHILD) { diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 77f749eb5c..97a03088ce 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -18,8 +18,8 @@ void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx); void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx); void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx); -extern Gfx* D_060012C0; -extern Gfx* D_06000918; +extern UNK_TYPE D_060012C0; +extern UNK_TYPE D_06000918; const ActorInit Bg_Spot05_Soko_InitVars = { ACTOR_BG_SPOT05_SOKO, @@ -33,11 +33,11 @@ const ActorInit Bg_Spot05_Soko_InitVars = { (ActorFunc)BgSpot05Soko_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static Gfx* dListTbl[] = { +static Gfx* sDLists[] = { 0x06000840, 0x06001190, }; @@ -49,7 +49,7 @@ void BgSpot05Soko_Init(Actor* thisx, GlobalContext* globalCtx) { u32 pad2; sp24 = 0; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); this->switchFlag = (thisx->params >> 8) & 0xFF; thisx->params &= 0xFF; DynaPolyInfo_SetActorMove(thisx, DPM_UNK); @@ -83,6 +83,7 @@ void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx) { void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (Flags_GetSwitch(globalCtx, this->switchFlag)) { Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 30, NA_SE_EV_METALDOOR_CLOSE); Actor_SetHeight(thisx, 50.0f); @@ -108,5 +109,5 @@ void BgSpot05Soko_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgSpot05Soko_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, dListTbl[thisx->params]); + Gfx_DrawDListOpa(globalCtx, sDLists[thisx->params]); } diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 5672e368ca..0b59d87a96 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -31,7 +31,7 @@ const ActorInit Bg_Spot09_Obj_InitVars = { (ActorFunc)BgSpot09Obj_Draw, }; -static u32 D_808B1F90[] = { 0x00000000, 0x06005520, 0x0600283C, 0x06008458, 0x06007580 }; +static UNK_PTR D_808B1F90[] = { NULL, 0x06005520, 0x0600283C, 0x06008458, 0x06007580 }; static s32 (*D_808B1FA4[])(BgSpot09Obj* this, GlobalContext* globalCtx) = { func_808B1BEC, @@ -39,21 +39,21 @@ static s32 (*D_808B1FA4[])(BgSpot09Obj* this, GlobalContext* globalCtx) = { func_808B1BA0, }; -static InitChainEntry initChain1[] = { +static InitChainEntry sInitChain1[] = { ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 3000, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 7200, ICHAIN_STOP), }; -static InitChainEntry initChain2[] = { +static InitChainEntry sInitChain2[] = { ICHAIN_F32(unk_F4, 7200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 800, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1500, ICHAIN_STOP), }; -static u32 dlists[] = { 0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210 }; +static Gfx* sDLists[] = { 0x06000100, 0x06003970, 0x06001120, 0x06007D40, 0x06006210 }; -extern UNK_TYPE D_06008010; +extern Gfx D_06008010[]; s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 carpentersRescued; @@ -119,12 +119,12 @@ s32 func_808B1C70(BgSpot09Obj* this, GlobalContext* globalCtx) { } s32 func_808B1CEC(BgSpot09Obj* this, GlobalContext* globalCtx) { - Actor_ProcessInitChain(&this->dyna.actor, &initChain1); + Actor_ProcessInitChain(&this->dyna.actor, sInitChain1); return 1; } s32 func_808B1D18(BgSpot09Obj* this, GlobalContext* globalCtx) { - Actor_ProcessInitChain(&this->dyna.actor, &initChain2); + Actor_ProcessInitChain(&this->dyna.actor, sInitChain2); return 1; } @@ -171,7 +171,7 @@ void BgSpot09Obj_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* dispRefs[3]; - Gfx_DrawDListOpa(globalCtx, dlists[thisx->params]); + Gfx_DrawDListOpa(globalCtx, sDLists[thisx->params]); if (thisx->params == 3) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 388); @@ -179,7 +179,7 @@ void BgSpot09Obj_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 391), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, &D_06008010); + gSPDisplayList(gfxCtx->polyXlu.p++, D_06008010); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot09_obj.c", 396); } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index 95f314460b..ddf43b1bdc 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -1,7 +1,7 @@ /* * File: z_bg_spot12_gate.c * Overlay: Bg_Spot12_Gate - * Description: + * Description: Haunted Wasteland Gate */ #include "z_bg_spot12_gate.h" @@ -36,14 +36,14 @@ const ActorInit Bg_Spot12_Gate_InitVars = { (ActorFunc)BgSpot12Gate_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 2500, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1200, ICHAIN_STOP), }; -extern UNK_TYPE D_06001080; +extern Gfx D_06001080[]; extern UNK_TYPE D_060011EC; void func_808B2F90(BgSpot12Gate* this, GlobalContext* globalCtx, UNK_TYPE collision, DynaPolyMoveFlag flags) { @@ -64,7 +64,7 @@ void BgSpot12Gate_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot12Gate* this = THIS; func_808B2F90(this, globalCtx, &D_060011EC, 0); - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { func_808B3274(this); @@ -147,5 +147,5 @@ void BgSpot12Gate_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgSpot12Gate_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_06001080); + Gfx_DrawDListOpa(globalCtx, D_06001080); } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 158508d55b..36a1200012 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -34,7 +34,7 @@ const ActorInit Bg_Spot12_Saku_InitVars = { (ActorFunc)BgSpot12Saku_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1200, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), @@ -62,7 +62,7 @@ void BgSpot12Saku_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot12Saku* this = THIS; func_808B3420(this, globalCtx, &D_0600238C, 0); - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { func_808B3714(this); } else { @@ -139,5 +139,5 @@ void BgSpot12Saku_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgSpot12Saku_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_06002260); + Gfx_DrawDListOpa(globalCtx, D_06002260); } diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index 0fbce64bce..7561c7050b 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -31,8 +31,8 @@ const ActorInit Bg_Spot15_Saku_InitVars = { (ActorFunc)BgSpot15Saku_Draw, }; -extern u32 D_060003C0; -extern u32 D_060004D0; +extern Gfx D_060003C0[]; +extern UNK_TYPE D_060004D0; void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot15Saku* this = THIS; @@ -103,7 +103,7 @@ void BgSpot15Saku_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot15_saku.c", 263), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, &D_060003C0); + gSPDisplayList(gfxCtx->polyXlu.p++, D_060003C0); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot15_saku.c", 268); } diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c index 0104d32b01..f6e9580d3e 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c @@ -28,7 +28,7 @@ const ActorInit Bg_Spot17_Funen_InitVars = { NULL, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; @@ -37,7 +37,7 @@ extern Gfx D_06000B40[]; void BgSpot17Funen_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot17Funen* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); osSyncPrintf("spot17 obj. 噴煙 (arg_data 0x%04x)\n", this->actor.params); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c index 1b138797c1..207403bf36 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c @@ -1,7 +1,7 @@ /* * File: z_bg_spot18_futa.c * Overlay: ovl_Bg_Spot18_Futa - * Description: The lid to a goron jar. + * Description: The lid to the spinning goron vase. */ #include "z_bg_spot18_futa.h" @@ -27,15 +27,15 @@ const ActorInit Bg_Spot18_Futa_InitVars = { (ActorFunc)BgSpot18Futa_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), }; -extern u32 DL_SPOT18_FUTA; // 0x6000368 -extern u32 DL_SPOT18_FUTA2; // 0x6000150 +extern UNK_TYPE D_06000368; +extern Gfx D_06000150[]; void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx) { BgSpot18Futa* this = THIS; @@ -43,9 +43,9 @@ void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx) { u32 sp1C = 0; DynaPolyInfo_SetActorMove(&this->actor, 0); - DynaPolyInfo_Alloc(&DL_SPOT18_FUTA, &sp1C); + DynaPolyInfo_Alloc(&D_06000368, &sp1C); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C); - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); } void BgSpot18Futa_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -71,5 +71,5 @@ void BgSpot18Futa_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &DL_SPOT18_FUTA2); + Gfx_DrawDListOpa(globalCtx, D_06000150); } diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 1f238dce29..3ed3a9a93f 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -19,7 +19,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx); void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx); void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx); -extern u32 D_06001BD0; +extern Gfx D_06001BD0[]; #include "z_bg_toki_swd_cutscene_data.c" EARLY @@ -35,20 +35,20 @@ const ActorInit Bg_Toki_Swd_InitVars = { (ActorFunc)BgTokiSwd_Draw, }; -static ColliderCylinderInit colliderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 10, 70, 0, { 0 } } }; -static CollisionCheckInfoInit colChkInfoInit = { +static CollisionCheckInfoInit sColChkInfoInit = { 0x0A, 0x0023, 0x0064, 0xFF, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP), }; @@ -60,7 +60,7 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { BgTokiSwd* this = THIS; s32 pad; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); this->actor.shape.unk_08 = 800.0f; BgTokiSwd_SetupAction(thisx, func_808BAF40); @@ -73,9 +73,9 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { } Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, thisx, &colliderInit); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); Collider_CylinderUpdate(thisx, &this->collider); - func_80061ED4(&thisx->colChkInfo, 0, &colChkInfoInit); + func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit); } void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -91,7 +91,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = D_808BBD90; gSaveContext.cutsceneTrigger = 1; } - if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20) != 0)) { + if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20))) { if (func_8002F410(&this->actor, globalCtx) != 0) { if (LINK_IS_CHILD) { Item_Give(globalCtx, ITEM_SWORD_MASTER); @@ -102,7 +102,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { Audio_SetBGM(NA_BGM_STOP); Audio_SetBGM(NA_SE_PL_BOUND_DIRT); gSaveContext.cutsceneTrigger = 1; - this->actor.attachedA = 0; + this->actor.attachedA = NULL; BgTokiSwd_SetupAction(this, func_808BB0AC); } else { if (func_8002E084(&this->actor, 0x2000) != 0) { @@ -169,7 +169,7 @@ void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames % 0x80), 32, 32)); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001BD0); + gSPDisplayList(gfxCtx->polyOpa.p++, D_06001BD0); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 776); } diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index ffebe67325..c97a1cb590 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -27,10 +27,10 @@ const ActorInit Bg_Umajump_InitVars = { (ActorFunc)BgUmaJump_Draw, }; -extern D_06001438; // segmented address: 0x06001438 -extern D_06001220; // segmented address: 0x06001220 +extern UNK_TYPE D_06001438; +extern Gfx D_06001220[]; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; @@ -39,7 +39,7 @@ void BgUmaJump_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; u32 sp24 = 0; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); DynaPolyInfo_SetActorMove(&this->actor, DPM_UNK); DynaPolyInfo_Alloc(&D_06001438, &sp24); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp24); @@ -63,5 +63,5 @@ void BgUmaJump_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_06001220); + Gfx_DrawDListOpa(globalCtx, D_06001220); } diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 41ad64fd07..3a2f62028a 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -5,7 +5,6 @@ */ #include "z_bg_zg.h" - #include #define FLAGS 0x00000010 @@ -24,16 +23,16 @@ void func_808C0CD4(BgZg* this, GlobalContext* globalCtx); void func_808C0D08(BgZg* this, GlobalContext* globalCtx); void func_808C0EEC(BgZg* this, GlobalContext* globalCtx); -static const BgZgActionFunc actionFuncs[] = { +static BgZgActionFunc sActionFuncs[] = { func_808C0CD4, func_808C0D08, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -static const BgZgDrawFunc drawFuncs[] = { +static BgZgDrawFunc sDrawFuncs[] = { func_808C0EEC, }; @@ -49,8 +48,8 @@ const ActorInit Bg_Zg_InitVars = { (ActorFunc)BgZg_Draw, }; -extern u32 D_06001080; -extern u32 D_060011D4; +extern Gfx D_06001080[]; +extern UNK_TYPE D_060011D4; void BgZg_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgZg* this = THIS; @@ -65,11 +64,13 @@ void func_808C0C50(BgZg* this) { s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; s32 flag = (thisx->params >> 8) & 0xFF; + return Flags_GetSwitch(globalCtx, flag); } s32 func_808C0CC8(BgZg* this) { s32 flag = this->dyna.actor.params & 0xFF; + return flag; } @@ -93,11 +94,11 @@ void BgZg_Update(Actor* thisx, GlobalContext* globalCtx) { BgZg* this = THIS; s32 action = this->action; - if (((action < 0) || (1 < action)) || (actionFuncs[action] == NULL)) { + if (((action < 0) || (1 < action)) || (sActionFuncs[action] == NULL)) { // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - actionFuncs[action](&this->dyna.actor, globalCtx); + sActionFuncs[action](&this->dyna.actor, globalCtx); } } @@ -106,7 +107,7 @@ void BgZg_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad[2]; u32 local_c; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); DynaPolyInfo_SetActorMove(thisx, DPM_UNK); local_c = 0; DynaPolyInfo_Alloc(&D_060011D4, &local_c); @@ -137,18 +138,18 @@ void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(gfxCtx, "../z_bg_zg.c", 315), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_06001080); + gSPDisplayList(gfxCtx->polyOpa.p++, D_06001080); Graph_CloseDisps(dispRefs, gfxCtx, "../z_bg_zg.c", 320); } void BgZg_Draw(Actor* thisx, GlobalContext* globalCtx) { BgZg* this = THIS; - s32 action = this->drawConfig; + s32 drawConfig = this->drawConfig; - if (((action < 0) || (action > 0)) || drawFuncs[action] == NULL) { + if (((drawConfig < 0) || (drawConfig > 0)) || sDrawFuncs[drawConfig] == NULL) { // Translates to: "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - drawFuncs[action](this, globalCtx); + sDrawFuncs[drawConfig](this, globalCtx); } } diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 387431c859..d3b2b487c1 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -1,7 +1,7 @@ /* * File: z_demo_geff.c * Overlay: Demo_Geff - * Description: + * Description: Ganon's Lair Rubble Fragment */ #include "z_demo_geff.h" @@ -25,21 +25,21 @@ void func_80978308(DemoGeff* this, GlobalContext* globalCtx); void func_809784D4(DemoGeff* this, GlobalContext* globalCtx); void func_80978344(DemoGeff* this, GlobalContext* globalCtx); -s16 objectIds[] = { +static s16 sObjectIDs[] = { OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, }; -DemoGeffInitFunc initFuncs[] = { +static DemoGeffInitFunc sInitFuncs[] = { func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, func_80978030, }; -DemoGeffActionFunc actionFuncs[] = { +static DemoGeffActionFunc sActionFuncs[] = { func_809783D4, func_80978308, }; -DemoGeffDrawFunc drawFuncs[] = { +static DemoGeffDrawFunc sDrawFuncs[] = { func_809784D4, func_80978344, }; @@ -56,7 +56,7 @@ const ActorInit Demo_Geff_InitVars = { (ActorFunc)DemoGeff_Draw, }; -extern UNK_TYPE D_06000EA0; +extern Gfx D_06000EA0[]; void DemoGeff_Destroy(Actor* thisx, GlobalContext* globalCtx) { } @@ -73,7 +73,7 @@ void DemoGeff_Init(Actor* thisx, GlobalContext* globalCtx) { this->drawConfig = 0; } -void func_80977EA8(GlobalContext* globalCtx, u32 dlist) { +void func_80977EA8(GlobalContext* globalCtx, Gfx* dlist) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -174,12 +174,12 @@ void func_80978308(DemoGeff* this, GlobalContext* globalCtx) { } void func_80978344(DemoGeff* this, GlobalContext* globalCtx) { - func_80977EA8(globalCtx, &D_06000EA0); + func_80977EA8(globalCtx, D_06000EA0); } void func_80978370(DemoGeff* this, GlobalContext* globalCtx) { s16 params = this->actor.params; - DemoGeffInitFunc initFunc = initFuncs[params]; + DemoGeffInitFunc initFunc = sInitFuncs[params]; if (initFunc == NULL) { osSyncPrintf(VT_FGCOL(RED) " Demo_Geff_main_init:初期化処理がおかしいarg_data = %d!\n" VT_RST, params); Actor_Kill(&this->actor); @@ -192,7 +192,7 @@ void func_809783D4(DemoGeff* this, GlobalContext* globalCtx) { ObjectContext* objCtx = &globalCtx->objectCtx; Actor* thisx = &this->actor; s32 params = thisx->params; - s16 objectId = objectIds[params]; + s16 objectId = sObjectIDs[params]; s32 objBankIndex = Object_GetIndex(objCtx, objectId); s32 pad; @@ -210,11 +210,11 @@ void func_809783D4(DemoGeff* this, GlobalContext* globalCtx) { void DemoGeff_Update(Actor* thisx, GlobalContext* globalCtx) { DemoGeff* this = THIS; - if (this->action < 0 || this->action >= 2 || actionFuncs[this->action] == NULL) { + if (this->action < 0 || this->action >= 2 || sActionFuncs[this->action] == NULL) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } - actionFuncs[this->action](this, globalCtx); + sActionFuncs[this->action](this, globalCtx); } void func_809784D4(DemoGeff* this, GlobalContext* globalCtx) { @@ -224,12 +224,12 @@ void DemoGeff_Draw(Actor* thisx, GlobalContext* globalCtx) { DemoGeff* this = THIS; s32 drawConfig = this->drawConfig; - if (drawConfig < 0 || drawConfig >= 2 || drawFuncs[drawConfig] == NULL) { + if (drawConfig < 0 || drawConfig >= 2 || sDrawFuncs[drawConfig] == NULL) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } if (drawConfig != 0) { func_80977F80(this, globalCtx); } - drawFuncs[drawConfig](this, globalCtx); + sDrawFuncs[drawConfig](this, globalCtx); } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 654a44b2e5..1d6b2cf304 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -15,9 +15,9 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx); void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx); void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx); -void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx); -void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx); -void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx); +void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx); +void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx); +void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx); const ActorInit Door_Ana_InitVars = { ACTOR_DOOR_ANA, @@ -31,8 +31,7 @@ const ActorInit Door_Ana_InitVars = { (ActorFunc)DoorAna_Draw, }; -// initial collision data -static ColliderCylinderInit colliderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 50, 10, 0, { 0 } }, @@ -44,7 +43,6 @@ static s16 entrances[] = { 0x05B0, 0x05B4, 0x05B8, 0x05BC, 0x05C0, 0x05C4, 0x05FC, }; -// display list extern Gfx D_05001390[]; void DoorAna_SetupAction(DoorAna* this, DoorAnaActionFunc actionFunc) { @@ -61,14 +59,14 @@ void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx) { // only allocate collider for grottos that need bombing/hammering open if ((this->actor.params & 0x200) != 0) { Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colliderInit); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); } else { this->actor.flags |= 0x10; } Actor_SetScale(&this->actor, 0); - DoorAna_SetupAction(this, DoorAna_Update_Hidden); + DoorAna_SetupAction(this, DoorAna_WaitClosed); } else { - DoorAna_SetupAction(this, DoorAna_Update_Open); + DoorAna_SetupAction(this, DoorAna_WaitOpen); } this->actor.unk_1F = 0; } @@ -83,7 +81,7 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) { } // update routine for grottos that are currently "hidden"/unopened -void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) { +void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) { u32 openGrotto = false; if ((this->actor.params & 0x200) == 0) { // opening with song of storms @@ -104,14 +102,14 @@ void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) { // open the grotto if (openGrotto) { this->actor.params &= ~0x0300; - DoorAna_SetupAction(this, DoorAna_Update_Open); + DoorAna_SetupAction(this, DoorAna_WaitOpen); Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } func_8002F5F0(&this->actor, globalCtx); } // update routine for grottos that are open -void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) { +void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { Player* player; s32 destinationIdx; @@ -128,7 +126,7 @@ void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) { destinationIdx = this->actor.initPosRot.rot.z + 1; } globalCtx->nextEntranceIndex = entrances[destinationIdx]; - DoorAna_SetupAction(this, DoorAna_Update_Entering); + DoorAna_SetupAction(this, DoorAna_GrabLink); } else { if (!func_8008E988(globalCtx) && !(player->stateFlags1 & 0x8800000) && this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink && @@ -144,7 +142,7 @@ void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) { } // update function for after the player has triggered the grotto -void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx) { +void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) { Player* player; if (this->actor.yDistanceFromLink <= 0.0f && 15.0f < this->actor.xzDistanceFromLink) { diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index dd8b8bda72..532327151c 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -1,7 +1,7 @@ /* * File: z_door_toki.c * Overlay: ovl_Door_Toki - * Description: Manages collision for the Door of Time. + * Description: Door of Time Collision */ #include "z_door_toki.h" @@ -26,10 +26,9 @@ const ActorInit Door_Toki_InitVars = { NULL, }; -// This has to be defined in the linker to produce a proper lui addiu pair -extern u32 DOOR_TOKI_COLLISION_DATA; +extern UNK_TYPE D_06007888; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; @@ -38,9 +37,9 @@ void DoorToki_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; u32 sp1C = 0; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); DynaPolyInfo_SetActorMove(&this->actor, 0); - DynaPolyInfo_Alloc(&DOOR_TOKI_COLLISION_DATA, &sp1C); + DynaPolyInfo_Alloc(&D_06007888, &sp1C); this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C); } diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 491a86d4c0..732a3fb8fb 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -44,18 +44,18 @@ const ActorInit En_Ani_InitVars = { (ActorFunc)EnAni_Draw, }; -static ColliderCylinderInit cylinderInitData = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 30, 40, 0, { 0 } }, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 850, ICHAIN_STOP), }; -static Vec3f EnAniVec = { 800.0f, 500.0f, 0.0f }; +static Vec3f sMultVec = { 800.0f, 500.0f, 0.0f }; UNK_PTR D_809B0F80[] = { 0x06000408, @@ -71,13 +71,13 @@ void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) { EnAni* this = THIS; s32 pad; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawFunc_Circle, 36.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, &D_060076EC, this->limbDrawTable, this->transitionDrawTable, 0x10); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060076EC); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = 0xFF; if (LINK_IS_CHILD) { EnAni_SetupAction(this, func_809B064C); @@ -307,7 +307,7 @@ s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { if (limbIndex == 15) { - Matrix_MultVec3f(&EnAniVec, &thisx->posRot2.pos); + Matrix_MultVec3f(&sMultVec, &thisx->posRot2.pos); } } diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index d18a0f38aa..2a30d4b3f5 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -5,7 +5,6 @@ */ #include "z_en_anubice_tag.h" - #include #define FLAGS 0x00000010 @@ -67,7 +66,6 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { if (this->anubis != NULL) { anubis = this->anubis; - if (anubis->actor.update == NULL) { return; } diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h index fab5ccef4f..2182ff6870 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h @@ -3,8 +3,7 @@ #include #include - -#include "../ovl_En_Anubice/z_en_anubice.h" +#include "overlays/actors/ovl_En_Anubice/z_en_anubice.h" struct EnAnubiceTag; diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.c b/src/overlays/actors/ovl_En_Bird/z_en_bird.c index 792a6f013f..0487c0ea63 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -1,7 +1,7 @@ /* * File: z_en_bird.c * Overlay: ovl_En_Bird - * Description: A brown bird. Tweet tweet. + * Description: An unused brown bird */ #include "z_en_bird.h" @@ -32,7 +32,7 @@ const ActorInit En_Bird_InitVars = { (ActorFunc)EnBird_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), }; @@ -46,7 +46,7 @@ void EnBird_SetupAction(EnBird* this, EnBirdActionFunc actionFunc) { void EnBird_Init(Actor* thisx, GlobalContext* globalCtx) { EnBird* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.01); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, 0, 0, 0); ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawFunc_Circle, 4); diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 3eba0ba5d1..9700aec919 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -29,21 +29,18 @@ const ActorInit En_Boom_InitVars = { (ActorFunc)EnBoom_Draw, }; -static ColliderQuadInit col = { +static ColliderQuadInit sQuadInit = { { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, { 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 }, { 0 }, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP), }; -static Vec3f mult1 = { -960.0f, 0.0f, 0.0f }; -static Vec3f mult2 = { 960.0f, 0.0f, 0.0f }; - -extern D_0400C808; +extern Gfx D_0400C808[]; void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -55,7 +52,7 @@ void EnBoom_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.room = -1; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); trail.p1StartColor.r = 0xFF; trail.p1StartColor.g = 0xFF; @@ -84,7 +81,7 @@ void EnBoom_Init(Actor* thisx, GlobalContext* globalCtx) { Effect_Add(globalCtx, &this->effectIndex, EFFECT_BLURE1, 0, 0, &trail); Collider_InitQuad(globalCtx, &this->collider); - Collider_SetQuad(globalCtx, &this->collider, this, &col); + Collider_SetQuad(globalCtx, &this->collider, this, &sQuadInit); EnBoom_SetupAction(this, EnBoom_Fly); } @@ -240,6 +237,8 @@ void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { + static Vec3f sMultVec1 = { -960.0f, 0.0f, 0.0f }; + static Vec3f sMultVec2 = { 960.0f, 0.0f, 0.0f }; EnBoom* this = THIS; Vec3f vec1; Vec3f vec2; @@ -251,8 +250,8 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateY(this->actor.posRot.rot.y * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateZ(0.7669904f, MTXMODE_APPLY); Matrix_RotateX(this->actor.posRot.rot.x * 0.0000958738f, MTXMODE_APPLY); - Matrix_MultVec3f(&mult1, &vec1); - Matrix_MultVec3f(&mult2, &vec2); + Matrix_MultVec3f(&sMultVec1, &vec1); + Matrix_MultVec3f(&sMultVec2, &vec2); if (func_80090480(globalCtx, &this->collider, &this->unk_1DC, &vec1, &vec2) != 0) { EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &vec1, &vec2); @@ -263,7 +262,7 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_boom.c", 601), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_0400C808); + gSPDisplayList(gfxCtx->polyOpa.p++, D_0400C808); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_boom.c", 604); } diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index d1c9ae413c..95b2abb344 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -38,17 +38,13 @@ const ActorInit En_Cow_InitVars = { (ActorFunc)EnCow_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 30, 40, 0, { 0, 0, 0 } }, }; -Vec3f D_809E010C = { - 0.0f, - -1300.0f, - 1100.0f, -}; +static Vec3f D_809E010C = { 0.0f, -1300.0f, 1100.0f }; extern AnimationHeader D_060001CC; extern SkeletonHeader D_06004010; @@ -91,9 +87,7 @@ void func_809DEE9C(EnCow* this) { void func_809DEF94(EnCow* this) { Vec3f vec; - // clang-format off - vec.x = 0.0f; vec.y = 57.0f; vec.z = -36.0f; - // clang-format on + VEC_SET(vec, 0.0f, 57.0f, -36.0f); func_809DEE00(&vec, this->actor.shape.rot.y); this->actor.posRot.pos.x += vec.x; @@ -112,9 +106,9 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { this->transitionDrawTable, 6); SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060001CC); Collider_InitCylinder(globalCtx, &this->colliders[0]); - Collider_SetCylinder(globalCtx, &this->colliders[0], &this->actor, &cylinderInit); + Collider_SetCylinder(globalCtx, &this->colliders[0], &this->actor, &sCylinderInit); Collider_InitCylinder(globalCtx, &this->colliders[1]); - Collider_SetCylinder(globalCtx, &this->colliders[1], &this->actor, &cylinderInit); + Collider_SetCylinder(globalCtx, &this->colliders[1], &this->actor, &sCylinderInit); func_809DEE9C(this); this->actionFunc = func_809DF96C; if (globalCtx->sceneNum == SCENE_LINK_HOME) { diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 1f876c40fb..a27ea54789 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -23,9 +23,6 @@ void EnDha_SetupDeath(EnDha* this); void EnDha_Die(EnDha* this, GlobalContext* globalCtx); void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx); -extern SkeletonHeader D_06000BD8; -extern AnimationHeader D_060015B0; - const ActorInit En_Dha_InitVars = { ACTOR_EN_DHA, ACTORTYPE_ENEMY, @@ -38,12 +35,12 @@ const ActorInit En_Dha_InitVars = { (ActorFunc)EnDha_Draw, }; -static DamageTable damageTable = { { +static DamageTable sDamageTable = { { 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, } }; -static ColliderJntSphItemInit colliderItemsInit[] = { +static ColliderJntSphItemInit sJntSphItemsInit[] = { { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 1, { { 0, 0, 0 }, 12 }, 100 }, @@ -66,18 +63,21 @@ static ColliderJntSphItemInit colliderItemsInit[] = { }, }; -static ColliderJntSphInit colliderInit = { +static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK6, 0x00, 0x09, 0x19, 0x10, COLSHAPE_JNTSPH }, 5, - &colliderItemsInit, + &sJntSphItemsInit, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x2E, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), }; +extern SkeletonHeader D_06000BD8; +extern AnimationHeader D_060015B0; + void EnDha_SetupAction(EnDha* this, EnDhaActionFunc actionFunc) { this->actionFunc = actionFunc; } @@ -85,8 +85,8 @@ void EnDha_SetupAction(EnDha* this, EnDhaActionFunc actionFunc) { void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) { EnDha* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); - this->actor.colChkInfo.damageTable = &damageTable; + Actor_ProcessInitChain(&this->actor, sInitChain); + this->actor.colChkInfo.damageTable = &sDamageTable; SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06000BD8, &D_060015B0, this->limbDrawTable, this->transitionDrawTable, 4); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Teardrop, 90.0f); @@ -96,7 +96,7 @@ void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.health = 8; this->unk_1CE = -0x4000; Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &colliderInit, &this->colliderItem); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItem); this->actor.flags &= ~1; func_809EC9C8(this); } diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index a7fcfc5ccb..50847b16f9 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -1,7 +1,7 @@ /* * File: z_en_dog.c * Overlay: ovl_En_Dog - * Description: Dog actor that Link can interact with + * Description: Dog */ #include "z_en_dog.h" @@ -34,13 +34,13 @@ const ActorInit En_Dog_InitVars = { (ActorFunc)EnDog_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 16, 20, 0, { 0 } }, }; -static CollisionCheckInfoInit2 colChkInfoInit = { +static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, // health 0x0000, // unk_10 0x0000, // unk_12 @@ -48,7 +48,7 @@ static CollisionCheckInfoInit2 colChkInfoInit = { 0x32, // mass }; -static struct_80034EC0_Entry animations[] = { +static struct_80034EC0_Entry sAnimations[] = { { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06000D78, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06000278, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, { 0x06001150, 1.0f, 0.0f, 4.0f, 0x02, -6.0f }, { 0x06001150, 1.0f, 5.0f, 25.0f, 0x04, -6.0f }, @@ -126,19 +126,19 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) { animation = 6; break; } - func_80034EC0(&this->skelAnime, &animations, animation); + func_80034EC0(&this->skelAnime, sAnimations, animation); } switch (this->behavior) { case DOG_SIT: if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) { - func_80034EC0(&this->skelAnime, &animations, 5); + func_80034EC0(&this->skelAnime, sAnimations, 5); this->behavior = this->nextBehavior = DOG_SIT_2; } break; case DOG_BOW: if (func_800A56C8(&this->skelAnime, this->skelAnime.animFrameCount) != 0) { - func_80034EC0(&this->skelAnime, &animations, 7); + func_80034EC0(&this->skelAnime, sAnimations, 7); this->behavior = this->nextBehavior = DOG_BOW_2; } break; @@ -227,7 +227,7 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007290, NULL, &this->unk_1F4, &this->unk_242, 13); - func_80034EC0(&this->skelAnime, animations, 0); + func_80034EC0(&this->skelAnime, sAnimations, 0); if ((this->actor.params & 0x8000) == 0) { this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8); @@ -240,8 +240,8 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { } Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); - func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 7ae8a22a22..1355933ed4 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -15,19 +15,6 @@ void EnDs_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnDs_Update(Actor* thisx, GlobalContext* globalCtx); void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx); -void EnDs_Talk(EnDs* this, GlobalContext* globalCtx); -void EnDs_TalkNoEmptyBottle(EnDs* this, GlobalContext* globalCtx); -void EnDs_TalkAfterGiveOddPotion(EnDs* this, GlobalContext* globalCtx); -void EnDs_DisplayOddPotionText(EnDs* this, GlobalContext* globalCtx); -void EnDs_GiveOddPotion(EnDs* this, GlobalContext* globalCtx); -void EnDs_TalkAfterBrewOddPotion(EnDs* this, GlobalContext* globalCtx); -void EnDs_BrewOddPotion3(EnDs* this, GlobalContext* globalCtx); -void EnDs_BrewOddPotion2(EnDs* this, GlobalContext* globalCtx); -void EnDs_BrewOddPotion1(EnDs* this, GlobalContext* globalCtx); -void EnDs_OfferOddPotion(EnDs* this, GlobalContext* globalCtx); -int EnDs_CheckRupeesAndBottle(); -void EnDs_GiveBluePotion(EnDs* this, GlobalContext* globalCtx); -void EnDs_OfferBluePotion(EnDs* this, GlobalContext* globalCtx); void EnDs_Wait(EnDs* this, GlobalContext* globalCtx); const ActorInit En_Ds_InitVars = { @@ -45,8 +32,6 @@ const ActorInit En_Ds_InitVars = { extern SkeletonHeader D_06004768; extern AnimationHeader D_0600039C; -Vec3f mtxSrc = { 1100.0f, 500.0f, 0.0f }; - void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { EnDs* this = THIS; @@ -221,7 +206,7 @@ void EnDs_OfferBluePotion(EnDs* this, GlobalContext* globalCtx) { void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 unkAngle; + s16 yawDiff; if (func_8002F194(&this->actor, globalCtx) != 0) { if (func_8002F368(globalCtx) == 8) { @@ -240,10 +225,10 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) { this->actionFunc = EnDs_Talk; } } else { - unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; + yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; this->actor.textId = 0x5048; - if ((ABS(unkAngle) < 0x2151) && (this->actor.xzDistanceFromLink < 200.0f)) { + if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistanceFromLink < 200.0f)) { func_8002F298(this, globalCtx, 100.0f, 8); this->unk_1E8 |= 1; } @@ -280,8 +265,10 @@ s32 EnDs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f sMultVec = { 1100.0f, 500.0f, 0.0f }; + if (limbIndex == 5) { - Matrix_MultVec3f(&mtxSrc, &thisx->posRot2.pos); + Matrix_MultVec3f(&sMultVec, &thisx->posRot2.pos); } } diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 1c9e973931..e838fd359c 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -1,11 +1,10 @@ /* * File: z_en_eg.c * Overlay: ovl_En_Eg - * Description: Zelda's Path in Ganon Castle Escape? + * Description: Triggers a void out (used in the tower collapse sequence?) */ #include "z_en_eg.h" - #include #define FLAGS 0x00000010 @@ -19,8 +18,9 @@ void EnEg_Draw(Actor* thisx, GlobalContext* globalCtx); void func_809FFDC8(EnEg* this, GlobalContext* globalCtx); -static bool hasVoidedOut = false; -static const EnEgActionFunc actionFuncs[] = { +static s32 voided = false; + +static EnEgActionFunc sActionFuncs[] = { func_809FFDC8, }; @@ -50,14 +50,14 @@ void EnEg_Init(Actor* thisx, GlobalContext* globalCtx) { } void func_809FFDC8(EnEg* this, GlobalContext* globalCtx) { - if (!hasVoidedOut && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) { + if (!voided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) { // Void the player out Gameplay_TriggerRespawn(globalCtx); gSaveContext.respawnFlag = -2; Audio_SetBGM(NA_BGM_STOP); globalCtx->fadeTransition = 2; EnEg_PlayVoidOutSFX(); - hasVoidedOut = true; + voided = true; } } @@ -65,11 +65,11 @@ void EnEg_Update(Actor* thisx, GlobalContext* globalCtx) { EnEg* this = THIS; s32 action = this->action; - if (((action < 0) || (0 < action)) || (actionFuncs[action] == NULL)) { + if (((action < 0) || (0 < action)) || (sActionFuncs[action] == NULL)) { // Translates to: "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!" osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - actionFuncs[action](this, globalCtx); + sActionFuncs[action](this, globalCtx); } } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index a4465b902c..f7ed2d8789 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -27,7 +27,7 @@ void EnFloormas_Split(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_Recover(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_DrawHighlighted(Actor* this, GlobalContext* globalCtx); void EnFloormas_SmWait(EnFloormas* this, GlobalContext* globalCtx); -void EnFloormas_BigDecideActionBegin(EnFloormas* this); +void EnFloormas_SetupBigDecideAction(EnFloormas* this); void EnFloormas_Freeze(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx); void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx); @@ -58,20 +58,20 @@ const ActorInit En_Floormas_InitVars = { (ActorFunc)EnFloormas_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, { 0x00, { 0xFFCFFFFF, 0x04, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x05, 0x01 }, { 25, 40, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit colCheckInfoInit = { 0x04, 0x001E, 0x0028, 0x96 }; +static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x001E, 0x0028, 0x96 }; -static DamageTable damageTable = { { +static DamageTable sDamageTable = { { 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, } }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 0x157C, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0xFC18, ICHAIN_STOP), @@ -89,13 +89,13 @@ static Vec3f D_80A1A4DC = { 0.0f, }; -static Vec3f dustPos = { +static Vec3f sDustPos = { 0.0f, 0.0f, 0.0f, }; -static Color_RGBA8 mergeColor = { +static Color_RGBA8 sMergeColor = { 0x00, 0xFF, 0x00, @@ -126,13 +126,13 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { s32 invisble; s32 pad; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->limbDrawTable, &this->transitionDrawTable, 25); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); - func_80061ED4(&this->actor.colChkInfo, &damageTable, &colCheckInfoInit); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->zOffset = -1600; invisble = this->actor.params & SPAWN_INVISIBLE; @@ -171,7 +171,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.attachedA->attachedA = this->actor.attachedB; this->actor.attachedB->attachedA = &this->actor; this->actor.attachedB->attachedB = this->actor.attachedA; - EnFloormas_BigDecideActionBegin(this); + EnFloormas_SetupBigDecideAction(this); } } @@ -193,18 +193,18 @@ void EnFloormas_MakeVulnerable(EnFloormas* this) { this->collider.base.acFlags &= ~4; } -void EnFloormas_BigDecideActionBegin(EnFloormas* this) { +void EnFloormas_SetupBigDecideAction(EnFloormas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009DB0); this->actionFunc = EnFloormas_BigDecideAction; this->actor.speedXZ = 0.0f; } -void EnFloormas_StandBegin(EnFloormas* this) { +void EnFloormas_SetupStand(EnFloormas* this) { SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0600A054, -3.0f); this->actionFunc = EnFloormas_Stand; } -void EnFloormas_BigWalkBegin(EnFloormas* this) { +void EnFloormas_SetupBigWalk(EnFloormas* this) { if (this->actionFunc != EnFloormas_Run) { SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 1.5f); } else { @@ -216,20 +216,20 @@ void EnFloormas_BigWalkBegin(EnFloormas* this) { this->actor.speedXZ = 1.5f; } -void EnFloormas_BigStopWalkBegin(EnFloormas* this) { +void EnFloormas_SetupBigStopWalk(EnFloormas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244); this->actionFunc = EnFloormas_BigStopWalk; this->actor.speedXZ = 0.0f; } -void EnFloormas_RunBegin(EnFloormas* this) { +void EnFloormas_SetupRun(EnFloormas* this) { this->actionTimer = 0; this->actionFunc = EnFloormas_Run; this->actor.speedXZ = 5.0f; this->skelAnime.animPlaybackSpeed = 3.0f; } -void EnFloormas_TurnBegin(EnFloormas* this) { +void EnFloormas_SetupTurn(EnFloormas* this) { s16 rotDelta = this->actionTarget - this->actor.shape.rot.y; this->actor.speedXZ = 0.0f; if (rotDelta > 0) { @@ -248,7 +248,7 @@ void EnFloormas_TurnBegin(EnFloormas* this) { this->actionFunc = EnFloormas_Turn; } -void EnFloormas_HoverBegin(EnFloormas* this, GlobalContext* globalCtx) { +void EnFloormas_SetupHover(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_ChangeAnim(&this->skelAnime, &D_06009520, 3.0f, 0, SkelAnime_GetFrameCount(&D_06009520), 2, -3.0f); this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; @@ -258,14 +258,14 @@ void EnFloormas_HoverBegin(EnFloormas* this, GlobalContext* globalCtx) { this->actionFunc = EnFloormas_Hover; } -void EnFloormas_ChargeBegin(EnFloormas* this) { +void EnFloormas_SetupCharge(EnFloormas* this) { this->actionTimer = 25; this->actor.gravity = -0.15f; this->actionFunc = EnFloormas_Charge; this->actor.speedXZ = 0.5f; } -void EnFloormas_LandBegin(EnFloormas* this) { +void EnFloormas_SetupLand(EnFloormas* this) { SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f); if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != EnFloormas_Charge)) { this->actionTimer = 30; @@ -276,7 +276,7 @@ void EnFloormas_LandBegin(EnFloormas* this) { this->actionFunc = EnFloormas_Land; } -void EnFloormas_SplitBegin(EnFloormas* this) { +void EnFloormas_SetupSplit(EnFloormas* this) { Actor_SetScale(&this->actor, 0.004f); this->actor.flags |= 0x10; @@ -289,23 +289,23 @@ void EnFloormas_SplitBegin(EnFloormas* this) { this->actor.posRot.pos = this->actor.attachedA->posRot.pos; this->actor.params = 0x10; SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, SkelAnime_GetFrameCount(&D_060019CC), 2, 0.0f); - this->collider.dim.radius = cylinderInit.dim.radius * 0.6f; - this->collider.dim.height = cylinderInit.dim.height * 0.6f; + this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f; + this->collider.dim.height = sCylinderInit.dim.height * 0.6f; this->collider.body.bumperFlags &= ~4; this->actor.speedXZ = 4.0f; this->actor.velocity.y = 7.0f; // using div creates a signed check. - this->actor.colChkInfo.health = colCheckInfoInit.health >> 1; + this->actor.colChkInfo.health = sColChkInfoInit.health >> 1; this->actionFunc = EnFloormas_Split; } -void EnFloormas_SmWalkBegin(EnFloormas* this) { +void EnFloormas_SetupSmWalk(EnFloormas* this) { SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 4.5f); this->actionFunc = EnFloormas_SmWalk; this->actor.speedXZ = 5.0f; } -void EnFloormas_SmDecideActionBegin(EnFloormas* this) { +void EnFloormas_SetupSmDecideAction(EnFloormas* this) { if (this->actionFunc != EnFloormas_SmWalk) { SkelAnime_ChangeAnimPlaybackRepeat(&this->skelAnime, &D_060041F4, 4.5f); } @@ -313,7 +313,7 @@ void EnFloormas_SmDecideActionBegin(EnFloormas* this) { this->actor.speedXZ = 5.0f; } -void EnFloormas_SmShrinkBegin(EnFloormas* this, GlobalContext* globalCtx) { +void EnFloormas_SetupSmShrink(EnFloormas* this, GlobalContext* globalCtx) { Vec3f pos; this->actor.speedXZ = 0.0f; @@ -325,19 +325,19 @@ void EnFloormas_SmShrinkBegin(EnFloormas* this, GlobalContext* globalCtx) { this->actionFunc = EnFloormas_SmShrink; } -void EnFloormas_SmSlaveJumpAtMasterBegin(EnFloormas* this) { +void EnFloormas_SetupSlaveJumpAtMaster(EnFloormas* this) { SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); this->actionFunc = EnFloormas_SmSlaveJumpAtMaster; this->actor.speedXZ = 0.0f; } -void EnFloormas_JumpAtLinkBegin(EnFloormas* this) { +void EnFloormas_SetupJumpAtLink(EnFloormas* this) { SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); this->actionFunc = EnFloormas_JumpAtLink; this->actor.speedXZ = 0.0f; } -void EnFloormas_GrabLinkBegin(EnFloormas* this, Player* player) { +void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { f32 yDelta; f32 xzDelta; @@ -360,7 +360,7 @@ void EnFloormas_GrabLinkBegin(EnFloormas* this, Player* player) { this->actionFunc = EnFloormas_GrabLink; } -void EnFloormas_MergeBegin(EnFloormas* this) { +void EnFloormas_SetupMerge(EnFloormas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009DB0); this->actionTimer = 0; this->smActionTimer += 1500; @@ -368,7 +368,7 @@ void EnFloormas_MergeBegin(EnFloormas* this) { this->actionFunc = EnFloormas_Merge; } -void EnFloormas_SmWaitBegin(EnFloormas* this) { +void EnFloormas_SetupSmWait(EnFloormas* this) { EnFloormas* attachedA = (EnFloormas*)this->actor.attachedA; EnFloormas* attachedB = (EnFloormas*)this->actor.attachedB; @@ -384,7 +384,7 @@ void EnFloormas_SmWaitBegin(EnFloormas* this) { this->actor.flags &= ~0x11; } -void EnFloormas_TakeDamageBegin(EnFloormas* this) { +void EnFloormas_SetupTakeDamage(EnFloormas* this) { SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f); if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; @@ -397,14 +397,14 @@ void EnFloormas_TakeDamageBegin(EnFloormas* this) { this->actor.velocity.y = 5.5f; } -void EnFloormas_RecoverBegin(EnFloormas* this) { +void EnFloormas_SetupRecover(EnFloormas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4); this->actor.velocity.y = this->actor.speedXZ = 0.0f; this->actor.posRot.rot.y = this->actor.shape.rot.y; this->actionFunc = EnFloormas_Recover; } -void EnFloormas_FreezeBegin(EnFloormas* this) { +void EnFloormas_SetupFreeze(EnFloormas* this) { SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f); this->actor.speedXZ = 0.0f; if (this->actor.colChkInfo.damageEffect == 4) { @@ -425,14 +425,14 @@ void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) { if (this->actor.scale.x > 0.004f) { // split this->actor.shape.rot.y = this->actor.rotTowardsLinkY + 0x8000; - EnFloormas_SplitBegin((EnFloormas*)this->actor.attachedB); - EnFloormas_SplitBegin((EnFloormas*)this->actor.attachedA); - EnFloormas_SplitBegin(this); + EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedB); + EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedA); + EnFloormas_SetupSplit(this); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT); } else { // Die Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); - EnFloormas_SmShrinkBegin(this, globalCtx); + EnFloormas_SetupSmShrink(this, globalCtx); } } @@ -441,12 +441,12 @@ void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) { // within 400 units of link and within 90 degrees rotation of him if (this->actor.xzDistanceFromLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) { this->actionTarget = this->actor.rotTowardsLinkY; - EnFloormas_TurnBegin(this); + EnFloormas_SetupTurn(this); // within 280 units of link and within 45 degrees rotation of him } else if (this->actor.xzDistanceFromLink < 280.0f && func_8002E084(&this->actor, 0x2000)) { - EnFloormas_HoverBegin(this, globalCtx); + EnFloormas_SetupHover(this, globalCtx); } else { - EnFloormas_StandBegin(this); + EnFloormas_SetupStand(this); } } } @@ -454,11 +454,11 @@ void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Stand(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { if (this->actor.scale.x > 0.004f) { - EnFloormas_BigWalkBegin(this); + EnFloormas_SetupBigWalk(this); } else if (this->actor.params == MERGE_SLAVE) { - EnFloormas_SmDecideActionBegin(this); + EnFloormas_SetupSmDecideAction(this); } else { - EnFloormas_SmWalkBegin(this); + EnFloormas_SetupSmWalk(this); } } } @@ -479,23 +479,23 @@ void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) { } if ((this->actor.xzDistanceFromLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) { - EnFloormas_RunBegin(this); + EnFloormas_SetupRun(this); } else if (this->actor.bgCheckFlags & 8) { // set target rotation to the colliding wall's rotation this->actionTarget = this->actor.wallPolyRot; - EnFloormas_TurnBegin(this); + EnFloormas_SetupTurn(this); } else if ((this->actor.xzDistanceFromLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) { // set target rotation to link. this->actionTarget = this->actor.rotTowardsLinkY; - EnFloormas_TurnBegin(this); + EnFloormas_SetupTurn(this); } else if (this->actionTimer == 0) { - EnFloormas_BigStopWalkBegin(this); + EnFloormas_SetupBigStopWalk(this); } } void EnFloormas_BigStopWalk(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { - EnFloormas_BigDecideActionBegin(this); + EnFloormas_SetupBigDecideAction(this); } } @@ -511,9 +511,9 @@ void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) { if ((this->actor.xzDistanceFromLink < 280.0f) && func_8002E084(&this->actor, 0x2000) && !(this->actor.bgCheckFlags & 8)) { - EnFloormas_HoverBegin(this, globalCtx); + EnFloormas_SetupHover(this, globalCtx); } else if (this->actor.xzDistanceFromLink > 400.0f) { - EnFloormas_BigWalkBegin(this); + EnFloormas_SetupBigWalk(this); } } @@ -523,7 +523,7 @@ void EnFloormas_Turn(EnFloormas* this, GlobalContext* globalCtx) { f32 sp2C; if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { - EnFloormas_StandBegin(this); + EnFloormas_SetupStand(this); } if (((this->skelAnime.animPlaybackSpeed > 0.0f) && func_800A56C8(&this->skelAnime, 21.0f)) || @@ -549,7 +549,7 @@ void EnFloormas_Turn(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Hover(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { - EnFloormas_ChargeBegin(this); + EnFloormas_SetupCharge(this); } this->actor.shape.rot.x += 0x140; this->actor.posRot.pos.y += 10.0f; @@ -570,13 +570,13 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) { pos2.z = Math_Coss(this->actor.shape.rot.y + 0x6000) * 7.0f; // create dust particle - func_800286CC(globalCtx, &pos, &pos2, &dustPos, 0x1C2, 0x64); + func_800286CC(globalCtx, &pos, &pos2, &sDustPos, 0x1C2, 0x64); pos2.x = Math_Sins(this->actor.shape.rot.y - 0x6000) * 7.0f; pos2.z = Math_Coss(this->actor.shape.rot.y - 0x6000) * 7.0f; // create dust particle - func_800286CC(globalCtx, &pos, &pos2, &dustPos, 0x1C2, 0x64); + func_800286CC(globalCtx, &pos, &pos2, &sDustPos, 0x1C2, 0x64); func_8002F974(this, NA_SE_EN_FLOORMASTER_SLIDING); } @@ -603,7 +603,7 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) { } if ((this->actor.bgCheckFlags & 8) || (this->actionTimer == 0)) { - EnFloormas_LandBegin(this); + EnFloormas_SetupLand(this); } } @@ -645,9 +645,9 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) { if (this->skelAnime.animFrameCount < 45.0f) { this->skelAnime.animFrameCount = SkelAnime_GetFrameCount(&D_060019CC); } else if (this->actor.params == MERGE_MASTER) { - EnFloormas_MergeBegin(this); + EnFloormas_SetupMerge(this); } else { - EnFloormas_StandBegin(this); + EnFloormas_SetupStand(this); this->smActionTimer = 50; } } @@ -662,7 +662,7 @@ void EnFloormas_Split(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { this->actor.flags |= 1; this->smActionTimer = 50; - EnFloormas_StandBegin(this); + EnFloormas_SetupStand(this); } Math_ApproxF(&this->actor.speedXZ, 0.0f, 1.0f); } @@ -681,10 +681,10 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) { } if (this->smActionTimer == 0) { - EnFloormas_SmDecideActionBegin(this); + EnFloormas_SetupSmDecideAction(this); } else if (this->actor.bgCheckFlags & 8) { this->actionTarget = this->actor.wallPolyRot; - EnFloormas_TurnBegin(this); + EnFloormas_SetupTurn(this); } else if (this->actor.xzDistanceFromLink < 120.0f) { Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0x38E); } @@ -701,7 +701,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { isAgainstWall = this->actor.bgCheckFlags & 8; if (isAgainstWall) { this->actionTarget = this->actor.wallPolyRot; - EnFloormas_TurnBegin(this); + EnFloormas_SetupTurn(this); return; } @@ -717,19 +717,19 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primaryFloormas), 0x38E); if (func_8002DB8C(&this->actor, primaryFloormas) < 80.0f) { - EnFloormas_SmSlaveJumpAtMasterBegin(this); + EnFloormas_SetupSlaveJumpAtMaster(this); } } else { Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.rotTowardsLinkY, 3, 0x71C); if (this->actor.xzDistanceFromLink < 80.0f) { - EnFloormas_JumpAtLinkBegin(this); + EnFloormas_SetupJumpAtLink(this); } } } void EnFloormas_SmShrink(EnFloormas* this, GlobalContext* globalCtx) { if (Math_ApproxF(&this->actor.scale.x, 0.0f, 0.0015f)) { - EnFloormas_SmWaitBegin(this); + EnFloormas_SetupSmWait(this); } this->actor.scale.z = this->actor.scale.x; this->actor.scale.y = this->actor.scale.x; @@ -748,11 +748,11 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) { this->actionTimer = 0x32; this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); - EnFloormas_LandBegin(this); + EnFloormas_SetupLand(this); } else if ((this->actor.yDistanceFromLink < -10.0f) && this->collider.base.maskA & 2 && (&player->actor == this->collider.base.oc)) { globalCtx->unk_11D4C(globalCtx, player); - EnFloormas_GrabLinkBegin(this, player); + EnFloormas_SetupGrabLink(this, player); } } @@ -804,7 +804,7 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.velocity.y = 6.0f; this->actor.flags |= 1; this->actor.speedXZ = -3.0f; - EnFloormas_LandBegin(this); + EnFloormas_SetupLand(this); } else { // Damage link every 20 frames if ((this->actionTarget % 20) == 0) { @@ -831,7 +831,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx) } else { if (this->actor.bgCheckFlags & 2) { this->actor.params = 0x10; - EnFloormas_LandBegin(this); + EnFloormas_SetupLand(this); } return; } @@ -843,12 +843,12 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx) } else if ((((primFloormas->posRot.pos.y - this->actor.posRot.pos.y) < -10.0f) && (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 10.0f)) && (fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 10.0f)) { - EnFloormas_SmWaitBegin(this); + EnFloormas_SetupSmWait(this); this->collider.base.maskA |= 1; } else if (this->actor.bgCheckFlags & 2) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); - EnFloormas_LandBegin(this); + EnFloormas_SetupLand(this); } if (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 5.0f && @@ -873,11 +873,11 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { if (this->smActionTimer == 0) { if (attachedA->actionFunc != EnFloormas_SmWait) { - EnFloormas_SmShrinkBegin(attachedA, globalCtx); + EnFloormas_SetupSmShrink(attachedA, globalCtx); } if (attachedB->actionFunc != EnFloormas_SmWait) { - EnFloormas_SmShrinkBegin(attachedB, globalCtx); + EnFloormas_SetupSmShrink(attachedB, globalCtx); } } else { if ((attachedA->actionFunc != EnFloormas_SmWait) && (attachedA->actionFunc != EnFloormas_SmShrink)) { @@ -904,8 +904,8 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND); } - this->collider.dim.radius = (cylinderInit.dim.radius * 100.0f) * this->actor.scale.x; - this->collider.dim.height = (cylinderInit.dim.height * 100.0f) * this->actor.scale.x; + this->collider.dim.radius = (sCylinderInit.dim.radius * 100.0f) * this->actor.scale.x; + this->collider.dim.height = (sCylinderInit.dim.height * 100.0f) * this->actor.scale.x; if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (this->actor.scale.x >= 0.01f) { @@ -913,8 +913,8 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { EnFloormas_MakeVulnerable(this); this->actor.params = 0; this->collider.body.bumperFlags |= 4; - this->actor.colChkInfo.health = colCheckInfoInit.health; - EnFloormas_StandBegin(this); + this->actor.colChkInfo.health = sColChkInfoInit.health; + EnFloormas_SetupStand(this); } else { if (this->actionTimer == 0) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060039B0); @@ -936,7 +936,7 @@ void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.health == 0) { EnFloormas_Die(this, globalCtx); } else { - EnFloormas_RecoverBegin(this); + EnFloormas_SetupRecover(this); } } @@ -952,7 +952,7 @@ void EnFloormas_TakeDamage(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Recover(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { - EnFloormas_StandBegin(this); + EnFloormas_SetupStand(this); } } @@ -966,7 +966,7 @@ void EnFloormas_Freeze(EnFloormas* this, GlobalContext* globalCtx) { EnFloormas_Die(this, globalCtx); return; } - EnFloormas_StandBegin(this); + EnFloormas_SetupStand(this); } } @@ -1001,14 +1001,14 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) { if ((this->actor.colChkInfo.damageEffect == 4) || (this->actor.colChkInfo.damageEffect == 1)) { if (this->actionFunc != EnFloormas_Freeze) { - EnFloormas_FreezeBegin(this); + EnFloormas_SetupFreeze(this); } } else { if (this->actor.colChkInfo.damageEffect == 2) { func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.scale.x * 4000.f, this->actor.scale.x * 4000.f); } - EnFloormas_TakeDamageBegin(this); + EnFloormas_SetupTakeDamage(this); } } } @@ -1032,7 +1032,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.velocity.y = 5.0f; - EnFloormas_LandBegin(this); + EnFloormas_SetupLand(this); } EnFloormas_ColliderCheck(this, globalCtx); this->actionFunc(this, globalCtx); @@ -1108,7 +1108,7 @@ void EnFloormas_Draw(Actor* thisx, GlobalContext* globalCtx) { Graph_OpenDisps(gfx, globalCtx->state.gfxCtx, "../z_en_floormas.c", 2318); func_80093D18(globalCtx->state.gfxCtx); if (this->collider.base.type == COLTYPE_UNK12) { - func_80026230(globalCtx, &mergeColor, this->actionTarget % 0x28, 0x28); + func_80026230(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28); } gfxCtx->polyOpa.p = @@ -1128,7 +1128,7 @@ void EnFloormas_DrawHighlighted(Actor* thisx, GlobalContext* globalCtx) { Graph_OpenDisps(gfx, globalCtx->state.gfxCtx, "../z_en_floormas.c", 2352); func_80093D84(globalCtx->state.gfxCtx); if (this->collider.base.type == COLTYPE_UNK12) { - func_80026690(globalCtx, &mergeColor, this->actionTarget % 0x28, 0x28); + func_80026690(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28); } gfxCtx->polyXlu.p = SkelAnime_DrawSV2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 9187a337a6..1dfb17d72b 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -65,7 +65,7 @@ static UNK_PTR sMouthSegments[] = { extern AnimationHeader D_0600057C; extern AnimationHeader D_06000B04; extern SkeletonHeader D_06006C90; -extern UNK_TYPE D_0200E080; +extern CutsceneData D_0200E080[]; typedef enum { /* 0x00 */ FU_FACE_CALM, diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c index b07971c6e2..5ce1da8ada 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c @@ -5,7 +5,6 @@ */ #include "z_en_ganon_organ.h" - #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" #define FLAGS 0x00000030 @@ -29,8 +28,8 @@ const ActorInit En_Ganon_Organ_InitVars = { (ActorFunc)EnGanonOrgan_Draw, }; -extern D_80A2CCA8; // remove when data is decompiled -extern D_80A2EAB0; // remove when data is decompiled +extern Gfx D_80A2CCA8[]; +extern Gfx D_80A2EAB0[]; void EnGanonOrgan_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->flags &= ~1; @@ -114,8 +113,8 @@ void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 221), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_80A2CCA8); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_80A2EAB0); + gSPDisplayList(gfxCtx->polyOpa.p++, D_80A2CCA8); + gSPDisplayList(gfxCtx->polyOpa.p++, D_80A2EAB0); osSyncPrintf("ORGAN DRAW 2\n"); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 230); } diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 70c0ada403..294eda2d9c 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -1,3 +1,9 @@ +/* + * File: z_en_guest.c + * Overlay: ovl_En_Guest + * Description: Happy Mask Shop Customer + */ + #include "z_en_guest.h" #include @@ -14,13 +20,6 @@ void func_80A50518(EnGuest* this, GlobalContext* globalCtx); void func_80A5057C(EnGuest* this, GlobalContext* globalCtx); void func_80A505CC(Actor* thisx, GlobalContext* globalCtx); -extern SkeletonHeader D_060000F0; -extern AnimationHeader D_060042AC; -extern UNK_TYPE D_060005FC; -extern UNK_TYPE D_060006FC; -extern UNK_TYPE D_060007FC; -extern Gfx D_060059B0[]; - const ActorInit En_Guest_InitVars = { ACTOR_EN_GUEST, ACTORTYPE_NPC, @@ -33,7 +32,7 @@ const ActorInit En_Guest_InitVars = { NULL, }; -static ColliderCylinderInit_Set3 sColliderInit = { +static ColliderCylinderInit_Set3 sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 10, 60, 0, { 0, 0, 0 } }, @@ -45,11 +44,15 @@ static InitChainEntry sInitChain[] = { }; UNK_PTR D_80A50BA4[] = { - &D_060005FC, - &D_060006FC, - &D_060007FC, + 0x060005FC, + 0x060006FC, + 0x060007FC, }; +extern SkeletonHeader D_060000F0; +extern AnimationHeader D_060042AC; +extern Gfx D_060059B0[]; + void EnGuest_Init(Actor* thisx, GlobalContext* globalCtx) { EnGuest* this = THIS; @@ -75,7 +78,7 @@ void EnGuest_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) { EnGuest* this = THIS; - u32 padding; + u32 pad; if (Object_IsLoaded(&globalCtx->objectCtx, this->osAnimeBankIndex) != 0) { this->actor.flags &= ~0x10; @@ -91,7 +94,7 @@ void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.update = func_80A505CC; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sColliderInit); + Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); Actor_SetHeight(&this->actor, 60.0f); @@ -144,7 +147,7 @@ void func_80A5057C(EnGuest* this, GlobalContext* globalCtx) { void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { EnGuest* this = THIS; - u32 padding; + u32 pad; Player* player; player = PLAYER; diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index 202cfe4f50..a6e203df99 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -27,7 +27,7 @@ const ActorInit En_Hata_InitVars = { (ActorFunc)EnHata_Draw, }; -static UNK_TYPE4 sUnusedData[] = { +static UNK_TYPE sUnusedData[] = { 0x0A000939, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x00000000, 0x00050100, 0x001000F6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, }; @@ -45,7 +45,7 @@ void EnHata_Init(Actor* thisx, GlobalContext* globalCtx) { f32 frameCount; temp = 0; - frameCount = (f32)SkelAnime_GetFrameCount(&D_06000444.genericHeader); + frameCount = SkelAnime_GetFrameCount(&D_06000444.genericHeader); Actor_SetScale(&this->dyna.actor, 1.0f / 75.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002FD0, &D_06000444, NULL, NULL, 0); SkelAnime_ChangeAnim(&this->skelAnime, &D_06000444, 1.0f, 0.0f, frameCount, 0, 0.0f); @@ -58,7 +58,7 @@ void EnHata_Init(Actor* thisx, GlobalContext* globalCtx) { this->invScale = 6; this->maxStep = 1000; this->minStep = 1; - this->unk_278 = (s16)(Math_Rand_ZeroOne() * 65535.0f); + this->unk_278 = Math_Rand_ZeroOne() * 65535.0f; } void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index d1a9f66c41..8a4f9366b3 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -54,7 +54,7 @@ extern AnimationHeader D_06005C30; extern AnimationHeader D_06005500; extern SkeletonHeader D_0600BAC8; extern Gfx D_0602B060[]; // Keaton Mask -extern Gfx D_06002C10[]; +extern Gfx D_06002C10[]; // 2D Guard in Window const ActorInit En_Heishi2_InitVars = { ACTOR_EN_HEISHI2, @@ -68,7 +68,7 @@ const ActorInit En_Heishi2_InitVars = { (ActorFunc)EnHeishi2_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 33, 40, 0, { 0, 0, 0 } }, @@ -80,7 +80,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->initParams = this->actor.params & 0xFF; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = 255; if ((this->initParams == 6) || (this->initParams == 9)) { this->actor.draw = func_80A54C6C; @@ -114,7 +114,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->transitionDrawTable, 17); collider = &this->collider; Collider_InitCylinder(globalCtx, collider); - Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit); + Collider_SetCylinder(globalCtx, collider, &this->actor, &sCylinderInit); this->collider.dim.yShift = 0; this->collider.dim.radius = 0xF; this->collider.dim.height = 0x46; @@ -855,7 +855,7 @@ void func_80A54C6C(Actor* thisx, GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1772); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1774), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_06002C10); // 2D Guard in Window + gSPDisplayList(gfxCtx->polyOpa.p++, &D_06002C10); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_heishi2.c", 1777); } diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 17381fdc6f..978c9fb1a6 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -42,7 +42,7 @@ const ActorInit En_Heishi3_InitVars = { (ActorFunc)EnHeishi3_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 15, 70, 0, { 0, 0, 0 } }, @@ -64,10 +64,10 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->limbDrawTable, this->transitionDrawTable, 17); - this->actor.colChkInfo.mass = -1; + this->actor.colChkInfo.mass = 0xFF; this->actor.unk_1F = 6; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); // "Castle Gate Soldier - Power Up" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST); diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index aab7e90bfb..39cca0330b 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -36,37 +36,32 @@ const ActorInit En_Horse_Ganon_InitVars = { (ActorFunc)EnHorseGanon_Draw, }; -extern SkeletonHeader D_06008668; +AnimationHeader* D_80A691B0[] = { 0x06004AA4, 0x06005264, 0x06005B78, 0x06002CE4 }; -extern AnimationHeader D_06004AA4; -extern AnimationHeader D_06005264; -extern AnimationHeader D_06005B78; -extern AnimationHeader D_06002CE4; -extern AnimationHeader D_06002650; -extern AnimationHeader D_06003858; +AnimationHeader* D_80A691C0[] = { 0x06002650, 0x06003858 }; -AnimationHeader* D_80A691B0[] = { &D_06004AA4, &D_06005264, &D_06005B78, &D_06002CE4 }; -AnimationHeader* D_80A691C0[] = { &D_06002650, &D_06003858 }; -static f32 animPlaybackSpeed[] = { 0.66666666f, 0.66666666f, 1.0f, 1.0f, 1.0f, 0.66666666f }; +static f32 sAnimPlaybackSpeeds[] = { 0.66666666f, 0.66666666f, 1.0f, 1.0f, 1.0f, 0.66666666f }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 40, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit jntsphItemsInit[1] = { + +static ColliderJntSphItemInit sJntSphItemsInit[] = { { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 13, { { 0, 0, 0 }, 20 }, 100 }, }, }; -static ColliderJntSphInit jntsphInit = { + +static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, 1, - jntsphItemsInit, + sJntSphItemsInit, }; -static CollisionCheckInfoInit collisionCheckInfoInit = { +static CollisionCheckInfoInit sColChkInfoInit = { 0x0A, 0x0023, 0x0064, @@ -83,14 +78,17 @@ unk_D_80A69248 D_80A69248[] = { { 0x09B8, 0x0126, 0x0E2C, 0x07 }, { 0x0C11, 0x01 s32 D_80A692B8[] = { 0, 0x00000010 }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F8, 1200, ICHAIN_STOP), }; -static EnHorseGanonActionFunc actionFuncs[] = { func_80A68AF0, func_80A68DB0, NULL }; +static EnHorseGanonActionFunc sActionFuncs[] = { func_80A68AF0, func_80A68DB0, NULL }; const f32 D_80A692D0 = 10430.3779f; +extern SkeletonHeader D_06008668; +extern AnimationHeader D_06004AA4; + void func_80A68660(unk_D_80A69248* data, s32 index, Vec3f* vec) { vec->x = data[index].unk_0.x; vec->y = data[index].unk_0.y; @@ -156,7 +154,7 @@ void func_80A68870(EnHorseGanon* this) { void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { EnHorseGanon* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.0115f); this->actor.gravity = -3.5f; @@ -171,11 +169,11 @@ void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_ChangeAnimDefaultStop(&this->skin.skelAnime, D_80A691B0[0]); Collider_InitCylinder(globalCtx, &this->colliderCylinder); - Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &cylinderInit); + Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); Collider_InitJntSph(globalCtx, &this->colliderSphere); - Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &jntsphInit, &this->colliderSphereItem); + Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem); - func_80061ED4(&this->actor.colChkInfo, 0, &collisionCheckInfoInit); + func_80061ED4(&this->actor.colChkInfo, 0, &sColChkInfoInit); func_80A68AC4(this); } @@ -234,11 +232,11 @@ void func_80A68B20(EnHorseGanon* this) { if (animationChanged == 1) { SkelAnime_ChangeAnim(&this->skin.skelAnime, D_80A691B0[this->currentAnimation], - animPlaybackSpeed[this->currentAnimation] * sp30 * 1.5f, 0.0f, + sAnimPlaybackSpeeds[this->currentAnimation] * sp30 * 1.5f, 0.0f, SkelAnime_GetFrameCount(&D_80A691B0[this->currentAnimation]->genericHeader), 2, -3.0f); } else { SkelAnime_ChangeAnim(&this->skin.skelAnime, D_80A691B0[this->currentAnimation], - animPlaybackSpeed[this->currentAnimation] * sp30 * 1.5f, 0.0f, + sAnimPlaybackSpeeds[this->currentAnimation] * sp30 * 1.5f, 0.0f, SkelAnime_GetFrameCount(&D_80A691B0[this->currentAnimation]->genericHeader), 2, 0.0f); } } @@ -276,7 +274,7 @@ void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { EnHorseGanon* this = THIS; s32 pad; - actionFuncs[this->action](this, globalCtx); + sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); this->actor.posRot2.pos = this->actor.posRot.pos; diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 18b9530870..0ecfb2d2b4 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -14,13 +14,13 @@ void EnIt_Init(Actor* thisx, GlobalContext* globalCtx); void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnIt_Update(Actor* thisx, GlobalContext* globalCtx); -static ColliderCylinderInit cylinderInitData = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 40, 10, 0, { 0 } }, }; -static CollisionCheckInfoInit2 colChkInfoInit = { +static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF, }; @@ -41,8 +41,8 @@ void EnIt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.params = 0x0D05; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); - func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit); // Init Damage Chart + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit); } void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index b609636d41..b433f123f9 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -27,8 +27,8 @@ const ActorInit En_Lightbox_InitVars = { (ActorFunc)EnLightbox_Draw, }; -extern u32 D_06000B70; -extern u32 D_06001F10; +extern Gfx D_06000B70[]; +extern UNK_TYPE D_06001F10; void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx) { u32 local_c = 0; @@ -111,5 +111,5 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_06000B70); + Gfx_DrawDListOpa(globalCtx, D_06000B70); } diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index 1c34caa10b..ecc73cb063 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -1,7 +1,7 @@ /* * File: z_en_m_fire1.c * Overlay: ovl_En_M_Fire1 - * Description: The attack from a Deku Nut. Spawned by ovl_En_Arrow. + * Description: Deku Nut Hitbox */ #include "z_en_m_fire1.h" @@ -26,7 +26,7 @@ const ActorInit En_M_Fire1_InitVars = { NULL, }; -static ColliderCylinderInit cylinderInitData = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_CYLINDER }, { 0x02, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, { 200, 200, 0, { 0 } } @@ -41,7 +41,7 @@ void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx) { } Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void EnMFire1_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index d152d353a7..348fa631c0 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -1,7 +1,7 @@ /* * File: z_en_ma1.c * Overlay: En_Ma1 - * Description: + * Description: Child Malon */ #include "z_en_ma1.h" @@ -39,13 +39,13 @@ const ActorInit En_Ma1_InitVars = { (ActorFunc)EnMa1_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 18, 46, 0, { 0, 0, 0 } }, }; -CollisionCheckInfoInit2 D_80AA166C = { +CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF, }; @@ -58,13 +58,13 @@ struct_D_80AA1678 D_80AA1678[] = { Vec3f D_80AA16B8 = { 800.0f, 0.0f, 0.0f }; -u32 D_80AA16C4[] = { +UNK_PTR D_80AA16C4[] = { 0x06001F18, 0x06002B18, 0x06002F18, }; -u32 D_80AA16D0[] = { +UNK_PTR D_80AA16D0[] = { 0x06001B18, 0x06002318, 0x06002718, @@ -251,8 +251,8 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA166C); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); if (!func_80AA08C4(this, globalCtx)) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 12349daff2..02251adbdc 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -33,63 +33,36 @@ const ActorInit En_Ma2_InitVars = { (ActorFunc)EnMa2_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 18, 46, 0, { 0, 0, 0 } }, }; -CollisionCheckInfoInit2 D_80AA284C = { +static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF, }; -struct_D_80AA1678 D_80AA2858[] = { - { - 0x060007D4, - 1.0f, - 0x00, - 0.0f, - }, - { - 0x060007D4, - 1.0f, - 0x00, - -10.0f, - }, - { - 0x060093BC, - 1.0f, - 0x00, - 0.0f, - }, - { - 0x06009EE0, - 1.0f, - 0x00, - 0.0f, - }, - { - 0x06009EE0, - 1.0f, - 0x00, - -10.0f, - }, +static struct_D_80AA1678 D_80AA2858[] = { + { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f }, + { 0x06009EE0, 1.0f, 0x00, 0.0f }, { 0x06009EE0, 1.0f, 0x00, -10.0f }, }; -Vec3f D_80AA28A8 = { 900.0f, 0.0f, 0.0f }; +static Vec3f D_80AA28A8 = { 900.0f, 0.0f, 0.0f }; -u32 D_80AA28B4[] = { +static UNK_PTR D_80AA28B4[] = { 0x06002970, 0x06003570, 0x06003770, }; -u32 D_80AA28C0[] = { + +static UNK_PTR D_80AA28C0[] = { 0x06002570, 0x06002C70, 0x06003070, }; -extern u32 D_06005420; +extern Gfx D_06005420[]; extern SkeletonHeader D_06008D90; extern AnimationHeader D_060093BC; extern AnimationHeader D_06009EE0; @@ -241,8 +214,8 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA284C); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); switch (func_80AA1B58(this, globalCtx)) { case 1: @@ -387,7 +360,7 @@ void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); } if ((limbIndex == 14) && (this->skelAnime.animCurrentSeg == &D_060093BC)) { - gSPDisplayList(gfxCtx->polyOpa.p++, &D_06005420); + gSPDisplayList(gfxCtx->polyOpa.p++, D_06005420); } Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma2.c", 927); diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 0c68527b71..cbec2f1f46 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -37,56 +37,28 @@ const ActorInit En_Ma3_InitVars = { (ActorFunc)EnMa3_Draw, }; -static ColliderCylinderInit cylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 18, 46, 0, { 0, 0, 0 } }, }; -CollisionCheckInfoInit2 D_80AA383C = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF }; -struct_D_80AA1678 D_80AA3848[] = { - { - 0x060007D4, - 1.0f, - 0x00, - 0.0f, - }, - { - 0x060007D4, - 1.0f, - 0x00, - -10.0f, - }, - { - 0x060093BC, - 1.0f, - 0x00, - 0.0f, - }, - { - 0x06009EE0, - 1.0f, - 0x00, - 0.0f, - }, - { - 0x06009EE0, - 1.0f, - 0x00, - -10.0f, - }, +static struct_D_80AA1678 D_80AA3848[] = { + { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f }, + { 0x06009EE0, 1.0f, 0x00, 0.0f }, { 0x06009EE0, 1.0f, 0x00, -10.0f }, }; -Vec3f D_80AA3898 = { 900.0f, 0.0f, 0.0f }; +static Vec3f D_80AA3898 = { 900.0f, 0.0f, 0.0f }; -u32 D_80AA38A4[] = { +static UNK_PTR D_80AA38A4[] = { 0x06002970, 0x06003570, 0x06003770, }; -u32 D_80AA38B0[] = { +static UNK_PTR D_80AA38B0[] = { 0x06002570, 0x06002C70, 0x06003070, @@ -271,8 +243,8 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, 0, 0, 0); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA383C); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); switch (func_80AA2EC8(this, globalCtx)) { case 0: diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 643e04d8e9..170fb00814 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -19,7 +19,7 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx); void EnMs_Wait(EnMs* this, GlobalContext* globalCtx); void EnMs_Talk(EnMs* this, GlobalContext* globalCtx); void EnMs_Sell(EnMs* this, GlobalContext* globalCtx); -void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx); +void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx); const ActorInit En_Ms_InitVars = { ACTOR_EN_MS, @@ -33,21 +33,21 @@ const ActorInit En_Ms_InitVars = { (ActorFunc)EnMs_Draw, }; -static ColliderCylinderInit_Set3 colliderInit = { +static ColliderCylinderInit_Set3 sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 22, 37, 0, { 0 } }, }; -static s16 prices[] = { +static s16 sPrices[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, }; -static u16 offerTextIds[] = { +static u16 sOfferTextIDs[] = { 0x405E, 0x405F, 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), }; @@ -61,7 +61,7 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) { if (BEANS_BOUGHT >= 10) { this->actor.textId = 0x406B; } else { - this->actor.textId = offerTextIds[BEANS_BOUGHT]; + this->actor.textId = sOfferTextIDs[BEANS_BOUGHT]; } } } @@ -74,11 +74,11 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, &this->unkSkelAnimeStruct, &this->unk_1C6, 9); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &colliderInit); + Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); Actor_SetScale(&this->actor, 0.015f); @@ -99,16 +99,16 @@ void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { - s16 unkAngle; + s16 yawDiff; - unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; + yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y; EnMs_SetOfferText(&this->actor, globalCtx); if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated this->actionFunc = EnMs_Talk; return; } - if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(unkAngle) < 0x2000)) { // talk range + if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range func_8002F2CC(&this->actor, globalCtx, 90.0f); } } @@ -125,7 +125,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) { if (func_80106BC8(globalCtx) != 0) { switch (globalCtx->msgCtx.choiceIndex) { case 0: // yes - if (gSaveContext.rupees < prices[BEANS_BOUGHT]) { + if (gSaveContext.rupees < sPrices[BEANS_BOUGHT]) { func_8010B720(globalCtx, 0x4069); // not enough rupees text return; } @@ -143,15 +143,15 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) { void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) { if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set - Rupees_ChangeBy(-prices[BEANS_BOUGHT]); + Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]); this->actor.attachedA = NULL; - this->actionFunc = EnMs_TalkAfterBuy; + this->actionFunc = EnMs_TalkAfterPurchase; return; } func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f); } -void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) { +void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx) { // if dialog state is 6 and player responded to textbox if ((func_8010BDBC(&globalCtx->msgCtx)) == 6 && (func_80106BC8(globalCtx) != 0)) { func_8010B720(globalCtx, 0x406C); diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 09dbac40e3..d79c303035 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -1,7 +1,7 @@ /* * File: z_en_nutsball.c * Overlay: ovl_En_Nutsball - * Description: The projectile fired by deku scrubs and octoroks. + * Description: Projectile fired by deku scrubs */ #include "z_en_nutsball.h" @@ -30,14 +30,15 @@ const ActorInit En_Nutsball_InitVars = { (ActorFunc)NULL, }; -static ColliderCylinderInit cylinderInitData = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x11, 0x01, 0x01 }, { 13, 13, 0, { 0 } }, }; -static s16 objectTbl[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK }; -static u32 dListTbl[] = { 0x06002028, 0x060012F0, 0x06004008, 0x06002410, 0x06001890 }; +static s16 sObjectIDs[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK }; + +static Gfx* sDLists[] = { 0x06002028, 0x060012F0, 0x06004008, 0x06002410, 0x06001890 }; void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { EnNutsball* this = THIS; @@ -45,8 +46,8 @@ void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); - this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[this->actor.params]); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[this->actor.params]); if (this->objBankIndex < 0) { Actor_Kill(&this->actor); @@ -80,7 +81,7 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { this->timer--; if (this->timer == 0) { - this->actor.gravity = -1; + this->actor.gravity = -1.0f; } this->actor.initPosRot.rot.z += 0x2AA8; @@ -126,7 +127,7 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10, cylinderInitData.dim.radius, cylinderInitData.dim.height, 5); + func_8002E4B4(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5); Collider_CylinderUpdate(&this->actor, &this->collider); this->actor.flags |= 0x1000000; @@ -148,7 +149,7 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateZ(thisx->initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); + gSPDisplayList(gfxCtx->polyOpa.p++, sDLists[thisx->params]); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337); } diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c index 60f635f682..0416dd7150 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -1,7 +1,7 @@ /* * File: z_en_oe2.c * Overlay: ovl_En_Oe2 - * Description: Blue Navi Target. Probably unused since NPC's are blue and they do not use this actor. + * Description: Blue Navi Target Spot */ #include "z_en_oe2.h" @@ -15,7 +15,7 @@ void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx); void EnOE2_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_80ABE6DC(EnOE2* this, GlobalContext* globalCtx); +void EnOE2_DoNothing(EnOE2* this, GlobalContext* globalCtx); const ActorInit En_OE2_InitVars = { ACTOR_EN_OE2, @@ -36,13 +36,13 @@ void EnOE2_SetupAction(EnOE2* this, EnOE2ActionFunc actionFunc) { void EnOE2_Init(Actor* thisx, GlobalContext* globalCtx) { EnOE2* this = THIS; - EnOE2_SetupAction(this, func_80ABE6DC); + EnOE2_SetupAction(this, EnOE2_DoNothing); } void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void func_80ABE6DC(EnOE2* this, GlobalContext* globalCtx) { +void EnOE2_DoNothing(EnOE2* this, GlobalContext* globalCtx) { } void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index c0abe5e0d8..1302210f1c 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -5,7 +5,6 @@ */ #include "z_en_okarina_effect.h" - #include #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index 432a39d001..f7e2fa3786 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -1,7 +1,7 @@ /* * File: z_en_pu_box.c * Overlay: ovl_En_Pu_Box - * Description: An unused stone cube. + * Description: An unused stone cube */ #include "z_en_pu_box.h" @@ -27,8 +27,8 @@ const ActorInit En_Pu_box_InitVars = { (ActorFunc)EnPubox_Draw, }; -extern u32 D_06000380; -extern u32 D_060006D0; +extern Gfx D_06000380[]; +extern UNK_TYPE D_060006D0; void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx) { u32 local_c = 0; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index cbb25458b2..9d27234d10 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -70,35 +70,35 @@ void func_80AF03F4(EnRu1* this, GlobalContext* globalCtx); void func_80AF0400(EnRu1* this, GlobalContext* globalCtx); void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx); -ColliderCylinderInit_Set3 D_80AF0800 = { +ColliderCylinderInit_Set3 sCylinderInit1 = { { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 25, 80, 0, { 0 } }, }; -ColliderCylinderInit_Set3 D_80AF082C = { +ColliderCylinderInit_Set3 sCylinderInit2 = { { COLTYPE_UNK0, 0x09, 0x00, 0x09, COLSHAPE_CYLINDER }, { 0x00, { 0x00000101, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, { 20, 30, 0, { 0 } }, }; -u32 D_80AF0858[] = { +UNK_PTR D_80AF0858[] = { 0x0600E3B8, 0x0600F238, 0x0600F638, 0x0600FE38, 0x06010238, 0x06010A38, }; -u32 D_80AF0870[] = { +UNK_PTR D_80AF0870[] = { 0x0600E838, 0x0600FA38, 0x06010638, }; -s32 D_80AF087C = 0; +s32 sUnused = 0; #include "z_en_ru1_cutscene_data.c" EARLY u32 D_80AF1938 = 0; -EnRu1ActionFunc D_80AF193C[] = { +EnRu1ActionFunc sActionFuncs[] = { func_80AEC0B4, func_80AEC100, func_80AEC130, func_80AEC17C, func_80AEC1D4, func_80AEC244, func_80AEC2C0, func_80AECA94, func_80AECAB4, func_80AECAD4, func_80AECB18, func_80AECB60, func_80AECBB8, func_80AECC1C, func_80AECC84, func_80AED304, func_80AED324, func_80AED344, func_80AED374, func_80AED3A4, func_80AED3E0, @@ -108,13 +108,13 @@ EnRu1ActionFunc D_80AF193C[] = { func_80AEFBC8, func_80AEFC24, func_80AEFECC, func_80AEFF40, }; -EnRu1PreLimbDrawFunc D_80AF19F4[] = { +EnRu1PreLimbDrawFunc sPreLimbDrawFuncs[] = { func_80AF0278, }; -Vec3f D_80AF19F8 = { 0.0f, 10.0f, 0.0f }; +Vec3f sMultVec = { 0.0f, 10.0f, 0.0f }; -EnRu1DrawFunc D_80AF1A04[] = { +EnRu1DrawFunc sDrawFuncs[] = { func_80AF03F4, func_80AF0400, func_80AF05D4, @@ -190,10 +190,10 @@ void func_80AEAD20(EnRu1* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); if (!thisx) {} // necessary to match - Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &D_80AF0800); + Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &sCylinderInit1); Collider_InitCylinder(globalCtx, &this->collider2); - Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &D_80AF082C); + Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &sCylinderInit2); } void func_80AEAD98(EnRu1* this, GlobalContext* globalCtx) { @@ -207,11 +207,13 @@ void func_80AEADD8(EnRu1* this) { u8 func_80AEADE0(EnRu1* this) { u8 params = this->actor.params >> 8; + return params; } u8 func_80AEADF0(EnRu1* this) { s16 params = this->actor.params; + return params; } @@ -272,6 +274,7 @@ CsCmdActorAction* func_80AEAF58(GlobalContext* globalCtx, s32 npcActionIdx) { s32 func_80AEAFA0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx); + if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action == action)) { return 1; } @@ -280,6 +283,7 @@ s32 func_80AEAFA0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { s32 func_80AEAFE0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx); + if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action != action)) { return 1; } @@ -591,6 +595,7 @@ void func_80AEBB3C(EnRu1* this) { void func_80AEBB78(EnRu1* this) { SkelAnime* skelAnime = &this->skelAnime; + if ((((func_800A56C8(skelAnime, 4.0f)) || (func_800A56C8(skelAnime, 13.0f))) || (func_800A56C8(skelAnime, 22.0f))) || (func_800A56C8(skelAnime, 31.0f))) { @@ -727,6 +732,7 @@ void func_80AEC100(EnRu1* this, GlobalContext* globalCtx) { void func_80AEC130(EnRu1* this, GlobalContext* globalCtx) { s32 something = EnRu1_FrameUpdateMatrix(this); + func_80AEAECC(this, globalCtx); func_80AEBB3C(this); func_80AEBE3C(this, globalCtx, something); @@ -807,6 +813,7 @@ void func_80AEC320(EnRu1* this, GlobalContext* globalCtx) { void func_80AEC40C(EnRu1* this) { Actor* thisx = &this->actor; f32 unk_26C = this->unk_26C; + if (unk_26C < 8.0f) { thisx->speedXZ = (((kREG(3) * 0.01f) + 2.7f) * 0.125f) * unk_26C; } else { @@ -843,6 +850,7 @@ s32 func_80AEC5FC(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; f32 thisPosZ = thisx->posRot.pos.z; f32 playerPosZ = player->actor.posRot.pos.z; + if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.posRot.pos.y >= thisx->posRot.pos.y)) { return 1; } @@ -890,6 +898,7 @@ void func_80AEC81C(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; CsCmdActorAction* csCmdNPCAction; s16 newRotY; + if (func_80AEAFE0(globalCtx, 1, 3)) { csCmdNPCAction = globalCtx->csCtx.npcActions[3]; thisx->posRot.pos.x = csCmdNPCAction->startPos.x; @@ -1259,12 +1268,14 @@ s32 func_80AED624(EnRu1* this, GlobalContext* globalCtx) { void func_80AED6DC(EnRu1* this, GlobalContext* globalCtx) { s8 curRoomNum = globalCtx->roomCtx.curRoom.num; + this->roomNum2 = curRoomNum; this->unk_288 = 0.0f; } void func_80AED6F8(GlobalContext* globalCtx) { s8 curRoomNum; + if ((!(gSaveContext.infTable[20] & 0x80))) { curRoomNum = globalCtx->roomCtx.curRoom.num; if (curRoomNum == 2) { @@ -1539,6 +1550,7 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) { void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) { DynaPolyActor* dyna; u32 floorPolySource; + if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != 0x32)) { floorPolySource = this->actor.floorPolySource; dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, floorPolySource); @@ -1839,6 +1851,7 @@ void func_80AEF080(EnRu1* this) { s32 func_80AEF0BC(EnRu1* this, GlobalContext* globalCtx) { s32 frameCount; + if (gSaveContext.infTable[20] & 4) { frameCount = SkelAnime_GetFrameCount(&D_06007534.genericHeader); SkelAnime_ChangeAnim(&this->skelAnime, &D_06007534, 1.0f, 0, frameCount, 2, -8.0f); @@ -1955,6 +1968,7 @@ void func_80AEF540(EnRu1* this) { void func_80AEF5B8(EnRu1* this) { f32 animCurrentFrame; + if (D_80AF1938 == 0) { animCurrentFrame = this->skelAnime.animCurrentFrame; if (animCurrentFrame >= 60.0f) { @@ -2241,11 +2255,11 @@ void func_80AF0050(EnRu1* this, GlobalContext* globalCtx) { void EnRu1_Update(Actor* thisx, GlobalContext* globalCtx) { EnRu1* this = THIS; - if (this->action < 0 || this->action >= 46 || D_80AF193C[this->action] == NULL) { + if (this->action < 0 || this->action >= 46 || sActionFuncs[this->action] == NULL) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } - D_80AF193C[this->action](this, globalCtx); + sActionFuncs[this->action](this, globalCtx); } void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -2308,10 +2322,10 @@ s32 EnRu1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Gfx** gfx) { EnRu1* this = THIS; - if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*D_80AF19F4[this->unk_290] == NULL)) { + if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*sPreLimbDrawFuncs[this->unk_290] == NULL)) { osSyncPrintf(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - D_80AF19F4[this->unk_290](this, globalCtx, limbIndex, rot); + sPreLimbDrawFuncs[this->unk_290](this, globalCtx, limbIndex, rot); } return 0; } @@ -2322,7 +2336,7 @@ void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Vec3f vec2; if (limbIndex == 15) { - vec1 = D_80AF19F8; + vec1 = sMultVec; Matrix_MultVec3f(&vec1, &vec2); thisx->posRot2.pos.x = vec2.x; thisx->posRot2.pos.y = vec2.y; @@ -2389,9 +2403,9 @@ void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx) { void EnRu1_Draw(Actor* thisx, GlobalContext* globalCtx) { EnRu1* this = THIS; - if (this->drawConfig < 0 || this->drawConfig >= 3 || D_80AF1A04[this->drawConfig] == 0) { + if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == 0) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } - D_80AF1A04[this->drawConfig](this, globalCtx); + sDrawFuncs[this->drawConfig](this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 12ca564032..7d21e7209a 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -5,7 +5,6 @@ */ #include "z_en_ru2.h" - #include #define FLAGS 0x00000010 @@ -44,29 +43,29 @@ void func_80AF321C(EnRu2* this, GlobalContext* globalCtx); void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 colliderInit = { +static ColliderCylinderInit_Set3 sCylinderInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x00, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 30, 100, 0, { 0 } }, }; -static u32 D_80AF410C[] = { +static UNK_PTR D_80AF410C[] = { 0x06000F20, 0x060022E0, 0x06002AE0, }; -static u32 D_80AF4118 = 0; +static UNK_TYPE D_80AF4118 = 0; #include "z_en_ru2_cutscene_data.c" EARLY -static EnRu2ActionFunc D_80AF50BC[] = { +static EnRu2ActionFunc sActionFuncs[] = { func_80AF2CB4, func_80AF2CD4, func_80AF2CF4, func_80AF2D2C, func_80AF2D6C, func_80AF2DAC, func_80AF2DEC, func_80AF3144, func_80AF3174, func_80AF31C8, func_80AF3604, func_80AF3624, func_80AF366C, func_80AF36AC, func_80AF3BC8, func_80AF3C04, func_80AF3C64, func_80AF3CB8, func_80AF3D0C, func_80AF3D60, }; -static EnRu2DrawFunc D_80AF510C[] = { +static EnRu2DrawFunc sDrawFuncs[] = { func_80AF3F14, func_80AF3F20, func_80AF321C, @@ -97,7 +96,7 @@ void func_80AF2550(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &colliderInit); + Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) { @@ -133,11 +132,13 @@ void func_80AF2608(EnRu2* this) { s32 func_80AF2690(EnRu2* this) { s32 params_shift = this->actor.params >> 8; + return params_shift & 0xFF; } s32 func_80AF26A0(EnRu2* this) { s16 params = this->actor.params; + return params & 0xFF; } @@ -152,6 +153,7 @@ void func_80AF26AC(EnRu2* this) { void func_80AF26D0(EnRu2* this, GlobalContext* globalCtx) { s32 one; // Needed to match + if (globalCtx->csCtx.state == 0) { if (D_80AF4118 != 0) { if (this->actor.params == 2) { @@ -249,6 +251,7 @@ void func_80AF29DC(EnRu2* this, GlobalContext* globalCtx) { f32 posX = thisx->posRot.pos.x; f32 posY = thisx->posRot.pos.y; f32 posZ = thisx->posRot.pos.z; + Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } @@ -283,6 +286,7 @@ void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx) { void func_80AF2B44(EnRu2* this, GlobalContext* globalCtx) { CutsceneContext* csCtx = &globalCtx->csCtx; CsCmdActorAction* csCmdNPCAction; + if (csCtx->state != 0) { csCmdNPCAction = csCtx->npcActions[3]; if (csCmdNPCAction != NULL && csCmdNPCAction->action == 2) { @@ -303,6 +307,7 @@ void func_80AF2B94(EnRu2* this) { void func_80AF2BC0(EnRu2* this, GlobalContext* globalCtx) { AnimationHeader* animation = &D_0600D3DC; CsCmdActorAction* csCmdNPCAction; + if (globalCtx->csCtx.state != 0) { csCmdNPCAction = globalCtx->csCtx.npcActions[3]; if (csCmdNPCAction != NULL && csCmdNPCAction->action == 3) { @@ -321,6 +326,7 @@ void func_80AF2C54(EnRu2* this, UNK_TYPE arg1) { void func_80AF2C68(EnRu2* this, GlobalContext* globalCtx) { CsCmdActorAction* csCmdNPCAction; + if (globalCtx->csCtx.state != 0) { csCmdNPCAction = globalCtx->csCtx.npcActions[6]; if (csCmdNPCAction != NULL && csCmdNPCAction->action == 2) { @@ -613,6 +619,7 @@ void func_80AF37AC() { void func_80AF37CC(EnRu2* this) { f32 funcFloat; + this->unk_2C0 += 1; funcFloat = func_8006F9BC((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0); this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (300.0f * funcFloat); @@ -622,6 +629,7 @@ s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) { Player* player = PLAYER; f32 thisPosX = this->actor.posRot.pos.x; f32 playerPosX = player->actor.posRot.pos.x; + if (playerPosX - thisPosX >= -202.0f) { return 1; } @@ -642,6 +650,7 @@ void func_80AF38D0(EnRu2* this, GlobalContext* globalCtx) { void func_80AF390C(EnRu2* this, GlobalContext* globalCtx) { f32* unk_2C4 = &this->unk_2C4; + *unk_2C4 += 1.0f; if (*unk_2C4 == kREG(6) + 40.0f) { func_80AF37AC(); @@ -751,11 +760,11 @@ void func_80AF3D60(EnRu2* this, GlobalContext* globalCtx) { void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; - if (this->action < 0 || this->action >= 20 || D_80AF50BC[this->action] == 0) { + if (this->action < 0 || this->action >= 20 || sActionFuncs[this->action] == 0) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } - D_80AF50BC[this->action](this, globalCtx); + sActionFuncs[this->action](this, globalCtx); } void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -812,9 +821,9 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) { void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; - if (this->drawConfig < 0 || this->drawConfig >= 3 || D_80AF510C[this->drawConfig] == 0) { + if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == 0) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } - D_80AF510C[this->drawConfig](this, globalCtx); + sDrawFuncs[this->drawConfig](this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 4a73671d07..df67814d23 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -81,7 +81,7 @@ void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) { EnSb* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - this->actor.colChkInfo.damageTable = sDamageTable; + this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 2; SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c index b92f8f0f50..98255e1c44 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c @@ -15,7 +15,7 @@ void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx); void EnSceneChange_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx); +void EnSceneChange_DoNothing(EnSceneChange* this, GlobalContext* globalCtx); const ActorInit En_Scene_Change_InitVars = { ACTOR_EN_SCENE_CHANGE, @@ -36,13 +36,13 @@ void EnSceneChange_SetupAction(EnSceneChange* this, EnSceneChangeActionFunc acti void EnSceneChange_Init(Actor* thisx, GlobalContext* globalCtx) { EnSceneChange* this = THIS; - EnSceneChange_SetupAction(this, func_80AF8CAC); + EnSceneChange_SetupAction(this, EnSceneChange_DoNothing); } void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx) { +void EnSceneChange_DoNothing(EnSceneChange* this, GlobalContext* globalCtx) { } void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index db700489a4..29a3ea00c0 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -28,24 +28,24 @@ const ActorInit En_Tana_InitVars = { NULL, }; -static char* shelfTypes[] = { +static char* sShelfTypes[] = { "木の棚", // "Wooden Shelves" "石の棚", // "Stone Shelves" }; -static const ActorFunc drawFuncs[] = { +static const ActorFunc sDrawFuncs[] = { func_80B17FC4, func_80B1809C, func_80B1809C, }; -static Gfx* dListTbl[] = { +static Gfx* sDLists1[] = { 0x06000B80, 0x060027E8, 0x060027E8, }; -static Gfx* dListTbl2[] = { +static UNK_PTR sUnkSegments[] = { NULL, 0x06000E08, 0x06001608, @@ -54,10 +54,10 @@ static Gfx* dListTbl2[] = { void EnTana_Init(Actor* thisx, GlobalContext* globalCtx) { EnTana* this = THIS; - osSyncPrintf("☆☆☆ %s ☆☆☆\n", shelfTypes[thisx->params]); + osSyncPrintf("☆☆☆ %s ☆☆☆\n", sShelfTypes[thisx->params]); Actor_SetScale(thisx, 1.0f); thisx->flags &= ~1; - thisx->draw = drawFuncs[thisx->params]; + thisx->draw = sDrawFuncs[thisx->params]; } void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -76,7 +76,7 @@ void func_80B17FC4(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tana.c", 152), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); + gSPDisplayList(gfxCtx->polyOpa.p++, sDLists1[thisx->params]); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 157); } @@ -88,9 +88,9 @@ void func_80B1809C(Actor* thisx, GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 163); func_80093D18(globalCtx->state.gfxCtx); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(dListTbl2[thisx->params])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(sUnkSegments[thisx->params])); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tana.c", 169), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); + gSPDisplayList(gfxCtx->polyOpa.p++, sDLists1[thisx->params]); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 174); } diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 1f60372070..c7b535e894 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -171,13 +171,13 @@ s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth /** z_en_tk_eff.c ends here probably **/ -static ColliderCylinderInit D_80B1D508 = { - { 0x0A, 0x00, 0x00, 0x39, 0x20, 0x01 }, +static ColliderCylinderInit sCylinderInit = { + { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 0x001E, 0x0034, 0x0000, { 0 } }, + { 30, 52, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 colChkInfoInit = { +static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF, }; @@ -506,9 +506,9 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { 0.f); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80B1D508); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &colChkInfoInit); + func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD || globalCtx->sceneNum != SCENE_SPOT02) { @@ -599,7 +599,7 @@ void EnTk_Walk(EnTk* this, GlobalContext* globalCtx) { void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { Vec3f rewardOrigin; Vec3f rewardPos; - s32 rewardParams[] = { + s32 sRewardParams[] = { 0x0000, /* Green rupee */ 0x0001, /* Blue rupee */ 0x0002, /* Red rupee */ @@ -639,7 +639,7 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { } } - Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]); + Item_DropCollectible(globalCtx, &rewardPos, sRewardParams[this->currentReward]); } } @@ -742,12 +742,11 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) { - static UNK_PTR eyeImages[] = { - &D_06003B40, - &D_06004340, - &D_06004B40, + static UNK_PTR sEyesSegments[] = { + 0x06003B40, + 0x06004340, + 0x06004B40, }; - EnTk* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; @@ -761,7 +760,7 @@ void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(eyeImages[this->eyeImageIdx])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(sEyesSegments[this->eyeImageIdx])); SkelAnime_DrawSV(globalCtx, this->skelAnim.skeleton, this->skelAnim.limbDrawTbl, this->skelAnim.dListCount, EnTk_OverrideLimbDraw, EnTk_PostLimbDraw, &this->actor); diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 0d05056111..d957cb2170 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -21,7 +21,7 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx); -static ColliderCylinderInit cylinderInitData = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, { 9, 23, 0, { 0 } }, @@ -49,7 +49,7 @@ void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap" Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Actor_SetScale(&this->actor, 0.1f); this->actionFunc = EnTuboTrap_WaitForProximity; } diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c index faa45c630d..128ecafcd3 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -26,7 +26,7 @@ const ActorInit En_Vase_InitVars = { (ActorFunc)EnVase_Draw, }; -extern u32 DL_VASE; +extern Gfx D_06000000[]; void EnVase_Init(Actor* thisx, GlobalContext* globalCtx) { EnVase* this = THIS; @@ -40,5 +40,5 @@ void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &DL_VASE); + Gfx_DrawDListOpa(globalCtx, &D_06000000); } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 4f64efe8f9..0487ba8d71 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -32,7 +32,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx); -void EnWallmas_DamageCoolDown(EnWallmas* this, GlobalContext* globalCtx); +void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx); @@ -52,25 +52,25 @@ const ActorInit En_Wallmas_InitVars = { (ActorFunc)EnWallmas_Draw, }; -static ColliderCylinderInit colCylinderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 30, 40, 0, { 0 } }, }; -static CollisionCheckInfoInit colChkInfoInit = { +static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x001E, 0x0028, 0x96, }; -static DamageTable damageTable = { +static DamageTable sDamageTable = { 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x30, 1), ICHAIN_F32(unk_4C, 0x157C, 1), ICHAIN_F32_DIV1000(gravity, 0xFA24, 0), @@ -93,14 +93,14 @@ extern Gfx D_06008688[]; void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) { EnWallmas* this = THIS; - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); ActorShape_Init(&thisx->shape, 0, NULL, 0.5f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e, 0x19); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, thisx, &colCylinderInit); - func_80061ED4(&thisx->colChkInfo, &damageTable, &colChkInfoInit); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); + func_80061ED4(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); this->switchFlag = (u8)(thisx->params >> 0x8); thisx->params = thisx->params & 0xFF; @@ -137,7 +137,7 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) { this->actionFunc = EnWallmas_WaitToDrop; } -void EnWallmas_DropStart(EnWallmas* this, GlobalContext* globalCtx) { +void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; AnimationHeader* objSegChangeAnime = &D_0600299C; @@ -153,7 +153,7 @@ void EnWallmas_DropStart(EnWallmas* this, GlobalContext* globalCtx) { this->actionFunc = EnWallmas_Drop; } -void EnWallmas_LandStart(EnWallmas* this, GlobalContext* globalCtx) { +void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) { AnimationHeader* objSegFrameCount = &D_060019CC; AnimationHeader* objSegChangeAnime = &D_060019CC; @@ -165,23 +165,23 @@ void EnWallmas_LandStart(EnWallmas* this, GlobalContext* globalCtx) { this->actionFunc = EnWallmas_Land; } -void EnWallmas_StandStart(EnWallmas* this) { +void EnWallmas_SetupStand(EnWallmas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600A054); this->actionFunc = EnWallmas_Stand; } -void EnWallmas_WalkStart(EnWallmas* this) { +void EnWallmas_SetupWalk(EnWallmas* this) { SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_060041F4, 3.0f); this->actionFunc = EnWallmas_Walk; this->actor.speedXZ = 3.0f; } -void EnWallmas_JumpToCeilingStart(EnWallmas* this) { +void EnWallmas_SetupJumpToCeiling(EnWallmas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244); this->actionFunc = EnWallmas_JumpToCeiling; this->actor.speedXZ = 0.0f; } -void EnWallmas_ReturnToCeilingStart(EnWallmas* this) { +void EnWallmas_SetupReturnToCeiling(EnWallmas* this) { AnimationHeader* objSegFrameCount = &D_060019CC; AnimationHeader* objSegChangeAnime = &D_060019CC; @@ -194,7 +194,7 @@ void EnWallmas_ReturnToCeilingStart(EnWallmas* this) { this->actionFunc = EnWallmas_ReturnToCeiling; } -void EnWallmas_TakeDamageStart(EnWallmas* this) { +void EnWallmas_SetupTakeDamage(EnWallmas* this) { SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f); if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; @@ -208,15 +208,15 @@ void EnWallmas_TakeDamageStart(EnWallmas* this) { this->actor.velocity.y = 10.0f; } -void EnWallmas_DamageCoolDownStart(EnWallmas* this) { +void EnWallmas_SetupCooldown(EnWallmas* this) { SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->actionFunc = EnWallmas_DamageCoolDown; + this->actionFunc = EnWallmas_Cooldown; } -void EnWallMas_DieBegin(EnWallmas* this, GlobalContext* globalCtx) { +void EnWallmas_SetupDie(EnWallmas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; @@ -227,7 +227,7 @@ void EnWallMas_DieBegin(EnWallmas* this, GlobalContext* globalCtx) { this->actionFunc = EnWallmas_Die; } -void EnWallmas_TakePlayerBegin(EnWallmas* this, GlobalContext* globalCtx) { +void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) { SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06009520, -5.0f); this->timer = -0x1e; this->actionFunc = EnWallmas_TakePlayer; @@ -250,7 +250,7 @@ void EnWallmas_ProximityOrSwitchInit(EnWallmas* this) { } } -void EnWallmas_StunBegin(EnWallmas* this) { +void EnWallmas_SetupStun(EnWallmas* this) { SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f); this->actor.speedXZ = 0.0f; @@ -291,7 +291,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { } if (this->timer == 0) { - EnWallmas_DropStart(this, globalCtx); + EnWallmas_SetupDrop(this, globalCtx); } } @@ -300,19 +300,19 @@ void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) { if (!func_8008E988(globalCtx) && (player->stateFlags2 & 0x10) == 0 && (player->invincibilityTimer >= 0) && (this->actor.xzDistanceFromLink < 30.0f) && (this->actor.yDistanceFromLink < -5.0f) && (-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) { - EnWallmas_TakePlayerBegin(this, globalCtx); + EnWallmas_SetupTakePlayer(this, globalCtx); } } void EnWallmas_Land(EnWallmas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { - EnWallmas_StandStart(this); + EnWallmas_SetupStand(this); } } void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { - EnWallmas_WalkStart(this); + EnWallmas_SetupWalk(this); } Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, this->actor.rotTowardsLinkY + 0x8000, 0xB6); @@ -320,7 +320,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { - EnWallmas_JumpToCeilingStart(this); + EnWallmas_SetupJumpToCeiling(this); } Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.rotTowardsLinkY + 0x8000), 0xB6); @@ -333,7 +333,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { - EnWallmas_ReturnToCeilingStart(this); + EnWallmas_SetupReturnToCeiling(this); } } @@ -368,9 +368,9 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (this->actor.colChkInfo.health == 0) { - EnWallMas_DieBegin(this, globalCtx); + EnWallmas_SetupDie(this, globalCtx); } else { - EnWallmas_DamageCoolDownStart(this); + EnWallmas_SetupCooldown(this); } } if (func_800A56C8(&this->skelAnime, 13.0f) != 0) { @@ -380,9 +380,9 @@ void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) { Math_ApproxF(&this->actor.speedXZ, 0.0f, 0.2f); } -void EnWallmas_DamageCoolDown(EnWallmas* this, GlobalContext* globalCtx) { +void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx) { if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { - EnWallmas_ReturnToCeilingStart(this); + EnWallmas_SetupReturnToCeiling(this); } } @@ -472,9 +472,9 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) { if (this->timer == 0) { if (this->actor.colChkInfo.health == 0) { - EnWallMas_DieBegin(this, globalCtx); + EnWallmas_SetupDie(this, globalCtx); } else { - EnWallmas_ReturnToCeilingStart(this); + EnWallmas_SetupReturnToCeiling(this); } } } @@ -497,14 +497,14 @@ void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { if ((this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_WHITE) || (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) { if (this->actionFunc != EnWallmas_Stun) { - EnWallmas_StunBegin(this); + EnWallmas_SetupStun(this); } } else { if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) { func_8002A65C(globalCtx, &this->actor, &this->actor.posRot.pos, 0x28, 0x28); } - EnWallmas_TakeDamageStart(this); + EnWallmas_SetupTakeDamage(this); } } } @@ -531,7 +531,7 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) { } else if (this->actor.posRot.pos.y <= this->unk_2c4) { this->actor.posRot.pos.y = this->unk_2c4; this->actor.velocity.y = 0.0f; - EnWallmas_LandStart(this, globalCtx); + EnWallmas_SetupLand(this, globalCtx); } if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index c4cefb11f5..2beda0fa45 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -53,8 +53,10 @@ void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 frameCount = globalCtx->csCtx.frames; Player* player = PLAYER; mf = &player->mf_9E0; + + // Draws the Triforce on Link's left hand { - // Draws the Triforce on Link's left hand + GraphicsContext* gfxCtx; Gfx* dispRefs[4]; gfxCtx = globalCtx->state.gfxCtx; @@ -67,10 +69,11 @@ void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateY(0.0f, MTXMODE_APPLY); Matrix_RotateZ(0.0f, MTXMODE_APPLY); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_end_title.c", 412), G_MTX_LOAD); - gSPDisplayList(gfxCtx->polyXlu.p++, triforceDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sTriforceDList); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_end_title.c", 417); } + // Draw title cards on the screen { GraphicsContext* gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_End_Title/z_end_title_gfx.c b/src/overlays/actors/ovl_End_Title/z_end_title_gfx.c index b63c2d3d59..e23c4c9501 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title_gfx.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title_gfx.c @@ -423,7 +423,7 @@ static UNK_TYPE D_80B69660[] = { 0x01F40195, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000500, 0x00000000, 0x00000000, 0xFFFFFFFF, }; -static Gfx triforceDL[] = { +static Gfx sTriforceDList[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 7ab8905535..6c981bb662 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -1,7 +1,7 @@ /* * File: z_item_inbox.c * Overlay: ovl_Item_Inbox - * Description: Zelda's magic to open gates. + * Description: Zelda's magic effect when opening gates in castle collapse */ #include "z_item_inbox.h" @@ -15,7 +15,7 @@ void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx); void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx); void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_80B86020(ItemInbox* this, GlobalContext* globalCtx); +void ItemInbox_Wait(ItemInbox* this, GlobalContext* globalCtx); const ActorInit Item_Inbox_InitVars = { ACTOR_ITEM_INBOX, @@ -32,14 +32,14 @@ const ActorInit Item_Inbox_InitVars = { void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx) { ItemInbox* this = THIS; - this->actionFunc = func_80B86020; + this->actionFunc = ItemInbox_Wait; Actor_SetScale(&this->actor, 0.2); } void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void func_80B86020(ItemInbox* this, GlobalContext* globalCtx) { +void ItemInbox_Wait(ItemInbox* this, GlobalContext* globalCtx) { if (Flags_GetTreasure(globalCtx, (this->actor.params >> 8) & 0x1F)) { Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 3dfc270c8c..18acf46de8 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -30,47 +30,47 @@ const ActorInit Obj_Bombiwa_InitVars = { (ActorFunc)ObjBombiwa_Draw, }; -static ColliderCylinderInit colliderInit = { +static ColliderCylinderInit sCylinderInit = { { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 55, 70, 0, { 0 } }, }; -static CollisionCheckInfoInit colChkInfoInit = { +static CollisionCheckInfoInit sColChkInfoInit = { 0x00, 0x000C, 0x003C, 0xFF, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 0x7D0, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 0x15E, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP), }; -static s16 effectScales[] = { +static s16 sEffectScales[] = { 17, 14, 10, 8, 7, 5, 3, 2, }; -extern Gfx* D_060009E0; // dlist +extern Gfx D_060009E0[]; void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx) { ObjBombiwa* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colliderInit); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Collider_CylinderUpdate(&this->actor, &this->collider); } void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { - Actor_ProcessInitChain(thisx, initChain); + Actor_ProcessInitChain(thisx, sInitChain); ObjBombiwa_InitCollision(thisx, globalCtx); if ((Flags_GetSwitch(globalCtx, thisx->params & 0x3F) != 0)) { Actor_Kill(thisx); } else { - func_80061ED4(&thisx->colChkInfo, NULL, &colChkInfoInit); + func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit); if (thisx->shape.rot.y == 0) { s16 rand = (s16)Math_Rand_ZeroFloat(65536.0f); thisx->posRot.rot.y = rand; @@ -93,15 +93,15 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { s16 scale; s32 i; - dlist = &D_060009E0; - for (i = 0; i < ARRAY_COUNT(effectScales); i++) { + dlist = D_060009E0; + for (i = 0; i < ARRAY_COUNT(sEffectScales); i++) { temp_s2.x = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x; temp_s2.y = ((Math_Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f; temp_s2.z = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z; temp_s3.x = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; temp_s3.y = (Math_Rand_ZeroOne() * 16.0f) + 5.0f; temp_s3.z = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; - scale = effectScales[i]; + scale = sEffectScales[i]; u0 = (scale >= 11) ? 37 : 33; func_80029E8C(globalCtx, &temp_s2, &temp_s3, &temp_s2, -400, u0, 10, 2, 0, scale, 1, 0, 80, -1, OBJECT_BOMBIWA, dlist); @@ -132,5 +132,5 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_060009E0); + Gfx_DrawDListOpa(globalCtx, D_060009E0); } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 4d1cdd234a..050e3bdfb6 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -17,7 +17,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx); void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx); void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx); -void ObjComb_SetWait(ObjComb* this); +void ObjComb_SetupWait(ObjComb* this); void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx); const ActorInit Obj_Comb_InitVars = { @@ -32,34 +32,34 @@ const ActorInit Obj_Comb_InitVars = { (ActorFunc)ObjComb_Draw, }; -ColliderJntSphItemInit colliderItemsInit[1] = { +ColliderJntSphItemInit sJntSphItemsInit[1] = { { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 0x00, { { 0, 0, 0 }, 15 }, 100 }, }, }; -ColliderJntSphInit colliderInit = { +ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH }, 1, - &colliderItemsInit, + &sJntSphItemsInit, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1100, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 100, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 900, ICHAIN_STOP), }; -extern UNK_TYPE D_050095B0; -extern UNK_TYPE D_05009940; +extern Gfx D_050095B0[]; +extern Gfx D_05009940[]; void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { Vec3f pos1; Vec3f posSum; Vec3f pos2; - Gfx** dlist = &D_05009940; + Gfx** dlist = D_05009940; s16 scale; s16 angle = 0; s16 gravityInfluence; @@ -135,17 +135,17 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) { void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) { ObjComb* this = THIS; - Actor_ProcessInitChain(&this->actor, &initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, this, &colliderInit, &this->colliderItems); - ObjComb_SetWait(this); + Collider_SetJntSph(globalCtx, &this->collider, this, &sJntSphInit, &this->colliderItems); + ObjComb_SetupWait(this); } void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx) { Collider_DestroyJntSph(globalCtx, &THIS->collider); } -void ObjComb_SetWait(ObjComb* this) { +void ObjComb_SetupWait(ObjComb* this) { this->actionFunc = ObjComb_Wait; } @@ -205,7 +205,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_comb.c", 394), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, &D_050095B0); + gSPDisplayList(gfxCtx->polyOpa.p++, D_050095B0); func_800628A4(0, &this->collider); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_obj_comb.c", 402); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index cc3acf9da2..f36db51534 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -1,7 +1,7 @@ /* * File: z_obj_elevator.c * Overlay: Obj_Elevator - * Description: Stone Dungeon Elevator + * Description: Stone Elevator */ #include "z_obj_elevator.h" @@ -32,16 +32,16 @@ const ActorInit Obj_Elevator_InitVars = { (ActorFunc)ObjElevator_Draw, }; -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_F4, 2000, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 600, ICHAIN_CONTINUE), ICHAIN_F32(unk_FC, 2000, ICHAIN_STOP), }; -static f32 sizes[] = { 0.1f, 0.05f }; +static f32 sScales[] = { 0.1f, 0.05f }; -extern u32 D_06000180; -extern u32 D_06000360; +extern Gfx D_06000180[]; +extern UNK_TYPE D_06000360; void ObjElevator_SetupAction(ObjElevator* this, ObjElevatorActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -67,8 +67,8 @@ void ObjElevator_Init(Actor* thisx, GlobalContext* globalCtx) { f32 temp_f0; func_80B92B08(this, globalCtx, &D_06000360, 1); - Actor_SetScale(thisx, sizes[thisx->params & 1]); - Actor_ProcessInitChain(thisx, initChain); + Actor_SetScale(thisx, sScales[thisx->params & 1]); + Actor_ProcessInitChain(thisx, sInitChain); temp_f0 = (thisx->params >> 8) & 0xF; this->unk_16C = temp_f0 + temp_f0; func_80B92C5C(this); @@ -88,6 +88,7 @@ void func_80B92C5C(ObjElevator* this) { void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) { f32 sub; Actor* thisx = &this->dyna.actor; + if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) { sub = thisx->posRot.pos.y - thisx->initPosRot.pos.y; if (fabsf(sub) < 0.1f) { @@ -105,6 +106,7 @@ void func_80B92D20(ObjElevator* this) { void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (fabsf(Math_SmoothScaleMaxMinF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { Audio_PlayActorSound2(thisx, NA_SE_EV_FOOT_SWITCH); func_80B92C5C(this); @@ -123,5 +125,5 @@ void ObjElevator_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjElevator_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, &D_06000180); + Gfx_DrawDListOpa(globalCtx, D_06000180); } diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 3abbe11843..5e59ca9c39 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -1,11 +1,10 @@ /* * File: z_obj_makekinsuta.c * Overlay: ovl_Obj_Makekinsuta - * Description: Skulltula Sprouting from Bean Spot. + * Description: Skulltula Sprouting from Bean Spot */ #include "z_obj_makekinsuta.h" - #include #define FLAGS 0x00000010 @@ -16,7 +15,7 @@ void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx); void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx); void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx); -void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx); +void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, GlobalContext* globalCtx); const ActorInit Obj_Makekinsuta_InitVars = { ACTOR_OBJ_MAKEKINSUTA, @@ -49,20 +48,20 @@ void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx) { void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) { if (this->unk_152 != 0) { - if (this->unk_150 >= 0x3C && !func_8002DEEC(PLAYER)) { + if (this->timer >= 60 && !func_8002DEEC(PLAYER)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, (this->actor.params | 0x8000)); - this->actionFunc = func_80B983D4; - return; + this->actionFunc = ObjMakekinsuta_DoNothing; + } else { + this->timer++; } - this->unk_150 = this->unk_150 + 1; - return; + } else { + this->timer = 0; } - this->unk_150 = 0; } -void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx) { +void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, GlobalContext* globalCtx) { } void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h index d9dfdc06d1..4d6b421afe 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h @@ -11,7 +11,7 @@ typedef void (*ObjMakekinsutaActionFunc)(struct ObjMakekinsuta*, GlobalContext*) typedef struct ObjMakekinsuta { /* 0x0000 */ Actor actor; /* 0x014C */ ObjMakekinsutaActionFunc actionFunc; - /* 0x150 */ s16 unk_150; + /* 0x150 */ s16 timer; /* 0x152 */ s16 unk_152; } ObjMakekinsuta; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 6a240c2961..fe64164fe3 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -1,7 +1,7 @@ /* * File: z_obj_roomtimer.c * Overlay: ovl_Obj_Roomtimer - * Description: Timer + * Description: Starts Timer 1 with a value specified in params */ #include "z_obj_roomtimer.h" @@ -51,10 +51,8 @@ void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx) { void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx) { ObjRoomtimer* this = THIS; - if (this->actor.params != 0x3FF) { - if (gSaveContext.timer1Value > 0) { - gSaveContext.timer1State = 10; - } + if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value > 0)) { + gSaveContext.timer1State = 10; } } @@ -72,18 +70,15 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) { if (this->actor.params != 0x3FF) { gSaveContext.timer1State = 10; } - Flags_SetClear(globalCtx, this->actor.room); Flags_SetSwitch(globalCtx, this->switchFlag); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->actor); } else { - if (this->actor.params != 0x3FF) { - if (gSaveContext.timer1Value == 0) { - Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - Gameplay_TriggerVoidOut(globalCtx); - Actor_Kill(&this->actor); - } + if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) { + Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Gameplay_TriggerVoidOut(globalCtx); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 18e942652d..b449524fd4 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -32,7 +32,7 @@ const ActorInit Oceff_Spot_InitVars = { #include "z_oceff_spot_gfx.c" -static InitChainEntry initChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 1500, ICHAIN_STOP), }; @@ -45,7 +45,7 @@ void OceffSpot_Init(Actor* thisx, GlobalContext* globalCtx) { u32 pad; OceffSpot* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); + Actor_ProcessInitChain(&this->actor, sInitChain); OceffSpot_SetupAction(this, OceffSpot_GrowCylinder); Lights_InitType0PositionalLight(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y, @@ -160,10 +160,10 @@ void OceffSpot_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_spot.c", 469), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 2, scroll * (-2), 32, 32, 1, 0, scroll * (-8), 32, 32)); - gSPDisplayList(gfxCtx->polyXlu.p++, cylinderDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sCylinderDl); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_spot.c", 485); } diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot_gfx.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot_gfx.c index df5359bce4..60462accc4 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot_gfx.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot_gfx.c @@ -49,7 +49,7 @@ static Vtx vertices[] = { VTX(35, 500, 35, 768, 0, 0xFF, 0xFF, 0xFF, 0xFF), }; -static Gfx textureDl[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -70,7 +70,7 @@ static Gfx textureDl[] = { gsSPEndDisplayList(), }; -static Gfx cylinderDl[] = { +static Gfx sCylinderDl[] = { gsSPVertex(vertices, 27, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0), diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 1ca70c424e..632893a7ba 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -14,6 +14,7 @@ void OceffStorm_Init(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Destroy(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_Draw(Actor* thisx, GlobalContext* globalCtx); + void OceffStorm_Draw2(Actor* thisx, GlobalContext* globalCtx); void OceffStorm_DefaultAction(OceffStorm* this, GlobalContext* globalCtx); @@ -138,7 +139,7 @@ void OceffStorm_Draw2(Actor* thisx, GlobalContext* globalCtx) { gDPSetAlphaDither(gfxCtx->polyXlu.p++, G_AD_NOISE); gDPSetColorDither(gfxCtx->polyXlu.p++, G_CD_NOISE); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 200, 200, 150, this->primColorAlpha); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 8, scroll * 4, 64, 64, 1, scroll * 4, scroll * 4, 64, 64)); gSPTextureRectangle(gfxCtx->polyXlu.p++, 0, 0, (SCREEN_WIDTH << 2), (SCREEN_HEIGHT << 2), G_TX_RENDERTILE, 0, 0, @@ -173,10 +174,10 @@ void OceffStorm_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_storm.c", 498), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, cylinderTexDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sCylinderTexDl); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 4, (0 - scroll) * 8, 32, 32, 1, scroll * 8, (0 - scroll) * 12, 32, 32)); - gSPDisplayList(gfxCtx->polyXlu.p++, cylinderDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sCylinderDl); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_storm.c", 512); diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm_gfx.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm_gfx.c index e2d592a93b..490d709c31 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm_gfx.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm_gfx.c @@ -120,7 +120,7 @@ static u32 tex0[] = { 0x74AADCEF, 0xD7B4A497, 0x7E562D15, 0x1023405E, 0x7E9FB7B9, 0x95898F97, 0x90734619, }; -static Gfx textureDl[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsDPSetRenderMode(IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1), @@ -153,7 +153,7 @@ static Vtx vertices[] = { VTX(35, 500, 35, 768, 0, 0xFF, 0xFF, 0xFF, 0x00), }; -static Gfx cylinderTexDl[] = { +static Gfx sCylinderTexDl[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -170,7 +170,7 @@ static Gfx cylinderTexDl[] = { gsSPEndDisplayList(), }; -static Gfx cylinderDl[] = { +static Gfx sCylinderDl[] = { gsSPVertex(vertices, 27, 0), gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0), gsSP2Triangles(6, 7, 8, 0, 6, 8, 4, 0), diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index cdef73009c..2fb18002c9 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -121,10 +121,10 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetEnvColor(gfxCtx->polyXlu.p++, 100, 0x00, 0xFF, 0x80); } - gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 - scroll, scroll * (-2), 32, 32, 1, 0 - scroll, scroll * (-2), 32, 32)); - gSPDisplayList(gfxCtx->polyXlu.p++, frustrumDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sFrustrumDl); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe.c", 398); } diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe_gfx.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe_gfx.c index 38f06ce78c..40322ce67c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe_gfx.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe_gfx.c @@ -55,7 +55,7 @@ static Vtx vertices[] = { VTX(165, 227, 0, 819, 1024, 0xFF, 0xFF, 0xFF, 0x00), VTX(0, 500, 1000, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF), }; -static Gfx textureDL[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -74,7 +74,7 @@ static Gfx textureDL[] = { gsSPEndDisplayList(), }; -static Gfx frustrumDl[] = { +static Gfx sFrustrumDl[] = { gsSPVertex(vertices, 32, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0), diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 7e0809525a..e3706ee7d1 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -106,10 +106,10 @@ void OceffWipe2_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x00, 0x00, 0xFF, 0xFF, 0xAA, 0xFF); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x64, 0x00, 0x80); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 6, scroll * (-6), 64, 64, 1, scroll * (-6), 0, 64, 64)); - gSPDisplayList(gfxCtx->polyXlu.p++, frustrumDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sFrustrumDl); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe2.c", 417); } diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2_gfx.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2_gfx.c index 8b6d786f87..e38297e4bb 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2_gfx.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2_gfx.c @@ -134,7 +134,7 @@ static Vtx vertices[] = { VTX(93, -285, 1000, 205, 0, 0xFF, 0xFF, 0xFF, 0xFF), VTX(0, -150, 0, 0, 2048, 0xFF, 0xFF, 0xFF, 0x00), }; -static Gfx textureDl[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -165,7 +165,7 @@ static Gfx textureDl[] = { gsSPEndDisplayList(), }; -static Gfx frustrumDl[] = { +static Gfx sFrustrumDl[] = { gsSPVertex(&vertices, 22, 0), gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), gsSP2Triangles(4, 5, 0, 0, 5, 1, 0, 0), diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 9d0557cd26..c891ade574 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -108,10 +108,10 @@ void OceffWipe3_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x00, 0x00, 0xFF, 0xFF, 0xAA, 0xFF); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x64, 0xC8, 0x00, 0x80); - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 12, scroll * (-12), 64, 64, 1, scroll * 8, scroll * (-8), 64, 64)); - gSPDisplayList(gfxCtx->polyXlu.p++, frustrumDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sFrustrumDl); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe3.c", 370); } diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3_gfx.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3_gfx.c index 0c6d95bf25..47276ec1a9 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3_gfx.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3_gfx.c @@ -131,7 +131,7 @@ static Vtx vertices[] = { VTX(143, -46, 0, 819, 2048, 0xFF, 0xFF, 0xFF, 0x00), VTX(243, -176, 1000, 614, 0, 0xFF, 0xFF, 0xFF, 0xFF), }; -static Gfx textureDl[] = { +static Gfx sTextureDL[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -150,7 +150,7 @@ static Gfx textureDl[] = { gsSPEndDisplayList(), }; -static Gfx frustrumDl[] = { +static Gfx sFrustrumDl[] = { gsSPVertex(vertices, 22, 0), gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), gsSP2Triangles(4, 5, 0, 0, 5, 1, 0, 0), diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index fbda23d935..b0c84b8f04 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -101,15 +101,15 @@ void OceffWipe4_Draw(Actor* thisx, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (this->actor.params == 1) { - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl1); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL1); } else { - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl0); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL0); } - gSPDisplayList(gfxCtx->polyXlu.p++, textureDl2); + gSPDisplayList(gfxCtx->polyXlu.p++, sTextureDL2); gSPDisplayList(gfxCtx->polyXlu.p++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, scroll * 2, scroll * (-2), 32, 64, 1, scroll * (-1), scroll, 32, 32)); - gSPDisplayList(gfxCtx->polyXlu.p++, frustrumDl); + gSPDisplayList(gfxCtx->polyXlu.p++, sFrustrumDl); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_oceff_wipe4.c", 344); } diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4_gfx.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4_gfx.c index c0e2845f2b..dd7a1ef05c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4_gfx.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4_gfx.c @@ -76,7 +76,7 @@ static Vtx vertices[] = { VTX(143, -46, 0, 410, 1024, 0xFF, 0xFF, 0xFF, 0x00), VTX(243, -176, 1000, 307, 0, 0xFF, 0xFF, 0xFF, 0xFF), }; -static Gfx textureDl0[] = { +static Gfx sTextureDL0[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -87,7 +87,7 @@ static Gfx textureDl0[] = { gsSPEndDisplayList(), }; -static Gfx textureDl1[] = { +static Gfx sTextureDL1[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -98,7 +98,7 @@ static Gfx textureDl1[] = { gsSPEndDisplayList(), }; -static Gfx textureDl2[] = { +static Gfx sTextureDL2[] = { gsDPPipeSync(), gsDPLoadTextureBlock(tex0, G_IM_FMT_I, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_NOMIRROR, G_TX_NOMIRROR | G_TX_NOMIRROR, 5, 6, 14, 1), @@ -111,7 +111,7 @@ static Gfx textureDl2[] = { //! @bug : gsSPEndDisplayList() is missing so the next dlist will execute as well }; -static Gfx frustrumDl[] = { +static Gfx sFrustrumDl[] = { gsSPVertex(vertices, 22, 0), gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), gsSP2Triangles(4, 5, 0, 0, 5, 1, 0, 0), diff --git a/tools/ichaindis.py b/tools/ichaindis.py index a05627280a..bb7afb7449 100755 --- a/tools/ichaindis.py +++ b/tools/ichaindis.py @@ -33,7 +33,7 @@ def main(): print('failed to read file' + args.filename) sys.exit(1) - print ('static InitChainEntry initChain[] = {') + print ('static InitChainEntry sInitChain[] = {') while True: entry = struct.unpack('>I', romData[romOff:romOff+4])[0] romOff += 4 diff --git a/tools/overlayhelpers/GenColliderInit.py b/tools/overlayhelpers/coliderinit.py similarity index 95% rename from tools/overlayhelpers/GenColliderInit.py rename to tools/overlayhelpers/coliderinit.py index 66d88fdeed..e8846667ae 100755 --- a/tools/overlayhelpers/GenColliderInit.py +++ b/tools/overlayhelpers/coliderinit.py @@ -102,7 +102,7 @@ def GetItems(data, off, count, structf, fmt, size): def GetJntSphItems(data, off, count): items = GetItems(data, off, count, sf_JntSphItem, f_JntSphItem, 0x24) print(''' -ColliderJntSphItemInit jntsphItemsInit[{0}] = {{{1} +static ColliderJntSphItemInit sJntSphItemsInit[{0}] = {{{1} }}; '''.format(count, items)) @@ -111,7 +111,7 @@ def GetJntSph(data, off, type): cJntSph = struct.unpack_from(sf_JntSph, data, off + 8) print(''' -ColliderJntSphInit{0} jntsphInit = +static ColliderJntSphInit{0} sJntSphInit = {{ {1}, {2}, @@ -122,7 +122,7 @@ ColliderJntSphInit{0} jntsphInit = def GetTrisItems(data, off, count): items = GetItems(data, off, count, sf_TrisItem, f_TrisItem, 0x24) print(''' -ColliderTrisItemInit trisItemsInit[{0}] = {{{1} +static ColliderTrisItemInit sTrisItemsInit[{0}] = {{{1} }}; '''.format(count, items)) @@ -133,7 +133,7 @@ def GetCylinder(data, off, type): cCyl16 = struct.unpack_from(sf_Cylinder16, data, off + 0x20) print(''' -ColliderCylinderInit{0} cylinderInit = +static ColliderCylinderInit{0} sCylinderInit = {{ {1}, {2}, @@ -146,7 +146,7 @@ def GetTris(data, off, type): cTris = struct.unpack_from(sf_Tris, data, off + 8) print(''' -ColliderTrisInit{0} trisInit = +static ColliderTrisInit{0} sTrisInit = {{ {1}, {2}, @@ -158,7 +158,7 @@ def GetQuad(data, off, type): cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08) cQuad = struct.unpack_from(sf_Quad, data, off + 0x20) print(''' -ColliderQuadInit{0} quadInit = +static ColliderQuadInit{0} sQuadInit = {{ {1}, {2}, diff --git a/undefined_syms.txt b/undefined_syms.txt index 5530049ef2..19b4fbc8a6 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -152,10 +152,10 @@ D_05017870 = 0x05017870; D_05017A60 = 0x05017A60; // z_en_vase -DL_VASE = 0x06000000; +D_06000000 = 0x06000000; // z_door_toki -DOOR_TOKI_COLLISION_DATA = 0x06007888; +D_06007888 = 0x06007888; // z_bg_spot09_obj D_06008010 = 0x06008010; @@ -169,8 +169,8 @@ D_06002260 = 0x06002260; D_0600238C = 0x0600238C; // z_bg_spot18_futa -DL_SPOT18_FUTA = 0x06000368; -DL_SPOT18_FUTA2 = 0x06000150; +D_06000368 = 0x06000368; +D_06000150 = 0x06000150; // z_bg_umajump D_06001438 = 0x06001438; @@ -370,9 +370,6 @@ D_040539B0 = 0x040539B0; D_06001144 = 0x06001144; D_06001FA8 = 0x06001FA8; D_06002F84 = 0x06002F84; -D_06003B40 = 0x06003B40; -D_06004340 = 0x06004340; -D_06004B40 = 0x06004B40; D_0600ACE0 = 0x0600ACE0; D_0600BC90 = 0x0600BC90; D_0600BCA0 = 0x0600BCA0; @@ -484,6 +481,7 @@ D_0600F8B8 = 0x0600F8B8; // z_bg_mjin D_06000140 = 0x06000140; D_06000330 = 0x06000330; +D_06000330_ = 0x06000330; D_06000658 = 0x06000658; // z_en_wallmas @@ -561,11 +559,6 @@ D_060048A8 = 0x060048A8; // z_en_horse_ganon D_06008668 = 0x06008668; D_06004AA4 = 0x06004AA4; -D_06005264 = 0x06005264; -D_06005B78 = 0x06005B78; -D_06002CE4 = 0x06002CE4; -D_06002650 = 0x06002650; -D_06003858 = 0x06003858; // z_en_skjneedle D_06000EB0 = 0x06000EB0; @@ -630,8 +623,5 @@ D_06003128 = 0x06003128; // z_en_guest D_060042AC = 0x060042AC; -D_060005FC = 0x060005FC; -D_060006FC = 0x060006FC; -D_060007FC = 0x060007FC; D_060059B0 = 0x060059B0;