Document object_dblue_object (Great Bay Temple objects) (#1077)

* Document everything except the unknown blob and the weird collision

* Add the last unused texture, thanks Tharo!

* Finish up documentation

* Respond to Elliptic's review
This commit is contained in:
Tom Overton
2022-09-24 11:51:10 -07:00
committed by GitHub
parent a390da9b56
commit 76dc0dd867
7 changed files with 227 additions and 157 deletions
@@ -1,7 +1,7 @@
/*
* File: z_bg_dblue_balance.c
* Overlay: ovl_Bg_Dblue_Balance
* Description: Great Bay Temple - See-Saw
* Description: Great Bay Temple - Seesaw and Waterwheel w/ Platforms
*/
#include "prevent_bss_reordering.h"
@@ -43,19 +43,19 @@ const ActorInit Bg_Dblue_Balance_InitVars = {
};
typedef struct {
/* 0x00 */ Gfx* unk_00;
/* 0x04 */ CollisionHeader* unk_04;
/* 0x00 */ Gfx* opaDList;
/* 0x04 */ CollisionHeader* colHeader;
/* 0x08 */ u32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ ActorFunc unk_14;
/* 0x18 */ ActorFunc unk_18;
} BgDblueBalanceStruct2;
/* 0x14 */ ActorFunc update;
/* 0x18 */ ActorFunc draw;
} BgDblueBalanceTypeInfo; // size = 0x1C
BgDblueBalanceStruct2 D_80B83A20[] = {
BgDblueBalanceTypeInfo sTypeInfo[] = {
{
object_dblue_object_DL_00B8F8,
&object_dblue_object_Colheader_00BC08,
gGreatBayTempleObjectSeesawShaftDL,
&gGreatBayTempleObjectSeesawShaftCol,
0x10,
360.0f,
300.0f,
@@ -63,8 +63,8 @@ BgDblueBalanceStruct2 D_80B83A20[] = {
BgDblueBalance_Draw,
},
{
object_dblue_object_DL_00BF48,
&object_dblue_object_Colheader_00C180,
gGreatBayTempleObjectLargeSeesawPlatformDL,
&gGreatBayTempleObjectLargeSeesawPlatformCol,
0x10,
210.0f,
190.0f,
@@ -72,8 +72,8 @@ BgDblueBalanceStruct2 D_80B83A20[] = {
BgDblueBalance_Draw,
},
{
object_dblue_object_DL_00C4B8,
&object_dblue_object_Colheader_00C700,
gGreatBayTempleObjectSmallSeesawPlatformDL,
&gGreatBayTempleObjectSmallSeesawPlatformCol,
0x10,
180.0f,
180.0f,
@@ -81,8 +81,8 @@ BgDblueBalanceStruct2 D_80B83A20[] = {
BgDblueBalance_Draw,
},
{
object_dblue_object_DL_001E68,
&object_dblue_object_Colheader_002E78,
gGreatBayTempleObjectWaterwheelWithPlatformsDL,
&gGreatBayTempleObjectWaterwheelWithPlatformsCol,
0x30,
1500.0f,
1500.0f,
@@ -311,19 +311,19 @@ void BgDblueBalance_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->dyna.actor.flags = D_80B83A20[sp2C].unk_08;
this->dyna.actor.uncullZoneScale = D_80B83A20[sp2C].unk_0C;
this->dyna.actor.uncullZoneDownward = D_80B83A20[sp2C].unk_10;
this->dyna.actor.update = D_80B83A20[sp2C].unk_14;
this->dyna.actor.draw = D_80B83A20[sp2C].unk_18;
this->dyna.actor.flags = sTypeInfo[sp2C].unk_08;
this->dyna.actor.uncullZoneScale = sTypeInfo[sp2C].unk_0C;
this->dyna.actor.uncullZoneDownward = sTypeInfo[sp2C].unk_10;
this->dyna.actor.update = sTypeInfo[sp2C].update;
this->dyna.actor.draw = sTypeInfo[sp2C].draw;
DynaPolyActor_Init(&this->dyna, 1);
DynaPolyActor_LoadMesh(play, &this->dyna, D_80B83A20[sp2C].unk_04);
DynaPolyActor_LoadMesh(play, &this->dyna, sTypeInfo[sp2C].colHeader);
if (sp2C == 3) {
D_80B83C70 = Lib_SegmentedToVirtual(object_dblue_object_Matanimheader_00CE00);
D_80B83C70 = Lib_SegmentedToVirtual(gGreatBayTempleObjectWaterwheelSplashTexAnim);
} else if (sp2C == 0) {
D_80B83C74 = Lib_SegmentedToVirtual(object_dblue_object_Matanimheader_00D250);
D_80B83C74 = Lib_SegmentedToVirtual(gGreatBayTempleObjectSeesawSplashTexAnim);
}
if (sp2C == 0) {
@@ -645,11 +645,11 @@ void func_80B83518(Actor* thisx, PlayState* play) {
void BgDblueBalance_Draw(Actor* thisx, PlayState* play) {
s32 pad;
BgDblueBalance* this = THIS;
BgDblueBalanceStruct2* ptr2 = &D_80B83A20[BGDBLUEBALANCE_GET_300(&this->dyna.actor)];
BgDblueBalanceTypeInfo* ptr2 = &sTypeInfo[BGDBLUEBALANCE_GET_300(&this->dyna.actor)];
BgDblueBalance* sp38;
Gfx* gfx;
Gfx_DrawDListOpa(play, ptr2->unk_00);
Gfx_DrawDListOpa(play, ptr2->opaDList);
if (!(BGDBLUEBALANCE_GET_300(&this->dyna.actor)) && (this->unk_160 != NULL)) {
AnimatedMat_Draw(play, D_80B83C74);
@@ -666,7 +666,7 @@ void BgDblueBalance_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(gfx++, &sSetupDL[6 * 25]);
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetEnvColor(gfx++, 0, 0, 0, this->unk_183);
gSPDisplayList(gfx++, object_dblue_object_DL_00D110);
gSPDisplayList(gfx++, gGreatBayTempleObjectSeesawSplashDL);
POLY_XLU_DISP = gfx;
@@ -681,7 +681,7 @@ void func_80B83758(Actor* thisx, PlayState* play) {
Gfx* gfx;
s32 i;
BgDblueBalanceStruct* ptr;
BgDblueBalanceStruct2* ptr2;
BgDblueBalanceTypeInfo* ptr2;
s32 temp;
if (this->unk_178 != 0) {
@@ -695,8 +695,8 @@ void func_80B83758(Actor* thisx, PlayState* play) {
}
if (this->dyna.actor.flags & ACTOR_FLAG_40) {
ptr2 = &D_80B83A20[BGDBLUEBALANCE_GET_300(&this->dyna.actor)];
Gfx_DrawDListOpa(play, ptr2->unk_00);
ptr2 = &sTypeInfo[BGDBLUEBALANCE_GET_300(&this->dyna.actor)];
Gfx_DrawDListOpa(play, ptr2->opaDList);
if (this->unk_183 != 0) {
AnimatedMat_Draw(play, D_80B83C70);
@@ -717,7 +717,7 @@ void func_80B83758(Actor* thisx, PlayState* play) {
temp = ptr->unk_0E * (f32)this->unk_183 * 0.003921569f;
gDPSetEnvColor(gfx++, 0, 0, 0, temp);
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, object_dblue_object_DL_00CD10);
gSPDisplayList(gfx++, gGreatBayTempleObjectWaterwheelSplashDL);
}
}
@@ -1,7 +1,7 @@
/*
* File: z_bg_dblue_movebg.c
* Overlay: ovl_Bg_Dblue_Movebg
* Description: Great Bay Temple - Waterwheels and push switches
* Description: Great Bay Temple - Waterwheels, push switches, gear shafts, and whirlpools
*/
#include "prevent_bss_reordering.h"
@@ -57,42 +57,42 @@ const ActorInit Bg_Dblue_Movebg_InitVars = {
(ActorFunc)BgDblueMovebg_Draw,
};
Gfx* D_80A2B8AC[] = {
static Gfx* sOpaDLists[] = {
NULL,
object_dblue_object_DL_0069D8,
gGreatBayTempleObjectTwoWaySwitchDL,
NULL,
NULL,
NULL,
NULL,
object_dblue_object_DL_004848,
object_dblue_object_DL_0061B8,
gGreatBayTempleObjectGearShaftWithPlatformsDL,
gGreatBayTempleObjectOneWaySwitchDL,
NULL,
NULL,
NULL,
NULL,
};
Gfx* D_80A2B8DC[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, object_dblue_object_DL_00CAA0, NULL,
static Gfx* sXluDLists[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, gGreatBayTempleObjectWhirlpoolDL, NULL,
};
CollisionHeader* D_80A2B90C[] = {
static CollisionHeader* sColHeaders[] = {
NULL,
&object_dblue_object_Colheader_006EA8,
&gGreatBayTempleObjectTwoWaySwitchCol,
NULL,
NULL,
NULL,
&object_dblue_object_Colheader_00D3DC,
&object_dblue_object_Colheader_005D28,
&object_dblue_object_Colheader_00714C,
&object_dblue_object_Colheader_00AED0,
&object_dblue_object_Colheader_00AED0,
&gGreatBayTempleObjectUnusedCol,
&gGreatBayTempleObjectGearShaftWithPlatformsCol,
&gGreatBayTempleObjectOneWaySwitchCol,
&gGreatBayTempleObjectWaterwheelCol,
&gGreatBayTempleObjectWaterwheelCol,
NULL,
NULL,
};
AnimatedMaterial* D_80A2B93C[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, object_dblue_object_Matanimheader_00CC18, NULL,
static AnimatedMaterial* sTexAnims[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, gGreatBayTempleObjectWhirlpoolTexAnim, NULL,
};
s16 D_80A2B96C[] = { 0, 0x16C, -0x16C, 0 };
@@ -189,13 +189,13 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) {
D_80A2BBF4.unk_01 = 1;
}
if (D_80A2B90C[this->unk_160] != NULL) {
DynaPolyActor_LoadMesh(play, &this->dyna, D_80A2B90C[this->unk_160]);
if (sColHeaders[this->unk_160] != NULL) {
DynaPolyActor_LoadMesh(play, &this->dyna, sColHeaders[this->unk_160]);
}
this->unk_164 = D_80A2B8AC[this->unk_160];
this->unk_168 = D_80A2B8DC[this->unk_160];
this->unk_16C = D_80A2B93C[this->unk_160];
this->opaDList = sOpaDLists[this->unk_160];
this->xluDList = sXluDLists[this->unk_160];
this->texAnim = sTexAnims[this->unk_160];
SubS_FillCutscenesList(&this->dyna.actor, this->unk_1B6, ARRAY_COUNT(this->unk_1B6));
@@ -341,9 +341,9 @@ void func_80A2A1E0(BgDblueMovebg* this, PlayState* play) {
this->dyna.actor.shape.rot.y += this->unk_1CC;
if (play->roomCtx.currRoom.num == 0) {
this->unk_164 = object_dblue_object_DL_004848;
this->opaDList = gGreatBayTempleObjectGearShaftWithPlatformsDL;
} else if (play->roomCtx.currRoom.num == 8) {
this->unk_164 = NULL;
this->opaDList = NULL;
}
if (play->roomCtx.currRoom.num != this->unk_170) {
@@ -678,9 +678,9 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) {
}
if (play->roomCtx.currRoom.num == 0) {
this->unk_164 = object_dblue_object_DL_008778;
this->opaDList = gGreatBayTempleObjectWaterwheelDL;
} else if (play->roomCtx.currRoom.num == 8) {
this->unk_164 = object_dblue_object_DL_00A528;
this->opaDList = gGreatBayTempleObjectWaterwheelWithFakeGearDL;
}
if (this == D_80A2BBF0) {
@@ -756,7 +756,7 @@ void func_80A2B308(Actor* thisx, PlayState* play) {
func_8012C28C(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, this->unk_164);
gSPDisplayList(POLY_OPA_DISP++, this->opaDList);
CLOSE_DISPS(play->state.gfxCtx);
}
@@ -774,34 +774,34 @@ void BgDblueMovebg_Draw(Actor* thisx, PlayState* play2) {
OPEN_DISPS(play->state.gfxCtx);
if ((this->unk_160 == 9) || (this->unk_160 == 8) || (this->dyna.actor.flags & ACTOR_FLAG_40)) {
if (this->unk_16C != NULL) {
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(this->unk_16C));
if (this->texAnim != NULL) {
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(this->texAnim));
}
if ((this->unk_164 != 0) || (this->unk_160 == 6)) {
if ((this->opaDList != NULL) || (this->unk_160 == 6)) {
gfx2 = Gfx_CallSetupDL(POLY_OPA_DISP, 0x19);
gSPMatrix(&gfx2[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->unk_160 == 6) {
gSPDisplayList(&gfx2[1], object_dblue_object_DL_0052B8);
if (this->unk_164 != 0) {
gSPDisplayList(&gfx2[2], this->unk_164);
gSPDisplayList(&gfx2[1], gGreatBayTempleObjectGearShaftDL);
if (this->opaDList != NULL) {
gSPDisplayList(&gfx2[2], this->opaDList);
POLY_OPA_DISP = &gfx2[3];
} else {
POLY_OPA_DISP = &gfx2[2];
}
} else {
gSPDisplayList(&gfx2[1], this->unk_164);
gSPDisplayList(&gfx2[1], this->opaDList);
POLY_OPA_DISP = &gfx2[2];
}
}
if (this->unk_168 != NULL) {
if (this->xluDList != NULL) {
gfx = func_8012C2B4(POLY_XLU_DISP);
gSPMatrix(&gfx[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&gfx[1], this->unk_168);
gSPDisplayList(&gfx[1], this->xluDList);
POLY_XLU_DISP = &gfx[2];
}
@@ -812,7 +812,7 @@ void BgDblueMovebg_Draw(Actor* thisx, PlayState* play2) {
CLOSE_DISPS(play->state.gfxCtx);
if ((this->unk_160 == 8) && (this->unk_172 & 0x20)) {
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(&object_dblue_object_Matanimheader_00CE00));
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(&gGreatBayTempleObjectWaterwheelSplashTexAnim));
OPEN_DISPS(play->state.gfxCtx);
@@ -844,7 +844,7 @@ void BgDblueMovebg_Draw(Actor* thisx, PlayState* play2) {
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetEnvColor(gfx++, 255, 255, 255, this->unk_1D8[j][i]);
gSPDisplayList(gfx++, object_dblue_object_DL_00CD10);
gSPDisplayList(gfx++, gGreatBayTempleObjectWaterwheelSplashDL);
Matrix_Pop();
}
@@ -17,9 +17,9 @@ typedef struct BgDblueMovebg {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgDblueMovebgActionFunc actionFunc;
/* 0x160 */ s32 unk_160;
/* 0x164 */ Gfx* unk_164;
/* 0x168 */ Gfx* unk_168;
/* 0x16C */ TexturePtr unk_16C;
/* 0x164 */ Gfx* opaDList;
/* 0x168 */ Gfx* xluDList;
/* 0x16C */ AnimatedMaterial* texAnim;
/* 0x170 */ s8 unk_170;
/* 0x171 */ s8 unk_171;
/* 0x172 */ u16 unk_172;
@@ -1,7 +1,7 @@
/*
* File: z_bg_dblue_waterfall.c
* Overlay: ovl_Bg_Dblue_Waterfall
* Description: Great Bay Temple - Freezable Geyser
* Description: Great Bay Temple - Freezable Waterfall
*/
#include "z_bg_dblue_waterfall.h"
@@ -344,7 +344,7 @@ void BgDblueWaterfall_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collider);
this->unk_190 = Lib_SegmentedToVirtual(object_dblue_object_Matanimheader_00B448);
this->unk_190 = Lib_SegmentedToVirtual(gGreatBayTempleObjectWaterfallTexAnim);
Actor_SetFocus(&this->actor, -100.0f);
func_80B84568(this, play);
@@ -600,30 +600,30 @@ void BgDblueWaterfall_Draw(Actor* thisx, PlayState* play) {
AnimatedMat_Draw(play, this->unk_190);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x8A, 255, 255, 255, sp38);
gSPDisplayList(POLY_XLU_DISP++, object_dblue_object_DL_00B280);
gSPDisplayList(POLY_XLU_DISP++, gGreatBayTempleObjectWaterfallDL);
}
if (this->unk_19F > 0) {
if (this->unk_19F < 255) {
gSPSegment(POLY_XLU_DISP++, 0x09, D_801AEF88);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x9B, 255, 255, 255, this->unk_19F);
gSPDisplayList(POLY_XLU_DISP++, object_dblue_object_DL_003358);
gSPDisplayList(POLY_XLU_DISP++, gGreatBayTempleObjectIceStalactiteDL);
} else {
func_8012C28C(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x09, D_801AEFA0);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x9B, 255, 255, 255, 255);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_dblue_object_DL_003358);
gSPDisplayList(POLY_OPA_DISP++, gGreatBayTempleObjectIceStalactiteDL);
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0xFF, 255, 255, 255, this->unk_19F);
gSPDisplayList(POLY_XLU_DISP++, object_dblue_object_DL_003250);
gSPDisplayList(POLY_XLU_DISP++, gGreatBayTempleObjectIceStalactiteRimDL);
}
if (this->unk_1A0 > 0) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0xFF, 255, 255, 255, this->unk_1A0);
gSPDisplayList(POLY_XLU_DISP++, object_dblue_object_DL_003770);
gSPDisplayList(POLY_XLU_DISP++, gGreatBayTempleObjectFrozenWaterfallDL);
}
CLOSE_DISPS(play->state.gfxCtx);
@@ -78,7 +78,7 @@ ShutterInfo D_808A21B0[] = {
{ gameplay_keep_DL_077990, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ object_numa_obj_DL_007150, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ object_hakugin_obj_DL_000128, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ object_dblue_object_DL_017D00, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ gGreatBayTempleObjectDoorDL, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ object_ikana_obj_DL_014A40, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ object_redead_obj_DL_0001A0, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
{ object_ikninside_obj_DL_004440, object_ikninside_obj_DL_005260, 130, 0, 20, 15 },