From 52f8905a78db18f755f10bce474291eb1e153fbd Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Wed, 27 Sep 2023 19:03:13 -0700 Subject: [PATCH] BossHakugin_Draw OK --- .../actors/ovl_Boss_Hakugin/z_boss_hakugin.c | 65 ++++++++++++++++++- .../actors/ovl_Boss_Hakugin/z_boss_hakugin.h | 17 +++-- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 4 +- 3 files changed, 78 insertions(+), 8 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c index 741e5e84c..0d2b2fa24 100644 --- a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c +++ b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c @@ -44,6 +44,10 @@ void func_80B09F7C(BossHakugin* this); void func_80B08550(BossHakugin* this, PlayState* play); void func_80B08848(BossHakugin* this, PlayState* play); +void func_80B0E5A4(BossHakugin* this, PlayState* play); +void func_80B0D69C(UNK_PTR arg0, BossHakugin* this); +void func_80B0D750(UNK_PTR arg0, BossHakugin* this, PlayState* play); + #if 0 ActorInit Boss_Hakugin_InitVars = { ACTOR_BOSS_HAKUGIN, @@ -467,6 +471,7 @@ void func_80B06C08(BossHakugin* this); void func_80B06D38(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B06D38.s") +void func_80B06F48(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B06F48.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0728C.s") @@ -915,28 +920,86 @@ void func_80B09EDC(BossHakugin* this, PlayState* play) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/BossHakugin_Update.s") +s32 func_80B0C000(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, struct Actor* thisx); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0C000.s") +void func_80B0C1BC(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, struct Actor* thisx); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0C1BC.s") +void func_80B0C398(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0C398.s") +void func_80B0C570(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0C570.s") +void func_80B0C7B0(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0C7B0.s") +void func_80B0CAF0(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0CAF0.s") +void func_80B0CCD8(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0CCD8.s") +void func_80B0CF24(BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0CF24.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/BossHakugin_Draw.s") +void BossHakugin_Draw(Actor* thisx, PlayState* play) { + s32 pad; + BossHakugin* this = (BossHakugin*)thisx; + UNK_PTR sp34 = GRAPH_ALLOC(play->state.gfxCtx, 0x1000); + + OPEN_DISPS(play->state.gfxCtx); + + Gfx_SetupDL25_Opa(play->state.gfxCtx); + gSPSegment(POLY_OPA_DISP++, 0x08, D_80B0EA88); + SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, + func_80B0C000, func_80B0C1BC, &this->actor); + + CLOSE_DISPS(play->state.gfxCtx); + + Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), this->unk_01DC, + this->unk_01E0, this->unk_01E4, this->unk_0196); + + SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &this->unk_0380, &this->unk_0458); + SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &this->unk_3734, &this->unk_0464); + + if (this->unk_0190 == 0) { + func_80B06F48(this, play); + } + this->unk_0190 = 1; + + if (this->actor.colorFilterTimer != 0) { + func_800AE5A0(play); + } + + if (this->actionFunc == func_80B0A8C4) { + func_80B0E5A4(this, play); + } else { + func_80B0C398(this, play); + } + + func_80B0C570(this, play); + func_80B0C7B0(this, play); + func_80B0CAF0(this, play); + func_80B0CCD8(this, play); + + if (this->unk_0193 > 0) { + func_80B0CF24(this, play); + } + + if (this->actionFunc != func_80B0A8C4) { + func_80B0D69C(sp34, this); + func_80B0D750(sp34, this, play); + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0D2B8.s") +void func_80B0D69C(UNK_PTR arg0, BossHakugin* this); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0D69C.s") +void func_80B0D750(UNK_PTR arg0, BossHakugin* this, PlayState* play); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0D750.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_Hakugin/func_80B0D9CC.s") diff --git a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h index b28c7055a..195323d9d 100644 --- a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h +++ b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h @@ -35,11 +35,14 @@ typedef struct BossHakugin { /* 0x0188 */ BossHakuginActionFunc actionFunc; /* 0x018C */ char unk_018C[0x1]; /* 0x018D */ s8 unk_018D; - /* 0x018E */ char unk_018E[3]; + /* 0x018E */ char unk_018E[2]; + /* 0x0190 */ u8 unk_0190; // boolean? /* 0x0191 */ u8 unk_0191; /* 0x0192 */ char unk_0192[0x1]; /* 0x0193 */ u8 unk_0193; - /* 0x0194 */ char unk_0194[0x8]; + /* 0x0194 */ char unk_0194[2]; + /* 0x0196 */ u8 unk_0196; + /* 0x0197 */ char unk_0197[0x5]; /* 0x019C */ s16 unk_019C; /* 0x019E */ s16 unk_019E; /* 0x01A0 */ s16 unk_01A0; @@ -56,12 +59,15 @@ typedef struct BossHakugin { /* 0x01C8 */ f32 unk_01C8; /* 0x01CC */ char unk_01CC[0x8]; /* 0x01D4 */ f32 unk_01D4; - /* 0x01D8 */ char unk_01D8[0x10]; + /* 0x01D8 */ char unk_01D8[0x4]; + /* 0x01DC */ f32 unk_01DC; + /* 0x01E0 */ f32 unk_01E0; + /* 0x01E4 */ f32 unk_01E4; /* 0x01E8 */ Vec3s jointTable[33]; /* 0x02AE */ Vec3s morphTable[33]; /* 0x0374 */ char unk_0374[0x6]; /* 0x037A */ Vec3s unk_037A; - /* 0x0380 */ char unk_0380[0xC]; + /* 0x0380 */ Vec3f unk_0380; /* 0x038C */ Vec3f unk_038C; /* 0x0398 */ Vec3f bodyPartsPos[15]; /* 0x044C */ char unk_044C[0xC]; @@ -78,7 +84,8 @@ typedef struct BossHakugin { /* 0x09F8 */ BossHakuginEffect unk_09F8[BOSS_HAKUGIN_EFFECT_COUNT]; /* 0x2618 */ BossHakuginUnkStruct_2618 unk_2618[20]; /* 0x3158 */ BossHakuginFhgFlashUnkStruct unk_3158[5][15]; - /* 0x3734 */ char unk_3734[0x84]; + /* 0x3734 */ Vec3f unk_3734; + /* 0x3740 */ char unk_3740[0x78]; /* 0x37B8 */ ColliderSphere unk_37B8; } BossHakugin; // size = 0x3810 diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c index f5885b3cf..0b8807c3c 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -93,8 +93,8 @@ void EnHakurock_Destroy(Actor* thisx, PlayState* play) { void func_80B21BE0(BossHakugin* parent, Vec3f* arg1, s32 arg2) { s32 i; - for (i = 0; i < ARRAY_COUNT(parent->unk_9F8); i++) { - BossHakuginEffect* gohtEffect = &parent->unk_9F8[i]; + for (i = 0; i < ARRAY_COUNT(parent->unk_09F8); i++) { + BossHakuginEffect* gohtEffect = &parent->unk_09F8[i]; if (gohtEffect->unk_18 < 0) { s16 sp2E; s16 sp2C;