diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 2d32a555b2..c173698d1e 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -9415,9 +9415,9 @@ SECTIONS ovl_Obj_Ending : AT(RomLocation) { build/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.o(.text) - build/asm/overlays/ovl_Obj_Ending_data.o(.data) + build/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.o(.data) build/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.o(.rodata) - build/asm/overlays/ovl_Obj_Ending_rodata.o(.rodata) + build/src/overlays/actors/ovl_Obj_Ending/z_obj_ending_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index 50edca5865..8c060c8733 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -478,6 +478,12 @@ D_06000E88 = 0x06000E88; /* z_obj_dinner */ D_060011E0 = 0x060011E0; +/* z_obj_ending */ +D_060003D0 = 0x060003D0; +D_060031A0 = 0x060031A0; +D_06003440 = 0x06003440; +D_06001FF8 = 0x06001FF8; + /* z_obj_funen */ D_060000D0 = 0x060000D0; diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c index 0b0e4ebb22..7ae7399ca4 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c @@ -1,3 +1,9 @@ +/* + * File: z_obj_ending.c + * Overlay: ovl_Obj_Ending + * Description: The stump and lighting at the end of the credits + */ + #include "z_obj_ending.h" #define FLAGS 0x00000030 @@ -8,7 +14,6 @@ void ObjEnding_Init(Actor* thisx, GlobalContext* globalCtx); void ObjEnding_Update(Actor* thisx, GlobalContext* globalCtx); void ObjEnding_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Obj_Ending_InitVars = { ACTOR_OBJ_ENDING, ACTORCAT_BG, @@ -20,34 +25,30 @@ const ActorInit Obj_Ending_InitVars = { (ActorFunc)ObjEnding_Update, (ActorFunc)ObjEnding_Draw, }; -*/ -extern InitChainEntry D_80C25CF8[]; -/* +extern Gfx D_060003D0[]; +extern Gfx D_060031A0[]; +extern Gfx D_06003440[]; +extern AnimatedMaterial D_06001FF8; + +static ObjEndingModelInfo sModelInfo[] = { + { { D_06003440, D_060031A0 }, NULL }, + { { NULL, D_060003D0 }, &D_06001FF8 }, +}; + static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -*/ - -extern unkStruct D_80C25CE0[]; -/* -static unkStruct D_80C25CE0[2] = { - {0x06003440, 0x060031A0, 0x00000000}, - {0x00000000, 0x060003D0, 0x06001FF8} -}; -*/ void ObjEnding_Init(Actor* thisx, GlobalContext* globalCtx) { ObjEnding* this = THIS; - AnimatedMaterial* texture; + AnimatedMaterial* animMat; - Actor_ProcessInitChain(&this->actor, D_80C25CF8); - this->unk144 = &D_80C25CE0[this->actor.params]; - if (false) {} - texture = this->unk144->texture; - - if (texture != NULL) { - this->texture = Lib_SegmentedToVirtual(texture); + Actor_ProcessInitChain(thisx, sInitChain); + this->modelInfo = &sModelInfo[thisx->params]; + animMat = this->modelInfo->animMat; + if (animMat != NULL) { + this->animMat = (AnimatedMaterial*)Lib_SegmentedToVirtual(animMat); } } @@ -56,18 +57,18 @@ void ObjEnding_Update(Actor* thisx, GlobalContext* globalCtx) { void ObjEnding_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjEnding* this = THIS; - Gfx* dl; - Gfx* tempunk4; + Gfx* dl1; + Gfx* dl2; - if (this->texture != NULL) { - AnimatedMat_Draw(globalCtx, this->texture); + if (this->animMat != NULL) { + AnimatedMat_Draw(globalCtx, this->animMat); } - tempunk4 = this->unk144->unk0; - if (tempunk4 != 0) { - func_800BDFC0(globalCtx, tempunk4); + dl1 = this->modelInfo->dLists[0]; + if (dl1 != NULL) { + func_800BDFC0(globalCtx, dl1); } - dl = this->unk144->dl; - if (dl != NULL) { - func_800BE03C(globalCtx, dl); + dl2 = this->modelInfo->dLists[1]; + if (dl2 != NULL) { + func_800BE03C(globalCtx, dl2); } } diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h index 5f4bcf4539..fa58607b3a 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h @@ -6,15 +6,14 @@ struct ObjEnding; typedef struct { - /* 0x0 */ UNK_TYPE4 unk0; - /* 0x4 */ Gfx* dl; - /* 0x8 */ AnimatedMaterial *texture; -} unkStruct; // size = 0xC + /* 0x0 */ Gfx* dLists[2]; + /* 0x8 */ AnimatedMaterial *animMat; +} ObjEndingModelInfo; // size = 0xC typedef struct ObjEnding { /* 0x000 */ Actor actor; - /* 0x144 */ unkStruct* unk144; - /* 0x148 */ AnimatedMaterial* texture; + /* 0x144 */ ObjEndingModelInfo* modelInfo; + /* 0x148 */ AnimatedMaterial* animMat; } ObjEnding; // size = 0x14C extern const ActorInit Obj_Ending_InitVars; diff --git a/tables/variables.txt b/tables/variables.txt index 5917303d7f..dd1e35a14b 100644 --- a/tables/variables.txt +++ b/tables/variables.txt @@ -18879,7 +18879,7 @@ 0x80C25B94:("enInvisibleRuppeOverlayRelocations","u32","[10]",0x28), 0x80C25BBC:("enInvisibleRuppeOverlayInfoOffset","u32","",0x4), 0x80C25CC0:("Obj_Ending_InitVars","UNK_TYPE1","",0x1), - 0x80C25CE0:("D_80C25CE0","UNK_TYPE1","",0x1), + 0x80C25CE0:("sModelInfo","UNK_TYPE1","",0x1), 0x80C25CF8:("D_80C25CF8","UNK_TYPE1","",0x1), 0x80C25D00:("objEndingOverlayInfo","OverlayRelocationSection","",0x14), 0x80C25D14:("objEndingOverlayRelocations","u32","[7]",0x1c),