From 13acaee08772cc96ccbf0c9572ab93ee634181c8 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 27 Sep 2025 12:17:13 +0200 Subject: [PATCH] Cleanup --- include/d/d_base.h | 7 +++++++ include/d/d_cs_game.h | 12 ++++++------ src/d/d_stage_mgr.cpp | 6 +++--- src/d/lyt/d_lyt_game_over.cpp | 16 ++++++++-------- src/d/lyt/d_lyt_pause.cpp | 14 +++++++------- src/toBeSorted/d_emitter.cpp | 5 ++--- 6 files changed, 33 insertions(+), 27 deletions(-) diff --git a/include/d/d_base.h b/include/d/d_base.h index 877e51e7..4946c452 100644 --- a/include/d/d_base.h +++ b/include/d/d_base.h @@ -19,6 +19,13 @@ public: BASE_PROP_0x40 = (1 << 6), BASE_PROP_0x80 = (1 << 7), BASE_PROP_0x100 = (1 << 8), + BASE_PROP_0x200 = (1 << 9), + BASE_PROP_0x400 = (1 << 10), + + BASE_PROP_UNK_PARTICLE_1 = BASE_PROP_0x400 | BASE_PROP_0x200 | BASE_PROP_0x80 | BASE_PROP_0x40 | + BASE_PROP_0x20 | BASE_PROP_0x10 | BASE_PROP_0x8 | BASE_PROP_0x1, + BASE_PROP_UNK_PARTICLE_2 = BASE_PROP_0x400 | BASE_PROP_0x200 | BASE_PROP_0x80 | BASE_PROP_0x40 | + BASE_PROP_0x20 | BASE_PROP_0x10 | BASE_PROP_0x8 | BASE_PROP_0x2 | BASE_PROP_0x1, }; // field from profile init diff --git a/include/d/d_cs_game.h b/include/d/d_cs_game.h index fd2216b9..0498a9a7 100644 --- a/include/d/d_cs_game.h +++ b/include/d/d_cs_game.h @@ -442,12 +442,12 @@ private: /* 0x1F0 */ dCsGameLyt1_c mLyt1; /* 0x290 */ dCsGameLyt2_c mLyt2; /* 0x330 */ lytItemCursor_c mCursor; - /* 0x9A0 */ bool mCursorActive; - /* 0x9A1 */ bool field_0x9A1; // Compares to mCursorActive to change state - /* 0x9A2 */ bool field_0x9A2; // A way of signalling Lyt non-normal state. - /* 0x9A4 */ CursorType_e mActiveCursorType; - /* 0x9A8 */ bool mNextCursorActive; - /* 0x9AC */ CursorType_e mNextCursorType; + /* 0xCD0 */ bool mCursorActive; + /* 0xCD1 */ bool field_0x9A1; // Compares to mCursorActive to change state + /* 0xCD2 */ bool field_0x9A2; // A way of signalling Lyt non-normal state. + /* 0xCD4 */ CursorType_e mActiveCursorType; + /* 0xCD8 */ bool mNextCursorActive; + /* 0xCDC */ CursorType_e mNextCursorType; }; #endif diff --git a/src/d/d_stage_mgr.cpp b/src/d/d_stage_mgr.cpp index 4ab7ff87..acf55ae1 100644 --- a/src/d/d_stage_mgr.cpp +++ b/src/d/d_stage_mgr.cpp @@ -236,7 +236,7 @@ void dStageMgr_c::initializeState_SceneChangeSave() { if (LYT_SAVE_MGR != nullptr) { fn_80285600(LYT_SAVE_MGR, 3, 0); } - dBase_c::s_NextExecuteControlFlags |= 1; + dBase_c::s_NextExecuteControlFlags |= BASE_PROP_0x1; dSys_c::setFrameRate(2); } @@ -252,8 +252,8 @@ void dStageMgr_c::executeState_SceneChangeSave() { } void dStageMgr_c::finalizeState_SceneChangeSave() { - dBase_c::s_NextExecuteControlFlags &= ~1; - dBase_c::s_DrawControlFlags &= ~1; + dBase_c::s_NextExecuteControlFlags &= ~BASE_PROP_0x1; + dBase_c::s_DrawControlFlags &= ~BASE_PROP_0x1; } void dStageMgr_c::initializeState_RestartSceneWait() { diff --git a/src/d/lyt/d_lyt_game_over.cpp b/src/d/lyt/d_lyt_game_over.cpp index 518045bf..f50045fd 100644 --- a/src/d/lyt/d_lyt_game_over.cpp +++ b/src/d/lyt/d_lyt_game_over.cpp @@ -163,8 +163,8 @@ bool dLytGameOver_c::remove() { mResAcc2.detach(); mResAcc1.detach(); - dBase_c::s_NextExecuteControlFlags &= ~0x200; - dBase_c::s_DrawControlFlags &= ~0x200; + dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x200; + dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x200; return true; } @@ -435,8 +435,8 @@ void dLytGameOverMgr_c::executeState_Select() { if (mTimer < 20) { mTimer++; if (mTimer == 20) { - dBase_c::s_NextExecuteControlFlags |= 1; - dBase_c::s_DrawControlFlags |= 1; + dBase_c::s_NextExecuteControlFlags |= dBase_c::BASE_PROP_0x1; + dBase_c::s_DrawControlFlags |= dBase_c::BASE_PROP_0x1; } } if (mMain.isChangingState() == true) { @@ -563,11 +563,11 @@ void dLytGameOverMgr_c::executeState_Select() { break; } case 100: { - dBase_c::s_NextExecuteControlFlags &= ~0x1; - dBase_c::s_DrawControlFlags &= ~0x1; + dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x1; + dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1; - dBase_c::s_NextExecuteControlFlags |= 0x200; - dBase_c::s_DrawControlFlags |= 0x200; + dBase_c::s_NextExecuteControlFlags |= dBase_c::BASE_PROP_0x200; + dBase_c::s_DrawControlFlags |= dBase_c::BASE_PROP_0x200; mStep++; break; diff --git a/src/d/lyt/d_lyt_pause.cpp b/src/d/lyt/d_lyt_pause.cpp index 39cd859a..926de978 100644 --- a/src/d/lyt/d_lyt_pause.cpp +++ b/src/d/lyt/d_lyt_pause.cpp @@ -112,8 +112,8 @@ bool dLytPauseMain_c::remove() { mpPauseBack = nullptr; } - dBase_c::s_NextExecuteControlFlags &= ~0x1; - dBase_c::s_DrawControlFlags &= ~0x1; + dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x1; + dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1; return true; } @@ -260,7 +260,7 @@ void dLytPauseMain_c::executeState_In() { } } void dLytPauseMain_c::finalizeState_In() { - dBase_c::s_DrawControlFlags |= 0x1; + dBase_c::s_DrawControlFlags |= dBase_c::BASE_PROP_0x1; } void dLytPauseMain_c::initializeState_Wait() { @@ -462,7 +462,7 @@ void dLytPauseMain_c::finalizeState_GetDemo() {} void dLytPauseMain_c::initializeState_Out() { mPartStateChangeFlags = 0; mStep = 0; - dBase_c::s_DrawControlFlags &= ~0x1; + dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1; mpArrow->requestOut(); } void dLytPauseMain_c::executeState_Out() { @@ -580,7 +580,7 @@ void dLytPauseMgr_c::executeState_None() { field_0x083A = true; mMain.requestIn(); mStateMgr.changeState(StateID_In); - dBase_c::s_NextExecuteControlFlags |= 0x1; + dBase_c::s_NextExecuteControlFlags |= BASE_PROP_0x1; dLytMeter_c::GetInstance()->setMeterField_0x13750(3); dLytControlGame_c *lytControl = dLytControlGame_c::getInstance(); if (lytControl->isPauseDemo()) { @@ -817,8 +817,8 @@ void dLytPauseMgr_c::initializeState_Out() { } void dLytPauseMgr_c::executeState_Out() { if (mMain.isChangingState() == true) { - dBase_c::s_NextExecuteControlFlags &= ~0x1; - dBase_c::s_DrawControlFlags &= ~0x1; + dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x1; + dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1; mStateMgr.changeState(StateID_None); } } diff --git a/src/toBeSorted/d_emitter.cpp b/src/toBeSorted/d_emitter.cpp index 4fb19c71..47abb431 100644 --- a/src/toBeSorted/d_emitter.cpp +++ b/src/toBeSorted/d_emitter.cpp @@ -856,7 +856,7 @@ void dJEffManager_c::execute() { sMassObjEmitters[i].execute(); } - if ((dBase_c::s_ExecuteControlFlags & 0x6F9) == 0) { + if ((dBase_c::s_ExecuteControlFlags & (dBase_c::BASE_PROP_UNK_PARTICLE_1)) == 0) { for (int i = 0; i < 12; i++) { dParticle::mgr_c::GetInstance()->calc(i); } @@ -886,8 +886,7 @@ void dJEffManager_c::draw() { bool dJEffManager_c::shouldBePaused(dBase_c *owner) { return owner != nullptr && !owner->checkBaseProperty(dBase_c::BASE_PROP_0x4) && (EventManager::isInEvent() || owner->checkProcControl(fBase_c::DISABLE_EXECUTE) || - // TODO execute control flags - (owner->s_ExecuteControlFlags & 0x6fb)); + (owner->s_ExecuteControlFlags & dBase_c::BASE_PROP_UNK_PARTICLE_2)); } void dJEffManager_c::draw(const JPADrawInfo *info, u32 groupId) {