From 7904ce76323bbb49163c31072a136fe694114dc7 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sun, 4 Oct 2026 23:11:47 -0400 Subject: [PATCH] d_a_swpropeller OK for demo and add debug inlines --- configure.py | 2 +- src/d/actor/d_a_swpropeller.cpp | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/configure.py b/configure.py index 98b4eb881..87a87cc5b 100755 --- a/configure.py +++ b/configure.py @@ -1823,7 +1823,7 @@ config.libs = [ ActorRel(Matching, "d_a_steam_tag"), ActorRel(Matching, "d_a_swattack"), ActorRel(Matching, "d_a_switem"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_swpropeller"), + ActorRel(Matching, "d_a_swpropeller"), ActorRel(Matching, "d_a_swtact"), ActorRel(Matching, "d_a_tag_etc"), ActorRel(Matching, "d_a_tag_island"), diff --git a/src/d/actor/d_a_swpropeller.cpp b/src/d/actor/d_a_swpropeller.cpp index 29958add7..e7ebca355 100644 --- a/src/d/actor/d_a_swpropeller.cpp +++ b/src/d/actor/d_a_swpropeller.cpp @@ -11,6 +11,11 @@ #include "res/Object/Hpbot1.h" #include "res/Object/Vpbot_00.h" +namespace daSwProp_prm { + inline u8 getSwitchNo(daSwProp_c* i_this) { return (fopAcM_GetParam(i_this) >> 0) & 0xFF; } + inline u8 getType(daSwProp_c* i_this) { return (fopAcM_GetParam(i_this) >> 8) & 0x0F; } +}; + const s16 daSwProp_c::m_bdlidx[2] = { dRes_INDEX_HPBOT1_BDL_HPBOT1_e, dRes_INDEX_VPBOT_00_BDL_VPBOT_00_e }; const u32 daSwProp_c::m_heapsize[2] = { 2176, 2240 }; const char* daSwProp_c::m_arcname[2] = { "Hpbot1", "Vpbot_00" }; @@ -87,7 +92,7 @@ void daSwProp_c::CreateInit() { mStts.Init(255, 255, this); mCyl.Set(l_cyl_src); mCyl.SetStts(&mStts); - mSwitchNo = fpcM_GetParam(this) & 0xFF; + mSwitchNo = daSwProp_prm::getSwitchNo(this); set_mtx(); @@ -123,7 +128,7 @@ static BOOL nodeCallBack(J3DNode* i_node, int i_calcTiming) { /* 00000404-00000590 .text _create__10daSwProp_cFv */ cPhs_State daSwProp_c::_create() { fopAcM_ct(this, daSwProp_c); - mType = fpcM_GetParam(this) >> 8 & 0xF; + mType = daSwProp_prm::getType(this); cPhs_State res = dComIfG_resLoad(&mPhs, m_arcname[mType]); if (res == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, m_heapsize[mType])) { @@ -145,6 +150,7 @@ void daSwProp_c::set_mtx() { /* 00000838-00000B60 .text _execute__10daSwProp_cFv */ bool daSwProp_c::_execute() { + s16 r30 = 0x1000; u8 windHit = 0; mAcch.CrrPos(*dComIfG_Bgsp()); if (mCyl.ChkTgHit()) { @@ -172,7 +178,7 @@ bool daSwProp_c::_execute() { } } if (windHit) { - mRotYVel = 0x1000; + mRotYVel = r30; mRotYVelTarget = 0; } else if (windHit != mPrevWindHit) { fopAcM_revSwitch(this, mSwitchNo); @@ -192,8 +198,7 @@ bool daSwProp_c::_execute() { } if (mType == 1) { - f32 vel = mRotYVel / 4096.0f * 100.0f; - mDoAud_seStart(JA_SE_OBJ_KM_WINDMILL, ¤t.pos, vel, 0); + mDoAud_seStart(JA_SE_OBJ_KM_WINDMILL, ¤t.pos, mRotYVel / (f32)r30 * 100.0f, 0); } mPrevWindHit = windHit;