mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
ovl_Obj_Kzsaku OK (#506)
* ovl_Obj_Kzsaku OK * add packing macro * made suggested changes * switch pad order * made some suggested changes. still don't know completely about naming Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
co-authored by
Anghelo Carvajal
parent
5e4c8e0506
commit
850823c2ee
@@ -5178,8 +5178,7 @@ beginseg
|
||||
name "ovl_Obj_Kzsaku"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.o"
|
||||
include "build/data/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku.data.o"
|
||||
include "build/data/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_obj_kzsaku.h"
|
||||
#include "objects/object_kzsaku/object_kzsaku.h"
|
||||
|
||||
#define FLAGS 0x00000030
|
||||
|
||||
@@ -15,7 +16,13 @@ void ObjKzsaku_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjKzsaku_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjKzsaku_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
void ObjKzsaku_SetupIdle(ObjKzsaku* this);
|
||||
void func_80C08BBC(ObjKzsaku* this);
|
||||
void func_80C08C84(ObjKzsaku* this);
|
||||
void ObjKzsaku_Idle(ObjKzsaku* this, GlobalContext* globalCtx);
|
||||
void ObjKzsaku_Rise(ObjKzsaku* this, GlobalContext* globalCtx);
|
||||
void func_80C08CB0(ObjKzsaku* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit Obj_Kzsaku_InitVars = {
|
||||
ACTOR_OBJ_KZSAKU,
|
||||
ACTORCAT_PROP,
|
||||
@@ -28,27 +35,96 @@ const ActorInit Obj_Kzsaku_InitVars = {
|
||||
(ActorFunc)ObjKzsaku_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
void ObjKzsaku_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
ObjKzsaku* this = THIS;
|
||||
CollisionHeader* col = NULL;
|
||||
|
||||
extern UNK_TYPE D_06000040;
|
||||
extern UNK_TYPE D_06001118;
|
||||
Actor_SetScale(&this->dyna.actor, 1.0f);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
CollisionHeader_GetVirtual(&object_kzsaku_Colheader_001118, &col);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Init.s")
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, col);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Destroy.s")
|
||||
this->switchFlag = KZSAKU_GET_SWITCHFLAG(thisx);
|
||||
this->raisedAmount = 0.0f;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08B60.s")
|
||||
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
func_80C08C84(this);
|
||||
} else {
|
||||
ObjKzsaku_SetupIdle(this);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08B7C.s")
|
||||
void ObjKzsaku_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjKzsaku* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08BBC.s")
|
||||
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08BD0.s")
|
||||
void ObjKzsaku_SetupIdle(ObjKzsaku* this) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
|
||||
this->actionFunc = ObjKzsaku_Idle;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08C84.s")
|
||||
void ObjKzsaku_Idle(ObjKzsaku* this, GlobalContext* globalCtx) {
|
||||
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
func_80C08BBC(this);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08CB0.s")
|
||||
void func_80C08BBC(ObjKzsaku* this) {
|
||||
this->actionFunc = ObjKzsaku_Rise;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Update.s")
|
||||
void ObjKzsaku_Rise(ObjKzsaku* this, GlobalContext* globalCtx) {
|
||||
if (this->dyna.actor.cutscene != -1) {
|
||||
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
|
||||
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
|
||||
} else {
|
||||
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
|
||||
}
|
||||
}
|
||||
if (this->raisedAmount < 450.0f) {
|
||||
func_800B9010(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
|
||||
this->raisedAmount += 15.0f;
|
||||
} else {
|
||||
func_80C08C84(this);
|
||||
}
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->raisedAmount;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Draw.s")
|
||||
void func_80C08C84(ObjKzsaku* this) {
|
||||
this->timer = 0;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 450.0f;
|
||||
this->actionFunc = func_80C08CB0;
|
||||
}
|
||||
|
||||
void func_80C08CB0(ObjKzsaku* this, GlobalContext* globalCtx) {
|
||||
if (this->timer <= 20) {
|
||||
if (this->timer == 20) {
|
||||
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
|
||||
ActorCutscene_Stop(this->dyna.actor.cutscene);
|
||||
}
|
||||
this->timer = 21;
|
||||
} else {
|
||||
this->timer++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ObjKzsaku_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjKzsaku* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
void ObjKzsaku_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_kzsaku_DL_000040);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -3,15 +3,18 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#define KZSAKU_GET_SWITCHFLAG(thisx) (((thisx)->params & 0x7F00) >> 8)
|
||||
|
||||
struct ObjKzsaku;
|
||||
|
||||
typedef void (*ObjKzsakuActionFunc)(struct ObjKzsaku*, GlobalContext*);
|
||||
|
||||
typedef struct ObjKzsaku {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ char unk_144[0x18];
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x015C */ ObjKzsakuActionFunc actionFunc;
|
||||
/* 0x0160 */ char unk_160[0xC];
|
||||
/* 0x0160 */ f32 raisedAmount;
|
||||
/* 0x0164 */ s32 switchFlag;
|
||||
/* 0x0168 */ s16 timer;
|
||||
} ObjKzsaku; // size = 0x16C
|
||||
|
||||
extern const ActorInit Obj_Kzsaku_InitVars;
|
||||
|
||||
@@ -16618,10 +16618,10 @@
|
||||
0x80C08950:("EnNnh_Draw",),
|
||||
0x80C08A80:("ObjKzsaku_Init",),
|
||||
0x80C08B2C:("ObjKzsaku_Destroy",),
|
||||
0x80C08B60:("func_80C08B60",),
|
||||
0x80C08B7C:("func_80C08B7C",),
|
||||
0x80C08B60:("ObjKzsaku_SetupIdle",),
|
||||
0x80C08B7C:("ObjKzsaku_Idle",),
|
||||
0x80C08BBC:("func_80C08BBC",),
|
||||
0x80C08BD0:("func_80C08BD0",),
|
||||
0x80C08BD0:("ObjKzsaku_Rise",),
|
||||
0x80C08C84:("func_80C08C84",),
|
||||
0x80C08CB0:("func_80C08CB0",),
|
||||
0x80C08D20:("ObjKzsaku_Update",),
|
||||
|
||||
@@ -2325,11 +2325,6 @@ D_0601B210 = 0x0601B210;
|
||||
|
||||
D_06000180 = 0x06000180;
|
||||
|
||||
// ovl_Obj_Kzsaku
|
||||
|
||||
D_06000040 = 0x06000040;
|
||||
D_06001118 = 0x06001118;
|
||||
|
||||
// ovl_Obj_Lift
|
||||
|
||||
D_06000D10 = 0x06000D10;
|
||||
|
||||
Reference in New Issue
Block a user