summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlejandro Javier Asenjo Nitti <alejandro.asenjo88@gmail.com>2023-11-01 18:32:00 -0300
committerAlejandro Javier Asenjo Nitti <alejandro.asenjo88@gmail.com>2023-11-01 18:32:00 -0300
commit4e92be46bb71cc330a60adf48cc5bbef71e34a71 (patch)
treedd485394f6ddb600e2ef999e7a2358babea79c21 /src
parent51ad0cbdc7bc6554a2392ed1779a49b7076bbf12 (diff)
ovl_En_Zl4 functions
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_En_Zl4/z_en_zl4.c83
-rw-r--r--src/overlays/actors/ovl_En_Zl4/z_en_zl4.h8
2 files changed, 79 insertions, 12 deletions
diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
index 1a132520b..914f277f1 100644
--- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
+++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
@@ -5,6 +5,7 @@
*/
#include "z_en_zl4.h"
+#include "objects/object_stk/object_stk.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
@@ -15,7 +16,10 @@ void EnZl4_Destroy(Actor* thisx, PlayState* play);
void EnZl4_Update(Actor* thisx, PlayState* play);
void EnZl4_Draw(Actor* thisx, PlayState* play);
+void func_809A1BB0(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex);
void func_809A1D0C(EnZl4* this, PlayState* play);
+void func_809A1DA4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
+void func_809A1DBC(PlayState* play, s32 limbIndex, Actor* thisx);
#if 0
ActorInit En_Zl4_InitVars = {
@@ -32,26 +36,85 @@ ActorInit En_Zl4_InitVars = {
#endif
-extern UNK_TYPE D_06013328;
+extern AnimationInfo D_809A1F80;
+extern Vec3f D_809A1F98;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1BB0.s")
+void func_809A1BB0(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex) {
+ f32 endFrame;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/EnZl4_Init.s")
+ animInfo += animIndex;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/EnZl4_Destroy.s")
+ if (animInfo->frameCount < 0.0f) {
+ endFrame = Animation_GetLastFrame(animInfo->animation);
+ } else {
+ endFrame = animInfo->frameCount;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1D0C.s")
+ Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
+ animInfo->mode, animInfo->morphFrames);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/EnZl4_Update.s")
+void EnZl4_Init(Actor* thisx, PlayState* play) {
+ EnZl4* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1D60.s")
+ this->unk_2E0 = 0;
+ this->unk_2F0 = 0xFF;
+ this->actor.targetArrowOffset = 3000.0f;
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_InitFlex(play, &this->skelanime, &gSkullKidSkel, NULL, NULL, NULL, 0);
+ func_809A1BB0(&this->skelanime, &D_809A1F80, 0);
+ Actor_SetScale(&this->actor, 0.01f);
+ this->actionFunc = func_809A1D0C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1DA4.s")
+void EnZl4_Destroy(Actor* thisx, PlayState* play) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1DBC.s")
+void func_809A1D0C(EnZl4* this, PlayState* play) {
+}
+
+void EnZl4_Update(Actor* thisx, PlayState* play) {
+ EnZl4* this = THIS;
+ SkelAnime_Update(&this->skelanime);
+ this->unk_2F0 = this->unk_2F0;
+ this->actionFunc(this, play);
+}
+
+s32 func_809A1D60(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ Vec3f vec = D_809A1F98;
+ return 0;
+}
+
+void func_809A1DA4(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+}
+
+void func_809A1DBC(PlayState* play, s32 limbIndex, Actor* thisx) {
+}
+
+s32 func_809A1DD0(GraphicsContext*, u32);
+
+s32 func_809A1E28(GraphicsContext*, u32);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1DD0.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/func_809A1E28.s")
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zl4/EnZl4_Draw.s")
+void EnZl4_Draw(Actor* thisx, PlayState* play) {
+ EnZl4* this = THIS;
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ Gfx_SetupDL25_Opa(play->state.gfxCtx);
+
+ if (this->unk_2F0 < 255) {
+ gSPSegment(POLY_OPA_DISP++, 0x0C, func_809A1DD0(play->state.gfxCtx, this->unk_2F0));
+ } else {
+ gSPSegment(POLY_OPA_DISP++, 0x0C, func_809A1E28(play->state.gfxCtx, this->unk_2F0));
+ }
+
+ CLOSE_DISPS(play->state.gfxCtx);
+
+ SkelAnime_DrawTransformFlexOpa(play, this->skelanime.skeleton, this->skelanime.jointTable,
+ this->skelanime.dListCount, func_809A1D60, func_809A1DA4, func_809A1DBC,
+ &this->actor);
+}
diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h
index 326d2545e..c1eed301b 100644
--- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h
+++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h
@@ -9,9 +9,13 @@ typedef void (*EnZl4ActionFunc)(struct EnZl4*, PlayState*);
typedef struct EnZl4 {
/* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0x14C];
+ /* 0x144 */ SkelAnime skelanime;
+ /* 0x188 */ char pad_188[0x108];
/* 0x290 */ EnZl4ActionFunc actionFunc;
- /* 0x294 */ char unk_294[0x60];
+ /* 0x294 */ char pad_294[0x4C];
+ /* 0x2E0 */ s16 unk_2E0;
+ /* 0x2E2 */ char pad_2E2[0xE];
+ /* 0x2F0 */ u32 unk_2F0;
} EnZl4; // size = 0x2F4
#endif // Z_EN_ZL4_H