mirror of https://github.com/zeldaret/mm.git
Obj_mu_pict OK (#189)
* inital commit * FeelsRegAllocMan * obj_mu_pict OK * fixing small things * fixing pr suggestions
This commit is contained in:
parent
3a7b440719
commit
0f1027fae1
|
@ -8784,9 +8784,9 @@ SECTIONS
|
||||||
ovl_Obj_Mu_Pict : AT(RomLocation)
|
ovl_Obj_Mu_Pict : AT(RomLocation)
|
||||||
{
|
{
|
||||||
build/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.o(.text)
|
build/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.o(.text)
|
||||||
build/asm/overlays/ovl_Obj_Mu_Pict_data.o(.data)
|
build/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.o(.data)
|
||||||
build/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.o(.rodata)
|
build/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.o(.rodata)
|
||||||
build/asm/overlays/ovl_Obj_Mu_Pict_rodata.o(.rodata)
|
build/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict_overlay.o(.ovl)
|
||||||
}
|
}
|
||||||
SegmentEnd = .;
|
SegmentEnd = .;
|
||||||
SegmentSize = SegmentEnd - SegmentStart;
|
SegmentSize = SegmentEnd - SegmentStart;
|
||||||
|
|
|
@ -9,7 +9,16 @@ void ObjMuPict_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||||
void ObjMuPict_Update(Actor* thisx, GlobalContext* globalCtx);
|
void ObjMuPict_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||||
void ObjMuPict_Draw(Actor* thisx, GlobalContext* globalCtx);
|
void ObjMuPict_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||||
|
|
||||||
/*
|
void func_80C06B5C(ObjMuPict* this);
|
||||||
|
void func_80C06B70(ObjMuPict* this, GlobalContext* globalCtx);
|
||||||
|
void func_80C06C54(ObjMuPict* this);
|
||||||
|
void func_80C06C68(ObjMuPict* this, GlobalContext* globalCtx);
|
||||||
|
void func_80C06CC4(ObjMuPict* this);
|
||||||
|
void func_80C06CD8(ObjMuPict* this, GlobalContext* globalCtx);
|
||||||
|
void func_80C06D90(ObjMuPict* this, GlobalContext* globalCtx);
|
||||||
|
void func_80C06DC8(ObjMuPict* this, GlobalContext* globalCtx);
|
||||||
|
void func_80C06E88(ObjMuPict* this, GlobalContext* globalCtx);
|
||||||
|
|
||||||
const ActorInit Obj_Mu_Pict_InitVars = {
|
const ActorInit Obj_Mu_Pict_InitVars = {
|
||||||
ACTOR_OBJ_MU_PICT,
|
ACTOR_OBJ_MU_PICT,
|
||||||
ACTORCAT_PROP,
|
ACTORCAT_PROP,
|
||||||
|
@ -21,30 +30,162 @@ const ActorInit Obj_Mu_Pict_InitVars = {
|
||||||
(ActorFunc)ObjMuPict_Update,
|
(ActorFunc)ObjMuPict_Update,
|
||||||
(ActorFunc)ObjMuPict_Draw,
|
(ActorFunc)ObjMuPict_Draw,
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/ObjMuPict_Init.asm")
|
void ObjMuPict_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
ObjMuPict* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/ObjMuPict_Destroy.asm")
|
if (!(gSaveContext.weekEventReg[75] & 0x20) && !(gSaveContext.weekEventReg[52] & 0x20)) {
|
||||||
|
Actor_MarkForDeath(&this->actor);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06B5C.asm")
|
func_80C06D90(this, globalCtx);
|
||||||
|
this->unk14A = UNK_ACTOR_PARAM;
|
||||||
|
this->actor.targetMode = 6;
|
||||||
|
this->actor.focus.pos = this->actor.world.pos;
|
||||||
|
this->actor.focus.pos.y += 30.0f;
|
||||||
|
this->unk148 = 0;
|
||||||
|
func_80C06B5C(this);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06B70.asm")
|
void ObjMuPict_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06C54.asm")
|
void func_80C06B5C(ObjMuPict* this) {
|
||||||
|
this->actionFunc = func_80C06B70;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06C68.asm")
|
void func_80C06B70(ObjMuPict* this, GlobalContext* globalCtx) {
|
||||||
|
s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06CC4.asm")
|
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||||
|
if (this->actor.cutscene < 0) {
|
||||||
|
func_80C06DC8(this, globalCtx);
|
||||||
|
func_80C06CC4(this);
|
||||||
|
} else {
|
||||||
|
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
|
||||||
|
ActorCutscene_Stop(0x7C);
|
||||||
|
}
|
||||||
|
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
|
||||||
|
func_80C06DC8(this, globalCtx);
|
||||||
|
func_80C06C54(this);
|
||||||
|
}
|
||||||
|
} else if (ABS_ALT(yawDiff) < 0x2AAA) {
|
||||||
|
func_800B8614(&this->actor, globalCtx, 80.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06CD8.asm")
|
void func_80C06C54(ObjMuPict* this) {
|
||||||
|
this->actionFunc = func_80C06C68;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06D90.asm")
|
void func_80C06C68(ObjMuPict* this, GlobalContext* globalCtx) {
|
||||||
|
if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
|
||||||
|
ActorCutscene_Start(this->actor.cutscene, &this->actor);
|
||||||
|
func_80C06CC4(this);
|
||||||
|
} else {
|
||||||
|
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06DC8.asm")
|
void func_80C06CC4(ObjMuPict* this) {
|
||||||
|
this->actionFunc = func_80C06CD8;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/func_80C06E88.asm")
|
void func_80C06CD8(ObjMuPict* this, GlobalContext* globalCtx) {
|
||||||
|
switch (func_80152498(&globalCtx->msgCtx)) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
func_80C06E88(this, globalCtx);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
if (func_80147624(globalCtx)) {
|
||||||
|
func_80C06B5C(this);
|
||||||
|
if (this->actor.cutscene >= 0) {
|
||||||
|
ActorCutscene_Stop(this->actor.cutscene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Math_SmoothStepToS(&this->actor.parent->world.rot.y, this->actor.parent->yawTowardsPlayer, 0xA, 0x71C, 0xB6);
|
||||||
|
this->actor.parent->shape.rot.y = this->actor.parent->world.rot.y;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/ObjMuPict_Update.asm")
|
void func_80C06D90(ObjMuPict* this, GlobalContext* globalCtx) {
|
||||||
|
Actor* actorPtr = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Mu_Pict_0x80C06AA0/ObjMuPict_Draw.asm")
|
while (actorPtr != NULL) {
|
||||||
|
if (actorPtr->id == ACTOR_EN_HGO) {
|
||||||
|
this->actor.parent = actorPtr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
actorPtr = actorPtr->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void func_80C06DC8(ObjMuPict* this, GlobalContext* globalCtx) {
|
||||||
|
if (this->unk14A == 0) {
|
||||||
|
if (this->unk148 == 0) {
|
||||||
|
this->unk148 = 1;
|
||||||
|
func_801518B0(globalCtx, 0x159A, &this->actor);
|
||||||
|
this->textId = 0x159A;
|
||||||
|
} else {
|
||||||
|
func_801518B0(globalCtx, 0x159D, &this->actor);
|
||||||
|
this->textId = 0x159D;
|
||||||
|
}
|
||||||
|
} else if (this->unk148 == 0) {
|
||||||
|
this->unk148 = 1;
|
||||||
|
func_801518B0(globalCtx, 0x15A0, &this->actor);
|
||||||
|
this->textId = 0x15A0;
|
||||||
|
} else {
|
||||||
|
func_801518B0(globalCtx, 0x15A3, &this->actor);
|
||||||
|
this->textId = 0x15A3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void func_80C06E88(ObjMuPict* this, GlobalContext* globalCtx) {
|
||||||
|
if (func_80147624(globalCtx)) {
|
||||||
|
switch (this->textId) {
|
||||||
|
case 0x159A:
|
||||||
|
func_801518B0(globalCtx, 0x159B, &this->actor);
|
||||||
|
this->textId = 0x159B;
|
||||||
|
break;
|
||||||
|
case 0x159B:
|
||||||
|
func_801518B0(globalCtx, 0x159C, &this->actor);
|
||||||
|
this->textId = 0x159C;
|
||||||
|
break;
|
||||||
|
case 0x159D:
|
||||||
|
func_801518B0(globalCtx, 0x159E, &this->actor);
|
||||||
|
this->textId = 0x159E;
|
||||||
|
break;
|
||||||
|
case 0x159E:
|
||||||
|
func_801518B0(globalCtx, 0x159F, &this->actor);
|
||||||
|
this->textId = 0x159F;
|
||||||
|
break;
|
||||||
|
case 0x15A0:
|
||||||
|
func_801518B0(globalCtx, 0x15A1, &this->actor);
|
||||||
|
this->textId = 0x15A1;
|
||||||
|
break;
|
||||||
|
case 0x15A1:
|
||||||
|
func_801518B0(globalCtx, 0x15A2, &this->actor);
|
||||||
|
this->textId = 0x15A2;
|
||||||
|
break;
|
||||||
|
case 0x15A3:
|
||||||
|
func_801518B0(globalCtx, 0x15A4, &this->actor);
|
||||||
|
this->textId = 0x15A4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjMuPict_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
ObjMuPict* this = THIS;
|
||||||
|
this->actionFunc(this, globalCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjMuPict_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
}
|
||||||
|
|
|
@ -5,11 +5,19 @@
|
||||||
|
|
||||||
struct ObjMuPict;
|
struct ObjMuPict;
|
||||||
|
|
||||||
|
#define UNK_ACTOR_PARAM ((this->actor.params & 0xF000) >> 0xC)
|
||||||
|
|
||||||
|
typedef void (*ObjMuPictActionFunc)(struct ObjMuPict*, GlobalContext*);
|
||||||
|
|
||||||
typedef struct ObjMuPict {
|
typedef struct ObjMuPict {
|
||||||
/* 0x000 */ Actor actor;
|
/* 0x000 */ Actor actor;
|
||||||
/* 0x144 */ char unk_144[0xC];
|
/* 0x144 */ ObjMuPictActionFunc actionFunc;
|
||||||
|
/* 0x148 */ s16 unk148;
|
||||||
|
/* 0x14A */ s16 unk14A;
|
||||||
|
/* 0x14C */ u16 textId;
|
||||||
} ObjMuPict; // size = 0x150
|
} ObjMuPict; // size = 0x150
|
||||||
|
|
||||||
extern const ActorInit Obj_Mu_Pict_InitVars;
|
extern const ActorInit Obj_Mu_Pict_InitVars;
|
||||||
|
|
||||||
|
|
||||||
#endif // Z_OBJ_MU_PICT_H
|
#endif // Z_OBJ_MU_PICT_H
|
||||||
|
|
Loading…
Reference in New Issue