BgInibsMovebg OK (#485)

* init messy but matching and data imported

* destroy matched

* all matching

* add param macro

* use generated reloc

* remove unneccessary comment

* add comment

* cleanup

* feedback

* use NULL

* sort variables by address
This commit is contained in:
retro 2021-12-27 02:29:48 +00:00 committed by GitHub
parent 2d15fd4a41
commit 5e72c01ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 12 deletions

3
spec
View File

@ -4441,8 +4441,7 @@ beginseg
name "ovl_Bg_Inibs_Movebg" name "ovl_Bg_Inibs_Movebg"
compress compress
include "build/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.o" include "build/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.o"
include "build/data/ovl_Bg_Inibs_Movebg/ovl_Bg_Inibs_Movebg.data.o" include "build/src/overlays/actors/ovl_Bg_Inibs_Movebg/ovl_Bg_Inibs_Movebg_reloc.o"
include "build/data/ovl_Bg_Inibs_Movebg/ovl_Bg_Inibs_Movebg.reloc.o"
endseg endseg
beginseg beginseg

View File

@ -14,7 +14,6 @@ void BgInibsMovebg_Init(Actor* thisx, GlobalContext* globalCtx);
void BgInibsMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgInibsMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgInibsMovebg_Draw(Actor* thisx, GlobalContext* globalCtx); void BgInibsMovebg_Draw(Actor* thisx, GlobalContext* globalCtx);
#if 0
const ActorInit Bg_Inibs_Movebg_InitVars = { const ActorInit Bg_Inibs_Movebg_InitVars = {
ACTOR_BG_INIBS_MOVEBG, ACTOR_BG_INIBS_MOVEBG,
ACTORCAT_BG, ACTORCAT_BG,
@ -27,17 +26,56 @@ const ActorInit Bg_Inibs_Movebg_InitVars = {
(ActorFunc)BgInibsMovebg_Draw, (ActorFunc)BgInibsMovebg_Draw,
}; };
// static InitChainEntry sInitChain[] = { extern Gfx D_06001C10[];
static InitChainEntry D_80B96578[] = { extern Gfx D_06001DC0[];
extern AnimatedMaterial D_06002598;
extern Gfx D_06006140[];
extern Gfx D_060062D8[];
extern AnimatedMaterial D_06006858;
Gfx* D_80B96560[] = { D_060062D8, D_06001DC0 };
Gfx* D_80B96568[] = { D_06006140, D_06001C10 };
AnimatedMaterial* D_80B96570[] = { &D_06006858, &D_06002598 };
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
}; };
#endif void BgInibsMovebg_Init(Actor* thisx, GlobalContext* globalCtx) {
BgInibsMovebg* this = THIS;
extern InitChainEntry D_80B96578[]; Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Inibs_Movebg/BgInibsMovebg_Init.s") this->unk_15C = D_80B96560[BGINIBSMOVEBG_GET_F(thisx)];
this->unk_160 = D_80B96568[BGINIBSMOVEBG_GET_F(thisx)];
this->unk_164 = D_80B96570[BGINIBSMOVEBG_GET_F(thisx)];
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Inibs_Movebg/BgInibsMovebg_Destroy.s") void BgInibsMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgInibsMovebg* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Inibs_Movebg/BgInibsMovebg_Draw.s") DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void BgInibsMovebg_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgInibsMovebg* this = THIS;
AnimatedMaterial* animMat;
Gfx* dl1;
Gfx* dl2;
animMat = this->unk_164;
if (animMat != NULL) {
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(this->unk_164));
}
dl1 = this->unk_15C;
if (dl1 != NULL) {
func_800BDFC0(globalCtx, this->unk_15C);
}
dl2 = this->unk_160;
if (dl2 != NULL) {
func_800BE03C(globalCtx, this->unk_160);
}
}

View File

@ -5,9 +5,13 @@
struct BgInibsMovebg; struct BgInibsMovebg;
#define BGINIBSMOVEBG_GET_F(thisx) ((u16)((thisx)->params) & 0xF)
typedef struct BgInibsMovebg { typedef struct BgInibsMovebg {
/* 0x000 */ Actor actor; /* 0x000 */ DynaPolyActor dyna;
/* 0x144 */ char unk_144[0x24]; /* 0x15C */ Gfx* unk_15C;
/* 0x160 */ Gfx* unk_160;
/* 0x164 */ AnimatedMaterial* unk_164;
} BgInibsMovebg; // size = 0x168 } BgInibsMovebg; // size = 0x168
extern const ActorInit Bg_Inibs_Movebg_InitVars; extern const ActorInit Bg_Inibs_Movebg_InitVars;

View File

@ -881,6 +881,15 @@ D_06013058 = 0x06013058;
D_060006B0 = 0x060006B0; D_060006B0 = 0x060006B0;
D_060016DC = 0x060016DC; D_060016DC = 0x060016DC;
// ovl_Bg_Inibs_Movebg
D_06001C10 = 0x06001C10;
D_06001DC0 = 0x06001DC0;
D_06002598 = 0x06002598;
D_06006140 = 0x06006140;
D_060062D8 = 0x060062D8;
D_06006858 = 0x06006858;
// ovl_Bg_Keikoku_Saku // ovl_Bg_Keikoku_Saku
D_06001640 = 0x06001640; D_06001640 = 0x06001640;