diff options
| author | YunataSavior <58997725+YunataSavior@users.noreply.github.com> | 2025-09-20 12:09:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-20 22:09:06 +0300 |
| commit | affd5d7f95da627b2d2ebaf5a7d34878f15fc9ab (patch) | |
| tree | 186894608b5c3e393c8863938676e8d6b5c0858c /src | |
| parent | 72236276a6af973baefd612f0a3d4fecccbab4e9 (diff) | |
d_a_obj_kanban2 & more OK (#2674)
* d_a_obj_kanban2 OK via gameInfo fakematch
Closes #1001
* Mark d_a_obj_kanban2 as matching for JP
* Mark npc_jagar as Matching
* d_a_tag_allmato OK via gameInfo fake match
* d_a_obj_wchain OK
* d_a_obj_so OK
---------
Co-authored-by: Max Roncace <me@caseif.net>
Diffstat (limited to 'src')
| -rw-r--r-- | src/d/actor/d_a_e_warpappear.cpp | 1 | ||||
| -rw-r--r-- | src/d/actor/d_a_npc_henna.cpp | 15 | ||||
| -rw-r--r-- | src/d/actor/d_a_npc_ks.cpp | 2 | ||||
| -rw-r--r-- | src/d/actor/d_a_obj_kanban2.cpp | 13 | ||||
| -rw-r--r-- | src/d/actor/d_a_obj_so.cpp | 10 | ||||
| -rw-r--r-- | src/d/actor/d_a_obj_wchain.cpp | 47 | ||||
| -rw-r--r-- | src/d/actor/d_a_tag_allmato.cpp | 14 |
7 files changed, 66 insertions, 36 deletions
diff --git a/src/d/actor/d_a_e_warpappear.cpp b/src/d/actor/d_a_e_warpappear.cpp index e60d32393f..c4193994e8 100644 --- a/src/d/actor/d_a_e_warpappear.cpp +++ b/src/d/actor/d_a_e_warpappear.cpp @@ -479,6 +479,7 @@ static void demo_camera(e_warpappear_class* i_this) { i_this->field_0x5f8 = 0.0f; } + // TODO: gameInfo fake match to force reuse of pointer play = &g_dComIfG_gameInfo.play; play->getEvent().onHindFlag(15); diff --git a/src/d/actor/d_a_npc_henna.cpp b/src/d/actor/d_a_npc_henna.cpp index 65b42b5e5e..525a8f004d 100644 --- a/src/d/actor/d_a_npc_henna.cpp +++ b/src/d/actor/d_a_npc_henna.cpp @@ -2219,10 +2219,15 @@ static void message_guide(npc_henna_class* i_this) { return; } - // TODO: fake match to force reuse of pointer +#if VERSION != VERSION_SHIELD_DEBUG + // TODO: gameInfo fake match to force reuse of pointer dComIfG_play_c* play = &g_dComIfG_gameInfo.play; - if (play->getEvent().runCheck()) { - if (actor->eventInfo.checkCommandTalk() == 0) { + if (play->getEvent().runCheck()) +#else + if (dComIfGp_event_runCheck()) +#endif + { + if (!actor->eventInfo.checkCommandTalk()) { return; } @@ -2251,7 +2256,11 @@ static void message_guide(npc_henna_class* i_this) { } if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { +#if VERSION != VERSION_SHIELD_DEBUG play->getEvent().reset(); +#else + dComIfGp_event_reset(); +#endif i_this->mIsTalking = 0; } } else { diff --git a/src/d/actor/d_a_npc_ks.cpp b/src/d/actor/d_a_npc_ks.cpp index 8d06c55738..3d94b89a51 100644 --- a/src/d/actor/d_a_npc_ks.cpp +++ b/src/d/actor/d_a_npc_ks.cpp @@ -5965,7 +5965,7 @@ static int npc_ks_fsdemo(npc_ks_class* i_this) { fopAcM_OnStatus(a_this, 0); cLib_onBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_SPEAK_e | fopAc_AttnFlag_TALK_e); a_this->eventInfo.onCondition(dEvtCnd_CANTALK_e); - // TODO: fake match to force reuse of pointer + // TODO: gameInfo fake match to force reuse of pointer dComIfG_play_c* play = &g_dComIfG_gameInfo.play; if (play->getEvent().runCheck()) { if (a_this->eventInfo.checkCommandTalk()) { diff --git a/src/d/actor/d_a_obj_kanban2.cpp b/src/d/actor/d_a_obj_kanban2.cpp index a642606504..257d7665a3 100644 --- a/src/d/actor/d_a_obj_kanban2.cpp +++ b/src/d/actor/d_a_obj_kanban2.cpp @@ -1002,9 +1002,20 @@ void daObj_Kanban2_c::executeNormal() { break; case 1: mInvulnerabilityTimer = 3; - if (dComIfGp_event_runCheck() && eventInfo.checkCommandTalk()) { +#if VERSION != VERSION_SHIELD_DEBUG + // TODO: gameInfo fake match to force reuse of pointer + dComIfG_play_c* play = &g_dComIfG_gameInfo.play; + if (play->getEvent().runCheck() && eventInfo.checkCommandTalk()) +#else + if (dComIfGp_event_runCheck() && eventInfo.checkCommandTalk()) +#endif + { if (mMsgFlow.doFlow(this, NULL, 0)) { +#if VERSION != VERSION_SHIELD_DEBUG + play->getEvent().reset(); +#else dComIfGp_event_reset(); +#endif field_0x9fe = 0; } } else { diff --git a/src/d/actor/d_a_obj_so.cpp b/src/d/actor/d_a_obj_so.cpp index 72c7ef90b1..7127124824 100644 --- a/src/d/actor/d_a_obj_so.cpp +++ b/src/d/actor/d_a_obj_so.cpp @@ -417,14 +417,13 @@ static void action(obj_so_class* i_this) { /* 80CE14DC-80CE2A64 0011FC 1588+00 1/1 0/0 0/0 .text part_move__FP12obj_so_class */ static void part_move(obj_so_class* i_this) { - // NONMATCHING static u16 e_id[3] = { 0x82AB, 0x82AC, 0x82AD, }; - fopAc_ac_c* player = dComIfGp_getPlayer(0); + fopAc_ac_c* player = (fopAc_ac_c*) dComIfGp_getPlayer(0); fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; cXyz spec, spf8, sp104; s16 tempCos; @@ -519,8 +518,7 @@ static void part_move(obj_so_class* i_this) { } } else { i_this->field_0x8f0[i].y = -10.0f; - i_this->field_0x8f0[i].z = 0.0f; - i_this->field_0x8f0[i].x = 0.0f; + i_this->field_0x8f0[i].x = i_this->field_0x8f0[i].z = 0.0f; if (daPy_getPlayerActorClass()->checkFrontRollCrash()) { spec.x = player->current.pos.x - i_this->field_0x618[i].x; spec.y = -(player->current.pos.y - i_this->field_0x618[i].y); @@ -715,8 +713,8 @@ static void part_move(obj_so_class* i_this) { spec.y = 0.0f; spec.z = (50.0f - var_f29) * (JREG_F(1) + 100.0f); MtxPosition(&spec, &spf8); - cLib_addCalcAngleS2(&i_this->field_0x1b20[i], spec.z, 2, 0x400); - cLib_addCalcAngleS2(&i_this->field_0x1b30[i], -spec.x, 2, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x1b20[i], spf8.z, 2, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x1b30[i], -spf8.x, 2, 0x400); } } diff --git a/src/d/actor/d_a_obj_wchain.cpp b/src/d/actor/d_a_obj_wchain.cpp index 909c6277a2..720ff26db0 100644 --- a/src/d/actor/d_a_obj_wchain.cpp +++ b/src/d/actor/d_a_obj_wchain.cpp @@ -130,10 +130,14 @@ s16 daObjWchain_c::getChainAngleZ(cXyz* param_0, int param_1) { } /* 80D3080C-80D310AC 00098C 08A0+00 1/1 0/0 0/0 .text setChainPos__13daObjWchain_cFv */ -// NONMATCHING instruction ordering void daObjWchain_c::setChainPos() { cXyz prev_pos, vec1; + int i; + cXyz* chain_pos; // dbg r27 + cXyz* chain_speed; // dbg sp_0x1C + csXyz* chain_angle; // dbg r28 + s16* chain_rotation; // dbg r26 if (mRide) { shape_angle.y = daPy_getLinkPlayerActorClass()->shape_angle.y; shape_angle.z = 0; @@ -151,17 +155,12 @@ void daObjWchain_c::setChainPos() { static Vec const currentOffset = {0.0f, 0.0f, -53.75f}; mDoMtx_stack_c::multVec(¤tOffset, ¤t.pos); - csXyz* chain_angle; - cXyz* chain_speed; - cXyz* chain_pos; - int i; - s16* chain_rotation; chain_pos = &mChainPos[0xf]; chain_angle = &mChainAngle[0xf]; chain_speed = &mChainSpeed[0xf]; chain_rotation = &mChainRotation[0xf]; prev_pos = current.pos; - int svar7 = shape_angle.z; + s16 svar7 = shape_angle.z; for (i = 0xf; i >= 0; i--, chain_pos--, chain_angle--, chain_speed--, chain_rotation--) { chain_angle->z += getChainAngleZ(chain_speed, abs((s16)(chain_angle->z - svar7))); *chain_speed = (prev_pos - *chain_pos) * 0.75; @@ -192,38 +191,40 @@ void daObjWchain_c::setChainPos() { } f32 fvar2 = mInitOutLength + mPullLength - 53.75f; int local_68 = fvar2 * (1.0f / 17.5f); - int ivar5 = local_68 <= 0xf ? local_68 + 1 : 0x10; - int chain_no = 0x10 - ivar5; + if (local_68 > 0xF) { + local_68 = 0x10; + } else { + ++local_68; + } - s16* chain_rotation; - cXyz* chain_speed; - cXyz* chain_pos; - csXyz* chain_angle; + f32 reg_f28 = (17.5f - (local_68 * 17.5f - fvar2)); + int chain_no = 0x10 - local_68; chain_pos = &mChainPos[chain_no]; chain_angle = &mChainAngle[chain_no]; + chain_speed = &mChainSpeed[chain_no]; chain_rotation = &mChainRotation[chain_no]; chain_pos->set( mRoofPos.x, - field_0x7a8 + (mRoofPos.y - (17.5f - (ivar5 * 17.5f - fvar2))), + field_0x7a8 + (mRoofPos.y - reg_f28), mRoofPos.z ); chain_angle->x = 0x4000; *chain_rotation = 0; - chain_pos = mChainPos + 1 + chain_no; - chain_angle++; - chain_speed = mChainSpeed + 1 + chain_no; - chain_rotation++; + ++chain_pos; + ++chain_angle; + ++chain_speed; + ++chain_rotation; mDoMtx_stack_c::YrotS(-shape_angle.y); - f32 prob = 0.2f; cXyz local_90; - if (!mEnd && cM_rnd() < prob) { - f32 ang = cM_rnd() * 6.283185f; + f32 prob = 0.2f; + if (!mEnd && cM_rnd() < 0.2f) { + f32 ang = cM_rnd() * 6.2831855f; local_90.set(cM_fsin(ang), 0.0f, cM_fcos(ang)); } else { local_90 = cXyz::Zero; } - for (int i = chain_no + 1; i < 0x10; i++, chain_pos++, chain_angle++, chain_speed++, chain_rotation++) { + for (i = chain_no + 1; i < 0x10; i++, chain_pos++, chain_angle++, chain_speed++, chain_rotation++) { prev_pos = *chain_pos; vec1 = *chain_pos - chain_pos[-1]; if (chain_speed->abs2XZ() < 0.04f && cM_rnd() < prob) { @@ -284,7 +285,7 @@ int daObjWchain_c::execute() { attention_info.flags &= ~fopAc_AttnFlag_LOCK_e; } attention_info.position = current.pos; - attention_info.position.y += 150.0f; + attention_info.position.y += 15.0f; setMatrix(); diff --git a/src/d/actor/d_a_tag_allmato.cpp b/src/d/actor/d_a_tag_allmato.cpp index 6b418035c7..cfc26225a2 100644 --- a/src/d/actor/d_a_tag_allmato.cpp +++ b/src/d/actor/d_a_tag_allmato.cpp @@ -67,7 +67,6 @@ int daTag_AllMato_c::Delete() { } /* 804876B8-80487C5C 0001F8 05A4+00 1/1 0/0 0/0 .text Execute__15daTag_AllMato_cFv */ -// NONMATCHING - issues with dComIfGp_getEventManager int daTag_AllMato_c::Execute() { camera_class* camera_p = NULL; @@ -79,7 +78,14 @@ int daTag_AllMato_c::Execute() { return 1; } - if (dComIfGp_event_runCheck()) { +#if VERSION != VERSION_SHIELD_DEBUG + // TODO: gameInfo fake match to force reuse of pointer + dComIfG_play_c* play = &g_dComIfG_gameInfo.play; + if (play->getEvent().runCheck()) +#else + if (dComIfGp_event_runCheck()) +#endif + { if (!eventInfo.checkCommandTalk()) { if (eventInfo.checkCommandDemoAccrpt() && dComIfGp_getEventManager().endCheck(mEventIdx)) { u16 evt_action = EVT_NONE; @@ -119,7 +125,11 @@ int daTag_AllMato_c::Execute() { } dCam_getBody()->CorrectCenter(); +#if VERSION != VERSION_SHIELD_DEBUG + play->getEvent().reset(); +#else dComIfGp_event_reset(); +#endif mEventIdx = -1; } } else { |
