diff --git a/configure.py b/configure.py index 509faa4255d..b83e33dd6d6 100755 --- a/configure.py +++ b/configure.py @@ -637,7 +637,7 @@ config.libs = [ Object(MatchingFor(ALL_GCN), "f_op/f_op_camera_mng.cpp"), Object(MatchingFor(ALL_GCN, "ShieldD"), "f_op/f_op_overlap.cpp"), Object(MatchingFor(ALL_GCN), "f_op/f_op_overlap_mng.cpp"), - Object(MatchingFor(ALL_GCN), "f_op/f_op_overlap_req.cpp"), + Object(MatchingFor(ALL_GCN, "ShieldD"), "f_op/f_op_overlap_req.cpp"), Object(MatchingFor(ALL_GCN), "f_op/f_op_scene.cpp"), Object(MatchingFor(ALL_GCN, "ShieldD"), "f_op/f_op_scene_iter.cpp"), Object(MatchingFor(ALL_GCN), "f_op/f_op_scene_mng.cpp"), diff --git a/include/d/d_s_play.h b/include/d/d_s_play.h index a29f9807093..5736f0838c7 100644 --- a/include/d/d_s_play.h +++ b/include/d/d_s_play.h @@ -68,7 +68,11 @@ public: bool resetGame(); void offReset(); + #if VERSION == VERSION_SHIELD_DEBUG static s8 isPause() { return pauseTimer | nextPauseTimer; } + #else + static s8 isPause() { return pauseTimer; } + #endif static void setPauseTimer(s8 time) { nextPauseTimer = time; } static s8 pauseTimer; diff --git a/src/Z2AudioLib/Z2StatusMgr.cpp b/src/Z2AudioLib/Z2StatusMgr.cpp index 619055090f6..c86b86eee32 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/f_op/f_op_camera.cpp b/src/f_op/f_op_camera.cpp index 37f7bfd784c..c2d94d0a76d 100644 --- a/src/f_op/f_op_camera.cpp +++ b/src/f_op/f_op_camera.cpp @@ -64,8 +64,8 @@ int fopCam_Delete(camera_class* i_this) { } static int fopCam_Create(void* i_this) { - int ret; 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); diff --git a/src/f_op/f_op_kankyo.cpp b/src/f_op/f_op_kankyo.cpp index 7a9b170786f..587da7cd09d 100644 --- a/src/f_op/f_op_kankyo.cpp +++ b/src/f_op/f_op_kankyo.cpp @@ -24,7 +24,7 @@ static int fopKy_Execute(void* i_this) { int ret; kankyo_class* a_this = (kankyo_class*)i_this; - if (dScnPly_c::isPause() && (!dComIfGp_isPauseFlag() || fpcM_GetName(i_this) == PROC_ENVSE)) { + if (!dScnPly_c::isPause() && (!dComIfGp_isPauseFlag() || fpcM_GetName(i_this) == PROC_ENVSE)) { ret = fpcMtd_Execute(&a_this->sub_method->base, i_this); } diff --git a/src/f_op/f_op_msg.cpp b/src/f_op/f_op_msg.cpp index 8bd113b43c0..f5cbf98b1cc 100644 --- a/src/f_op/f_op_msg.cpp +++ b/src/f_op/f_op_msg.cpp @@ -72,8 +72,8 @@ u8 fopMsg::MemCheck; static int fopMsg_MSG_TYPE; int fopMsg_Create(void* i_this) { - int ret; msg_class* a_this = (msg_class*)i_this; + int ret; if (fpcM_IsFirstCreating(i_this)) { msg_process_profile_definition* profile = diff --git a/src/f_op/f_op_overlap_req.cpp b/src/f_op/f_op_overlap_req.cpp index 112809a7062..28d0a743cc3 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_mng.cpp b/src/f_op/f_op_scene_mng.cpp index b5475492005..a36df47584d 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) { @@ -43,6 +42,7 @@ u32 fopScnM_ReRequest(s16 i_procName, u32 i_data) { void fopScnM_Management() { fopScnRq_Handler(); + JUT_ASSERT(326, 0); } void fopScnM_Init() {} diff --git a/src/f_op/f_op_scene_req.cpp b/src/f_op/f_op_scene_req.cpp index 8bf1afd91f5..b64055cc5e1 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;