From 9f647b6b142cc773cefe92c06ea6506833f9483f Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sat, 20 Jul 2024 19:31:55 -0400 Subject: [PATCH] minor bk, damagereaction, mozo work --- include/c/c_damagereaction.h | 17 +++++++----- include/d/actor/d_a_bk.h | 13 +++++++--- include/d/actor/d_a_mozo.h | 41 +++++++++++++++++++++-------- src/d/actor/d_a_dr.cpp | 2 +- src/d/actor/d_a_mozo.cpp | 50 ++++++++++++++++++++++++------------ src/d/actor/d_a_nh.cpp | 2 +- src/d/actor/d_a_tbox.cpp | 2 +- 7 files changed, 86 insertions(+), 41 deletions(-) diff --git a/include/c/c_damagereaction.h b/include/c/c_damagereaction.h index c4dc6702a..6e7075e18 100644 --- a/include/c/c_damagereaction.h +++ b/include/c/c_damagereaction.h @@ -87,9 +87,11 @@ struct damagereaction { /* 0x100 */ cXyz m100[20]; /* 0x1F0 */ cXyz m1F0[20]; /* 0x2E0 */ cXyz m2E0[20]; - /* 0x3D0 */ u8 m3D0[0x410 - 0x3D0]; + /* 0x3D0 */ int m3D0[14]; + /* 0x408 */ int m408; + /* 0x40C */ int m40C; /* 0x410 */ int m410; - /* 0x414 */ u8 m414[0x418 - 0x414]; + /* 0x414 */ int m414; /* 0x418 */ int m418; /* 0x41C */ u8 m41C[0x420 - 0x41C]; /* 0x420 */ int m420; @@ -101,7 +103,7 @@ struct damagereaction { /* 0x440 */ s16 m440; /* 0x442 */ s16 m442; /* 0x444 */ s16 m444; - /* 0x446 */ u8 m446[0x448 - 0x446]; + /* 0x446 */ s16 m446; /* 0x448 */ s16 m448; /* 0x44A */ u8 m44A[0x44C - 0x44A]; /* 0x44C */ cXyz m44C; @@ -161,7 +163,7 @@ struct damagereaction { /* 0x70E */ u8 m70E; /* 0x70F */ u8 m70F[0x710 - 0x70F]; /* 0x710 */ u8 m710; - /* 0x711 */ u8 m711[0x712 - 0x711]; + /* 0x711 */ u8 m711; /* 0x712 */ u8 m712; /* 0x713 */ u8 m713; /* 0x714 */ fopAc_ac_c* m714; @@ -182,9 +184,12 @@ struct damagereaction { /* 0x7AE */ s16 m7AE; /* 0x7B0 */ u8 m7B0[0x7B2 - 0x7B0]; /* 0x7B2 */ s16 m7B2; - /* 0x7B4 */ u8 m7B4[0x7B8 - 0x7B4]; + /* 0x7B4 */ u8 m7B4[0x7B6 - 0x7B4]; + /* 0x7B6 */ u8 m7B6; + /* 0x7B7 */ u8 m7B7[0x7B8 - 0x7B7]; /* 0x7B8 */ int m7B8; -}; +}; // Size: 0x7BC + // STATIC_ASSERT(sizeof(damagereaction) == 0x7BC); BOOL ice_bg_check(enemyice*); diff --git a/include/d/actor/d_a_bk.h b/include/d/actor/d_a_bk.h index c06d9cffa..e54363360 100644 --- a/include/d/actor/d_a_bk.h +++ b/include/d/actor/d_a_bk.h @@ -26,7 +26,8 @@ class bk_class : public fopEn_enemy_c { /* 0x02C8 */ s16 m02C8; /* 0x02CA */ s16 m02CA; /* 0x02CC */ s16 m02CC; - /* 0x02CE */ u8 m02CE[0x02D0 - 0x02CE]; + /* 0x02CE */ s8 m02CE; + /* 0x02CF */ u8 m02CF[0x02D0 - 0x02CF]; /* 0x02D0 */ J3DModel* m02D0; /* 0x02D4 */ u8 m02D4; /* 0x02D5 */ u8 m02D5; @@ -126,14 +127,18 @@ class bk_class : public fopEn_enemy_c { /* 0x1226 */ u8 m1226[0x1228 - 0x1226]; /* 0x1228 */ s16 m1228; /* 0x122A */ s16 m122A; - /* 0x122C */ u8 m122C[0x1230 - 0x122C]; + /* 0x122C */ s8 m122C; /* 0x1230 */ J3DMaterialTable* m1230; /* 0x1234 */ s8 m1234; - /* 0x1235 */ u8 m1235[0x1264 - 0x1235]; + /* 0x1236 */ s16 m1236; + /* 0x1238 */ cXyz m1238; + /* 0x1244 */ cXyz m1244; + /* 0x1250 */ u8 m1250[0x1260 - 0x1250]; + /* 0x1260 */ f32 m1260; /* 0x1264 */ enemyice mEnemyIce; /* 0x161C */ enemyfire mEnemyFire; /* 0x1844 */ JntHit_c* mpJntHit; -}; +}; // Size: 0x1848 class bkHIO_c : public JORReflexible { public: diff --git a/include/d/actor/d_a_mozo.h b/include/d/actor/d_a_mozo.h index bb00e98ce..efa588dc5 100644 --- a/include/d/actor/d_a_mozo.h +++ b/include/d/actor/d_a_mozo.h @@ -5,6 +5,7 @@ #include "SSystem/SComponent/c_phase.h" #include "m_Do/m_Do_ext.h" #include "d/d_cc_d.h" +#include "m_Do/m_Do_hostIO.h" class daMozo_c : public fopAc_ac_c { public: @@ -50,25 +51,43 @@ class daMozo_c : public fopAc_ac_c { /* 0x3BC */ dCcD_Cps mCps; }; -class daMozo_HIO_c { +class daMozo_childHIO_c { public: - daMozo_HIO_c(); - ~daMozo_HIO_c() {} -}; + virtual ~daMozo_childHIO_c() {} -class daMozo_childHIO_c { + /* 0x04 */ f32 m04; + /* 0x08 */ f32 m08; + /* 0x0C */ s16 m0C; + /* 0x0E */ s16 m0E; + /* 0x10 */ u8 m10; + /* 0x11 */ u8 m11[0x14 - 0x11]; +}; // Size: 0x14 + +class daMozo_BeamChildHIO_c : public daMozo_childHIO_c { public: - ~daMozo_childHIO_c() {} + virtual ~daMozo_BeamChildHIO_c() {} }; -class daMozo_FireChildHIO_c { +class daMozo_FireChildHIO_c : public daMozo_childHIO_c { public: - ~daMozo_FireChildHIO_c() {} + virtual ~daMozo_FireChildHIO_c() {} }; -class daMozo_BeamChildHIO_c { +class daMozo_HIO_c : public JORReflexible { public: - ~daMozo_BeamChildHIO_c() {} -}; + daMozo_HIO_c(); + virtual ~daMozo_HIO_c() {} + + /* 0x04 */ s8 mChildID; + /* 0x05 */ u8 m05[0x08 - 0x05]; + /* 0x08 */ int m08; + /* 0x0C */ daMozo_BeamChildHIO_c* mpBeamChild; + /* 0x10 */ daMozo_FireChildHIO_c* mpFireChild; + /* 0x14 */ daMozo_BeamChildHIO_c mBeamChild; + /* 0x28 */ daMozo_FireChildHIO_c mFireChild; + /* 0x3C */ f32 m3C; + /* 0x40 */ f32 m40; + /* 0x44 */ f32 m44; +}; // Size: 0x48 #endif /* D_A_MOZO_H */ diff --git a/src/d/actor/d_a_dr.cpp b/src/d/actor/d_a_dr.cpp index ec12c3355..17c14bba5 100644 --- a/src/d/actor/d_a_dr.cpp +++ b/src/d/actor/d_a_dr.cpp @@ -246,7 +246,7 @@ static s32 daDr_Create(fopAc_ac_c* i_actor) { daDr_setMtx(i_this); if (l_HIO.mChildID < 0) { - l_HIO.mChildID = mDoHIO_root.mDoHIO_createChild("ドラゴン", &l_HIO); + l_HIO.mChildID = mDoHIO_root.mDoHIO_createChild("ドラゴン", &l_HIO); // "Dragon" } } diff --git a/src/d/actor/d_a_mozo.cpp b/src/d/actor/d_a_mozo.cpp index 0feb8c4d9..02695e6aa 100644 --- a/src/d/actor/d_a_mozo.cpp +++ b/src/d/actor/d_a_mozo.cpp @@ -1,7 +1,7 @@ -// -// Generated by dtk -// Translation Unit: d_a_mozo.cpp -// +/** + * d_a_mozo.cpp + * Moblin Statue / モ石像 (Mo Sekizou) + */ #include "d/actor/d_a_mozo.h" #include "d/res/res_mozo.h" @@ -14,12 +14,30 @@ #include "d/d_lib.h" #include "m_do/m_Do_mtx.h" #include "m_Do/m_Do_ext.h" +#include "m_Do/m_Do_hostIO.h" static daMozo_HIO_c l_HIO; /* 000000EC-000001D0 .text __ct__12daMozo_HIO_cFv */ daMozo_HIO_c::daMozo_HIO_c() { /* Nonmatching */ + m3C = 0.0f; + m40 = -300.0f; + m44 = 600.0f; + mChildID = -1; + m08 = -1; + mpBeamChild = &mBeamChild; + mpFireChild = &mFireChild; + mpBeamChild->m04 = 1000.0f; + mpBeamChild->m08 = 1200.0f; + mpBeamChild->m0C = 0x2000; + mpBeamChild->m0E = 0x2800; + mpBeamChild->m10 = 0; + mpFireChild->m04 = 1000.0f; + mpFireChild->m08 = 1200.0f; + mpFireChild->m0C = 0x2000; + mpFireChild->m0E = 0x2800; + mpFireChild->m10 = 0; } /* 000002D0-00000568 .text daMozo_nodeCallBackBeam__FP8daMozo_cP8J3DModelP7J3DNodei */ @@ -157,28 +175,22 @@ s32 daMozo_c::CreateInit() { /* Nonmatching */ J3DModelData* mdlData = mAnimMorf->getModel()->getModelData(); - int param = base.mParameters * 0xFF; - if (param == 0xFF) { - param = 0; + u8 temp = fopAcM_GetParam(this) & 0xFF; + if (temp == 0xFF) { + temp = 0; } - - int a = 2; - if (param < 3) { - a = param; - } - - // TODO: insert missing assignment here + field_0x376 = cLib_minMaxLimit(temp, 0, 2); mAnimMorf->getModel()->setUserArea((u32)this); - for (int i = 0; i < mdlData->getJointNum(); i++) { + for (u16 i = 0; i < mdlData->getJointNum(); i++) { if (i == 2) { - mdlData->getJointNodePointer(2)->setCallBack((J3DNodeCallBack)daMozo_nodeCallBack); + mdlData->getJointNodePointer(i)->setCallBack(daMozo_nodeCallBack); } } mQuatRotation = ZeroQuat; - fopAcM_setCullSizeBox(this, -1000.f, -1000.f, -1000.f, 1000.0f, 1000.0f, 1000.0f); + fopAcM_setCullSizeBox(this, -1000.0f, -1000.0f, -1000.0f, 1000.0f, 1000.0f, 1000.0f); fopAcM_SetMtx(this, mAnimMorf->getModel()->getBaseTRMtx()); // TODO: Insert missing code here @@ -187,6 +199,10 @@ s32 daMozo_c::CreateInit() { mAnimMorf->calc(); wait_proc_init(); + if (l_HIO.mChildID < 0) { + l_HIO.mChildID = mDoHIO_root.mDoHIO_createChild("モ石像", &l_HIO); // "Mo Statue" (mo sekizou) + } + return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_nh.cpp b/src/d/actor/d_a_nh.cpp index 46ec3f452..3175142e3 100644 --- a/src/d/actor/d_a_nh.cpp +++ b/src/d/actor/d_a_nh.cpp @@ -135,7 +135,7 @@ s32 daNh_c::create() { fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); if (l_HIO.mChildID < 0) { - l_HIO.mChildID = mDoHIO_root.mDoHIO_createChild("森のほたる", &l_HIO); + l_HIO.mChildID = mDoHIO_root.mDoHIO_createChild("森のほたる", &l_HIO); // "Forest Firefly" (mori no hotaru) l_HIO.mpActor = this; } if (!init()) { diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 04cc4e30a..f010b5383 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -541,7 +541,7 @@ void daTbox_c::CreateInit() { mAllColRatio = 1.0f; if (l_HIO.mHioId < 0) { - l_HIO.mHioId = mDoHIO_root.mDoHIO_createChild("宝箱", &l_HIO); + l_HIO.mHioId = mDoHIO_root.mDoHIO_createChild("宝箱", &l_HIO); // "Treasure Chest" } shape_angle.z = 0;