summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiklas Bauer <nikbau2000@gmail.com>2025-12-26 22:17:51 +0100
committerGitHub <noreply@github.com>2025-12-26 13:17:51 -0800
commit67b576ad9aec15953fa0d52f33cc88e8a783b46b (patch)
tree2e9e78e8cca507807292d9288a54babfe187cca0 /src
parent229527daf71c76965ef0735abca530cee68b7358 (diff)
f_op debug work (#2991)
* f_op debug 1 * f_op debug 2 * f_op debug 3 * f_op debug 4 * f_op debug 5 * f_op_debug fix build * f_op linking * remove goto in fopac_create * fix regressions * fix regressions * pr comments
Diffstat (limited to 'src')
-rw-r--r--src/Z2AudioLib/Z2StatusMgr.cpp2
-rw-r--r--src/d/actor/d_a_obj_stone.cpp3
-rw-r--r--src/d/d_camera.cpp6
-rw-r--r--src/d/d_debug_camera.cpp6
-rw-r--r--src/d/d_particle.cpp2
-rw-r--r--src/f_op/f_op_actor.cpp91
-rw-r--r--src/f_op/f_op_actor_mng.cpp395
-rw-r--r--src/f_op/f_op_actor_tag.cpp4
-rw-r--r--src/f_op/f_op_camera.cpp27
-rw-r--r--src/f_op/f_op_camera_mng.cpp6
-rw-r--r--src/f_op/f_op_draw_iter.cpp8
-rw-r--r--src/f_op/f_op_kankyo.cpp47
-rw-r--r--src/f_op/f_op_kankyo_mng.cpp20
-rw-r--r--src/f_op/f_op_msg.cpp57
-rw-r--r--src/f_op/f_op_overlap.cpp32
-rw-r--r--src/f_op/f_op_overlap_mng.cpp41
-rw-r--r--src/f_op/f_op_overlap_req.cpp19
-rw-r--r--src/f_op/f_op_scene.cpp24
-rw-r--r--src/f_op/f_op_scene_mng.cpp14
-rw-r--r--src/f_op/f_op_scene_pause.cpp2
-rw-r--r--src/f_op/f_op_scene_req.cpp34
-rw-r--r--src/f_op/f_op_view.cpp23
-rw-r--r--src/f_pc/f_pc_manager.cpp1
-rw-r--r--src/m_Do/m_Do_hostIO.cpp4
24 files changed, 546 insertions, 322 deletions
diff --git a/src/Z2AudioLib/Z2StatusMgr.cpp b/src/Z2AudioLib/Z2StatusMgr.cpp
index 619055090f..c86b86eee3 100644
--- a/src/Z2AudioLib/Z2StatusMgr.cpp
+++ b/src/Z2AudioLib/Z2StatusMgr.cpp
@@ -114,7 +114,7 @@ void Z2StatusMgr::heartGaugeOn() {
void Z2StatusMgr::processHeartGaugeSound() {
if (!dComIfGp_event_runCheck() && mHeartGaugeOn != 0) {
- if (dScnPly_c::isPause()) {
+ if (!dScnPly_c::isPause()) {
mHeartGaugeOn--;
}
diff --git a/src/d/actor/d_a_obj_stone.cpp b/src/d/actor/d_a_obj_stone.cpp
index bea118ce80..488436c5ee 100644
--- a/src/d/actor/d_a_obj_stone.cpp
+++ b/src/d/actor/d_a_obj_stone.cpp
@@ -991,8 +991,7 @@ int daObjStone_c::draw() {
int daObjStone_c::_delete() {
mSound.deleteObject();
- u16 setid = fopAcM_GetSetId(this);
- fopAcM_offActor(this, setid);
+ fopAcM_offActor(this, fopAcM_GetSetId(this));
effect_delete(true);
dComIfG_resDelete(&mPhase, l_arcName[mStoneType]);
return 1;
diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp
index 894c0507f7..9fca792bc5 100644
--- a/src/d/d_camera.cpp
+++ b/src/d/d_camera.cpp
@@ -4391,7 +4391,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
v.Val(lockon->field_0x34.V() + ang5 * 0.05f);
} else {
r = lockon->field_0x34.R();
- r = r + ((fVar44a - r) * lockon->field_0x54 * fabsf(ang5.Cos()));
+ r = r + (fVar44a - r) * lockon->field_0x54 * fabsf(ang5.Cos());
u.Val(lockon->field_0x34.U() + (ang4 - lockon->field_0x34.U()) * lockon->field_0x58);
v.Val(lockon->field_0x34.V() + ang5 * lockon->field_0x58);
}
@@ -4443,9 +4443,9 @@ bool dCamera_c::lockonCamera(s32 param_0) {
bool bVar3 = false;
f32 fVar31;
- if (std::fabsf(fVar47) > 0.05f) {
+ if (fabsf(fVar47) > 0.05f) {
cSAngle ang = globe2.U() + cSAngle(dCamMath::rationalBezierRatio(fVar47, 0.5f) * 7.5f);
- fVar31 = std::fabsf(fVar47) - 0.05f;
+ fVar31 = fabsf(fVar47) - 0.05f;
lockon->field_0x42 = ang;
lockon->field_0x4c = 0.0f;
bVar3 = true;
diff --git a/src/d/d_debug_camera.cpp b/src/d/d_debug_camera.cpp
index 2d54283bf1..d80eb3202b 100644
--- a/src/d/d_debug_camera.cpp
+++ b/src/d/d_debug_camera.cpp
@@ -557,6 +557,8 @@ int dDbgCamera_c::moveTool() {
field_0x44.Val(*sp30 - *var_r28);
switch (field_0xc00) {
+ f32 temp_f26;
+ f32 temp_f1_2;
case 2:
*var_r28 = *var_r28 + (field_0x44.Norm() * mCamSetup.Turbo(field_0xc10 * var_f30));
@@ -571,8 +573,8 @@ int dDbgCamera_c::moveTool() {
*var_r28 = *var_r28 - (field_0x44.Norm() * mCamSetup.Translate(field_0xc10 * var_f30));
break;
case 3: {
- f32 temp_f26 = fabsf(substick_x);
- f32 temp_f1_2 = fabsf(substick_y);
+ temp_f26 = fabsf(substick_x);
+ temp_f1_2 = fabsf(substick_y);
if (field_0xc0c == 0 || temp_f26 < temp_f1_2) {
cXyz sp1B0(0.0f, 1.0f, 0.0f);
diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp
index c28ef4be0c..f4c164ef29 100644
--- a/src/d/d_particle.cpp
+++ b/src/d/d_particle.cpp
@@ -1218,7 +1218,7 @@ bool dPa_control_c::readScene(u8 param_0, mDoDvdThd_toMainRam_c** param_1) {
if (m_sceneRes) {
JUT_ASSERT(2641, !(--mSceneCount));
- JKRHeap::free(m_sceneRes, NULL);
+ JKRFree(m_sceneRes);
m_sceneRes = NULL;
}
JUT_ASSERT(2647, !mSceneCount++);
diff --git a/src/f_op/f_op_actor.cpp b/src/f_op/f_op_actor.cpp
index 7ad3bae85e..2a0d52a768 100644
--- a/src/f_op/f_op_actor.cpp
+++ b/src/f_op/f_op_actor.cpp
@@ -6,8 +6,8 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/actor/d_a_alink.h"
+#include "d/actor/d_a_suspend.h"
#include "d/d_com_inf_actor.h"
-#include "d/d_com_static.h"
#include "d/d_demo.h"
#include "d/d_s_play.h"
#include "f_ap/f_ap_game.h"
@@ -242,7 +242,7 @@ static int fopAc_Draw(void* i_this) {
if (!dComIfGp_isPauseFlag()) {
int var_r28 = dComIfGp_event_moveApproval(actor);
- if ((var_r28 == 2 || (!fopAcM_CheckStatus(actor, fopAc_ac_c::stopStatus) &&
+ if ((var_r28 == 2 || (!fopAcM_CheckStatus(actor, fopAc_ac_c::getStopStatus()) &&
(!fopAcM_CheckStatus(actor, fopAcStts_CULL_e) || !fopAcM_cullingCheck(actor)))) &&
!fopAcM_CheckStatus(actor, 0x21000000))
{
@@ -315,54 +315,52 @@ static int fopAc_Execute(void* i_this) {
JUT_ASSERT(685, -1.0e32f < actor->current.pos.x && actor->current.pos.x < 1.0e32f && -1.0e32f < actor->current.pos.y && actor->current.pos.y < 1.0e32f && -1.0e32f < actor->current.pos.z && actor->current.pos.z < 1.0e32f);
#endif
- if (!dComIfGp_isPauseFlag() && dScnPly_c::isPause()) {
- if (!dComIfA_PauseCheck()) {
- daSus_c::check(actor);
- actor->eventInfo.beforeProc();
- s32 move = dComIfGp_event_moveApproval(i_this);
- fopAcM_OffStatus(actor, 0x40000000);
-
- if (!fopAcM_CheckStatus(actor, 0x20000000) &&
- (move == 2 ||
- (move != 0 && !fopAcM_CheckStatus(actor, fopAc_ac_c::stopStatus) &&
- (!fopAcM_CheckStatus(actor, fopAcStts_NOEXEC_e) || !fopAcM_CheckCondition(actor, fopAcCnd_NODRAW_e)))))
- {
- fopAcM_OffCondition(actor, fopAcCnd_NOEXEC_e);
- actor->old = actor->current;
-
- #if DEBUG
- {
- print_error_check_c error_check(actor, print_error_check_c::sEXECUTE);
- #endif
+ if (!dComIfGp_isPauseFlag() && !dScnPly_c::isPause() && !dComIfA_PauseCheck()) {
+ daSus_c::check(actor);
+ actor->eventInfo.beforeProc();
+ s32 move = dComIfGp_event_moveApproval(actor);
+ fopAcM_OffStatus(actor, 0x40000000);
- ret = fpcMtd_Execute((process_method_class*)actor->sub_method, actor);
-
- #if DEBUG
- }
- #endif
- } else {
- actor->eventInfo.suspendProc(actor);
- fopAcM_OnCondition(actor, fopAcCnd_NOEXEC_e);
- }
+ if (!fopAcM_CheckStatus(actor, 0x20000000) &&
+ (move == 2 ||
+ (move != 0 && !fopAcM_CheckStatus(actor, fopAc_ac_c::getStopStatus()) &&
+ (!fopAcM_CheckStatus(actor, fopAcStts_NOEXEC_e) || !fopAcM_CheckCondition(actor, fopAcCnd_NODRAW_e)))))
+ {
+ fopAcM_OffCondition(actor, fopAcCnd_NOEXEC_e);
+ actor->old = actor->current;
- if (fopAcM_CheckStatus(actor, 0x20) &&
- actor->home.pos.y - actor->current.pos.y > 5000.0f)
+ #if DEBUG
{
- fopAcM_delete(actor);
- }
+ print_error_check_c error_check(actor, print_error_check_c::sEXECUTE);
+ #endif
- JUT_ASSERT(750, !isnan(actor->current.pos.x));
- JUT_ASSERT(751, !isnan(actor->current.pos.y));
- JUT_ASSERT(752, !isnan(actor->current.pos.z));
+ ret = fpcMtd_Execute((process_method_class*)actor->sub_method, actor);
- if (actor->current.pos.y < -1e31f) {
- actor->current.pos.y = -1e31f;
+ #if DEBUG
}
+ #endif
+ } else {
+ actor->eventInfo.suspendProc(actor);
+ fopAcM_OnCondition(actor, fopAcCnd_NOEXEC_e);
+ }
+
+ if (fopAcM_CheckStatus(actor, 0x20) &&
+ actor->home.pos.y - actor->current.pos.y > 5000.0f)
+ {
+ fopAcM_delete(actor);
+ }
- JUT_ASSERT(762, -1.0e32f < actor->current.pos.x && actor->current.pos.x < 1.0e32f && -1.0e32f < actor->current.pos.y && actor->current.pos.y < 1.0e32f && -1.0e32f < actor->current.pos.z && actor->current.pos.z < 1.0e32f);
+ JUT_ASSERT(750, !isnan(actor->current.pos.x));
+ JUT_ASSERT(751, !isnan(actor->current.pos.y));
+ JUT_ASSERT(752, !isnan(actor->current.pos.z));
- dKy_depth_dist_set(actor);
+ if (actor->current.pos.y < -1e31f) {
+ actor->current.pos.y = -1e31f;
}
+
+ JUT_ASSERT(762, -1.0e32f < actor->current.pos.x && actor->current.pos.x < 1.0e32f && -1.0e32f < actor->current.pos.y && actor->current.pos.y < 1.0e32f && -1.0e32f < actor->current.pos.z && actor->current.pos.z < 1.0e32f);
+
+ dKy_depth_dist_set(actor);
}
#if DEBUG
@@ -400,7 +398,7 @@ static int fopAc_IsDelete(void* i_this) {
static int fopAc_Delete(void* i_this) {
fopAc_ac_c* actor = (fopAc_ac_c*)i_this;
- int ret;
+ int ret = FALSE;
#if DEBUG
{
@@ -416,7 +414,7 @@ static int fopAc_Delete(void* i_this) {
if (ret == TRUE) {
fopAcTg_ActorQTo(&actor->actor_tag);
fopDwTg_DrawQTo(&actor->draw_tag);
- fopAcM_DeleteHeap(actor);
+ fopAcM_DeleteHeap((fopAc_ac_c*) i_this);
dDemo_actor_c* demoAc = dDemo_c::getActor(actor->demoActorID);
if (demoAc != NULL) {
@@ -442,7 +440,7 @@ static int fopAc_Create(void* i_this) {
if (fpcM_IsFirstCreating(i_this)) {
actor_process_profile_definition* profile =
(actor_process_profile_definition*)fpcM_GetProfile(i_this);
- actor->actor_type = fpcBs_MakeOfType(&g_fopAc_type);
+ actor->actor_type = fpcM_MakeOfType(&g_fopAc_type);
actor->sub_method = (profile_method_class*)profile->sub_method;
fopAcTg_Init(&actor->actor_tag, actor);
@@ -506,8 +504,9 @@ static int fopAc_Create(void* i_this) {
}
if (filelist != NULL) {
+ u8 sw;
if (!dStage_FileList_dt_GetEnemyAppear1Flag(filelist)) {
- u8 sw = dStage_FileList_dt_GetBitSw(filelist);
+ sw = dStage_FileList_dt_GetBitSw(filelist);
if (sw != 0xFF && dComIfGs_isSwitch(sw, actor->home.roomNo) &&
profile->group == fopAc_ENEMY_e)
{
@@ -515,7 +514,7 @@ static int fopAc_Create(void* i_this) {
return cPhs_ERROR_e;
}
} else {
- u8 sw = dStage_FileList_dt_GetBitSw(filelist);
+ sw = dStage_FileList_dt_GetBitSw(filelist);
if (sw != 0xFF && !dComIfGs_isSwitch(sw, actor->home.roomNo) &&
profile->group == fopAc_ENEMY_e)
{
diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp
index 3d10b12fdc..e3e33f7ba0 100644
--- a/src/f_op/f_op_actor_mng.cpp
+++ b/src/f_op/f_op_actor_mng.cpp
@@ -16,10 +16,12 @@
#include "d/actor/d_a_tag_stream.h"
#include "d/d_item.h"
#include "d/d_path.h"
+#include "d/d_s_play.h"
#include "f_op/f_op_actor_mng.h"
#include "f_op/f_op_camera_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "m_Do/m_Do_lib.h"
+#include <cstring.h>
#define MAKE_ITEM_PARAMS(itemNo, itemBitNo, param_2, param_3) \
((itemNo & 0xFF) << 0 | (itemBitNo & 0xFF) << 0x8 | param_2 << 0x10 | (param_3 & 0xF) << 0x18)
@@ -107,7 +109,7 @@ fopAc_ac_c* fopAcM_FastCreate(s16 i_procName, FastCreateReqFunc i_createFunc, vo
void fopAcM_setStageLayer(void* i_proc) {
scene_class* stageProc = fopScnM_SearchByID(dStage_roomControl_c::getProcID());
- JUT_ASSERT(0, stageProc != NULL);
+ JUT_ASSERT(367, stageProc != NULL);
fpcM_ChangeLayerID(i_proc, fopScnM_LayerID(stageProc));
}
@@ -115,7 +117,7 @@ void fopAcM_setStageLayer(void* i_proc) {
void fopAcM_setRoomLayer(void* i_proc, int i_roomNo) {
if (i_roomNo >= 0) {
scene_class* roomProc = fopScnM_SearchByID(dStage_roomControl_c::getStatusProcID(i_roomNo));
- JUT_ASSERT(0, roomProc != NULL);
+ JUT_ASSERT(390, roomProc != NULL);
fpcM_ChangeLayerID(i_proc, fopScnM_LayerID(roomProc));
}
@@ -283,13 +285,13 @@ fpc_ProcID fopAcM_createChildFromOffset(s16 i_procName, fpc_ProcID i_parentID, u
s16 parent_angleY = parent_actor->current.angle.y;
cXyz offset_pos;
+ csXyz offset_angle;
if (i_pos == NULL) {
offset_pos = cXyz::Zero;
} else {
offset_pos = *i_pos;
}
- csXyz offset_angle;
if (i_angle == NULL) {
offset_angle = csXyz::Zero;
} else {
@@ -354,10 +356,31 @@ u8 fopAcM::HeapAdjustVerbose;
u8 fopAcM::HeapAdjustQuiet;
u8 fopAcM::HeapDummyCreate;
+static bool lbl_8074C4DC;
+static bool lbl_8074C4DD;
+
+struct DummyCheckHeap {
+ static JKRHeap* getHeap();
+
+ /* 0x0 */ JKRHeap* dummyHeap;
+};
+
+static DummyCheckHeap* dch;
+
bool fopAcM_entrySolidHeap_(fopAc_ac_c* i_actor, heapCallbackFunc i_heapCallback, u32 i_size) {
const char* procNameString = fopAcM_getProcNameString(i_actor);
JKRSolidHeap* heap00 = NULL;
+#if DEBUG
+ if (lbl_8074C4DC != 0 && lbl_8074C4DD != 0 && dch != NULL) {
+ JKRHeap* dummy_heap = dch->getHeap();
+ if (dummy_heap != NULL) {
+ JKRSolidHeap* heap = mDoExt_createSolidHeap(-1, dummy_heap, 0x20);
+ JUT_ASSERT(1211, heap);
+ }
+ }
+#endif
+
if (fopAcM::HeapAdjustVerbose) {
OS_REPORT("\x1b[36mfopAcM_entrySolidHeap 開始 [%s] 見積もりサイズ=%08x\n\x1b[m",
procNameString, i_size);
@@ -521,29 +544,33 @@ void fopAcM_setCullSizeSphere(fopAc_ac_c* i_actor, f32 i_minX, f32 i_minY, f32 i
void fopAcM_setCullSizeBox2(fopAc_ac_c* i_actor, J3DModelData* i_modelData) {
J3DJoint* jointNode = i_modelData->getJointNodePointer(0);
-
- f32 minX = i_actor->scale.x * jointNode->getMin()->x;
- f32 minY = i_actor->scale.y * jointNode->getMin()->y;
- f32 minZ = i_actor->scale.z * jointNode->getMin()->z;
- f32 maxX = i_actor->scale.x * jointNode->getMax()->x;
- f32 maxY = i_actor->scale.y * jointNode->getMax()->y;
- f32 maxZ = i_actor->scale.z * jointNode->getMax()->z;
-
- fopAcM_setCullSizeBox(i_actor, minX, minY, minZ, maxX, maxY, maxZ);
+ fopAcM_setCullSizeBox(i_actor,
+ i_actor->scale.x * jointNode->getMin()->x,
+ i_actor->scale.y * jointNode->getMin()->y,
+ i_actor->scale.z * jointNode->getMin()->z,
+ i_actor->scale.x * jointNode->getMax()->x,
+ i_actor->scale.y * jointNode->getMax()->y,
+ i_actor->scale.z * jointNode->getMax()->z);
}
bool fopAcM_addAngleY(fopAc_ac_c* i_actor, s16 i_target, s16 i_step) {
- return cLib_chaseAngleS(&fopAcM_GetAngle_p(i_actor)->y, i_target, i_step);
+ csXyz* angle = fopAcM_GetAngle_p(i_actor);
+ return cLib_chaseAngleS(&angle->y, i_target, i_step);
+}
+
+void dummy(fopAc_ac_c* i_actor) {
+ fopAcM_SetSpeedF(i_actor, 10.0f);
}
void fopAcM_calcSpeed(fopAc_ac_c* i_actor) {
+ f32 xSpeed, ySpeed, zSpeed;
f32 speedF = fopAcM_GetSpeedF(i_actor);
f32 gravity = fopAcM_GetGravity(i_actor);
cXyz* speed = fopAcM_GetSpeed_p(i_actor);
- f32 xSpeed = speedF * cM_ssin(i_actor->current.angle.y);
- f32 ySpeed = speed->y + gravity;
- f32 zSpeed = speedF * cM_scos(i_actor->current.angle.y);
+ xSpeed = speedF * cM_ssin(i_actor->current.angle.y);
+ ySpeed = speed->y + gravity;
+ zSpeed = speedF * cM_scos(i_actor->current.angle.y);
if (ySpeed < fopAcM_GetMaxFallSpeed(i_actor)) {
ySpeed = fopAcM_GetMaxFallSpeed(i_actor);
@@ -580,13 +607,14 @@ s16 fopAcM_searchActorAngleX(const fopAc_ac_c* i_actorA, const fopAc_ac_c* i_act
f32 x_dist = posB->x - posA->x;
f32 z_dist = posB->z - posA->z;
- return cM_atan2s(posB->y - posA->y, JMAFastSqrt(x_dist * x_dist + z_dist * z_dist));
+ f32 dist = JMAFastSqrt(x_dist * x_dist + z_dist * z_dist);
+ return cM_atan2s(posB->y - posA->y, dist);
}
s32 fopAcM_seenActorAngleY(const fopAc_ac_c* i_actorA, const fopAc_ac_c* i_actorB) {
- s16 target_angle =
- cLib_targetAngleY(fopAcM_GetPosition_p(i_actorA), fopAcM_GetPosition_p(i_actorB));
- return abs((s16)(target_angle - i_actorA->shape_angle.y));
+ s16 target_angle = cLib_targetAngleY(fopAcM_GetPosition_p(i_actorA), fopAcM_GetPosition_p(i_actorB));
+ target_angle -= i_actorA->shape_angle.y;
+ return abs(target_angle);
}
f32 fopAcM_searchActorDistance(const fopAc_ac_c* i_actorA, const fopAc_ac_c* i_actorB) {
@@ -778,49 +806,50 @@ s32 fopAcM_cullingCheck(fopAc_ac_c const* i_actor) {
mDoLib_clipper::clip(mtx_p, &i_actor->cull.box.max, &i_actor->cull.box.min);
mDoLib_clipper::resetFar();
return ret;
- } else {
- return mDoLib_clipper::clip(mtx_p, &i_actor->cull.box.max, &i_actor->cull.box.min);
}
- } else {
- cull_box* box = &l_cullSizeBox[fopAcM_CULLSIZE_IDX(fopAcM_GetCullSize(i_actor))];
- if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
- mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
- u32 ret = mDoLib_clipper::clip(mtx_p, &box->max, &box->min);
- mDoLib_clipper::resetFar();
- return ret;
- } else {
- return mDoLib_clipper::clip(mtx_p, &box->max, &box->min);
- }
+ return mDoLib_clipper::clip(mtx_p, &i_actor->cull.box.max, &i_actor->cull.box.min);
}
- } else {
- if (fopAcM_GetCullSize(i_actor) == fopAc_CULLSPHERE_CUSTOM_e) {
- if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
- mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
- u32 ret = mDoLib_clipper::clip(mtx_p, fopAcM_getCullSizeSphereCenter(i_actor),
- fopAcM_getCullSizeSphereR(i_actor));
- mDoLib_clipper::resetFar();
- return ret;
- } else {
- return mDoLib_clipper::clip(mtx_p, fopAcM_getCullSizeSphereCenter(i_actor),
- fopAcM_getCullSizeSphereR(i_actor));
- }
- } else {
- cull_sphere* sphere = &l_cullSizeSphere[fopAcM_CULLSIZE_Q_IDX(fopAcM_GetCullSize(i_actor))];
- if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
- mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
- u32 ret = mDoLib_clipper::clip(mtx_p, sphere->center, sphere->radius);
- mDoLib_clipper::resetFar();
- return ret;
- } else {
- return mDoLib_clipper::clip(mtx_p, sphere->center, sphere->radius);
- }
+ cull_box* box = &l_cullSizeBox[fopAcM_CULLSIZE_IDX(fopAcM_GetCullSize(i_actor))];
+
+ if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
+ mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
+ u32 ret = mDoLib_clipper::clip(mtx_p, &box->max, &box->min);
+ mDoLib_clipper::resetFar();
+ return ret;
+ }
+
+ return mDoLib_clipper::clip(mtx_p, &box->max, &box->min);
+ }
+
+ if (fopAcM_GetCullSize(i_actor) == fopAc_CULLSPHERE_CUSTOM_e) {
+ if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
+ mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
+ u32 ret = mDoLib_clipper::clip(mtx_p, fopAcM_getCullSizeSphereCenter(i_actor),
+ fopAcM_getCullSizeSphereR(i_actor));
+ mDoLib_clipper::resetFar();
+ return ret;
}
+
+ return mDoLib_clipper::clip(mtx_p, fopAcM_getCullSizeSphereCenter(i_actor),
+ fopAcM_getCullSizeSphereR(i_actor));
}
+
+ cull_sphere* sphere = &l_cullSizeSphere[fopAcM_CULLSIZE_Q_IDX(fopAcM_GetCullSize(i_actor))];
+
+ if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
+ mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
+ u32 ret = mDoLib_clipper::clip(mtx_p, sphere->center, sphere->radius);
+ mDoLib_clipper::resetFar();
+ return ret;
+ }
+
+ return mDoLib_clipper::clip(mtx_p, sphere->center, sphere->radius);
}
-void* event_second_actor(u16) {
+void* event_second_actor(u16 i_flag) {
+ (void)i_flag;
return dComIfGp_getPlayer(0);
}
@@ -880,15 +909,19 @@ s32 fopAcM_orderDoorEvent(fopAc_ac_c* i_actorA, fopAc_ac_c* i_actorB, u16 i_prio
i_priority = 0xFF;
}
- s16 eventID = i_actorB->eventInfo.getEventId();
- u8 toolID = i_actorB->eventInfo.getMapToolId();
+ s16 evid = i_actorB->eventInfo.getEventId();
+ u8 toolid = i_actorB->eventInfo.getMapToolId();
- if (fopAcM_GetProfName(i_actorB) == 0x55 && toolID != 0xFF) {
- eventID = dComIfGp_getEventManager().getEventIdx(i_actorA, NULL, toolID);
+ if (fopAcM_GetProfName(i_actorB) == 0x55) {
+ if (toolid != 0xFF) {
+ evid = dComIfGp_getEventManager().getEventIdx(i_actorA, NULL, toolid);
+ }
+ } else if (fopAcM_GetProfName(i_actorB) == 0xAB) {
}
+ OS_REPORT("toolid<%d>evid<%d>\n", toolid, evid);
- return dComIfGp_event_order(dEvt_type_DOOR_e, i_priority, i_flag, -1, i_actorA, i_actorB, eventID,
- toolID);
+ return dComIfGp_event_order(dEvt_type_DOOR_e, i_priority, i_flag, -1, i_actorA, i_actorB, evid,
+ toolid);
}
s32 fopAcM_orderCatchEvent(fopAc_ac_c* i_actorA, fopAc_ac_c* i_actorB, u16 i_priority, u16 i_flag) {
@@ -976,6 +1009,7 @@ s32 fopAcM_orderOtherEventId(fopAc_ac_c* i_actor, s16 i_eventID, u8 i_mapToolID,
}
u16 newPriority = 50;
+ u16 eventPrio;
s32 roomNo = dComIfGp_roomControl_getStayNo();
if (i_actor != NULL) {
roomNo = fopAcM_GetRoomNo(i_actor);
@@ -984,7 +1018,7 @@ s32 fopAcM_orderOtherEventId(fopAc_ac_c* i_actor, s16 i_eventID, u8 i_mapToolID,
if (i_priority != 0) {
newPriority = i_priority;
} else if (i_actor != NULL) {
- u16 eventPrio = dComIfGp_getEventManager().getEventPrio(i_actor, i_eventID);
+ eventPrio = dComIfGp_getEventManager().getEventPrio(i_actor, i_eventID);
if (eventPrio != 0) {
newPriority = eventPrio;
@@ -1018,10 +1052,12 @@ s32 fopAcM_orderMapToolEvent(fopAc_ac_c* i_actor, u8 param_1, s16 i_eventID, u16
dStage_MapEvent_dt_c* dt = dEvt_control_c::searchMapEventData(param_1, roomNo);
if (dt != NULL) {
newPriority = dt->priority;
-
+
if (i_eventID == 0xFF) {
i_eventID = dComIfGp_getEventManager().getEventIdx(i_actor, param_1);
}
+ } else {
+ OS_REPORT("\x1b[31m%s: %d: fopAcM_orderMapToolEvent() マップデータがみつかりません\n\x1b[m", __FILE__, 2984); // "Map data could not be found."
}
if (i_flag & 0x100) {
@@ -1038,7 +1074,9 @@ s32 fopAcM_orderMapToolEvent(fopAc_ac_c* i_actor, u8 param_1, s16 i_eventID, u16
s32 fopAcM_orderMapToolAutoNextEvent(fopAc_ac_c* i_actor, u8 param_1, s16 i_eventID, u16 param_3,
u16 i_flag, u16 param_5) {
- return fopAcM_orderMapToolEvent(i_actor, param_1, i_eventID, param_3, i_flag | 0x100, param_5);
+ u16 flag = i_flag;
+ flag = flag | 0x100;
+ return fopAcM_orderMapToolEvent(i_actor, param_1, i_eventID, param_3, flag, param_5);
}
s32 fopAcM_orderPotentialEvent(fopAc_ac_c* i_actor, u16 i_flag, u16 param_2, u16 i_priority) {
@@ -1087,11 +1125,13 @@ s32 fopAcM_orderTreasureEvent(fopAc_ac_c* i_actorA, fopAc_ac_c* i_actorB, u16 i_
-1);
}
-fopAc_ac_c* fopAcM_getTalkEventPartner(fopAc_ac_c const*) {
+fopAc_ac_c* fopAcM_getTalkEventPartner(fopAc_ac_c const* i_this) {
+ (void)i_this;
return (fopAc_ac_c*)dComIfGp_event_getTalkPartner();
}
-fopAc_ac_c* fopAcM_getItemEventPartner(fopAc_ac_c const*) {
+fopAc_ac_c* fopAcM_getItemEventPartner(fopAc_ac_c const* i_this) {
+ (void)i_this;
return (fopAc_ac_c*)dComIfGp_event_getItemPartner();
}
@@ -1106,9 +1146,11 @@ fopAc_ac_c* fopAcM_getEventPartner(fopAc_ac_c const* i_actor) {
fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 param_2,
int i_itemBitNo, int i_roomNo, csXyz const* i_angle,
cXyz const* i_scale) {
+ JUT_ASSERT(3214, 0 <= i_itemNo && i_itemNo < 256);
dComIfGp_event_setGtItm(i_itemNo);
if (i_itemNo == fpcNm_ITEM_NONE) {
+ OS_REPORT("プレゼントデモ用なのに「ハズレ」です![%d]\n", i_itemNo); // Even though it is for a Present Demo, it is a 'Miss'!
return fpcM_ERROR_PROCESS_ID_e;
}
@@ -1117,13 +1159,17 @@ fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 p
fpc_ProcID fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_itemBitNo,
int i_roomNo, csXyz const* i_angle, cXyz const* i_scale) {
- dComIfGp_event_setGtItm(i_itemNo);
+
+ JUT_ASSERT(3259, 0 <= i_itemNo && i_itemNo < 256);
+ dComIfGp_event_setGtItm(i_itemNo);
if (i_itemNo == fpcNm_ITEM_NONE) {
+ OS_REPORT("ゲットデモ用なのに「ハズレ」です![%d]\n", i_itemNo); // Even though it is for a Get Demo, it is a 'Miss'!
return fpcM_ERROR_PROCESS_ID_e;
}
- return fopAcM_createDemoItem(i_pos, i_itemNo, i_itemBitNo, i_angle, i_roomNo, i_scale, 0);
+ u8 param_7 = 0;
+ return fopAcM_createDemoItem(i_pos, i_itemNo, i_itemBitNo, i_angle, i_roomNo, i_scale, param_7);
}
struct ItemTableList {
@@ -1134,23 +1180,26 @@ struct ItemTableList {
};
u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo) {
- u8 tableNo = i_tableNo;
+ u8 hp_max;
+ u8 hp_percent;
ItemTableList* tableList = (ItemTableList*)dComIfGp_getItemTable();
-
+
if (i_tableNo == 255) {
return i_tableNo;
}
-
+
#if DEBUG
- if (tableList->mTableNum - 1 < i_tableNo) {
+ u8 tableNum = tableList->mTableNum;
+ if (tableNum - 1 < i_tableNo) {
// "Table Num<%d>, Specified Table<%d>, over table num!\n"
OSReport_Error("テーブル数<%d>、指定テーブル番号<%d>で、テーブル数オーバーしています!\n",
- tableList->mTableNum, i_tableNo);
+ tableNum, i_tableNo);
i_tableNo = 0;
}
#endif
- u8 hp_percent = (dComIfGs_getLife() * 100) / (((dComIfGs_getMaxLife() / 5) * 4) & 0xFC);
+ hp_max = dComIfGs_getMaxLife() / 5 * 4;
+ hp_percent = (dComIfGs_getLife() * 100) / hp_max;
switch (i_tableNo) {
case 150:
@@ -1160,19 +1209,20 @@ u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo) {
case 190:
if (hp_percent < 80) {
if (hp_percent >= 60) {
- tableNo = i_tableNo + 1;
+ i_tableNo = i_tableNo + 1;
} else if (hp_percent >= 40) {
- tableNo = i_tableNo + 2;
+ i_tableNo = i_tableNo + 2;
} else if (hp_percent >= 20) {
- tableNo = i_tableNo + 3;
+ i_tableNo = i_tableNo + 3;
} else {
- tableNo = i_tableNo + 4;
+ i_tableNo = i_tableNo + 4;
}
}
break;
}
- return tableList->mTables[tableNo][(int)cM_rndF(15.9999f)];
+ i_tableNo = tableList->mTables[i_tableNo][(int)cM_rndF(15.9999f)];
+ return i_tableNo;
}
struct EnemyTableList {
@@ -1190,11 +1240,14 @@ struct EnemyTable {
fpc_ProcID fopAcM_createItemFromEnemyID(u8 i_enemyID, cXyz const* i_pos, int i_itemBitNo,
int i_roomNo, csXyz const* i_angle, cXyz const* i_scale,
f32* i_speedF, f32* i_speedY) {
+ int itemNo;
int tableNo = 0xFF;
- EnemyTableList* tblList = (EnemyTableList*)dEnemyItem_c::mData;
- int tableNum = tblList->field_0x4;
- EnemyTable* table = (EnemyTable*)&tblList->mData;
-
+ u32* data = (u32*)dEnemyItem_c::getItemData();
+ data++;
+ int tableNum = (int) *data;
+ data++;
+ EnemyTable* table = (EnemyTable*)data;
+
for (u32 i = 0; i < tableNum; i++) {
if (i_enemyID == table->mEnemyID) {
if (table->mStage[0] == '#') {
@@ -1206,11 +1259,11 @@ fpc_ProcID fopAcM_createItemFromEnemyID(u8 i_enemyID, cXyz const* i_pos, int i_i
}
table++;
}
-
+
if (daPy_getPlayerActorClass()->checkHorseRide()) {
- int itemNo = fopAcM_getItemNoFromTableNo(tableNo);
+ tableNo = fopAcM_getItemNoFromTableNo(tableNo);
void* actor =
- fopAcM_createItemForDirectGet(i_pos, itemNo, i_roomNo, NULL, NULL, 0.0f, 0.0f);
+ fopAcM_createItemForDirectGet(i_pos, tableNo, i_roomNo, NULL, NULL, 0.0f, 0.0f);
return fopAcM_GetID(actor);
}
@@ -1369,7 +1422,7 @@ fpc_ProcID fopAcM_createItem(const cXyz* i_pos, int i_itemNo, int i_itemBitNo, i
fopAc_ac_c* fopAcM_fastCreateItem2(const cXyz* i_pos, int i_itemNo, int i_itemBitNo, int i_roomNo,
int param_5, const csXyz* i_angle, const cXyz* i_scale) {
// clang-format off
- JUT_ASSERT(0, 0 <= i_itemNo && i_itemNo < 256 && (-1 <= i_itemBitNo && i_itemBitNo < (dSv_info_c::DAN_ITEM + dSv_info_c::MEMORY_ITEM + dSv_info_c::ZONE_ITEM )) || i_itemBitNo == 255);
+ JUT_ASSERT(4202, 0 <= i_itemNo && i_itemNo < 256 && (-1 <= i_itemBitNo && i_itemBitNo < (dSv_info_c::DAN_ITEM + dSv_info_c::MEMORY_ITEM + dSv_info_c::ZONE_ITEM )) || i_itemBitNo == 255);
// clang-format on
csXyz item_angle(csXyz::Zero);
@@ -1387,49 +1440,53 @@ fopAc_ac_c* fopAcM_fastCreateItem2(const cXyz* i_pos, int i_itemNo, int i_itemBi
u8 item_no = check_itemno(i_itemNo);
u32 params = MAKE_ITEM_PARAMS(item_no, i_itemBitNo, 0xFF, param_5);
+ fopAc_ac_c* ret;
switch (i_itemNo) {
case fpcNm_ITEM_RECOVERY_FAILY:
- return fopAcM_fastCreate(PROC_Obj_Yousei, 0xFFFFFFFF, i_pos, i_roomNo, i_angle, i_scale, -1,
+ ret = fopAcM_fastCreate(PROC_Obj_Yousei, 0xFFFFFFFF, i_pos, i_roomNo, i_angle, i_scale, -1,
NULL, NULL);
+ break;
#if DEBUG
case fpcNm_ITEM_SMALL_KEY:
// "Small Key: Can't support map display, so program generation is prohibited!\n"
OS_REPORT_ERROR("小さい鍵:マップ表示対応出来ないので、プログラム生成禁止!\n");
- JUT_ASSERT(0, FALSE);
+ JUT_ASSERT(4268, FALSE);
break;
case fpcNm_ITEM_KANTERA:
// "Lantern: Program generation is prohibited!\n"
OS_REPORT_ERROR("カンテラ:プログラム生成禁止!\n");
- JUT_ASSERT(0, FALSE);
+ JUT_ASSERT(4272, FALSE);
break;
case fpcNm_ITEM_LIGHT_DROP:
// "Light Drop: Program generation is prohibited!\n"
OS_REPORT_ERROR("光の雫:プログラム生成禁止!\n");
- JUT_ASSERT(0, FALSE);
+ JUT_ASSERT(4276, FALSE);
break;
#endif
case fpcNm_ITEM_KAKERA_HEART:
case fpcNm_ITEM_UTAWA_HEART:
- return fopAcM_fastCreate(PROC_Obj_LifeContainer, params, i_pos, i_roomNo, i_angle, i_scale,
+ ret = fopAcM_fastCreate(PROC_Obj_LifeContainer, params, i_pos, i_roomNo, i_angle, i_scale,
-1, NULL, NULL);
+ break;
case fpcNm_ITEM_TRIPLE_HEART:
for (int i = 0; i < 2; i++) {
- fopAcM_fastCreate(PROC_ITEM, params, i_pos, i_roomNo, &item_angle, i_scale, -1, NULL,
+ ret = fopAcM_fastCreate(PROC_ITEM, params, i_pos, i_roomNo, &item_angle, i_scale, -1, NULL,
NULL);
item_angle.y = cM_rndFX(0x7FFF);
}
default:
- return fopAcM_fastCreate(PROC_ITEM, params, i_pos, i_roomNo, &item_angle, i_scale, -1, NULL,
+ ret = fopAcM_fastCreate(PROC_ITEM, params, i_pos, i_roomNo, &item_angle, i_scale, -1, NULL,
NULL);
}
+ return ret;
}
fopAc_ac_c* fopAcM_fastCreateItem(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, f32* i_speedF,
f32* i_speedY, int i_itemBitNo, int param_9,
createFunc i_createFunc) {
- JUT_ASSERT(0, 0 <= i_itemNo && i_itemNo < 256);
+ JUT_ASSERT(4324, 0 <= i_itemNo && i_itemNo < 256);
csXyz angle;
if (i_itemNo == fpcNm_ITEM_NONE) {
@@ -1446,31 +1503,35 @@ fopAc_ac_c* fopAcM_fastCreateItem(const cXyz* i_pos, int i_itemNo, int i_roomNo,
*i_speedF = 2.0f * *i_speedF;
}
+ fopAc_ac_c* ret;
+
switch (i_itemNo) {
case fpcNm_ITEM_RECOVERY_FAILY:
- return fopAcM_fastCreate(PROC_Obj_Yousei, 0xFFFFFFFF, i_pos, i_roomNo, i_angle, i_scale, -1,
+ ret = fopAcM_fastCreate(PROC_Obj_Yousei, 0xFFFFFFFF, i_pos, i_roomNo, i_angle, i_scale, -1,
NULL, NULL);
+ break;
#if DEBUG
case fpcNm_ITEM_SMALL_KEY:
// "Small Key: Can't support map display, so program generation is prohibited!\n"
OS_REPORT_ERROR("小さい鍵:マップ表示対応出来ないので、プログラム生成禁止!\n");
- JUT_ASSERT(0, FALSE);
+ JUT_ASSERT(4383, FALSE);
break;
case fpcNm_ITEM_KANTERA:
// "Lantern: Program generation is prohibited!\n"
OS_REPORT_ERROR("カンテラ:プログラム生成禁止!\n");
- JUT_ASSERT(0, FALSE);
+ JUT_ASSERT(4387, FALSE);
break;
case fpcNm_ITEM_LIGHT_DROP:
// "Light Drop: Program generation is prohibited!\n"
OS_REPORT_ERROR("光の雫:プログラム生成禁止!\n");
- JUT_ASSERT(0, FALSE);
+ JUT_ASSERT(4391, FALSE);
break;
#endif
case fpcNm_ITEM_KAKERA_HEART:
case fpcNm_ITEM_UTAWA_HEART:
- return fopAcM_fastCreate(PROC_Obj_LifeContainer, params, i_pos, i_roomNo, i_angle, i_scale,
+ ret = fopAcM_fastCreate(PROC_Obj_LifeContainer, params, i_pos, i_roomNo, i_angle, i_scale,
-1, NULL, NULL);
+ break;
case fpcNm_ITEM_TRIPLE_HEART:
for (i = 0; i < 2; i++) {
if (i_angle != NULL) {
@@ -1502,25 +1563,26 @@ fopAc_ac_c* fopAcM_fastCreateItem(const cXyz* i_pos, int i_itemNo, int i_roomNo,
}
angle.z = 0xFF;
- fopAc_ac_c* actor = (fopAc_ac_c*)fopAcM_fastCreate(PROC_ITEM, params, i_pos, i_roomNo,
+ ret = fopAcM_fastCreate(PROC_ITEM, params, i_pos, i_roomNo,
&angle, i_scale, -1, i_createFunc, NULL);
- if (actor != NULL) {
+ if (ret != NULL) {
if (i_speedF != NULL) {
- actor->speedF = *i_speedF;
+ ret->speedF = *i_speedF;
}
if (i_speedY != NULL) {
- actor->speed.y = *i_speedY;
+ ret->speed.y = *i_speedY;
}
}
-
- return actor;
}
+
+ return ret;
}
fpc_ProcID fopAcM_createBokkuri(u16 i_setId, const cXyz* i_pos, int i_itemNo, int i_itemBit,
int i_roomNo, const cXyz* param_6, int i_itemType, int param_8) {
+ u32 params = 0;
csXyz params_ex(0, 0, 0);
if (param_6 != NULL) {
params_ex.y = param_6->atan2sX_Z();
@@ -1528,7 +1590,6 @@ fpc_ProcID fopAcM_createBokkuri(u16 i_setId, const cXyz* i_pos, int i_itemNo, in
param_8 = 1;
}
- u32 params = 0;
daObjCarry_c::make_prm_bokkuri(&params, &params_ex, i_itemNo, i_itemBit, i_itemType, param_8);
return fopAcM_create(PROC_Obj_Carry, i_setId, params, i_pos, i_roomNo, &params_ex, NULL, -1, NULL);
}
@@ -1538,13 +1599,13 @@ fpc_ProcID fopAcM_createWarpHole(const cXyz* i_pos, const csXyz* i_angle, int i_
if (param_6 == 0xFF) {
param_6 = param_4;
}
- u32 actorParams;
- make_prm_warp_hole(&actorParams, param_5, param_6, param_4);
- return fopAcM_create(PROC_Obj_BossWarp, actorParams, i_pos, i_roomNo, i_angle, NULL, -1);
+ u32 actorParams = 0x17000000 + 0xFF;
+ u32 actorParamsOut = actorParams | (param_5 << 0x1B) | (param_6 << 0x10) | (param_4 << 0x8);
+ return fopAcM_create(PROC_Obj_BossWarp, actorParamsOut, i_pos, i_roomNo, i_angle, NULL, -1);
}
void* enemySearchJugge(void* i_actor, void* i_data) {
- if (i_actor != NULL && fopAc_IsActor(i_actor) && ((fopAc_ac_c*)i_actor)->group == fopAc_ENEMY_e)
+ if (i_actor != NULL && fopAcM_IsActor(i_actor) && fopAcM_GetGroup((fopAc_ac_c*)i_actor) == fopAc_ENEMY_e)
{
return i_actor;
} else {
@@ -1553,17 +1614,18 @@ void* enemySearchJugge(void* i_actor, void* i_data) {
}
fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 roomNo) {
- JUT_ASSERT(0, roomNo >= 0);
+ JUT_ASSERT(4659, roomNo >= 0);
- int procID = dStage_roomControl_c::getStatusProcID(roomNo);
- scene_class* roomProc = fopScnM_SearchByID(procID);
- JUT_ASSERT(0, roomProc != NULL);
+ scene_class* roomProc = fopScnM_SearchByID(dStage_roomControl_c::getStatusProcID(roomNo));
+ JUT_ASSERT(4662, roomProc != NULL);
- u32 actorID = ((daPy_py_c*)dComIfGp_getPlayer(0))->getGrabActorID();
- fopAc_ac_c* actor = fopAcM_SearchByID(actorID);
+ {
+ daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+ fopAc_ac_c* actor = fopAcM_SearchByID(player->getGrabActorID());
- if (actor != NULL && fopAcM_GetGroup(actor) == 2) {
- return actor;
+ if (actor != NULL && fopAcM_GetGroup(actor) == 2) {
+ return actor;
+ }
}
return (fopAc_ac_c*)fpcM_JudgeInLayer(fpcM_LayerID(roomProc), enemySearchJugge, NULL);
@@ -1571,9 +1633,11 @@ fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 roomNo) {
fpc_ProcID fopAcM_createDisappear(const fopAc_ac_c* i_actor, const cXyz* i_pos, u8 i_size,
u8 i_type, u8 i_enemyID) {
- return fopAcM_GetID(fopAcM_fastCreate(
- PROC_DISAPPEAR, (i_enemyID << 0x10) | (i_size << 0x8) | i_type, i_pos,
- fopAcM_GetRoomNo(i_actor), &i_actor->current.angle, NULL, 0xFF, NULL, NULL));
+ u32 param = (i_enemyID << 0x10) | (i_size << 0x8) | i_type;
+ fopAc_ac_c* actor = fopAcM_fastCreate(
+ PROC_DISAPPEAR, param, i_pos, fopAcM_GetRoomNo(i_actor), &i_actor->current.angle, NULL, 0xFF,
+ NULL, NULL);
+ return fopAcM_GetID(actor);
}
void fopAcM_setCarryNow(fopAc_ac_c* i_actor, int param_1) {
@@ -1589,14 +1653,11 @@ void fopAcM_cancelCarryNow(fopAc_ac_c* i_actor) {
if (fopAcM_checkCarryNow(i_actor)) {
i_actor->actor_status &= ~0x2000;
- s8 roomNo = fopAcM_GetHomeRoomNo(i_actor);
- if (roomNo != -1) {
- int procID = dStage_roomControl_c::getStatusProcID(fopAcM_GetRoomNo(i_actor));
- scene_class* roomProc = fopScnM_SearchByID(procID);
-
- if (roomProc != NULL) {
- fopAcM_setRoomLayer(i_actor, fopAcM_GetRoomNo(i_actor));
- }
+ if (fopAcM_GetHomeRoomNo(i_actor) != -1 &&
+ fopScnM_SearchByID(dStage_roomControl_c::getStatusProcID(fopAcM_GetRoomNo(i_actor))) !=
+ NULL)
+ {
+ fopAcM_setRoomLayer(i_actor, fopAcM_GetRoomNo(i_actor));
}
i_actor->shape_angle.z = 0;
@@ -1624,6 +1685,7 @@ BOOL fopAcM_otoCheck(fopAc_ac_c const* i_actor, f32 param_1) {
BOOL fopAcM_otherBgCheck(fopAc_ac_c const* param_0, fopAc_ac_c const* param_1) {
dBgS_LinChk linChk;
+ cXyz _;
cXyz start;
cXyz end;
@@ -1650,14 +1712,14 @@ BOOL fopAcM_wayBgCheck(fopAc_ac_c const* param_0, f32 param_1, f32 param_2) {
start = param_0->current.pos;
start.y += param_2;
- mDoMtx_YrotS((MtxP)calc_mtx, param_0->shape_angle.y);
+ cMtx_YrotS((MtxP)calc_mtx, param_0->shape_angle.y);
offset.x = 0.0f;
offset.y = 50.0f;
offset.z = param_1;
MtxPosition(&offset, &end);
- VECAdd(&end, &param_0->current.pos, &end);
+ end += param_0->current.pos;
linChk.Set(&start, &end, param_0);
@@ -1669,7 +1731,8 @@ BOOL fopAcM_wayBgCheck(fopAc_ac_c const* param_0, f32 param_1, f32 param_2) {
}
BOOL fopAcM_plAngleCheck(fopAc_ac_c const* i_actor, s16 i_angle) {
- s16 angle = i_actor->shape_angle.y - dComIfGp_getPlayer(0)->shape_angle.y;
+ fopAc_ac_c* player = dComIfGp_getPlayer(0);
+ s16 angle = i_actor->shape_angle.y - player->shape_angle.y;
if (angle <= i_angle && angle >= (s16)-i_angle) {
return FALSE;
}
@@ -1701,7 +1764,7 @@ void fopAcM_effSmokeSet1(u32* param_0, u32* param_1, cXyz const* param_2, csXyz
f32 param_4, dKy_tevstr_c const* param_5, int param_6) {
cXyz p2(param_2->x, param_2->y + 100.0f, param_2->z);
if (fopAcM_gc_c::gndCheck(&p2)) {
- p2.y = fopAcM_gc_c::getGroundY();
+ p2.y = fopAcM_gc_c::getGroundY() + TREG_F(7);
cXyz stack_18(param_4, param_4, param_4);
*param_0 =
dComIfGp_particle_setSimpleFoot(*param_0, param_1, *fopAcM_gc_c::getGroundCheck(), &p2,
@@ -1725,6 +1788,11 @@ void fopAcM_effHamonSet(u32* param_0, cXyz const* param_1, f32 param_2, f32 emit
}
s32 fopAcM_riverStream(cXyz* param_0, s16* param_1, f32* param_2, f32 param_3) {
+ (void)&param_0;
+ (void)&param_1;
+ (void)&param_2;
+ (void)&param_3;
+
return 0;
}
@@ -1737,14 +1805,14 @@ s32 fopAcM_carryOffRevise(fopAc_ac_c* param_0) {
start = player->current.pos;
start.y = param_0->current.pos.y;
- mDoMtx_YrotS((MtxP)calc_mtx, player->shape_angle.y);
+ cMtx_YrotS((MtxP)calc_mtx, player->shape_angle.y);
offset.x = 0.0f;
offset.y = param_0->current.pos.y - player->current.pos.y;
- offset.z = 150.0f;
+ offset.z = 150.0f + AREG_F(17);
MtxPosition(&offset, &end);
- VECAdd(&end, &player->current.pos, &end);
+ end += player->current.pos;
linChk.Set(&start, &end, param_0);
@@ -1786,11 +1854,12 @@ void fopAcM_setEffectMtx(const fopAc_ac_c* i_actor, const J3DModelData* modelDat
cXyz v1 = *pEyePos - camera->lookat.eye;
cXyz v2;
get_vectle_calc(&i_actor->tevStr.field_0x32c, pEyePos, &v2);
- Vec half;
+ cXyz half;
C_VECHalfAngle(&v1, &v2, &half);
Mtx mtx;
C_MTXLookAt(mtx, &cXyz::Zero, &cXyz::BaseY, &half);
- mDoMtx_stack_c::scaleS(1.0, 1.0, 1.0);
+ f32 scale = 1.0f + IREG_F(0);
+ mDoMtx_stack_c::scaleS(scale, scale, 1.0); //
static Mtx const mtx_adj = {
{0.5f, 0.0f, 0.0f, 0.5f},
{0.0f, -0.5f, 0.0f, 0.5f},
@@ -1798,19 +1867,19 @@ void fopAcM_setEffectMtx(const fopAc_ac_c* i_actor, const J3DModelData* modelDat
};
mDoMtx_stack_c::concat(mtx_adj);
mDoMtx_stack_c::concat(mtx);
- MtxP currentMtx = mDoMtx_stack_c::get();
- currentMtx[0][3] = 0.0;
- currentMtx[1][3] = 0.0;
- currentMtx[2][3] = 0.0;
+ mDoMtx_stack_c::get()[0][3] = 0.0;
+ mDoMtx_stack_c::get()[1][3] = 0.0;
+ mDoMtx_stack_c::get()[2][3] = 0.0;
Mtx mtx2;
- mDoMtx_copy(currentMtx, mtx2);
+ cMtx_copy(mDoMtx_stack_c::get(), mtx2);
for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
J3DMaterial* material = modelData->getMaterialNodePointer(i);
for (u32 j = 0; j < 8; j++) {
J3DTexMtx* texMtx = material->getTexMtx(j);
if (texMtx != NULL) {
- switch (texMtx->getTexMtxInfo().mInfo) {
+ J3DTexMtxInfo* info = &texMtx->getTexMtxInfo();
+ switch (info->mInfo) {
case 6:
texMtx->setEffectMtx(mtx2);
break;
@@ -1827,12 +1896,12 @@ const char* fopAcM_getProcNameString(const fopAc_ac_c* i_actor) {
}
static const fopAc_ac_c* fopAcM_findObjectCB(fopAc_ac_c const* i_actor, void* i_data) {
- fopAcM_search_prm* prm = (fopAcM_search_prm*)i_data;
-
if (!fopAcM_IsExecuting(fopAcM_GetID(i_actor))) {
return NULL;
}
+ fopAcM_search_prm* prm = (fopAcM_search_prm*)i_data;
+
if (prm->procname == fopAcM_GetProfName(i_actor) && prm->argument == i_actor->argument) {
if (prm->prm0 == 0 || prm->prm1 == (prm->prm0 & fopAcM_GetParam(i_actor))) {
return i_actor;
@@ -1878,12 +1947,12 @@ fopAc_ac_c* fopAcM_searchFromName4Event(char const* i_name, s16 i_eventID) {
prm.event_id = i_eventID;
strcpy(prm.name, i_name);
- char* chr = strchr(prm.name, ':');
+ char* chr = std::strchr(prm.name, ':');
if (chr != NULL) {
chr[0] = 0;
+ chr++;
prm.event_id = 0;
- chr++;
for (; *chr != 0; chr++) {
if (*chr < '0' || *chr > '9') {
prm.event_id = 0xFFFF;
@@ -1923,7 +1992,8 @@ s32 fopAcM_getWaterY(cXyz const* param_0, f32* o_waterY) {
void fpoAcM_relativePos(fopAc_ac_c const* i_actor, cXyz const* i_pos, cXyz* o_pos) {
s16 angle = -i_actor->shape_angle.y;
- cXyz pos = *i_pos - i_actor->current.pos;
+ cXyz pos;
+ pos = *i_pos - i_actor->current.pos;
o_pos->x = (pos.z * cM_ssin(angle)) + (pos.x * cM_scos(angle));
o_pos->y = pos.y;
@@ -1932,14 +2002,13 @@ void fpoAcM_relativePos(fopAc_ac_c const* i_actor, cXyz const* i_pos, cXyz* o_po
s32 fopAcM_getWaterStream(cXyz const* pos, cBgS_PolyInfo const& polyinfo, cXyz* speed,
int* power, BOOL param_4) {
- daTagStream_c* stream = daTagStream_c::getTop();
- if (stream != NULL) {
- for (stream = daTagStream_c::getTop(); stream != NULL; stream = stream->getNext()) {
+ if (daTagStream_c::getTop() != NULL) {
+ for (daTagStream_c* stream = daTagStream_c::getTop(); stream != NULL; stream = stream->getNext()) {
if (stream->checkStreamOn() && (!param_4 || stream->checkCanoeOn()) &&
stream->checkArea(pos))
{
*speed = stream->speed;
- *power = stream->getPower() & 0xff;
+ *power = stream->getPower();
return 1;
}
}
@@ -1977,7 +2046,11 @@ s16 fopAcM_getPolygonAngle(cBgS_PolyInfo const& poly, s16 param_1) {
s16 fopAcM_getPolygonAngle(cM3dGPla const* p_plane, s16 param_1) {
if (p_plane == NULL) {
+#if DEBUG
+ JUT_ASSERT(5810, FALSE);
+#else
return 0;
+#endif
}
f32 cos = cM_scos(p_plane->mNormal.atan2sX_Z() - param_1);
@@ -1992,6 +2065,10 @@ bool fopAcM_lc_c::lineCheck(cXyz const* i_start, cXyz const* i_end, fopAc_ac_c c
return dComIfG_Bgsp().LineCross(&mLineCheck);
}
+bool fopAcM_lc_c::dummyCheck(cM3dGPla* i_plane) {
+ return getTriPla(i_plane);
+}
+
bool fopAcM_gc_c::gndCheck(cXyz const* i_pos) {
mGndCheck.SetPos(i_pos);
mGroundY = (f32)dComIfG_Bgsp().GroundCross(&mGndCheck);
@@ -2021,4 +2098,12 @@ BOOL fopAcM_getNameString(const fopAc_ac_c* i_actor, char* o_name) {
return TRUE;
}
-void fopAcM_initManager() {}
+void fopAcM_initManager() {
+#if DEBUG
+ DummyCheckHeap_init();
+ if (lbl_8074C4DC != 0) {
+ DummyCheckHeap_create();
+ }
+ l_hio.entry();
+#endif
+}
diff --git a/src/f_op/f_op_actor_tag.cpp b/src/f_op/f_op_actor_tag.cpp
index b4a95012e5..2f0518b595 100644
--- a/src/f_op/f_op_actor_tag.cpp
+++ b/src/f_op/f_op_actor_tag.cpp
@@ -12,8 +12,8 @@ int fopAcTg_ToActorQ(create_tag_class* i_createTag) {
return cTg_Addition(&g_fopAcTg_Queue, i_createTag);
}
-int fopAcTg_ActorQTo(create_tag_class* i_createTag) {
- return cTg_SingleCutFromTree(i_createTag);
+void fopAcTg_ActorQTo(create_tag_class* i_createTag) {
+ int _ = cTg_SingleCutFromTree(i_createTag);
}
int fopAcTg_Init(create_tag_class* i_createTag, void* i_data) {
diff --git a/src/f_op/f_op_camera.cpp b/src/f_op/f_op_camera.cpp
index 3d17f6d4fa..c2d94d0a76 100644
--- a/src/f_op/f_op_camera.cpp
+++ b/src/f_op/f_op_camera.cpp
@@ -5,26 +5,42 @@
#include "f_op/f_op_camera.h"
#include "f_op/f_op_camera_mng.h"
+#include "f_ap/f_ap_game.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
#include "f_op/f_op_draw_tag.h"
static s32 fopCam_Draw(camera_class* i_this) {
s32 ret = 1;
+ #if DEBUG
+ fapGm_HIO_c::startCpuTimer();
+ #endif
+
if (!dComIfGp_isPauseFlag()) {
ret = fpcLf_DrawMethod(i_this->submethod, i_this);
}
+ #if DEBUG
+ fapGm_HIO_c::stopCpuTimer("カメラ(描画処理)"); // Camera (rendering process)
+ #endif
+
return ret;
}
static int fopCam_Execute(camera_class* i_this) {
int ret;
+ #if DEBUG
+ fapGm_HIO_c::startCpuTimer();
+ #endif
- if (!dComIfGp_isPauseFlag() && dScnPly_c::isPause()) {
+ if (!dComIfGp_isPauseFlag() && !dScnPly_c::isPause()) {
ret = fpcMtd_Execute((process_method_class*)i_this->submethod, i_this);
}
+ #if DEBUG
+ fapGm_HIO_c::stopCpuTimer("カメラ(計算処理)"); // Camera (computational processing)
+ #endif
+
return ret;
}
@@ -38,7 +54,8 @@ int fopCam_IsDelete(camera_class* i_this) {
}
int fopCam_Delete(camera_class* i_this) {
- int ret = fpcMtd_Delete((process_method_class*)i_this->submethod, i_this);
+ int ret = 0;
+ ret = fpcMtd_Delete((process_method_class*)i_this->submethod, i_this);
if (ret == 1) {
fopDwTg_DrawQTo(&i_this->create_tag);
}
@@ -48,6 +65,7 @@ int fopCam_Delete(camera_class* i_this) {
static int fopCam_Create(void* i_this) {
camera_class* a_this = (camera_class*)i_this;
+ int ret;
if (fpcM_IsFirstCreating(i_this)) {
camera_process_profile_definition* profile = (camera_process_profile_definition*)fpcM_GetProfile(i_this);
@@ -61,10 +79,9 @@ static int fopCam_Create(void* i_this) {
}
}
- int ret = fpcMtd_Create(&a_this->submethod->base, a_this);
+ ret = fpcMtd_Create(&a_this->submethod->base, a_this);
if (ret == cPhs_COMPLEATE_e) {
- s32 priority = fpcM_DrawPriority(a_this);
- fopDwTg_ToDrawQ(&a_this->create_tag, priority);
+ fopDwTg_ToDrawQ(&a_this->create_tag, fpcM_DrawPriority(a_this));
}
return ret;
diff --git a/src/f_op/f_op_camera_mng.cpp b/src/f_op/f_op_camera_mng.cpp
index ea40325226..e8a035a40e 100644
--- a/src/f_op/f_op_camera_mng.cpp
+++ b/src/f_op/f_op_camera_mng.cpp
@@ -4,8 +4,6 @@
*/
#include "f_op/f_op_camera_mng.h"
-#include "f_pc/f_pc_layer.h"
-#include "f_pc/f_pc_stdcreate_req.h"
static fpc_ProcID l_fopCamM_id[4];
@@ -13,6 +11,10 @@ u32 fopCamM_GetParam(camera_class* i_this) {
return fpcM_GetParam(i_this);
}
+void dummy(fpc_ProcID i_procName) {
+ fpcM_SearchByID(i_procName);
+}
+
fpc_ProcID fopCamM_Create(int i_cameraIdx, s16 i_procName, void* i_append) {
l_fopCamM_id[i_cameraIdx] = fpcM_Create(i_procName, NULL, i_append);
return l_fopCamM_id[i_cameraIdx];
diff --git a/src/f_op/f_op_draw_iter.cpp b/src/f_op/f_op_draw_iter.cpp
index 8f9150acfa..de1805762a 100644
--- a/src/f_op/f_op_draw_iter.cpp
+++ b/src/f_op/f_op_draw_iter.cpp
@@ -12,8 +12,8 @@ static int l_fopDwTg_id;
create_tag_class* fopDwIt_GetTag() {
while (l_fopDwTg_id + 1 < g_fopDwTg_Queue.mNumLists) {
- l_fopDwTg_id++;
- node_class* node = g_fopDwTg_Queue.mpLists[l_fopDwTg_id].mpHead;
+ node_list_class* list = &g_fopDwTg_Queue.mpLists[++l_fopDwTg_id];
+ node_class* node = list->mpHead;
if (node != NULL) {
return (create_tag_class*)node;
@@ -30,13 +30,13 @@ create_tag_class* fopDwIt_Begin() {
if (tag != NULL) {
return tag;
}
- return tag = fopDwIt_GetTag();
+ return fopDwIt_GetTag();
}
create_tag_class* fopDwIt_Next(create_tag_class* i_createTag) {
create_tag_class* tag = (create_tag_class*)i_createTag->mpNode.mpNextNode;
if (tag == NULL) {
- tag = fopDwIt_GetTag();
+ return fopDwIt_GetTag();
}
return tag;
}
diff --git a/src/f_op/f_op_kankyo.cpp b/src/f_op/f_op_kankyo.cpp
index 7a9b170786..c65007622a 100644
--- a/src/f_op/f_op_kankyo.cpp
+++ b/src/f_op/f_op_kankyo.cpp
@@ -6,38 +6,59 @@
#include "f_op/f_op_kankyo.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
+#include "f_ap/f_ap_game.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_kankyo_mng.h"
+static int fopKy_KANKYO_TYPE;
+
+void fopKy_IsKankyo(void* i_this) {
+ fpcM_IsJustType(fopKy_KANKYO_TYPE, ((kankyo_class*)i_this)->type);
+}
+
static int fopKy_Draw(void* i_this) {
int ret;
- kankyo_class* a_this = (kankyo_class*)i_this;
+
+#if DEBUG
+ fapGm_HIO_c::startCpuTimer();
+#endif
if (!dComIfGp_isPauseFlag()) {
- ret = fpcLf_DrawMethod(a_this->sub_method, i_this);
+ ret = fpcLf_DrawMethod(((kankyo_class*)i_this)->sub_method, i_this);
}
+#if DEBUG
+ fapGm_HIO_c::stopCpuTimer("環境関係(描画処理)"); // Environmental aspects (rendering processing)
+#endif
+
return ret;
}
static int fopKy_Execute(void* i_this) {
- int ret;
kankyo_class* a_this = (kankyo_class*)i_this;
+ int ret;
+
+#if DEBUG
+ fapGm_HIO_c::startCpuTimer();
+#endif
- if (dScnPly_c::isPause() && (!dComIfGp_isPauseFlag() || fpcM_GetName(i_this) == PROC_ENVSE)) {
- ret = fpcMtd_Execute(&a_this->sub_method->base, i_this);
+ if (!dScnPly_c::isPause() && (!dComIfGp_isPauseFlag() || fpcM_GetName(a_this) == PROC_ENVSE)) {
+ ret = fpcMtd_Execute(&((kankyo_class*)i_this)->sub_method->base, i_this);
}
+#if DEBUG
+ fapGm_HIO_c::stopCpuTimer("環境関係(計算処理)"); // Environmental aspects (computational processing)
+#endif
+
return ret;
}
static int fopKy_IsDelete(void* i_this) {
int ret;
- kankyo_class* a_this = (kankyo_class*)i_this;
- ret = fpcMtd_IsDelete(&a_this->sub_method->base, a_this);
+ ret = fpcMtd_IsDelete(&((kankyo_class*)i_this)->sub_method->base, i_this);
if (ret == 1) {
- fopDwTg_DrawQTo(&a_this->draw_tag);
+ fopDwTg_DrawQTo(&((kankyo_class*)i_this)->draw_tag);
}
return ret;
@@ -52,15 +73,14 @@ static int fopKy_Delete(void* i_this) {
return ret;
}
-static int fopKy_KANKYO_TYPE;
-
static int fopKy_Create(void* i_this) {
kankyo_class* a_this = (kankyo_class*)i_this;
+ int ret;
if (fpcM_IsFirstCreating(i_this)) {
kankyo_process_profile_definition* profile = (kankyo_process_profile_definition*)fpcM_GetProfile(i_this);
- a_this->type = fpcBs_MakeOfType(&fopKy_KANKYO_TYPE);
+ a_this->type = fpcM_MakeOfType(&fopKy_KANKYO_TYPE);
a_this->sub_method = profile->sub_method;
fopDwTg_Init(&a_this->draw_tag, a_this);
@@ -73,10 +93,9 @@ static int fopKy_Create(void* i_this) {
}
}
- int ret = fpcMtd_Create(&a_this->sub_method->base, a_this);
+ ret = fpcMtd_Create(&a_this->sub_method->base, a_this);
if (ret == cPhs_COMPLEATE_e) {
- s32 priority = fpcM_DrawPriority(a_this);
- fopDwTg_ToDrawQ(&a_this->draw_tag, priority);
+ fopDwTg_ToDrawQ(&a_this->draw_tag, fpcM_DrawPriority(a_this));
}
return ret;
diff --git a/src/f_op/f_op_kankyo_mng.cpp b/src/f_op/f_op_kankyo_mng.cpp
index d09a6be0df..0093173817 100644
--- a/src/f_op/f_op_kankyo_mng.cpp
+++ b/src/f_op/f_op_kankyo_mng.cpp
@@ -7,12 +7,22 @@
#include "SSystem/SComponent/c_malloc.h"
#include "d/d_com_inf_game.h"
+void dummy(fpcLyIt_JudgeFunc i_createFunc, void* i_this) {
+ fpcM_Search(i_createFunc, i_this);
+}
+
+void fopKyM_IsKy(void* i_this) {
+ fopKy_IsKankyo((fopKyM_prm_class*)i_this);
+}
+
fopKyM_prm_class* fopKyM_CreateAppend() {
fopKyM_prm_class* append = (fopKyM_prm_class*)cMl::memalignB(-4, sizeof(fopKyM_prm_class));
if (append != NULL) {
cLib_memSet(append, 0, sizeof(fopKyM_prm_class));
- append->scale.set(1.0f, 1.0f, 1.0f);
+ append->scale.x = 1.0f;
+ append->scale.y = 1.0f;
+ append->scale.z = 1.0f;
}
return append;
}
@@ -71,9 +81,7 @@ fpc_ProcID fopKyM_createWpillar(cXyz const* i_pos, f32 scale, int i_param) {
}
append->pos = *i_pos;
- append->scale.x = scale;
- append->scale.y = scale;
- append->scale.z = scale;
+ append->scale.set(scale, scale, scale);
append->parameters = i_param;
return fopKyM_Create(PROC_WPILLAR, NULL, append);
@@ -86,9 +94,7 @@ fpc_ProcID fopKyM_createMpillar(cXyz const* i_pos, f32 i_size) {
};
cXyz scale;
- scale.x = i_size;
- scale.y = i_size;
- scale.z = i_size;
+ scale.setall(i_size);
for (int i = 0; i < 2; i++) {
dComIfGp_particle_set(m_name[i], i_pos, NULL, &scale);
diff --git a/src/f_op/f_op_msg.cpp b/src/f_op/f_op_msg.cpp
index 4b9ad8afe6..f5cbf98b1c 100644
--- a/src/f_op/f_op_msg.cpp
+++ b/src/f_op/f_op_msg.cpp
@@ -5,32 +5,52 @@
#include "f_op/f_op_msg.h"
#include "d/d_s_play.h"
+#include "f_ap/f_ap_game.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_msg_mng.h"
#include "f_pc/f_pc_manager.h"
+#include "m_Do/m_Do_machine.h"
static int fopMsg_Draw(void* i_this) {
- msg_class* a_this = (msg_class*)i_this;
- return fpcLf_DrawMethod(a_this->sub_method, i_this);
+#if DEBUG
+ fapGm_HIO_c::startCpuTimer();
+#endif
+ s32 ret = fpcLf_DrawMethod(((msg_class*)i_this)->sub_method, i_this);
+#if DEBUG
+ fapGm_HIO_c::stopCpuTimer("2D関係(描画処理)"); // 2D graphics (rendering)
+#endif
+ return ret;
}
static int fopMsg_Execute(void* i_this) {
msg_class* a_this = (msg_class*)i_this;
-
int ret = 1;
- if (dScnPly_c::isPause()) {
- ret = fpcMtd_Execute(&a_this->sub_method->base, i_this);
+#if DEBUG
+ fapGm_HIO_c::startCpuTimer();
+#endif
+ if (!dScnPly_c::isPause()) {
+#if DEBUG
+ if (fopMsg::MemCheck) {
+ mDoMch_HeapCheckAll();
+ }
+#endif
+ ret = fpcMtd_Execute(&((msg_class*)i_this)->sub_method->base, i_this);
+#if DEBUG
+ if (fopMsg::MemCheck) {
+ mDoMch_HeapCheckAll();
+ }
+#endif
}
-
+#if DEBUG
+ fapGm_HIO_c::stopCpuTimer("2D関係(計算処理)"); // 2D graphics (computational processing)
+#endif
return ret;
}
static int fopMsg_IsDelete(void* i_this) {
- msg_class* a_this = (msg_class*)i_this;
-
- int ret = fpcMtd_IsDelete(&a_this->sub_method->base, i_this);
+ int ret = fpcMtd_IsDelete(&((msg_class*)i_this)->sub_method->base, i_this);
if (ret == 1) {
- fopDwTg_DrawQTo(&a_this->draw_tag);
+ fopDwTg_DrawQTo(&((msg_class*)i_this)->draw_tag);
}
return ret;
@@ -39,7 +59,7 @@ static int fopMsg_IsDelete(void* i_this) {
static int fopMsg_Delete(void* i_this) {
msg_class* a_this = (msg_class*)i_this;
- int ret = fpcMtd_Delete(&a_this->sub_method->base, i_this);
+ int ret = fpcMtd_Delete(&((msg_class*)i_this)->sub_method->base, i_this);
fopDwTg_DrawQTo(&a_this->draw_tag);
return ret;
@@ -53,12 +73,14 @@ static int fopMsg_MSG_TYPE;
int fopMsg_Create(void* i_this) {
msg_class* a_this = (msg_class*)i_this;
+ int ret;
- if (fpcM_IsFirstCreating(a_this)) {
- msg_process_profile_definition* profile = (msg_process_profile_definition*)fpcM_GetProfile(i_this);
- a_this->type = fpcBs_MakeOfType(&fopMsg_MSG_TYPE);
+ if (fpcM_IsFirstCreating(i_this)) {
+ msg_process_profile_definition* profile =
+ (msg_process_profile_definition*)fpcM_GetProfile(i_this);
+ a_this->type = fpcM_MakeOfType(&fopMsg_MSG_TYPE);
a_this->sub_method = profile->sub_method;
-
+
fopDwTg_Init(&a_this->draw_tag, a_this);
fopMsg_prm_class* append = fopMsgM_GetAppend(a_this);
@@ -71,10 +93,9 @@ int fopMsg_Create(void* i_this) {
}
}
- int ret = fpcMtd_Create(&a_this->sub_method->base, a_this);
+ ret = fpcMtd_Create(&a_this->sub_method->base, a_this);
if (ret == cPhs_COMPLEATE_e) {
- s32 priority = fpcM_DrawPriority(a_this);
- fopDwTg_ToDrawQ(&a_this->draw_tag, priority);
+ fopDwTg_ToDrawQ(&a_this->draw_tag, fpcM_DrawPriority(a_this));
}
return ret;
diff --git a/src/f_op/f_op_overlap.cpp b/src/f_op/f_op_overlap.cpp
index 6625931ac9..557e9bda08 100644
--- a/src/f_op/f_op_overlap.cpp
+++ b/src/f_op/f_op_overlap.cpp
@@ -4,26 +4,34 @@
*/
#include "f_op/f_op_overlap.h"
+#include "JSystem/JKernel/JKRExpHeap.h"
#include "f_pc/f_pc_manager.h"
+#include "m_Do/m_Do_ext.h"
static s32 fopOvlp_Draw(void* i_this) {
- overlap_task_class* a_this = (overlap_task_class*)i_this;
- return fpcLf_DrawMethod(a_this->submethod, i_this);
+ s32 ret = fpcLf_DrawMethod(((overlap_task_class*)i_this)->submethod, i_this);
+ return ret;
}
static s32 fopOvlp_Execute(void* i_this) {
- overlap_task_class* a_this = (overlap_task_class*)i_this;
- return fpcMtd_Execute(&a_this->submethod->base, i_this);
+ s32 ret = fpcMtd_Execute(&((overlap_task_class*)i_this)->submethod->base, i_this);
+ return ret;
}
static s32 fopOvlp_IsDelete(void* i_this) {
- overlap_task_class* a_this = (overlap_task_class*)i_this;
- return fpcMtd_IsDelete(&a_this->submethod->base, i_this);
+ s32 ret = fpcMtd_IsDelete(&((overlap_task_class*)i_this)->submethod->base, i_this);
+ return ret;
}
static s32 fopOvlp_Delete(void* i_this) {
- overlap_task_class* a_this = (overlap_task_class*)i_this;
- return fpcMtd_Delete(&a_this->submethod->base, i_this);
+ s32 ret = 0;
+ ret = fpcMtd_Delete(&((overlap_task_class*)i_this)->submethod->base, i_this);
+#if DEBUG
+ if (ret == 1 && mDoExt_getSafeZeldaHeapSize() >= 0) {
+ mDoExt_addSafeZeldaHeapSize(mDoExt_getZeldaHeap()->getSize(i_this));
+ }
+#endif
+ return ret;
}
static s32 fopOvlp_Create(void* i_this) {
@@ -36,9 +44,15 @@ static s32 fopOvlp_Create(void* i_this) {
cReq_Create(&a_this->request, 1);
a_this->submethod = profile->sub_method;
a_this->scene_id = fpcM_ERROR_PROCESS_ID_e;
+#if DEBUG
+ if (mDoExt_getSafeZeldaHeapSize() >= 0) {
+ mDoExt_addSafeZeldaHeapSize(-mDoExt_getZeldaHeap()->getSize(i_this));
+ }
+#endif
}
- return fpcMtd_Create(&a_this->submethod->base, a_this);
+ s32 ret = fpcMtd_Create(&a_this->submethod->base, a_this);
+ return ret;
}
leafdraw_method_class g_fopOvlp_Method = {
diff --git a/src/f_op/f_op_overlap_mng.cpp b/src/f_op/f_op_overlap_mng.cpp
index 5ed2a95de8..844b18a16a 100644
--- a/src/f_op/f_op_overlap_mng.cpp
+++ b/src/f_op/f_op_overlap_mng.cpp
@@ -4,29 +4,32 @@
*/
#include "SSystem/SComponent/c_request.h"
+#include "m_Do/m_Do_controller_pad.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_overlap_req.h"
+#include "f_op/f_op_scene_mng.h"
#include "f_op/f_op_scene_pause.h"
-#include "f_pc/f_pc_executor.h"
// making it not an array put it in .bss
static overlap_request_class* l_fopOvlpM_overlap[1] = {NULL};
int fopOvlpM_SceneIsStop() {
if (l_fopOvlpM_overlap[0] != NULL) {
- return fopScnPause_Enable(
- (scene_class*)fpcEx_SearchByID(l_fopOvlpM_overlap[0]->overlap_task->scene_id));
+ fpc_ProcID scene_id = l_fopOvlpM_overlap[0]->overlap_task->scene_id;
+ scene_class* cls = (scene_class*)fpcM_SearchByID(scene_id);
+ return fopScnM_PauseEnable(cls);
}
-
+
return 0;
}
int fopOvlpM_SceneIsStart() {
if (l_fopOvlpM_overlap[0] != NULL) {
- return fopScnPause_Disable(
- (scene_class*)fpcEx_SearchByID(l_fopOvlpM_overlap[0]->overlap_task->scene_id));
+ fpc_ProcID scene_id = l_fopOvlpM_overlap[0]->overlap_task->scene_id;
+ scene_class* cls = (scene_class*)fpcM_SearchByID(scene_id);
+ return fopScnM_PauseDisable(cls);
}
-
+
return 0;
}
@@ -45,23 +48,31 @@ void fopOvlpM_ToldAboutID(fpc_ProcID i_sceneId) {
}
int fopOvlpM_IsPeek() {
- return l_fopOvlpM_overlap[0] != NULL ? l_fopOvlpM_overlap[0]->field_0x8 : FALSE;
+ if (l_fopOvlpM_overlap[0] != NULL) {
+ return l_fopOvlpM_overlap[0]->field_0x8;
+ }
+ return FALSE;
}
int fopOvlpM_IsDone() {
- return l_fopOvlpM_overlap[0] != NULL ? cReq_Is_Done(&l_fopOvlpM_overlap[0]->base) : FALSE;
+ if (l_fopOvlpM_overlap[0] != NULL) {
+ return cReq_Is_Done(&l_fopOvlpM_overlap[0]->base);
+ }
+ return FALSE;
}
int fopOvlpM_IsDoingReq() {
if (l_fopOvlpM_overlap[0] != NULL && l_fopOvlpM_overlap[0]->field_0x4 == 1) {
return 1;
}
-
- return 0;
+ return FALSE;
}
int fopOvlpM_ClearOfReq() {
- return l_fopOvlpM_overlap[0] != NULL ? fopOvlpReq_OverlapClr(l_fopOvlpM_overlap[0]) : 0;
+ if (l_fopOvlpM_overlap[0] != NULL) {
+ return fopOvlpReq_OverlapClr(l_fopOvlpM_overlap[0]);
+ }
+ return FALSE;
}
static overlap_request_class l_fopOvlpM_Request;
@@ -94,6 +105,12 @@ int fopOvlpM_Cancel() {
if (fopOvlpReq_Cancel(l_fopOvlpM_overlap[0]) == true) {
l_fopOvlpM_overlap[0] = NULL;
+#if DEBUG
+ BOOL state = mDoCPd_c::isConnect(PAD_3);
+ if (state) {
+ JUT_WARN(336, "%s", "fopOvlpM_Cancel SUCCESSED");
+ }
+#endif
return 1;
}
diff --git a/src/f_op/f_op_overlap_req.cpp b/src/f_op/f_op_overlap_req.cpp
index 112809a706..28d0a743cc 100644
--- a/src/f_op/f_op_overlap_req.cpp
+++ b/src/f_op/f_op_overlap_req.cpp
@@ -80,7 +80,7 @@ static int fopOvlpReq_phase_IsCreated(overlap_request_class* i_overlapReq) {
static int fopOvlpReq_phase_Create(overlap_request_class* i_overlapReq) {
fpcLy_SetCurrentLayer(i_overlapReq->layer);
i_overlapReq->request_id =
- fpcSCtRq_Request(fpcLy_CurrentLayer(), i_overlapReq->procname, NULL, NULL, NULL);
+ fpcM_Create(i_overlapReq->procname, NULL, NULL);
return cPhs_NEXT_e;
}
@@ -98,8 +98,7 @@ overlap_request_class* fopOvlpReq_Request(overlap_request_class* i_overlapReq, s
};
if (i_overlapReq->field_0x4 == 1) {
- i_overlapReq = NULL;
- return i_overlapReq;
+ return NULL;
}
cReq_Command(&i_overlapReq->base, 1);
@@ -116,9 +115,7 @@ overlap_request_class* fopOvlpReq_Request(overlap_request_class* i_overlapReq, s
}
int fopOvlpReq_Handler(overlap_request_class* i_overlapReq) {
- int phase_state = cPhs_Do(&i_overlapReq->phase_req, i_overlapReq);
-
- switch (phase_state) {
+ switch (cPhs_Do(&i_overlapReq->phase_req, i_overlapReq)) {
case cPhs_NEXT_e:
return fopOvlpReq_Handler(i_overlapReq);
case cPhs_INIT_e:
@@ -136,11 +133,17 @@ int fopOvlpReq_Handler(overlap_request_class* i_overlapReq) {
}
int fopOvlpReq_Cancel(overlap_request_class* i_overlapReq) {
- return fopOvlpReq_phase_Done(i_overlapReq) == cPhs_NEXT_e ? TRUE : FALSE;
+ if (fopOvlpReq_phase_Done(i_overlapReq) == cPhs_NEXT_e) {
+ return TRUE;
+ }
+ return FALSE;
}
int fopOvlpReq_Is_PeektimeLimit(overlap_request_class* i_overlapReq) {
- return i_overlapReq->peektime == 0 ? TRUE : FALSE;
+ if (i_overlapReq->peektime == 0) {
+ return TRUE;
+ }
+ return FALSE;
}
void fopOvlpReq_SetPeektime(overlap_request_class* i_overlapReq, u16 i_peektime) {
diff --git a/src/f_op/f_op_scene.cpp b/src/f_op/f_op_scene.cpp
index 68624b5548..97a0124b09 100644
--- a/src/f_op/f_op_scene.cpp
+++ b/src/f_op/f_op_scene.cpp
@@ -5,13 +5,17 @@
#include "f_op/f_op_scene.h"
#include "f_pc/f_pc_manager.h"
+#include "f_op/f_op_scene_mng.h"
+#include "m_Do/m_Do_hostIO.h"
static int fopScn_Draw(scene_class* i_this) {
- return fpcNd_DrawMethod((nodedraw_method_class*)i_this->submethod, i_this);
+ int ret = fpcNd_DrawMethod((nodedraw_method_class*)i_this->submethod, i_this);
+ return ret;
}
static int fopScn_Execute(scene_class* i_this) {
- return fpcMtd_Execute((process_method_class*)i_this->submethod, i_this);
+ int ret = fpcMtd_Execute((process_method_class*)i_this->submethod, i_this);
+ return ret;
}
static int fopScn_IsDelete(void* i_this) {
@@ -20,15 +24,21 @@ static int fopScn_IsDelete(void* i_this) {
static int fopScn_Delete(void* i_this) {
scene_class* scene = (scene_class*)i_this;
- int ret = fpcMtd_Delete((process_method_class*)scene->submethod, scene);
+ int ret = 0;
+ ret = fpcMtd_Delete((process_method_class*)scene->submethod, scene);
if (ret == 1) {
fopScnTg_QueueTo(&scene->scene_tag);
}
+#if DEBUG
+ mDoHIO_update();
+#endif
return ret;
}
static int fopScn_Create(void* i_this) {
scene_class* scene = (scene_class*)i_this;
+ int ret;
+
if (fpcM_IsFirstCreating(i_this)) {
scene_process_profile_definition* profile = (scene_process_profile_definition*)fpcM_GetProfile(i_this);
scene->submethod = profile->submethod;
@@ -36,13 +46,15 @@ static int fopScn_Create(void* i_this) {
fopScnTg_Init(&scene->scene_tag, i_this);
fopScnTg_ToQueue(&scene->scene_tag);
- u32* append = (u32*)fpcM_GetAppend(i_this);
+ u32* append = (u32*)fopScnM_GetAppend(i_this);
if (append != NULL) {
- scene->base.base.parameters = *append;
+ fopScnM_SetParam(i_this, *append);
}
}
- return fpcMtd_Create((process_method_class*)scene->submethod, i_this);
+
+ ret = fpcMtd_Create((process_method_class*)scene->submethod, i_this);
+ return ret;
}
leafdraw_method_class g_fopScn_Method = {
diff --git a/src/f_op/f_op_scene_mng.cpp b/src/f_op/f_op_scene_mng.cpp
index b547549200..ba1f322139 100644
--- a/src/f_op/f_op_scene_mng.cpp
+++ b/src/f_op/f_op_scene_mng.cpp
@@ -4,6 +4,7 @@
*/
#include "f_op/f_op_scene_mng.h"
+#include "JSystem/JUtility/JUTAssert.h"
#include "f_op/f_op_scene_iter.h"
#include "f_op/f_op_scene_req.h"
@@ -24,13 +25,11 @@ int fopScnM_ChangeReq(scene_class* i_scene, s16 i_procName, s16 param_3, u16 par
}
fpc_ProcID fopScnM_DeleteReq(scene_class* i_scene) {
- fpc_ProcID request_id = fopScnRq_Request(1, i_scene, 0x7FFF, NULL, 0x7FFF, 0);
- return request_id != fpcM_ERROR_PROCESS_ID_e;
+ return fopScnRq_Request(1, i_scene, 0x7FFF, NULL, 0x7FFF, 0) != fpcM_ERROR_PROCESS_ID_e;
}
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, u32 i_data) {
- fpc_ProcID request_id = fopScnRq_Request(0, 0, i_procName, (void*)i_data, param_2, param_3);
- return request_id != fpcM_ERROR_PROCESS_ID_e;
+ return fopScnRq_Request(0, 0, i_procName, (void*)i_data, param_2, param_3) != fpcM_ERROR_PROCESS_ID_e;
}
u32 fopScnM_ReRequest(s16 i_procName, u32 i_data) {
@@ -42,7 +41,14 @@ u32 fopScnM_ReRequest(s16 i_procName, u32 i_data) {
}
void fopScnM_Management() {
+#if DEBUG
+ if (fopScnRq_Handler()) {
+ return;
+ };
+ JUT_ASSERT(326, 0);
+#else
fopScnRq_Handler();
+#endif
}
void fopScnM_Init() {}
diff --git a/src/f_op/f_op_scene_pause.cpp b/src/f_op/f_op_scene_pause.cpp
index 3628f188e8..db98067143 100644
--- a/src/f_op/f_op_scene_pause.cpp
+++ b/src/f_op/f_op_scene_pause.cpp
@@ -19,7 +19,7 @@ int fopScnPause_Enable(scene_class* i_scene) {
int fopScnPause_Disable(scene_class* i_scene) {
if (i_scene != NULL) {
- process_node_class* process_node = i_scene->base.base.layer_tag.layer->process_node;
+ process_node_class* process_node = fpcM_Layer(i_scene);
if (process_node == NULL) {
fpcM_PauseDisable(i_scene, 1);
diff --git a/src/f_op/f_op_scene_req.cpp b/src/f_op/f_op_scene_req.cpp
index 8bf1afd91f..d3136962ae 100644
--- a/src/f_op/f_op_scene_req.cpp
+++ b/src/f_op/f_op_scene_req.cpp
@@ -11,11 +11,13 @@
#include "f_pc/f_pc_manager.h"
static cPhs__Step fopScnRq_phase_ClearOverlap(scene_request_class* i_sceneReq) {
+ cPhs__Step rv;
if (fopOvlpM_ClearOfReq() == 1) {
- return cPhs_NEXT_e;
+ rv = cPhs_NEXT_e;
} else {
- return cPhs_INIT_e;
+ rv = cPhs_INIT_e;
}
+ return rv;
}
static cPhs__Step fopScnRq_phase_Execute(scene_request_class* i_sceneReq) {
@@ -23,26 +25,31 @@ static cPhs__Step fopScnRq_phase_Execute(scene_request_class* i_sceneReq) {
}
static cPhs__Step fopScnRq_phase_IsDoingOverlap(scene_request_class* i_sceneReq) {
+ cPhs__Step rv;
if (fopOvlpM_IsDoingReq() == 1) {
- return cPhs_NEXT_e;
+ rv = cPhs_NEXT_e;
} else {
- return cPhs_INIT_e;
+ rv = cPhs_INIT_e;
}
+ return rv;
}
static cPhs__Step fopScnRq_phase_IsDoneOverlap(scene_request_class* i_sceneReq) {
+ cPhs__Step rv;
if (fopOvlpM_IsDone() == 1) {
- return cPhs_NEXT_e;
+ rv = cPhs_NEXT_e;
} else {
- return cPhs_INIT_e;
+ rv = cPhs_INIT_e;
}
+ return rv;
}
static BOOL l_fopScnRq_IsUsingOfOverlap;
static cPhs__Step fopScnRq_phase_Done(scene_request_class* i_sceneReq) {
if (i_sceneReq->create_request.parameters != 1) {
- fopScnPause_Disable((scene_class*)fpcEx_SearchByID(i_sceneReq->create_request.creating_id));
+ scene_class* scene = (scene_class*)fpcM_SearchByID(i_sceneReq->create_request.creating_id);
+ fopScnPause_Disable(scene);
}
l_fopScnRq_IsUsingOfOverlap = FALSE;
@@ -55,6 +62,9 @@ static void fopScnRq_Execute(scene_request_class* i_sceneReq) {
switch (phase_state) {
case cPhs_NEXT_e:
fopScnRq_Execute(i_sceneReq);
+ break;
+ default:
+ break;
}
}
@@ -77,9 +87,11 @@ static int fopScnRq_Cancel(scene_request_class* i_sceneReq) {
static scene_request_class* fopScnRq_FadeRequest(s16 i_procname, u16 i_peektime) {
overlap_request_class* req = NULL;
- if (!l_fopScnRq_IsUsingOfOverlap && (req = fopOvlpM_Request(i_procname, i_peektime), req != NULL))
- {
- l_fopScnRq_IsUsingOfOverlap = TRUE;
+ if (!l_fopScnRq_IsUsingOfOverlap) {
+ req = fopOvlpM_Request(i_procname, i_peektime);
+ if (req != NULL) {
+ l_fopScnRq_IsUsingOfOverlap = TRUE;
+ }
}
return (scene_request_class*)req;
@@ -145,6 +157,6 @@ s32 fopScnRq_ReRequest(fpc_ProcID i_requestId, s16 i_procName, void* i_data) {
return fpcNdRq_ReRequest(i_requestId, i_procName, i_data);
}
-void fopScnRq_Handler() {
+int fopScnRq_Handler() {
fpcNdRq_Handler();
}
diff --git a/src/f_op/f_op_view.cpp b/src/f_op/f_op_view.cpp
index 0265048740..c48f7eb0f7 100644
--- a/src/f_op/f_op_view.cpp
+++ b/src/f_op/f_op_view.cpp
@@ -6,31 +6,36 @@
#include "f_op/f_op_view.h"
#include "f_pc/f_pc_manager.h"
-void fopVw_Draw(view_class* i_this) {
- fpcLf_DrawMethod(i_this->sub_method, i_this);
+s32 fopVw_Draw(view_class* i_this) {
+ int ret = fpcLf_DrawMethod(i_this->sub_method, i_this);
+ return ret;
}
-void fopVw_Execute(view_class* i_this) {
- fpcMtd_Execute(&i_this->sub_method->base, i_this);
+s32 fopVw_Execute(view_class* i_this) {
+ int ret = fpcMtd_Execute(&i_this->sub_method->base, i_this);
+ return ret;
}
s32 fopVw_IsDelete(void* i_this) {
- view_class* a_this = (view_class*)i_this;
- return fpcMtd_IsDelete(&a_this->sub_method->base, a_this);
+ int ret = fpcMtd_IsDelete(&((view_class*)i_this)->sub_method->base, i_this);
+ return ret;
}
s32 fopVw_Delete(view_class* i_this) {
- return fpcMtd_Delete(&i_this->sub_method->base, i_this);
+ int ret = fpcMtd_Delete(&i_this->sub_method->base, i_this);
+ return ret;
}
s32 fopVw_Create(void* i_this) {
view_class* a_this = (view_class*)i_this;
+ int ret;
- view_process_profile_definition* profile = (view_process_profile_definition*)fpcM_GetProfile(a_this);
+ view_process_profile_definition* profile = (view_process_profile_definition*)fpcM_GetProfile(i_this);
a_this->sub_method = profile->sub_method;
a_this->field_0xc4 = profile->unk_0x28;
- return fpcMtd_Create(&a_this->sub_method->base, a_this);
+ ret = fpcMtd_Create(&a_this->sub_method->base, a_this);
+ return ret;
}
leafdraw_method_class g_fopVw_Method = {
diff --git a/src/f_pc/f_pc_manager.cpp b/src/f_pc/f_pc_manager.cpp
index 4e49170d59..a6acd65848 100644
--- a/src/f_pc/f_pc_manager.cpp
+++ b/src/f_pc/f_pc_manager.cpp
@@ -7,6 +7,7 @@
#include "SSystem/SComponent/c_API_graphic.h"
#include "d/d_error_msg.h"
#include "d/d_lib.h"
+#include "f_op/f_op_scene.h"
#include "f_pc/f_pc_creator.h"
#include "f_pc/f_pc_deletor.h"
#include "f_pc/f_pc_draw.h"
diff --git a/src/m_Do/m_Do_hostIO.cpp b/src/m_Do/m_Do_hostIO.cpp
index 286a942110..7ee6a3653b 100644
--- a/src/m_Do/m_Do_hostIO.cpp
+++ b/src/m_Do/m_Do_hostIO.cpp
@@ -128,6 +128,10 @@ void mDoHIO_updateChild(s8 i_no) {
mDoHIO_root.updateChild(i_no);
}
+void mDoHIO_update() {
+ mDoHIO_root.update();
+}
+
void mDoHIO_root_c::updateChild(s8 i_no) {
mSub.updateChild(i_no);
}