From 77cc6a61194623890f41ba1caa3e245d291d51b1 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Fri, 22 Aug 2025 23:14:23 -0400 Subject: [PATCH] stone OK and misc demo matches --- configure.py | 2 +- include/d/actor/d_a_stone.h | 12 +++++++----- src/d/actor/d_a_kanban.cpp | 4 ++-- src/d/actor/d_a_obj_barrier.cpp | 1 - src/d/actor/d_a_stone.cpp | 30 ++++++++++++++++++------------ src/d/actor/d_a_stone2.cpp | 8 +++++--- src/d/actor/d_a_tsubo.cpp | 9 +++++---- 7 files changed, 38 insertions(+), 28 deletions(-) diff --git a/configure.py b/configure.py index 54dbb077a..2c35f4d6c 100755 --- a/configure.py +++ b/configure.py @@ -1452,7 +1452,7 @@ config.libs = [ ActorRel(Matching, "d_a_sk2"), ActorRel(Matching, "d_a_spotbox"), ActorRel(Matching, "d_a_ssk"), - ActorRel(Equivalent, "d_a_stone"), + ActorRel(Matching, "d_a_stone"), ActorRel(Equivalent, "d_a_stone2"), ActorRel(Matching, "d_a_swc00"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_swhit0"), diff --git a/include/d/actor/d_a_stone.h b/include/d/actor/d_a_stone.h index 698548e75..16d2453f3 100644 --- a/include/d/actor/d_a_stone.h +++ b/include/d/actor/d_a_stone.h @@ -11,10 +11,12 @@ namespace daStone { static BOOL CreateHeapCB(fopAc_ac_c*); enum DataFlag_e { - DATAFLG_1_e = 1 << 0, - DATAFLG_2_e = 1 << 1, - DATAFLG_4_e = 1 << 2, - DATAFLG_8_e = 1 << 3, + DATAFLG_0_e = 0, + DATAFLG_1_e = 1 << 0, + DATAFLG_2_e = 1 << 1, + DATAFLG_4_e = 1 << 2, + DATAFLG_8_e = 1 << 3, + DATAFLG_10_e = 1 << 4, }; struct Data_c { @@ -103,7 +105,7 @@ namespace daStone { s32 prm_get_cull() const { return daObj::PrmAbstract(this,PRM_CULL_W, PRM_CULL_S); } s32 prm_get_itemNo() const { return daObj::PrmAbstract(this, PRM_ITEMNO_W, PRM_ITEMNO_S); } s32 prm_get_itemSave() const { return daObj::PrmAbstract(this, PRM_ITEMSAVE_W, PRM_ITEMSAVE_S); } - u32 prm_get_moveBg() const { return daObj::PrmAbstract(this, PRM_MOVEBG_W, PRM_MOVEBG_S); } + bool prm_get_moveBg() const { return daObj::PrmAbstract(this, PRM_MOVEBG_W, PRM_MOVEBG_S) == 1UL; } s32 prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWSAVE_W, PRM_SWSAVE_S); } s32 prm_get_type() const { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); } void prm_off_moveBg() { fopAcM_SetParam(this, fopAcM_GetParam(this) | 0xC0); } diff --git a/src/d/actor/d_a_kanban.cpp b/src/d/actor/d_a_kanban.cpp index 56fe843be..242868393 100644 --- a/src/d/actor/d_a_kanban.cpp +++ b/src/d/actor/d_a_kanban.cpp @@ -1088,8 +1088,8 @@ static cPhs_State daKanban_Create(fopAc_ac_c* a_this) { a_this->attention_info.position.y = a_this->eyePos.y + 60.0f; a_this->attention_info.position.z = a_this->eyePos.z; - a_this->attention_info.distances[1] = 5; - a_this->attention_info.distances[3] = 6; + a_this->attention_info.distances[fopAc_Attn_TYPE_TALK_e] = 5; + a_this->attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = 6; a_this->attention_info.flags = fopAc_Attn_TALKFLAG_READ_e | fopAc_Attn_ACTION_SPEAK_e | fopAc_Attn_LOCKON_TALK_e; i_this->m350.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, &i_this->m310, diff --git a/src/d/actor/d_a_obj_barrier.cpp b/src/d/actor/d_a_obj_barrier.cpp index 20a0780dd..089a51b22 100644 --- a/src/d/actor/d_a_obj_barrier.cpp +++ b/src/d/actor/d_a_obj_barrier.cpp @@ -279,7 +279,6 @@ bool daObjBarrier_c::break_check() { bool chk = false; #if VERSION <= VERSION_JPN - if (mMoya == 0) { if (dComIfGs_isEventBit(0x3980) == true) { daPy_py_c* player_p = (daPy_py_c*)daPy_getPlayerActorClass(); diff --git a/src/d/actor/d_a_stone.cpp b/src/d/actor/d_a_stone.cpp index fd284b02c..167adf1b4 100644 --- a/src/d/actor/d_a_stone.cpp +++ b/src/d/actor/d_a_stone.cpp @@ -65,7 +65,7 @@ const Data_c Act_c::M_data[] = { 0.0f, 0.0f, 0.0f, 0x9C4, 0x9C4, 0x3E8, 0.006f, 0.001f, 200.0f, 0.6f, 0x0, 5.4f, 0.04f, 0.014f, 0.04f, 0.015f, 30.0f, 0.5f, 1.0f, 0.3f, 0x96, - 0x5, 0x64, 0x4, 0x7D, 0x5, 0x0, M_arcname_Always, + 0x5, 0x64, 0x4, 0x7D, 0x5, DATAFLG_0_e, M_arcname_Always, #if VERSION == VERSION_DEMO 0x1240, #else @@ -80,7 +80,7 @@ const Data_c Act_c::M_data[] = { 0.0f, 0.0f, 0.0f, 0x7D0, 0x7D0, 0x0, 0.006f, 0.001f, 200.0f, 0.6f, 0x2, 6.5f, 0.04f, 0.014f, 0.04f, 0.015f, 30.0f, 0.5f, 1.0f, 0.3f, 0x96, - 0x5, 0x64, 0x4, 0x7D, 0x5, 0x2, M_arcname_Always, + 0x5, 0x64, 0x4, 0x7D, 0x5, DATAFLG_2_e, M_arcname_Always, #if VERSION == VERSION_DEMO 0x1240, #else @@ -95,7 +95,7 @@ const Data_c Act_c::M_data[] = { 0.0f, 0.0f, 0.0f, 0x9C4, 0x9C4, 0x3E8, 0.006f, 0.001f, 200.0f, 3.0f, 0x6, 5.4f, 0.04f, 0.014f, 0.04f, 0.015f, 30.0f, 2.5f, 1.0f, 1.5f, 0xFF, - 0xA, 0x64, 0x4, 0xFF, 0xA, 0xF, M_arcname_Ebrock, + 0xA, 0x64, 0x4, 0xFF, 0xA, DataFlag_e(DATAFLG_1_e | DATAFLG_2_e | DATAFLG_4_e | DATAFLG_8_e), M_arcname_Ebrock, 0xB80, 0x4, 0x19, 0x140, 0x118, 0x1C6, 0x12C, 0x0, 0x696A, 0x692A, 0x691A, 0x691D, 0xD, 0x0, 0xC8, 0x0, 0x258, 0x0, 0xC8, 0x0, 0x190, @@ -103,7 +103,7 @@ const Data_c Act_c::M_data[] = { }, { -6.0f, 120.0f, 175.0f, 1.0f, 0xFF, 27.0f, 36.0f, 0.0f, 0.0f, 0.0f, 0x9C4, 0x9C4, 0x3E8, 0.006f, 0.001f, 200.0f, 3.0f, 0x6, 5.4f, - 0.04f, 0.014f, 0.04f, 0.015f, 30.0f, 2.5f, 1.0f, 1.5f, 0xFF, 0xA, 0x64, 0x4, 0xFF, 0xA, 0x1F, M_arcname_Ekao, 0xD40, 0x4, 0x18, + 0.04f, 0.014f, 0.04f, 0.015f, 30.0f, 2.5f, 1.0f, 1.5f, 0xFF, 0xA, 0x64, 0x4, 0xFF, 0xA, DataFlag_e(DATAFLG_1_e | DATAFLG_2_e | DATAFLG_4_e | DATAFLG_8_e | DATAFLG_10_e), M_arcname_Ekao, 0xD40, 0x4, 0x18, 0x144, 0x113, 0x15E, 0x1AE, 0x0, 0x6969, 0x692A, 0x691A, 0x691D, 0xD, 0x0, 0x78, 0x0, 0x212, 0x0, 0x78, 0x0, 0x15E, 6000.0f, }, { @@ -111,7 +111,7 @@ const Data_c Act_c::M_data[] = { 0.0f, 0.0f, 0.0f, 0x9C4, 0x9C4, 0x3E8, 0.006f, 0.001f, 200.0f, 2.0f, 0x4, 5.4f, 0.04f, 0.014f, 0.04f, 0.015f, 30.0f, 1.5f, 1.0f, 1.0f, 0xFF, - 0xA, 0x64, 0x4, 0xFF, 0xA, 0xF, M_arcname_Ebrock, + 0xA, 0x64, 0x4, 0xFF, 0xA, DataFlag_e(DATAFLG_1_e | DATAFLG_2_e | DATAFLG_4_e | DATAFLG_8_e), M_arcname_Ebrock, 0x620, 0x5, 0xE, 0x87, 0x6E, 0x96, 0xAA, 0x0, 0x696B, 0x692A, 0x691A, 0x691D, 0xD, 0x0, 0x32, 0x0, 0x1C2, 0x0, 0x32, 0x0, 0x96, @@ -232,7 +232,7 @@ cPhs_State Act_c::_create() { mAcch.CrrPos(*dComIfG_Bgsp()); mAcch.ClrGroundLanding(); - if (prm_get_moveBg() == 1) { + if (prm_get_moveBg()) { current.pos = home.pos; if (dComIfG_Bgsp()->ChkMoveBG_NoDABg(mAcch.m_gnd)) { prm_off_moveBg(); @@ -248,7 +248,7 @@ cPhs_State Act_c::_create() { mode_wait_init(); cLib_onBit(attention_info.flags, fopAc_Attn_ACTION_CARRY_e); - attention_info.distances[4] = data().m7E; + attention_info.distances[fopAc_Attn_TYPE_CARRY_e] = data().m7E; if (data().m70 & 2) { fopAcM_OnStatus(this, fopAcStts_UNK10000_e); @@ -427,7 +427,7 @@ bool Act_c::mode_proc_call() { mode_carry_init(); } - bool uVar7 = prm_get_moveBg() == 1; + bool uVar7 = prm_get_moveBg(); cXyz sp08 = current.pos; (this->*mode_proc[m674])(); @@ -448,7 +448,7 @@ bool Act_c::mode_proc_call() { m67A = 1; } - if (prm_get_moveBg() == 1) { + if (prm_get_moveBg()) { prm_off_moveBg(); sp08.y = mAcch.GetGroundH(); m688 = sp08.y; @@ -920,7 +920,7 @@ void Act_c::cam_lockoff() const { bool Act_c::_execute() { cull_set_move(); if (m67A != 0 || m674 != 0 || mAcch.ChkGroundHit() == false || mAcch.ChkGroundLanding() || prm_get_cull() == 0 || !fopAcM_cullingCheck(this) || - prm_get_moveBg() == DATAFLG_1_e) + prm_get_moveBg()) { m67A = 0; BOOL bVar1 = TRUE; @@ -958,8 +958,14 @@ bool Act_c::_execute() { /* 00003358-0000344C .text _draw__Q27daStone5Act_cFv */ bool Act_c::_draw() { - if (prm_get_moveBg() != 1) { - g_env_light.settingTevStruct(cLib_checkBit(DataFlag_e(data().m70), DATAFLG_4_e), ¤t.pos, &tevStr); + if (!prm_get_moveBg()) { + int light_type; + if (cLib_checkBit(DataFlag_e(data().m70), DATAFLG_4_e)) { + light_type = TEV_TYPE_BG0; + } else { + light_type = TEV_TYPE_ACTOR; + } + g_env_light.settingTevStruct(light_type, ¤t.pos, &tevStr); g_env_light.setLightTevColorType(mpModel, &tevStr); mDoExt_modelUpdateDL(mpModel); if (fopAcM_GetModel(this) == NULL) { diff --git a/src/d/actor/d_a_stone2.cpp b/src/d/actor/d_a_stone2.cpp index fe2ee9596..1978dba92 100644 --- a/src/d/actor/d_a_stone2.cpp +++ b/src/d/actor/d_a_stone2.cpp @@ -158,7 +158,7 @@ BOOL Act_c::Create() { mAcch.ClrGroundLanding(); current.pos.set(home.pos); cLib_onBit(attention_info.flags, fopAc_Attn_ACTION_CARRY_e); - attention_info.distances[4] = attr().m0C; + attention_info.distances[fopAc_Attn_TYPE_CARRY_e] = attr().m0C; fopAcM_OnStatus(this, fopAcStts_UNK10000_e); attention_info.position.x = current.pos.x; @@ -658,7 +658,8 @@ void Act_c::demo_non() { /* 000021AC-00002214 .text demo_req_init__Q28daStone25Act_cFv */ void Act_c::demo_req_init() { if (prmZ_get_evId() == 0) { - fopAcM_orderOtherEventId(this, m650, m652); + u8 evno = m652; + fopAcM_orderOtherEventId(this, m650, evno); eventInfo.onCondition(dEvtCmd_INDEMO_e); m64C = 1; } @@ -670,7 +671,8 @@ void Act_c::demo_req() { if (eventInfo.checkCommandDemoAccrpt()) { demo_run_init(); } else { - fopAcM_orderOtherEventId(this, m650, m652); + u8 evno = m652; + fopAcM_orderOtherEventId(this, m650, evno); eventInfo.onCondition(dEvtCmd_INDEMO_e); } } else { diff --git a/src/d/actor/d_a_tsubo.cpp b/src/d/actor/d_a_tsubo.cpp index 55205e901..4451f60c0 100644 --- a/src/d/actor/d_a_tsubo.cpp +++ b/src/d/actor/d_a_tsubo.cpp @@ -1360,7 +1360,7 @@ cPhs_State Act_c::_create() { m6EC = 0.0f; m6F0 = cXyz::Zero; cLib_onBit(attention_info.flags, fopAc_Attn_ACTION_CARRY_e); - attention_info.distances[4] = data().mAttnDist; + attention_info.distances[fopAc_Attn_TYPE_CARRY_e] = data().mAttnDist; attention_info.position.x = current.pos.x; attention_info.position.y = current.pos.y + data().mAttnY; attention_info.position.z = current.pos.z; @@ -2760,7 +2760,7 @@ void Act_c::bound(float arg1) { } } } - } else if (mAcch.ChkWallHit()) { + } else if (mAcch.ChkWallHit() != false) { speedF *= 0.9f; } } @@ -2885,8 +2885,9 @@ void Act_c::set_wind_vec() { fopAc_ac_c* pfVar4 = mCyl.GetTgHitAc(); if (pfVar4 != NULL && fopAcM_GetProfName(pfVar4) == PROC_PLAYER) { s16 iVar5 = cM_atan2s(sp3C.x, sp3C.z); - if (cM_scos(pfVar4->shape_angle.y - iVar5) > 0.866f) { - fVar1 = cM_scos(pfVar4->shape_angle.y - iVar5) * 2.0f + 1.0f; + f32 cos = cM_scos(pfVar4->shape_angle.y - iVar5); + if (cos > 0.866f) { + fVar1 = cos * 2.0f + 1.0f; } else { fVar1 = 0.0f; }