mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-16 04:44:44 +00:00
ovl_Magic_Dark 3 matching, 4 nonmatching (#310)
* match MagicDark_Init * update struct fields and add THIS comment thanks to Ethan * match MagicDark_Destroy * start on func_80B874E4 * move func_80B874E4 to a comment for now * match MagicDark_Update (again thanks to Ethan) * comment out func_80B8772C and use macro for ACTIVE_CAM * various changes * implement permuter suggestion * reorder nayru temps to fix stack * use LINK_IS_CHILD * match func_80B874E4 a bit more * initially store msgMode in temp_t2 * add msgMode temp * comment out func_80B874E4 because regalloc >:( * comment out func_80B874E4 again * add unk_90C to Player * change unk_14F to an array for more explicit padding * remove partially completed functions * remove matched functions from asm * clang format * subtract SFX_FLAG * combine unk_14F and unk_150
This commit is contained in:
parent
d374d8d026
commit
c9729e638d
6 changed files with 74 additions and 228 deletions
|
@ -15,6 +15,10 @@ void MagicDark_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void MagicDark_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void MagicDark_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void func_80B874E4(Actor* thisx, GlobalContext* globalCtx);
|
||||
void func_80B8772C(GlobalContext* globalCtx, f32 a1);
|
||||
void func_80B87A18(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
/*
|
||||
const ActorInit Magic_Dark_InitVars = {
|
||||
ACTOR_MAGIC_DARK,
|
||||
|
@ -28,15 +32,72 @@ const ActorInit Magic_Dark_InitVars = {
|
|||
(ActorFunc)MagicDark_Draw,
|
||||
};
|
||||
*/
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Dark/MagicDark_Init.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Dark/MagicDark_Destroy.s")
|
||||
void MagicDark_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
MagicDark* this = THIS;
|
||||
Player* player = PLAYER;
|
||||
|
||||
if (LINK_IS_CHILD) {
|
||||
this->unk_15C = 0.4f;
|
||||
} else {
|
||||
this->unk_15C = 0.6f;
|
||||
}
|
||||
|
||||
this->actor.posRot.pos = player->actor.posRot.pos;
|
||||
Actor_SetScale(&this->actor, 0.0f);
|
||||
this->actor.room = -1;
|
||||
|
||||
if (gSaveContext.nayrusLoveTimer != 0) {
|
||||
this->actor.update = func_80B874E4;
|
||||
this->actor.draw = func_80B87A18;
|
||||
this->actor.scale.x = this->actor.scale.z = this->unk_15C * 1.6f;
|
||||
// THIS needed below to match
|
||||
this->actor.scale.y = THIS->unk_15C * 0.8f;
|
||||
this->unk_14C = 0;
|
||||
this->unk_14E = 0;
|
||||
} else {
|
||||
this->unk_14C = 0;
|
||||
gSaveContext.nayrusLoveTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void MagicDark_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.nayrusLoveTimer == 0) {
|
||||
func_800876C8(globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Dark/func_80B874E4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Dark/func_80B8772C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Dark/MagicDark_Update.s")
|
||||
void MagicDark_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
MagicDark* this = THIS;
|
||||
s32 pad;
|
||||
Player* player = PLAYER;
|
||||
|
||||
func_8002F974(&this->actor, NA_SE_PL_MAGIC_SOUL_BALL - SFX_FLAG);
|
||||
if (this->unk_14C < 35) {
|
||||
func_80B8772C(globalCtx, this->unk_14C * (1 / 45.0f));
|
||||
Math_SmoothScaleMaxMinF(&this->actor.scale.x, this->unk_15C * (1 / 12.000001f), 0.05f, 0.01f, 0.0001f);
|
||||
Actor_SetScale(&this->actor, this->actor.scale.x);
|
||||
} else if (this->unk_14C < 55) {
|
||||
Actor_SetScale(&this->actor, this->actor.scale.x * 0.9f);
|
||||
Math_SmoothScaleMaxMinF(&this->unk_154, player->unk_90C, 0.5f, 3.0f, 1.0f);
|
||||
if (this->unk_14C >= 49) {
|
||||
func_80B8772C(globalCtx, (54 - this->unk_14C) * 0.2f);
|
||||
}
|
||||
} else {
|
||||
this->actor.update = func_80B874E4;
|
||||
this->actor.draw = func_80B87A18;
|
||||
this->actor.scale.x = this->actor.scale.z = this->unk_15C * 1.6f;
|
||||
// THIS needed below to match
|
||||
this->actor.scale.y = THIS->unk_15C * 0.8f;
|
||||
this->unk_14C = 0;
|
||||
this->unk_14E = 0;
|
||||
}
|
||||
this->unk_14C += 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Dark/func_80B87A18.s")
|
||||
|
||||
|
|
|
@ -8,7 +8,13 @@ struct MagicDark;
|
|||
|
||||
typedef struct MagicDark {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ char unk_14C[0x18];
|
||||
/* 0x014C */ s16 unk_14C;
|
||||
/* 0x014E */ u8 unk_14E;
|
||||
/* 0x014F */ char unk_14F[0x5];
|
||||
/* 0x0154 */ f32 unk_154;
|
||||
/* 0x0158 */ char unk_158[0x4];
|
||||
/* 0x015C */ f32 unk_15C;
|
||||
/* 0x0160 */ char unk_160[0x4];
|
||||
} MagicDark; // size = 0x0164
|
||||
|
||||
extern const ActorInit Magic_Dark_InitVars;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue