diff --git a/include/variables_overlay.h b/include/variables_overlay.h index 14c0bd3522..76776c4d3f 100644 --- a/include/variables_overlay.h +++ b/include/variables_overlay.h @@ -11797,7 +11797,7 @@ extern UNK_TYPE4 D_80B7E664; // D_80B7E664 extern OverlayRelocationSection enNeoReebaOverlayInfo; // D_80B7E670 extern u32 enNeoReebaOverlayRelocations[170]; // D_80B7E684 extern u32 enNeoReebaOverlayInfoOffset; // D_80B7E92C -extern ActorInit bgMbarChairInitData; // D_80B7EA00 +extern ActorInit Bg_Mbar_Chair_InitVars; // D_80B7EA00 extern InitChainEntry bgMbarChairInitVars[4]; // D_80B7EA20 extern OverlayRelocationSection bgMbarChairOverlayInfo; // D_80B7EA30 extern u32 bgMbarChairOverlayRelocations[6]; // D_80B7EA44 diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 3bfff95822..be978fc9ad 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -5781,8 +5781,9 @@ SECTIONS ovl_Bg_Mbar_Chair : AT(RomLocation) { build/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.o(.text) - build/asm/ovl_Bg_Mbar_Chair_data.o(.data) - build/asm/ovl_Bg_Mbar_Chair_rodata.o(.rodata) + build/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.o(.data) + build/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.o(.rodata) + build/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index 904945b923..19710e0d67 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -13,4 +13,7 @@ D_0E000140 = 0x0E000140; D_0E0001C8 = 0x0E0001C8; D_0E0002C8 = 0x0E0002C8; -D_06000500 = 0x06000500; \ No newline at end of file +D_06000500 = 0x06000500; + +D_06000288 = 0x06000288; +D_060019B4 = 0x060019B4; \ No newline at end of file diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c index 3e2e4e8734..2618199090 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c @@ -9,7 +9,6 @@ void BgMbarChair_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgMbarChair_Update(Actor* thisx, GlobalContext* globalCtx); void BgMbarChair_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Bg_Mbar_Chair_InitVars = { ACTOR_BG_MBAR_CHAIR, ACTORTYPE_BG, @@ -21,12 +20,34 @@ const ActorInit Bg_Mbar_Chair_InitVars = { (ActorFunc)BgMbarChair_Update, (ActorFunc)BgMbarChair_Draw }; -*/ -GLOBAL_ASM("asm/non_matchings/ovl_Bg_Mbar_Chair_0x80B7E930/BgMbarChair_Init.asm") +static InitChainEntry bgMbarChairInitVars[] = { + ICHAIN_F32(unkFC, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(unk100, 60, ICHAIN_CONTINUE), + ICHAIN_F32(unk104, 80, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), +}; -GLOBAL_ASM("asm/non_matchings/ovl_Bg_Mbar_Chair_0x80B7E930/BgMbarChair_Destroy.asm") +extern BgMeshHeader D_060019B4; +extern UNK_TYPE D_06000288; -GLOBAL_ASM("asm/non_matchings/ovl_Bg_Mbar_Chair_0x80B7E930/BgMbarChair_Update.asm") +void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) { + BgMbarChair* this = THIS; -GLOBAL_ASM("asm/non_matchings/ovl_Bg_Mbar_Chair_0x80B7E930/BgMbarChair_Draw.asm") + Actor_ProcessInitChain(&this->dyna.actor, bgMbarChairInitVars); + BcCheck3_BgActorInit(&this->dyna, 0); + BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060019B4); +} + +void BgMbarChair_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgMbarChair* this = THIS; + + BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} + +void BgMbarChair_Update(Actor* thisx, GlobalContext* globalCtx) { +} + +void BgMbarChair_Draw(Actor* thisx, GlobalContext* globalCtx) { + func_800BDFC0(globalCtx, &D_06000288); +} diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h index 1f2dabe25e..704f175dff 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h @@ -6,8 +6,7 @@ struct BgMbarChair; typedef struct BgMbarChair { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x18]; + /* 0x000 */ DynaPolyActor dyna; } BgMbarChair; // size = 0x15C extern const ActorInit Bg_Mbar_Chair_InitVars; diff --git a/tables/variables.txt b/tables/variables.txt index 8296004690..6640f52f59 100644 --- a/tables/variables.txt +++ b/tables/variables.txt @@ -16783,7 +16783,7 @@ 0x80B7E670:("enNeoReebaOverlayInfo","OverlayRelocationSection","",0x14), 0x80B7E684:("enNeoReebaOverlayRelocations","u32","[170]",0x2a8), 0x80B7E92C:("enNeoReebaOverlayInfoOffset","u32","",0x4), - 0x80B7EA00:("bgMbarChairInitData","ActorInit","",0x20), + 0x80B7EA00:("Bg_Mbar_Chair_InitVars","ActorInit","",0x20), 0x80B7EA20:("bgMbarChairInitVars","ActorInitVar","[4]",0x10), 0x80B7EA30:("bgMbarChairOverlayInfo","OverlayRelocationSection","",0x14), 0x80B7EA44:("bgMbarChairOverlayRelocations","u32","[6]",0x18),