diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2021-05-30 12:30:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-30 12:30:38 -0400 |
| commit | f6470eaa0881b7f038ca1a7e30d6516fafaf2ecb (patch) | |
| tree | 191322114e34030d7e68a23cf96f51074dfe7f6f /src | |
| parent | 515ebdce9daf801705fa9d4f03f01b3c26269488 (diff) | |
"Decompile" more objects. (#784)
* Object_hakach_objects OK and fix a warning in z_play.c
* Object Warp1 OK
* Object_spot16_obj OK
* object_cs Skeleton and limbs OK
* Limbs are broken
* Limbs OK
* Object_CS OK
* Object_jya_door OK
* fix errors and add new lines
* PR fixes (AngheloAlf)
* PR fixes (EllipticEllipsis)
* PR fixes (Fig)
* Rename Spot16 and Jya
* GraveYard -> Graveyard
* PR fixes
* -s
* PR fixes
Diffstat (limited to 'src')
12 files changed, 118 insertions, 79 deletions
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 9090729ae..0b745243f 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -45,10 +45,10 @@ u8 gPlayerModelTypes[][5] = { }; Gfx* D_80125CE8[] = { - 0x060226E0, gLinkChildRightHandClosedNearDL, 0x06027690, gLinkChildRightHandClosedFarDL, + 0x060226E0, gLinkChildRightHandClosedNearDL, 0x06027690, gLinkChildRightHandClosedFarDL, 0x060226E0, gLinkChildRightFistAndDekuShieldNearDL, 0x06027690, gLinkChildRightFistAndDekuShieldFarDL, - 0x06022970, gLinkChildRightHandClosedNearDL, 0x06027918, gLinkChildRightHandClosedFarDL, - 0x060241C0, gLinkChildRightHandClosedNearDL, 0x06028B40, gLinkChildRightHandClosedFarDL, + 0x06022970, gLinkChildRightHandClosedNearDL, 0x06027918, gLinkChildRightHandClosedFarDL, + 0x060241C0, gLinkChildRightHandClosedNearDL, 0x06028B40, gLinkChildRightHandClosedFarDL, }; Gfx* D_80125D28[] = { diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 13e9c477d..ad316108d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -5,6 +5,7 @@ */ #include "z_bg_haka_huta.h" +#include "objects/object_hakach_objects/object_hakach_objects.h" #define FLAGS 0x00000010 @@ -16,15 +17,12 @@ void BgHakaHuta_Update(Actor* thisx, GlobalContext* globalCtx); void BgHakaHuta_Draw(Actor* thisx, GlobalContext* globalCtx); void BgHakaHuta_SpawnDust(BgHakaHuta* this, GlobalContext* globalCtx); -void func_8087D268(BgHakaHuta* this, GlobalContext* globalCtx, u16 sfx); +void BgHakaHuta_PlaySound(BgHakaHuta* this, GlobalContext* globalCtx, u16 sfx); void BgHakaHuta_SpawnEnemies(BgHakaHuta* this, GlobalContext* globalCtx); void BgHakaHuta_Open(BgHakaHuta* this, GlobalContext* globalCtx); void BgHakaHuta_SlideOpen(BgHakaHuta* this, GlobalContext* globalCtx); void func_8087D720(BgHakaHuta* this, GlobalContext* globalCtx); -void func_8087D8C0(BgHakaHuta* this, GlobalContext* globalCtx); - -extern Gfx D_060006B0[]; -extern CollisionHeader D_06000870; +void BgHakaHuta_DoNothing(BgHakaHuta* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Huta_InitVars = { ACTOR_BG_HAKA_HUTA, @@ -45,16 +43,15 @@ static InitChainEntry sInitChain[] = { void BgHakaHuta_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaHuta* this = THIS; s16 pad; - CollisionHeader* colHeader; + CollisionHeader* colHeader = NULL; - colHeader = NULL; - Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - DynaPolyActor_Init(&this->dyna, 1); - CollisionHeader_GetVirtual(&D_06000870, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); + Actor_ProcessInitChain(thisx, sInitChain); + DynaPolyActor_Init(&this->dyna, DPM_PLAYER); + CollisionHeader_GetVirtual(&gBotwCoffinLidCol, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); this->unk_16A = (thisx->params >> 8) & 0xFF; - this->dyna.actor.params &= 0xFF; - if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) { + thisx->params &= 0xFF; + if (Flags_GetSwitch(globalCtx, thisx->params)) { this->counter = -1; this->actionFunc = func_8087D720; } else { @@ -98,7 +95,7 @@ void BgHakaHuta_SpawnDust(BgHakaHuta* this, GlobalContext* globalCtx) { } } -void func_8087D268(BgHakaHuta* this, GlobalContext* globalCtx, u16 sfx) { +void BgHakaHuta_PlaySound(BgHakaHuta* this, GlobalContext* globalCtx, u16 sfx) { Vec3f pos; pos.z = (this->dyna.actor.shape.rot.y == 0) ? this->dyna.actor.world.pos.z + 120.0f @@ -152,7 +149,7 @@ void BgHakaHuta_Open(BgHakaHuta* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + posOffset, 2.0f); if (this->counter == 0) { this->counter = 37; - func_8087D268(this, globalCtx, NA_SE_EV_COFFIN_CAP_OPEN); + BgHakaHuta_PlaySound(this, globalCtx, NA_SE_EV_COFFIN_CAP_OPEN); this->actionFunc = BgHakaHuta_SlideOpen; } } @@ -168,7 +165,7 @@ void BgHakaHuta_SlideOpen(BgHakaHuta* this, GlobalContext* globalCtx) { BgHakaHuta_SpawnDust(this, globalCtx); } if (this->counter == 0) { - func_8087D268(this, globalCtx, NA_SE_EV_COFFIN_CAP_BOUND); + BgHakaHuta_PlaySound(this, globalCtx, NA_SE_EV_COFFIN_CAP_BOUND); this->actionFunc = func_8087D720; } } @@ -182,14 +179,14 @@ void func_8087D720(BgHakaHuta* this, GlobalContext* globalCtx) { this->counter++; if (this->counter == 6) { - this->actionFunc = func_8087D8C0; + this->actionFunc = BgHakaHuta_DoNothing; quakeIndex = Quake_Add(ACTIVE_CAM, 3); Quake_SetSpeed(quakeIndex, 0x7530); Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0); Quake_SetCountdown(quakeIndex, 2); } else if (this->counter == 0) { this->counter = 6; - this->actionFunc = func_8087D8C0; + this->actionFunc = BgHakaHuta_DoNothing; } D_8087D958.x = this->counter + 24.0f; @@ -206,14 +203,15 @@ void func_8087D720(BgHakaHuta* this, GlobalContext* globalCtx) { func_800D20CC(&mtx, &this->dyna.actor.shape.rot, 0); } -void func_8087D8C0(BgHakaHuta* this, GlobalContext* globalCtx) { +void BgHakaHuta_DoNothing(BgHakaHuta* this, GlobalContext* globalCtx) { } void BgHakaHuta_Update(Actor* thisx, GlobalContext* globalCtx) { BgHakaHuta* this = THIS; + this->actionFunc(this, globalCtx); } void BgHakaHuta_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_060006B0); + Gfx_DrawDListOpa(globalCtx, gBotwCoffinLidDL); } 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 3b87b6d21..fd2b5435f 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 @@ -5,6 +5,7 @@ */ #include "z_bg_haka_megane.h" +#include "objects/object_hakach_objects/object_hakach_objects.h" #define FLAGS 0x000000B0 @@ -35,16 +36,25 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_06001830, D_06001AB8, D_06004330, D_060044D0, D_06004780, D_06004940, D_06004B00, D_06004CC0; - static CollisionHeader* sCollisionHeaders[] = { - &D_06001830, &D_06001AB8, NULL, &D_06004330, &D_060044D0, NULL, &D_06004780, - &D_06004940, NULL, &D_06004B00, NULL, &D_06004CC0, NULL, + &gBotw1Col, &gBotw2Col, NULL, 0x06004330, 0x060044D0, NULL, 0x06004780, + 0x06004940, NULL, 0x06004B00, NULL, 0x06004CC0, NULL, }; static Gfx* sDLists[] = { - 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, - 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, + gBotwFakeWallsAndFloorsDL, + gBotwThreeFakeFloorsDL, + gBotwHoleTrap2DL, + 0x060040F0, + 0x060043B0, + 0x06001120, + 0x060045A0, + 0x060047F0, + 0x060018F0, + 0x060049B0, + 0x06003CF0, + 0x06004B70, + 0x06002ED0, }; extern Gfx D_06001250[]; @@ -126,6 +136,6 @@ void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx) { } if (thisx->params == 0) { - Gfx_DrawDListXlu(globalCtx, D_06001250); + Gfx_DrawDListXlu(globalCtx, gBotwBloodSplatterDL); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index 7b6f9d07a..10853bedb 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -5,6 +5,7 @@ */ #include "z_bg_haka_water.h" +#include "objects/object_hakach_objects/object_hakach_objects.h" #define FLAGS 0x00000030 @@ -15,7 +16,7 @@ void BgHakaWater_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgHakaWater_Update(Actor* thisx, GlobalContext* globalCtx); void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_80881D94(BgHakaWater* this, GlobalContext* globalCtx); +void BgHakaWater_LowerWater(BgHakaWater* this, GlobalContext* globalCtx); void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx); void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx); @@ -35,9 +36,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_06001E50[]; -extern Gfx D_06002010[]; - void BgHakaWater_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaWater* this = THIS; @@ -49,14 +47,14 @@ void BgHakaWater_Init(Actor* thisx, GlobalContext* globalCtx) { } else { this->isLowered = false; } - func_80881D94(this, globalCtx); + BgHakaWater_LowerWater(this, globalCtx); this->actionFunc = BgHakaWater_Wait; } void BgHakaWater_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void func_80881D94(BgHakaWater* this, GlobalContext* globalCtx) { +void BgHakaWater_LowerWater(BgHakaWater* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 9; i++) { @@ -100,7 +98,7 @@ void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx) { this->actor.draw = NULL; } } - func_80881D94(this, globalCtx); + BgHakaWater_LowerWater(this, globalCtx); } void BgHakaWater_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -132,7 +130,7 @@ void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_haka_water.c", 312), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06001E50); + gSPDisplayList(POLY_XLU_DISP++, gBotwWaterRingDL); Matrix_Translate(0.0f, 92.0f, -1680.0f, MTXMODE_NEW); Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); @@ -145,7 +143,7 @@ void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(5.1f * temp)); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_haka_water.c", 328), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06002010); + gSPDisplayList(POLY_XLU_DISP++, gBotwWaterFallDL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_haka_water.c", 332); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 0578cbefd..573851827 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -5,6 +5,7 @@ */ #include "z_bg_haka_zou.h" +#include "objects/object_hakach_objects/object_hakach_objects.h" #define FLAGS 0x00000010 @@ -71,10 +72,8 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_06000A10[]; extern CollisionHeader D_06005E30; extern CollisionHeader D_06006F70; -extern CollisionHeader D_06000C2C; void BgHakaZou_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; @@ -186,7 +185,7 @@ void BgHakaZou_Wait(BgHakaZou* this, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06005E30, &colHeader); this->collider.dim.yShift = -50; } else { - CollisionHeader_GetVirtual(&D_06000C2C, &colHeader); + CollisionHeader_GetVirtual(&gBotwBombSpotCol, &colHeader); this->collider.dim.radius = 55; this->collider.dim.height = 20; } @@ -259,13 +258,13 @@ void func_80882E54(BgHakaZou* this, GlobalContext* globalCtx) { fragmentPos.y = this->collider.dim.pos.y; fragmentPos.z = this->collider.dim.pos.z; - EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, D_06000A10); + EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, gBotwBombSpotDL); for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { fragmentPos.x = this->collider.dim.pos.x + (((j * 2) - 1) * num); fragmentPos.z = this->collider.dim.pos.z + (((i * 2) - 1) * num); - EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, D_06000A10); + EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, gBotwBombSpotDL); func_800286CC(globalCtx, &fragmentPos, &sZeroVec, &sZeroVec, 1000, 50); } } @@ -405,7 +404,7 @@ void BgHakaZou_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHakaZou_Draw(Actor* thisx, GlobalContext* globalCtx) { - static Gfx* dLists[] = { 0x060064E0, 0x06005CE0, 0x06000A10, 0x06005CE0 }; + static Gfx* dLists[] = { 0x060064E0, 0x06005CE0, gBotwBombSpotDL, 0x06005CE0 }; Gfx_DrawDListOpa(globalCtx, dLists[thisx->params]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 8e99a85b0..43de77e3f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -73,7 +73,7 @@ static s16 D_80899520[] = { 18, 26, 34, 42, 50, 60, 70, 80 }; static s16 D_80899530[] = { 48, 42, 36, 32, 28, 24, 20, 16 }; static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale.x, 100, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index fa47035d1..08b0b225b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -180,7 +180,7 @@ void BgJyaZurerukabe_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actionFunc(this, globalCtx); - + if (this->unk_168 == 0) { func_8089B4C8(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index ef4a2ca3f..7e4ccf88b 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -1,4 +1,5 @@ #include "z_bg_spot16_bombstone.h" +#include "objects/object_spot16_obj/object_spot16_obj.h" #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" @@ -184,7 +185,7 @@ s32 func_808B4D9C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { func_808B4D04(this, globalCtx); this->sinRotation = Math_SinS(this->actor.shape.rot.y); this->cosRotation = Math_CosS(this->actor.shape.rot.y); - this->unk_150 = D_06000C20; + this->dList = gDodongosCavernRock3DL; func_808B5934(this); return true; @@ -220,7 +221,7 @@ s32 func_808B4E58(BgSpot16Bombstone* this, GlobalContext* globalctx) { actor->shape.rot.y = D_808B5DD8[actor->params][8]; actor->shape.rot.z = D_808B5DD8[actor->params][9]; - this->unk_150 = D_060009E0; + this->dList = D_060009E0; this->bombiwaBankIndex = Object_GetIndex(&globalctx->objectCtx, OBJECT_BOMBIWA); if (this->bombiwaBankIndex < 0) { @@ -298,8 +299,6 @@ void func_808B5240(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (1) {} - // for(;this->unk_158 < ARRAY_COUNTU(D_808B5EB0); this->unk_158++) - while (true) { if ((u32)this->unk_158 >= ARRAY_COUNTU(D_808B5EB0) || this->unk_154 < D_808B5EB0[this->unk_158][0]) { break; @@ -547,11 +546,11 @@ void BgSpot16Bombstone_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.params == 0xFF) { // The boulder is intact - gSPDisplayList(POLY_OPA_DISP++, this->unk_150); + gSPDisplayList(POLY_OPA_DISP++, this->dList); } else { // The boulder is debris gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->bombiwaBankIndex].segment); - gSPDisplayList(POLY_OPA_DISP++, this->unk_150); + gSPDisplayList(POLY_OPA_DISP++, this->dList); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_spot16_bombstone.c", 1274); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 9ebec63a1..1642b31ba 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -11,7 +11,7 @@ typedef void (*BgSpot16BombstoneActionFunc)(struct BgSpot16Bombstone*, GlobalCon typedef struct BgSpot16Bombstone { /* 0x0000 */ Actor actor; /* 0x014C */ BgSpot16BombstoneActionFunc actionFunc; - /* 0x0150 */ Gfx* unk_150; + /* 0x0150 */ Gfx* dList; /* 0x0154 */ s16 unk_154; /* 0x0156 */ s16 switchFlag; /* 0x0158 */ s16 unk_158; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index dc8fe5092..0943f952f 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -12,6 +12,7 @@ #include "objects/object_goma/object_goma.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_hidan_objects/object_hidan_objects.h" +#include "objects/object_jya_door/object_jya_door.h" #include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000010 @@ -57,7 +58,7 @@ typedef struct { u8 index2; } ShutterObjectInfo; -static ShutterObjectInfo D_809980F0[] = { +static ShutterObjectInfo sObjectInfo[] = { { OBJECT_GND, 4, 4 }, { OBJECT_GOMA, 5, 5 }, { OBJECT_YDAN_OBJECTS, 0, 1 }, @@ -86,14 +87,14 @@ typedef struct { /* 0x000B */ u8 f; } ShutterInfo; -static ShutterInfo D_80998134[] = { +static ShutterInfo sShutterInfo[] = { { gDTDungeonDoor1DL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { gDTDungeonDoor2DL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { 0x060000C0, 0x060001F0, 240, 14, 70, 15 }, { 0x06000590, 0x06006460, 0, 110, 50, 15 }, { gPhantomGanonBarsDL, NULL, 130, 12, 50, 15 }, { gGohmaDoorDL, NULL, 130, 12, 50, 15 }, - { 0x06000100, 0x060001F0, 240, 14, 50, 15 }, + { gSpiritDoorDL, gJyaDoorMetalBarsDL, 240, 14, 50, 15 }, { 0x060010C0, NULL, 130, 12, 50, 15 }, { gDungeonDoorDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { gFireTempleDoorFrontDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, @@ -125,7 +126,7 @@ typedef struct { u8 index; } ShutterSceneInfo; -static ShutterSceneInfo D_80998240[] = { +static ShutterSceneInfo sSceneInfo[] = { { SCENE_YDAN, 0x02 }, { SCENE_DDAN, 0x03 }, { SCENE_DDAN_BOSS, 0x03 }, { SCENE_BDAN, 0x04 }, { SCENE_BMORI1, 0x05 }, { SCENE_HIDAN, 0x08 }, { SCENE_GANON, 0x09 }, { SCENE_GANON_BOSS, 0x09 }, { SCENE_JYASINZOU, 0x0A }, @@ -168,7 +169,7 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, GlobalContext* globalCtx) { TransitionActorEntry* transitionEntry = &globalCtx->transitionActorList[(u16)this->dyna.actor.params >> 0xA]; s8 frontRoom = transitionEntry->sides[0].room; s32 doorType = this->doorType; - ShutterObjectInfo* temp_t0 = &D_809980F0[this->unk_16B]; + ShutterObjectInfo* temp_t0 = &sObjectInfo[this->unk_16B]; if (doorType != SHUTTER_KEY_LOCKED) { if (frontRoom == transitionEntry->sides[1].room) { @@ -224,7 +225,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (phi_a3 < 0) { ShutterSceneInfo* phi_v1; - for (phi_v1 = &D_80998240[0], i = 0; i < ARRAY_COUNT(D_80998240) - 1; i++, phi_v1++) { + for (phi_v1 = &sSceneInfo[0], i = 0; i < ARRAY_COUNT(sSceneInfo) - 1; i++, phi_v1++) { if (globalCtx2->sceneNum == phi_v1->sceneNum) { break; } @@ -242,7 +243,8 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { } else { this->dyna.actor.room = -1; } - if (this->requiredObjBankIndex = objectIndex = Object_GetIndex(&globalCtx2->objectCtx, D_809980F0[phi_a3].objectId), + if (this->requiredObjBankIndex = objectIndex = + Object_GetIndex(&globalCtx2->objectCtx, sObjectInfo[phi_a3].objectId), (s8)objectIndex < 0) { Actor_Kill(&this->dyna.actor); return; @@ -283,7 +285,7 @@ void DoorShutter_SetupType(DoorShutter* this, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; Actor_SetObjectDependency(globalCtx, &this->dyna.actor); - this->unk_16C = D_809980F0[this->unk_16B].index1; + this->unk_16C = sObjectInfo[this->unk_16B].index1; CollisionHeader_GetVirtual((this->doorType == SHUTTER_GOHMA_BLOCK) ? &gGohmaDoorCol : &gPhantomGanonBarsCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); @@ -323,7 +325,7 @@ s32 func_809968D4(DoorShutter* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (!Player_InCsMode(globalCtx)) { - ShutterInfo* temp_v1 = &D_80998134[this->unk_16C]; + ShutterInfo* temp_v1 = &sShutterInfo[this->unk_16C]; f32 temp_f2 = func_80996840(globalCtx, this, (this->unk_16C != 3) ? 0.0f : 80.0f, temp_v1->e, temp_v1->f); if (fabsf(temp_f2) < 50.0f) { @@ -683,7 +685,7 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { //! from drawing until initialization is complete. However if the required object is the same as the //! object dependency listed in init vars (gameplay_keep in this case), the check will pass even though //! initialization has not completed. When this happens, it will try to draw the display list of the - //! first entry in `D_80998134`, which will likely crash the game. + //! first entry in `sShutterInfo`, which will likely crash the game. //! This only matters in very specific scenarios, when the door is unculled on the first possible frame //! after spawning. It will try to draw without having run update yet. //! @@ -693,7 +695,7 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex && (this->unk_16B == 0 || func_80997A34(this, globalCtx) != 0)) { s32 pad[2]; - ShutterInfo* sp70 = &D_80998134[this->unk_16C]; + ShutterInfo* sp70 = &sShutterInfo[this->unk_16C]; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_door_shutter.c", 2048); diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 1c309a8c0..daa4de2f9 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -1,4 +1,5 @@ #include "z_door_warp1.h" +#include "objects/object_warp1/object_warp1.h" #define FLAGS 0x00000000 @@ -9,10 +10,6 @@ void DoorWarp1_Destroy(Actor* thisx, GlobalContext* globalCtx); void DoorWarp1_Update(Actor* thisx, GlobalContext* globalCtx); void DoorWarp1_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_060001A0; -extern UNK_TYPE D_06001374; -extern UNK_TYPE D_06002CA8; - /* const ActorInit Door_Warp1_InitVars = { ACTOR_DOOR_WARP1, diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 260fdfe76..6ab5c3ebf 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -1,4 +1,5 @@ #include "z_en_cs.h" +#include "objects/object_cs/object_cs.h" #include "objects/object_link_child/object_link_child.h" #define FLAGS 0x00000009 @@ -16,8 +17,6 @@ void EnCs_Wait(EnCs* this, GlobalContext* globalCtx); s32 EnCs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx); void EnCs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx); -extern FlexSkeletonHeader D_06008540; // Graveyard boy skeleton - const ActorInit En_Cs_InitVars = { ACTOR_EN_CS, ACTORCAT_NPC, @@ -52,13 +51,46 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable sDamageTable = { 0 }; +static DamageTable sDamageTable[] = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static struct_D_80AA1678 sAnimations[] = { - { 0x06000700, 1.0f, ANIMMODE_ONCE, -10.0f }, - { 0x06000E10, 1.0f, ANIMMODE_ONCE, -10.0f }, - { 0x06001588, 1.0f, ANIMMODE_ONCE, -10.0f }, - { 0x0600195C, 1.0f, ANIMMODE_ONCE, -10.0f }, + { &gGraveyardKidWalkAnim, 1.0f, ANIMMODE_ONCE, -10.0f }, + { &gGraveyardKidSwingStickUpAnim, 1.0f, ANIMMODE_ONCE, -10.0f }, + { &gGraveyardKidGrabStickTwoHandsAnim, 1.0f, ANIMMODE_ONCE, -10.0f }, + { &gGraveyardKidIdleAnim, 1.0f, ANIMMODE_ONCE, -10.0f }, }; void EnCs_SetAnimFromIndex(EnCs* this, s32 animIndex, s32* currentAnimIndex) { @@ -94,12 +126,12 @@ void EnCs_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008540, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGraveyardKidSkel, NULL, this->jointTable, this->morphTable, 16); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, sDamageTable, &sColChkInfoInit2); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Animation_Change(&this->skelAnime, sAnimations[0].animation, 1.0f, 0.0f, @@ -416,7 +448,11 @@ void EnCs_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnCs_Draw(Actor* thisx, GlobalContext* globalCtx) { - static u64* eyeTextures[] = { 0x06002130, 0x06002930, 0x06003130 }; + static u64* eyeTextures[] = { + gGraveyardKidEyesOpenTex, + gGraveyardKidEyesHalfTex, + gGraveyardKidEyesClosedTex, + }; EnCs* this = THIS; s32 pad; |
