ShieldD: Clean up a bunch of 99% matching TUs (#3113)

* d_a_npc_ks debug code 100%

* d_a_npc_rafrel debug code 100%

* d_a_npc_inko minor improvements

* d_a_npc_gro debug code 100%

* d_a_npc_pachi_taro debug code 100%

* d_a_npc_passer debug code 100%

* d_a_npc_pachi_maro debug code 100%

* d_a_npc_post debug code 100%

* d_a_obj_bemos debug improvements

* d_a_obj_scannon_ten debug code 100%

* d_a_b_mgn debug code 100%

* d_a_e_fb debug code 100%

* d_a_e_gb debug code 100%

* d_a_e_hz debug code 100%

* d_a_e_cr_egg debug code 100%

* d_a_e_md debug code 100%

* d_a_e_wb debug code 100%

* d_a_obj_mirror_6pole debug code 100%

* d_a_obj_spinLift debug data fixes

* d_a_obj_pdwall debug data fixes

* d_a_obj_ss_drink debug code almost matching

* d_a_obj_poFire debug code 100%

* d_a_obj_picture debug code 100%

* d_a_obj_dust debug code 100%

* d_a_obj_fallobj debug code 100%

* d_a_obj_itamato debug code almost matching

* d_a_obj_syRock debug code 100%

* d_a_obj_katatsumuri debug code 100%

* d_a_obj_wood_statue debug code 100%

* d_a_obj_lv6egate debug code 100%

* d_a_tag_qs minor debug symbol fixes

* d_a_obj_twGate debug code 100%

* d_a_obj_lv6SwGate debug code 100%

* d_a_obj_lv6swturn debug code 100%

* d_a_obj_lv6Tenbin debug code 100%

* d_a_obj_kwheel01 debug code 100%

* Fix RTTI order regression (cM3dGCyl vs cBgS_*)
This commit is contained in:
Max Roncace
2026-02-28 15:13:57 -05:00
committed by GitHub
parent c900a043b8
commit ebe7c7aabc
92 changed files with 1767 additions and 1295 deletions
+141 -129
View File
@@ -169,10 +169,14 @@ static fopAc_ac_c* m_near_carry;
static fopAc_ac_c* m_near_weapon;
static void* s_obj_sub(void* i_actor, void* i_data) {
f32 actor_dist;
UNUSED(i_data);
if (fopAcM_IsActor(i_actor)) {
if (!fpcM_IsCreating(fopAcM_GetID(i_actor)) && !fopAcM_checkCarryNow((fopAc_ac_c*)i_actor))
{
f32 actor_dist = fopAcM_searchActorDistance((fopAc_ac_c*)i_actor, (fopAc_ac_c*)i_data);
actor_dist = fopAcM_searchActorDistance((fopAc_ac_c*)i_actor, (fopAc_ac_c*)i_data);
if (actor_dist < 100.0f && !fopAcM_GetSpeedF((fopAc_ac_c*)i_actor) &&
!fopAcM_GetSpeed((fopAc_ac_c*)i_actor).y)
@@ -713,8 +717,12 @@ void daE_HZ_c::initBackWalk() {
linChk.Set(&start, &end, NULL);
if (dComIfG_Bgsp().LineCross(&linChk)) {
cLib_offsetPos(&field_0x678, &home.pos, modifiedTargetAngleY & 0x4000 ? (s16)((targetAngleY + 0x4000) & 0x8000) :
(s16)((targetAngleY & 0x8000) + 0x4000), &position);
if (modifiedTargetAngleY & 0x4000) {
targetAngleY = (s16)(targetAngleY + 0x4000 & 0x8000);
} else {
targetAngleY = (s16)((targetAngleY & 0x8000) + 0x4000);
}
cLib_offsetPos(&field_0x678, &home.pos, targetAngleY, &position);
}
}
}
@@ -863,6 +871,7 @@ void daE_HZ_c::executeWind() {
dBgS_GndChk gndChk;
dBgS_LinChk linChk;
BOOL bVar = false;
f32 deltaY;
f32 frame = mpMorfSO->getFrame();
f32 playerDist;
f32 groundCross;
@@ -890,12 +899,12 @@ void daE_HZ_c::executeWind() {
field_0x6cc = (s16)((playerDist * 15.0f) / 1000.0f);
/* fallthrough */
case 1:
frame = 6.0f - frame / 3.0f;
if (frame < 0.0f) {
frame = 0.0f;
deltaY = 6.0f - frame / 3.0f;
if (deltaY < 0.0f) {
deltaY = 0.0f;
}
current.pos.y += frame;
current.pos.y += deltaY;
ANGLE_SUB(shape_angle.y, 0x7D0);
if (mpMorfSO->checkFrame(field_0x6cc) || mpBoomerangActor == NULL ||
@@ -1345,15 +1354,14 @@ void daE_HZ_c::executeWindWalk() {
}
void daE_HZ_c::setWaterEffect() {
cXyz position(current.pos.x, mGroundCross, current.pos.z);
static cXyz sc(2.0f, 2.0f, 2.0f);
static u16 w_eff_id[4] = {
ID_ZI_J_DOWNWTRA_A,
ID_ZI_J_DOWNWTRA_B,
ID_ZI_J_DOWNWTRA_C,
ID_ZI_J_DOWNWTRA_D,
};
cXyz position(current.pos.x, mGroundCross, current.pos.z);
static cXyz sc(2.0f, 2.0f, 2.0f);
for (int i = 0; i < 4; i++) {
mWaterEffects[i] = dComIfGp_particle_set(mWaterEffects[i], w_eff_id[i], &position, &tevStr,
@@ -1453,7 +1461,7 @@ void daE_HZ_c::executeDeathWait() {
}
void daE_HZ_c::damage_check() {
s16 angle;
s16 targetAngleY;
if (mAction != 1 || mMode < 4) {
if (mSpheres[0].ChkTgHit() && mSpheres[0].GetTgHitObj()->ChkAtType(AT_TYPE_BOOMERANG)) {
@@ -1533,68 +1541,68 @@ void daE_HZ_c::damage_check() {
}
setActionMode(ACTION_DEATH);
return;
}
} else {
if (mAction == ACTION_AWAY) {
if (bVar) {
field_0x6cc = 1;
setActionMode(ACTION_DAMAGE);
return;
}
if (mAction == ACTION_AWAY) {
if (bVar) {
field_0x6cc = 1;
setActionMode(ACTION_DAMAGE);
targetAngleY = cLib_targetAngleY(&mSpheres[1].GetCoCP(), &player_pos);
targetAngleY = (s16)(targetAngleY - shape_angle.y);
if (i == 1) {
if (abs(targetAngleY) >= 0x4000) {
if (bVar) {
mBackbone1YZRot.z = 0x5000;
mBackbone2YZRot.z = -0x4000;
mBackbone3YZRot.z = 0;
} else {
mBackbone1YZRot.z = 0x3000;
}
} else if (bVar) {
mBackbone1YZRot.z = -0x3000;
mBackbone2YZRot.z = -0x2000;
mBackbone3YZRot.z = -0x1000;
} else {
mBackbone1YZRot.z = -0x2000;
mBackbone2YZRot.z = -0x1000;
mBackbone3YZRot.z = -0x800;
}
speedF = 0.0f;
} else if (bVar) {
mBackbone1YZRot.z = 0x5000;
mBackbone2YZRot.z = -0x4000;
mBackbone3YZRot.z = 0;
} else {
mBackbone1YZRot.z = 0x3000;
}
if (targetAngleY < -0x2800) {
targetAngleY = -0x2800;
}
if (targetAngleY > 0x2800) {
targetAngleY = 0x2800;
}
mBackbone1YZRot.y = targetAngleY;
mSound.startCreatureVoice(Z2SE_EN_HZ_V_DAMAGE, -1);
return;
}
angle = cLib_targetAngleY(&mSpheres[1].GetCoCP(), &player_pos) - shape_angle.y;
if (i == 1) {
if (abs(angle) >= 0x4000) {
if (bVar) {
mBackbone1YZRot.z = 0x5000;
mBackbone2YZRot.z = -0x4000;
mBackbone3YZRot.z = 0;
} else {
mBackbone1YZRot.z = 0x3000;
}
} else if (bVar) {
mBackbone1YZRot.z = -0x3000;
mBackbone2YZRot.z = -0x2000;
mBackbone3YZRot.z = -0x1000;
} else {
mBackbone1YZRot.z = -0x2000;
mBackbone2YZRot.z = -0x1000;
mBackbone3YZRot.z = -0x800;
}
speedF = 0.0f;
} else if (bVar) {
mBackbone1YZRot.z = 0x5000;
mBackbone2YZRot.z = -0x4000;
mBackbone3YZRot.z = 0;
if (bVar) {
field_0x6cc = 1;
} else {
mBackbone1YZRot.z = 0x3000;
field_0x6cc = 0;
if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_SHIELD_ATTACK)) {
field_0x6cc = 2;
}
}
if (angle < -0x2800) {
angle = -0x2800;
}
if (angle > 0x2800) {
angle = 0x2800;
}
mBackbone1YZRot.y = angle;
mSound.startCreatureVoice(Z2SE_EN_HZ_V_DAMAGE, -1);
return;
setActionMode(ACTION_DAMAGE);
}
if (bVar) {
field_0x6cc = 1;
} else {
field_0x6cc = 0;
if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_SHIELD_ATTACK)) {
field_0x6cc = 2;
}
}
setActionMode(ACTION_DAMAGE);
return;
}
}
@@ -1605,13 +1613,8 @@ void daE_HZ_c::damage_check() {
bool daE_HZ_c::checkWaterSurface() {
dBgS_ObjGndChk_Spl spline;
Vec modified_pos /* = current.pos; */;
// this might not match in debug since it's not calling
// Vec::operator_= in debug
// For retail, it's no problem since it gets optimized out
modified_pos.x = current.pos.x;
modified_pos.y = current.pos.y;
modified_pos.z = current.pos.z;
Vec modified_pos;
modified_pos = current.pos;
modified_pos.y += 500.0f;
spline.SetPos(&modified_pos);
mGroundCross = dComIfG_Bgsp().GroundCross(&spline);
@@ -1722,59 +1725,64 @@ void daE_HZ_c::action() {
void daE_HZ_c::mtx_set() {
mDoMtx_stack_c::transS(home.pos.x, home.pos.y - 13.0f, home.pos.z);
mpModel2->setBaseTRMtx(mDoMtx_stack_c::get());
if (field_0x6e8 == 0) {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::ZXYrotM(shape_angle);
mDoMtx_stack_c::scaleM(l_HIO.basic_size, l_HIO.basic_size, l_HIO.basic_size);
J3DModel* morfModel = mpMorfSO->getModel();
morfModel->setBaseTRMtx(mDoMtx_stack_c::get());
mpMorfSO->modelCalc();
MtxP anmMtx = morfModel->getAnmMtx(7);
mpModel->setBaseTRMtx(anmMtx);
mSmokeEffectPosition.set(anmMtx[0][3], anmMtx[1][3], anmMtx[2][3]);
if (mSetModelAnmMtx) {
mSetModelAnmMtx = false;
mDoMtx_stack_c::copy(anmMtx);
mDoMtx_stack_c::ZrotM(-0x4000);
mDoMtx_stack_c::transM(0.0f, 14.0f, 0.0f);
MTXCopy(mDoMtx_stack_c::get(), mMtx);
} else {
mDoMtx_stack_c::transS(home.pos);
MTXCopy(mDoMtx_stack_c::get(), mMtx);
}
if (mpBgW != NULL) {
mpBgW->Move();
}
if (field_0x6e8 != 0) {
return;
}
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::ZXYrotM(shape_angle);
mDoMtx_stack_c::scaleM(l_HIO.basic_size, l_HIO.basic_size, l_HIO.basic_size);
J3DModel* morfModel = mpMorfSO->getModel();
morfModel->setBaseTRMtx(mDoMtx_stack_c::get());
mpMorfSO->modelCalc();
MtxP anmMtx = morfModel->getAnmMtx(7);
mpModel->setBaseTRMtx(anmMtx);
mSmokeEffectPosition.set(anmMtx[0][3], anmMtx[1][3], anmMtx[2][3]);
if (mSetModelAnmMtx) {
mSetModelAnmMtx = false;
mDoMtx_stack_c::copy(anmMtx);
mDoMtx_stack_c::ZrotM(-0x4000);
mDoMtx_stack_c::transM(0.0f, 14.0f, 0.0f);
cMtx_copy(mDoMtx_stack_c::get(), mMtx);
} else {
mDoMtx_stack_c::transS(home.pos);
cMtx_copy(mDoMtx_stack_c::get(), mMtx);
}
if (mpBgW != NULL) {
mpBgW->Move();
}
}
void daE_HZ_c::cc_set() {
if (field_0x6e8 == 0) {
cXyz pos;
J3DModel* morfModel = mpMorfSO->getModel();
attention_info.position = eyePos = mSmokeEffectPosition;
attention_info.position.y += 30.0f;
MTXCopy(morfModel->getAnmMtx(7), mDoMtx_stack_c::get());
mDoMtx_stack_c::multVecZero(&pos);
mSpheres[0].SetC(pos);
mSpheres[0].SetR(80.0f);
dComIfG_Ccsp()->Set(&mSpheres[0]);
MTXCopy(morfModel->getAnmMtx(1), mDoMtx_stack_c::get());
mDoMtx_stack_c::multVecZero(&pos);
mSpheres[1].SetC(pos);
mSpheres[1].SetR(80.0f);
dComIfG_Ccsp()->Set(&mSpheres[1]);
MTXCopy(morfModel->getAnmMtx(0x12), mDoMtx_stack_c::get());
mDoMtx_stack_c::multVecZero(&pos);
mSpheres[2].SetC(pos);
mSpheres[2].SetR(80.0f);
dComIfG_Ccsp()->Set(&mSpheres[2]);
if (field_0x6e8 != 0) {
return;
}
cXyz pos;
J3DModel* morfModel = mpMorfSO->getModel();
attention_info.position = eyePos = mSmokeEffectPosition;
attention_info.position.y += 30.0f;
MTXCopy(morfModel->getAnmMtx(7), mDoMtx_stack_c::get());
mDoMtx_stack_c::multVecZero(&pos);
mSpheres[0].SetC(pos);
mSpheres[0].SetR(80.0f);
dComIfG_Ccsp()->Set(&mSpheres[0]);
MTXCopy(morfModel->getAnmMtx(1), mDoMtx_stack_c::get());
mDoMtx_stack_c::multVecZero(&pos);
mSpheres[1].SetC(pos);
mSpheres[1].SetR(80.0f);
dComIfG_Ccsp()->Set(&mSpheres[1]);
MTXCopy(morfModel->getAnmMtx(0x12), mDoMtx_stack_c::get());
mDoMtx_stack_c::multVecZero(&pos);
mSpheres[2].SetC(pos);
mSpheres[2].SetR(80.0f);
dComIfG_Ccsp()->Set(&mSpheres[2]);
}
int daE_HZ_c::execute() {
@@ -1875,7 +1883,8 @@ static int daE_HZ_Delete(daE_HZ_c* i_this) {
}
int daE_HZ_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
int joint_no = i_joint->getJntNo();
J3DJoint* joint = i_joint;
int joint_no = joint->getJntNo();
mDoMtx_stack_c::copy(i_model->getAnmMtx(joint_no));
@@ -1897,7 +1906,7 @@ int daE_HZ_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
}
i_model->setAnmMtx(joint_no, mDoMtx_stack_c::get());
MTXCopy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
return 1;
}
@@ -2007,11 +2016,11 @@ int daE_HZ_c::create() {
static dCcD_SrcSph cc_sph_src2 = {
{
{0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0x0}, {0xd8fafdff, 0x3}, 0x75}}, // mObj
{dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0x0}, {(s32)0xd8fafdff, 0x3}, 0x75}}, // mObj
{dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
} // mSphAttr
@@ -2026,7 +2035,10 @@ int daE_HZ_c::create() {
return phase;
}
if ((fopAcM_GetParam(this) >> 8 & 0xFF) == 1) {
u8 param = (fopAcM_GetParam(this) >> 8) & 0xFF;
if (param == 1) {
int dummy; // force debug to use r31 as stack pointer
mpName = "E_hzp2";
} else {
mpName = "E_hzp";
@@ -2035,7 +2047,7 @@ int daE_HZ_c::create() {
phase = dComIfG_resLoad(&mPhaseReq2, mpName);
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_HZ PARAM %x\n", fopAcM_GetParam(this));
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x2C20)) {
return cPhs_ERROR_e;
}
@@ -2046,7 +2058,7 @@ int daE_HZ_c::create() {
if (!hio_set) {
mHIOInit = true;
hio_set = true;
l_HIO.enemy_sample = mDoHIO_CREATE_CHILD("Hajiki-san", &l_HIO);
l_HIO.enemy_sample = mDoHIO_CREATE_CHILD("ハジキさん", &l_HIO);
}
fopAcM_SetMtx(this, mpMorfSO->getModel()->getBaseTRMtx());