From f7d1a7f2114bf5ea8e2bd981fc08b98a980a4484 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:09:29 -0500 Subject: [PATCH 1/7] cleanup(iplController): name decide/pinch/kpad/classic fields unk_0x08 -> mDecideHoldCount unk_0x1C -> mbForceInvalid unk_0x1D -> mbPinching unk_0x1E -> mbWasPinching unk_0x20 -> mpKpadStatus unk_0x24 -> mClassicCursorPos unk_0x2C -> mClassicCursorTimer Also update iplControllerManager ctor inits for Base fields. Matching 100% before/after; DOL sha1 unchanged. --- include/system/iplController.h | 52 +++++------ src/system/iplController.cpp | 128 ++++++++++++++-------------- src/system/iplControllerManager.cpp | 6 +- 3 files changed, 93 insertions(+), 93 deletions(-) diff --git a/include/system/iplController.h b/include/system/iplController.h index f637f3a2..326106c5 100644 --- a/include/system/iplController.h +++ b/include/system/iplController.h @@ -118,26 +118,26 @@ namespace ipl { public: Base(int chan, KPADStatus& status) { mButton = 0; - unk_0x08 = 0; + mDecideHoldCount = 0; mLastRumbleTime = 0; mRumbleType = -1; mChan = chan; mType = 2; - unk_0x1C = 0; + mbForceInvalid = 0; KPADEnableDPD(chan); - unk_0x1D = 0; - unk_0x1E = 0; - unk_0x20 = &status; + mbPinching = 0; + mbWasPinching = 0; + mpKpadStatus = &status; } Base(int chan, int type, KPADStatus& status) { mButton = 0; - unk_0x08 = 0; + mDecideHoldCount = 0; mLastRumbleTime = 0; mRumbleType = -1; mChan = chan; mType = type; - unk_0x1C = 0; + mbForceInvalid = 0; KPADEnableDPD(chan); } @@ -152,15 +152,15 @@ namespace ipl { protected: u8 mButton; - u32 unk_0x08; + u32 mDecideHoldCount; OSTick mLastRumbleTime; s32 mRumbleType; u32 mChan; u32 mType; - u8 unk_0x1C; - u8 unk_0x1D; - u8 unk_0x1E; - KPADStatus* unk_0x20; + u8 mbForceInvalid; + u8 mbPinching; + u8 mbWasPinching; + KPADStatus* mpKpadStatus; }; class Revolution : public Base { @@ -206,8 +206,8 @@ namespace ipl { virtual BOOL isValidDpdClassic() const; private: - math::VEC2 unk_0x24; - int unk_0x2C; + math::VEC2 mClassicCursorPos; + int mClassicCursorTimer; }; class Master : public Interface { @@ -264,18 +264,18 @@ namespace ipl { public: Base(int chan, KPADStatus& arg1) { mButton = 0; - unk_0x08 = 0; + mDecideHoldCount = 0; mLastRumbleTime = 0; mRumbleType = -1; mChan = chan; mType = 2; - unk_0x1C = 0; + mbForceInvalid = 0; KPADEnableDPD(chan); - unk_0x1D = 0; - unk_0x1E = 0; - unk_0x20 = &arg1; + mbPinching = 0; + mbWasPinching = 0; + mpKpadStatus = &arg1; } virtual ~Base(); // 0x08 @@ -326,15 +326,15 @@ namespace ipl { // protected: u8 mButton; // 0x4 - u32 unk_0x08; // 0x8 + u32 mDecideHoldCount; // 0x8 OSTick mLastRumbleTime; // 0xC s32 mRumbleType; // 0x10 u32 mChan; // 0x14 u32 mType; // 0x18 - u8 unk_0x1C; - u8 unk_0x1D; // 0x1D - u8 unk_0x1E; // 0x1E - KPADStatus* unk_0x20; // 0x20 + u8 mbForceInvalid; + u8 mbPinching; // 0x1D + u8 mbWasPinching; // 0x1E + KPADStatus* mpKpadStatus; // 0x20 }; class Interface : public Base { @@ -446,8 +446,8 @@ namespace ipl { virtual BOOL isValidDpdClassic() const; // 0x8C private: - math::VEC2 unk_0x24; - int unk_0x2C; + math::VEC2 mClassicCursorPos; + int mClassicCursorTimer; }; class Manager { diff --git a/src/system/iplController.cpp b/src/system/iplController.cpp index 2449cbae..358a84fa 100644 --- a/src/system/iplController.cpp +++ b/src/system/iplController.cpp @@ -46,17 +46,17 @@ namespace ipl { } if (mButton != 0) { if (down(BTN_INTERACT)) { - unk_0x08++; + mDecideHoldCount++; } else { - unk_0x08 = 0; + mDecideHoldCount = 0; mButton = 0; } } else { - unk_0x08 = 0; + mDecideHoldCount = 0; } } else { mButton = 0; - unk_0x08 = 0; + mDecideHoldCount = 0; } switch (mRumbleType) { @@ -109,7 +109,7 @@ namespace ipl { return NULL; } int ipl::controller::Base::decide() const { - return unk_0x08 == 5; + return mDecideHoldCount == 5; } int ipl::controller::Base::rumble(int type) { int ret = FALSE; @@ -130,44 +130,44 @@ namespace ipl { } void ipl::controller::Revolution::read() { if (!isValidDpd()) { - unk_0x20->pos.y = 1.0f / 0.0f; - unk_0x20->pos.x = 1.0f / 0.0f; - unk_0x20->speed = 0.0f; - unk_0x20->vec.y = 0.0f; - unk_0x20->vec.x = 0.0f; + mpKpadStatus->pos.y = 1.0f / 0.0f; + mpKpadStatus->pos.x = 1.0f / 0.0f; + mpKpadStatus->speed = 0.0f; + mpKpadStatus->vec.y = 0.0f; + mpKpadStatus->vec.x = 0.0f; } - unk_0x1E = unk_0x1D; + mbWasPinching = mbPinching; if (isValidBtn()) { - if (unk_0x1E == 0) { + if (mbWasPinching == 0) { if (down(0x800) && down(0x400)) { - unk_0x1D = 1; + mbPinching = 1; } } else if (!down(0x800) || !down(0x400)) { - unk_0x1D = 0; + mbPinching = 0; } } else { - unk_0x1D = 0; + mbPinching = 0; } Base::read(); } bool ipl::controller::Revolution::isValidDpd() const { - if (unk_0x1C != 0) { + if (mbForceInvalid != 0) { return false; } - return (unk_0x20->wpad_err == 0 || unk_0x20->wpad_err == -7) && unk_0x20->dpd_valid_fg != 0; + return (mpKpadStatus->wpad_err == 0 || mpKpadStatus->wpad_err == -7) && mpKpadStatus->dpd_valid_fg != 0; } bool ipl::controller::Revolution::isValidBtn() const { - u8 val = unk_0x20->wpad_err; + u8 val = mpKpadStatus->wpad_err; return (u8)(val + 7) <= 7 && ((1 << (val + 7)) & 0xA1) != 0; } bool ipl::controller::Revolution::down(u32 mButton) const { bool ret = false; if (isValidBtn()) { - if (unk_0x20->hold & (mButton & 0xFFFF)) { + if (mpKpadStatus->hold & (mButton & 0xFFFF)) { ret = true; } } @@ -177,7 +177,7 @@ namespace ipl { ipl::math::VEC2 ipl::controller::Revolution::getDpdProjectionPos() const { math::VEC2 ret; Vec2 dest; - Vec2 src = {unk_0x20->pos.x, unk_0x20->pos.y}; + Vec2 src = {mpKpadStatus->pos.x, mpKpadStatus->pos.y}; nw4r::ut::Rect nw4r_rect; // constructor shouldn't be inlined Rect kpad_rect; @@ -216,9 +216,9 @@ namespace ipl { y = fy; } ipl::controller::Classic::Classic(int arg0, KPADStatus& arg1) : Revolution(arg0, arg1) { - unk_0x24.x = 0.01f; - unk_0x24.y = 0.01f; - unk_0x2C = 0; + mClassicCursorPos.x = 0.01f; + mClassicCursorPos.y = 0.01f; + mClassicCursorTimer = 0; } ipl::controller::Base::~Base() { } @@ -230,32 +230,32 @@ namespace ipl { } void ipl::controller::Classic::read() { if (!Revolution::isValidDpd()) { - math::VEC2 lstick(unk_0x20->ex_status.cl.lstick.x, unk_0x20->ex_status.cl.lstick.y); + math::VEC2 lstick(mpKpadStatus->ex_status.cl.lstick.x, mpKpadStatus->ex_status.cl.lstick.y); if (lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f) { - unk_0x24.x = math::abs_clamp(unk_0x24.x + unk_0x20->ex_status.cl.lstick.x * 0.05f, 1.8f); - unk_0x24.y = math::abs_clamp(unk_0x24.y - unk_0x20->ex_status.cl.lstick.y * 0.05f, 1.2f); + mClassicCursorPos.x = math::abs_clamp(mClassicCursorPos.x + mpKpadStatus->ex_status.cl.lstick.x * 0.05f, 1.8f); + mClassicCursorPos.y = math::abs_clamp(mClassicCursorPos.y - mpKpadStatus->ex_status.cl.lstick.y * 0.05f, 1.2f); } - math::VEC2 rstick = math::VEC2(unk_0x20->ex_status.cl.rstick.x, unk_0x20->ex_status.cl.rstick.y); + math::VEC2 rstick = math::VEC2(mpKpadStatus->ex_status.cl.rstick.x, mpKpadStatus->ex_status.cl.rstick.y); if (getClassicHoldFlag() != 0 || lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f || rstick.x * rstick.x + rstick.y * rstick.y > 0.0036f) { - unk_0x2C = 180; + mClassicCursorTimer = 180; } - if (--unk_0x2C < 0) { - unk_0x2C = 0; + if (--mClassicCursorTimer < 0) { + mClassicCursorTimer = 0; } } else { - unk_0x24.y = 0.01f; - unk_0x24.x = 0.01f; - unk_0x2C = 0; + mClassicCursorPos.y = 0.01f; + mClassicCursorPos.x = 0.01f; + mClassicCursorTimer = 0; } Revolution::read(); } int ipl::controller::Classic::getClassicHoldFlag() const { - return unk_0x20->ex_status.cl.hold; + return mpKpadStatus->ex_status.cl.hold; } template <> f32 ipl::math::abs_clamp(const f32& x, const f32& y) { @@ -270,7 +270,7 @@ namespace ipl { ipl::math::VEC2 ipl::controller::Classic::getHorizon() const { math::VEC2 ret; if (Revolution::isValidDpd()) { - ret.set(unk_0x20->horizon.x, unk_0x20->horizon.y); + ret.set(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y); } else { ret.x = 1.0f; ret.y = -0.2679492f; @@ -280,9 +280,9 @@ namespace ipl { ipl::math::VEC2 ipl::controller::Classic::getDpdPos() const { math::VEC2 ret; if (Revolution::isValidDpd()) { - ret.set(unk_0x20->pos.x, unk_0x20->pos.y); - } else if (unk_0x2C != 0) { - ret = unk_0x24; + ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y); + } else if (mClassicCursorTimer != 0) { + ret = mClassicCursorPos; } else { ret.x = (1.0f / 0.0f); ret.y = (1.0f / 0.0f); @@ -296,9 +296,9 @@ namespace ipl { ipl::math::VEC2 ipl::controller::Classic::getDpdProjectionPos() const { math::VEC2 ret; if (Revolution::isValidDpd()) { - ret.set(unk_0x20->pos.x, unk_0x20->pos.y); - } else if (unk_0x2C != 0) { - ret = unk_0x24; + ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y); + } else if (mClassicCursorTimer != 0) { + ret = mClassicCursorPos; } else { ret.set(1.0f / 0.0f, 1.0f / 0.0f); } @@ -454,7 +454,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) { return -1; } void ipl::controller::Base::setForceInvalid(bool flag) { - unk_0x1C = flag; + mbForceInvalid = flag; } int ipl::controller::Base::getType() const { return mType; @@ -463,65 +463,65 @@ void ipl::controller::Master::setForceInvalid(bool flag) { return mChan; } KPADStatus* ipl::controller::Revolution::getKPADStatus() const { - return unk_0x20; + return mpKpadStatus; } f32 ipl::controller::Revolution::getDpdDistance() const { - return unk_0x20->dist; + return mpKpadStatus->dist; } int ipl::controller::Revolution::getReleaseFlag() const { - return unk_0x20->release; + return mpKpadStatus->release; } int ipl::controller::Revolution::getTrigFlag() const { - return unk_0x20->trig; + return mpKpadStatus->trig; } int ipl::controller::Revolution::getHoldFlag() const { - return unk_0x20->hold; + return mpKpadStatus->hold; } int ipl::controller::Revolution::pinchOffTrg() const { int ret = 0; - if (isValidBtn() && unk_0x1D == 0 && unk_0x1E != 0) { + if (isValidBtn() && mbPinching == 0 && mbWasPinching != 0) { ret = 1; } return ret; } int ipl::controller::Revolution::pinch() const { int ret = 0; - if (isValidBtn() && unk_0x1D != 0) { + if (isValidBtn() && mbPinching != 0) { ret = 1; } return ret; } int ipl::controller::Revolution::pinchTrg() const { int ret = 0; - if (isValidBtn() && unk_0x1D != 0 && unk_0x1E == 0) { + if (isValidBtn() && mbPinching != 0 && mbWasPinching == 0) { ret = 1; } return ret; } bool ipl::controller::Revolution::repeat(u32 button) const { - return down(button) && (unk_0x20->hold & 0x80000000) != 0; + return down(button) && (mpKpadStatus->hold & 0x80000000) != 0; } BOOL ipl::controller::Classic::isValidDpdClassic() const { - return unk_0x2C != 0; + return mClassicCursorTimer != 0; } bool ipl::controller::Classic::isValidDpd() const { - if (unk_0x1C != 0) { + if (mbForceInvalid != 0) { return false; } - return (Revolution::isValidDpd() != 0) || (unk_0x2C != 0); + return (Revolution::isValidDpd() != 0) || (mClassicCursorTimer != 0); } int ipl::controller::Classic::getClassicReleaseFlag() const { - return unk_0x20->ex_status.cl.release; + return mpKpadStatus->ex_status.cl.release; } int ipl::controller::Classic::getClassicTrigFlag() const { - return unk_0x20->ex_status.cl.trig; + return mpKpadStatus->ex_status.cl.trig; } bool ipl::controller::Classic::upTrg(u32 button) const { bool ret = false; if (isValidBtn()) { bool pressed = true; - KPADStatus* status = unk_0x20; + KPADStatus* status = mpKpadStatus; if ((status->release & (button & 0xFFFF)) == 0) { if ((status->ex_status.cl.release & (button >> 16)) == 0) { pressed = false; @@ -537,7 +537,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) { bool ret = false; if (isValidBtn()) { bool pressed = true; - KPADStatus* status = unk_0x20; + KPADStatus* status = mpKpadStatus; if ((status->trig & (button & 0xFFFF)) == 0) { if ((status->ex_status.cl.trig & (button >> 16)) == 0) { pressed = false; @@ -553,8 +553,8 @@ void ipl::controller::Master::setForceInvalid(bool flag) { bool ret = false; if (isValidBtn()) { bool pressed = true; - if ((unk_0x20->hold & (button & 0xFFFF)) == 0) { - if ((unk_0x20->ex_status.cl.hold & (button >> 16)) == 0) { + if ((mpKpadStatus->hold & (button & 0xFFFF)) == 0) { + if ((mpKpadStatus->ex_status.cl.hold & (button >> 16)) == 0) { pressed = false; } } @@ -565,15 +565,15 @@ void ipl::controller::Master::setForceInvalid(bool flag) { return ret; } ipl::math::VEC2 ipl::controller::Revolution::getHorizon() const { - return math::VEC2(unk_0x20->horizon.x, unk_0x20->horizon.y); + return math::VEC2(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y); } ipl::math::VEC2 ipl::controller::Revolution::getDpdPos() const { - return math::VEC2(unk_0x20->pos.x, unk_0x20->pos.y); + return math::VEC2(mpKpadStatus->pos.x, mpKpadStatus->pos.y); } bool ipl::controller::Revolution::upTrg(u32 button) const { bool ret = false; if (isValidBtn()) { - if (unk_0x20->release & (button & 0xFFFF)) { + if (mpKpadStatus->release & (button & 0xFFFF)) { ret = true; } } @@ -582,7 +582,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) { bool ipl::controller::Revolution::downTrg(u32 button) const { bool ret = false; if (isValidBtn()) { - if (unk_0x20->trig & (button & 0xFFFF)) { + if (mpKpadStatus->trig & (button & 0xFFFF)) { ret = true; } } diff --git a/src/system/iplControllerManager.cpp b/src/system/iplControllerManager.cpp index eb8e0261..608fcf42 100644 --- a/src/system/iplControllerManager.cpp +++ b/src/system/iplControllerManager.cpp @@ -152,9 +152,9 @@ namespace ipl { } Revolution::Revolution(int chan, int type, KPADStatus& status) : Base(chan, type, status) { - unk_0x1D = 0; - unk_0x1E = 0; - unk_0x20 = &status; + mbPinching = 0; + mbWasPinching = 0; + mpKpadStatus = &status; } Interface* Manager::getMasterController() { -- 2.49.1 From 414b553743b2e286579bcef2907f24ffa65abadf Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:09:31 -0500 Subject: [PATCH 2/7] cleanup(iplNwc24Manager): name receiving / title-table flags (#870) unk_0xA31 -> mbReceiving unk_0xA33 -> mbNewTitleTblReady isUnk0xA31 -> isReceivingIdle (same == false semantics) Touched channelTitle / sdChannelTitle / iplResetHandler callers for the getter rename. Matching units 100% before/after; DOL sha1 unchanged. --- include/system/iplNwc24Manager.h | 6 +++--- src/scene/channelTitle/iplChannelTitle.cpp | 2 +- src/scene/sdChannelTitle/iplSDChannelTitle.cpp | 2 +- src/system/iplNwc24Manager.cpp | 10 +++++----- src/system/iplResetHandler.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/system/iplNwc24Manager.h b/include/system/iplNwc24Manager.h index 47340ec5..117442a4 100644 --- a/include/system/iplNwc24Manager.h +++ b/include/system/iplNwc24Manager.h @@ -139,7 +139,7 @@ namespace ipl { bool received() { return mbReviecedMsg; } void prepNextReceive() { mbReviecedMsg = false; } - volatile bool isUnk0xA31() { return unk_0xA31 == false; } + volatile bool isReceivingIdle() { return mbReceiving == false; } BOOL isAppDlEnableLock(u32 appId) { utility::autoMutexLock lock(mAutoLock); @@ -175,9 +175,9 @@ namespace ipl { OSMutex mAutoLock; // 0xA18 bool mbReviecedMsg; - bool unk_0xA31; + bool mbReceiving; bool mbReceivePaused; // 0xA32 - bool unk_0xA33; + bool mbNewTitleTblReady; static Arg smArg; diff --git a/src/scene/channelTitle/iplChannelTitle.cpp b/src/scene/channelTitle/iplChannelTitle.cpp index c8d7b4e3..2e9cb6e2 100644 --- a/src/scene/channelTitle/iplChannelTitle.cpp +++ b/src/scene/channelTitle/iplChannelTitle.cpp @@ -648,7 +648,7 @@ namespace ipl { } if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped()) { - if (System::getNwc24Manager() && !System::getNwc24Manager()->isUnk0xA31()) { + if (System::getNwc24Manager() && !System::getNwc24Manager()->isReceivingIdle()) { goto scn_continue; } diff --git a/src/scene/sdChannelTitle/iplSDChannelTitle.cpp b/src/scene/sdChannelTitle/iplSDChannelTitle.cpp index a359ffaa..1c89bc11 100644 --- a/src/scene/sdChannelTitle/iplSDChannelTitle.cpp +++ b/src/scene/sdChannelTitle/iplSDChannelTitle.cpp @@ -353,7 +353,7 @@ FaderSceneCommand SDChannelTitle::calcFadeout() { mWpadStopTick = OSGetTick(); } if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped() && - (!System::getNwc24Manager() || System::getNwc24Manager()->isUnk0xA31())) { + (!System::getNwc24Manager() || System::getNwc24Manager()->isReceivingIdle())) { OSReport("NWC24 Scheduler stopped.\n"); NandSDWorker* worker = mpChannelSelect->getWorker(); if (mNextScene == 17) { diff --git a/src/system/iplNwc24Manager.cpp b/src/system/iplNwc24Manager.cpp index 81f315be..8c4a94fc 100644 --- a/src/system/iplNwc24Manager.cpp +++ b/src/system/iplNwc24Manager.cpp @@ -47,7 +47,7 @@ namespace ipl { (((mLastError > NWC24_ERR_FILE_OPEN || mLastError < NWC24_ERR_FILE_OTHER) && mLastError != NWC24_ERR_NAND_CORRUPT) && \ (mLastError != NWC24_ERR_FILE_EXISTS && mLastError != NWC24_ERR_INTERNAL_VF && mLastError != NWC24_ERR_FILE_BROKEN)) - Manager::Manager(EGG::Heap* heap) : mbReviecedMsg(false), unk_0xA31(false), mbReceivePaused(false), unk_0xA33(false) { + Manager::Manager(EGG::Heap* heap) : mbReviecedMsg(false), mbReceiving(false), mbReceivePaused(false), mbNewTitleTblReady(false) { OSInitMutex(&mLock); OSInitMutex(&mAutoLock); @@ -526,7 +526,7 @@ namespace ipl { return; } - unk_0xA31 = true; + mbReceiving = true; NWC24UserId myUserId; getMyUserId(&myUserId); @@ -910,8 +910,8 @@ namespace ipl { close(); - unk_0xA33 = true; - unk_0xA31 = false; + mbNewTitleTblReady = true; + mbReceiving = false; } void Manager::addDlTask() { @@ -996,7 +996,7 @@ namespace ipl { } BOOL Manager::getNewTitleTbl(u32* titleTbl) const { - if (!unk_0xA33) { + if (!mbNewTitleTblReady) { return FALSE; } diff --git a/src/system/iplResetHandler.cpp b/src/system/iplResetHandler.cpp index 81954576..90d6920e 100644 --- a/src/system/iplResetHandler.cpp +++ b/src/system/iplResetHandler.cpp @@ -61,7 +61,7 @@ namespace ipl { if (System::getPostmanManager()->IsUnknown() || (System::getSceneManager() != NULL && System::getScene(SCENE_ADDRESS) != NULL)) { if (System::getNwc24Manager() != NULL && !System::isNandFull()) { - if (System::createdAfterAndLibMgr() && !System::getNwc24Manager()->isUnk0xA31()) { + if (System::createdAfterAndLibMgr() && !System::getNwc24Manager()->isReceivingIdle()) { return; } } -- 2.49.1 From c7d0f8f01b829b99854c816c610631c220baca69 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:09:58 -0500 Subject: [PATCH 3/7] cleanup(CDBRecordFile): rename unk_0x1C to allocFlag (#871) Stores CDB_RECORD_ALLOC_* from CDBRecordInstanceInit type arg. --- libs/RevoEX/include/private/cdb/CDBRecord.h | 2 +- libs/RevoEX/src/cdb/CDBRecord.c | 12 ++++++------ libs/RevoEX/src/cdb/CDBSystem.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/RevoEX/include/private/cdb/CDBRecord.h b/libs/RevoEX/include/private/cdb/CDBRecord.h index 98f146c0..1fda0750 100644 --- a/libs/RevoEX/include/private/cdb/CDBRecord.h +++ b/libs/RevoEX/include/private/cdb/CDBRecord.h @@ -19,7 +19,7 @@ typedef struct _CDBRecordFile { #else u8 unk_0x00[0x1C - 0x00]; #endif - int unk_0x1C; + int allocFlag; // 0x1C CDBAttr attr; // 0x20 CDBBridgeFile bridgeFile; // 0x42C u8 unk_0x434[0x438 - 0x434]; diff --git a/libs/RevoEX/src/cdb/CDBRecord.c b/libs/RevoEX/src/cdb/CDBRecord.c index 64439b37..0d8ee5f2 100644 --- a/libs/RevoEX/src/cdb/CDBRecord.c +++ b/libs/RevoEX/src/cdb/CDBRecord.c @@ -57,7 +57,7 @@ void CDBRecordInstanceInit(CDBRecordFile* recordFile, CDBRecord* record, int typ OSLockMutex((OSMutex*)recordFile); recordFile->used = 1; OSUnlockMutex((OSMutex*)recordFile); - recordFile->unk_0x1C = type; + recordFile->allocFlag = type; recordFile->database = record->unk_0x00; CDBAttrInit(&recordFile->attr); CDBRecordKeyCopy(&recordFile->key, &record->key); @@ -310,7 +310,7 @@ CDBErr CDBRecordWrite_(CDBRecord* record, void* buffer, u32 size) { CDBReportError("can't write data in the record; the record is closed\n"); return CDB_ERROR_27; } - if ((recordFile->unk_0x1C & 2) == 0) { + if ((recordFile->allocFlag & 2) == 0) { CDBReportError("can't write data in the record; the record is opened as READONLY\n"); return CDB_ERROR_27; } @@ -687,7 +687,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32 if ((s32)recordFile == 0) { return CDB_ERROR_27; } - if (recordFile->unk_0x1C == 1) { + if (recordFile->allocFlag == 1) { return CDB_ERROR_26; } if ((s32)buffer == 0) { @@ -699,7 +699,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32 tempFile = record->file; if ((s32)tempFile == 0) { result = CDB_ERROR_27; - } else if (tempFile->unk_0x1C == 1) { + } else if (tempFile->allocFlag == 1) { result = CDB_ERROR_26; } else { CDBAttrSetWiiId(&tempFile->attr, CDBGetWiiId()); @@ -713,7 +713,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32 CDBErr result; if ((s32)record->file == 0) { result = CDB_ERROR_27; - } else if (((CDBRecordFile*)record->file)->unk_0x1C == 1) { + } else if (((CDBRecordFile*)record->file)->allocFlag == 1) { result = CDB_ERROR_26; } else { CDBAttrInitIV(&((CDBRecordFile*)record->file)->attr); @@ -727,7 +727,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32 CDBErr result; if ((s32)record->file == 0) { result = CDB_ERROR_27; - } else if (((CDBRecordFile*)record->file)->unk_0x1C == 1) { + } else if (((CDBRecordFile*)record->file)->allocFlag == 1) { result = CDB_ERROR_26; } else { CDBAttrSetKeyStr(&((CDBRecordFile*)record->file)->attr, key); diff --git a/libs/RevoEX/src/cdb/CDBSystem.c b/libs/RevoEX/src/cdb/CDBSystem.c index 0e59ea71..584fb4e2 100644 --- a/libs/RevoEX/src/cdb/CDBSystem.c +++ b/libs/RevoEX/src/cdb/CDBSystem.c @@ -265,7 +265,7 @@ CDBErr CDBRecordFree(CDBRecord* record) { OSLockMutex((OSMutex*)recordFile); *(u32*)&recordFile->unk_0x00[0x18] = 0; OSUnlockMutex((OSMutex*)recordFile); - recordFile->unk_0x1C = 0; + recordFile->allocFlag = 0; record->file = NULL; OSUnlockMutex(&s_mutex); } -- 2.49.1 From 282ddd99b73e2c9704bc75f4a1e94f8bf4634985 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:10:24 -0500 Subject: [PATCH 4/7] cleanup(iplSettingButton): rename Unk ring-buffer placeholders (#872) Unk -> CmdEntry; unk_0x64 -> mCmdQueue; capacity/count/read/write indices. Byte-identical (DOL sha1 unchanged). --- .../scene/settingSelect/iplSettingButton.h | 14 +++---- src/scene/settingSelect/iplSettingButton.cpp | 40 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/scene/settingSelect/iplSettingButton.h b/include/scene/settingSelect/iplSettingButton.h index 764e8937..a68cc1c5 100644 --- a/include/scene/settingSelect/iplSettingButton.h +++ b/include/scene/settingSelect/iplSettingButton.h @@ -62,17 +62,17 @@ namespace ipl { void start_left_event(const char* paneName); void start_trig_event(const char* paneName); - typedef struct Unk { + typedef struct CmdEntry { int command; // 0x00 u32 msgID; // 0x04 - } Unk; + } CmdEntry; - Unk unk_0x64[64]; + CmdEntry mCmdQueue[64]; - int unk_0x264; - int unk_0x268; - int unk_0x26C; - int unk_0x270; + int mQueueCapacity; + int mQueueCount; + int mQueueRead; + int mQueueWrite; int mSettingArg; // 0x274 diff --git a/src/scene/settingSelect/iplSettingButton.cpp b/src/scene/settingSelect/iplSettingButton.cpp index 16df6d8a..c8254859 100644 --- a/src/scene/settingSelect/iplSettingButton.cpp +++ b/src/scene/settingSelect/iplSettingButton.cpp @@ -15,10 +15,10 @@ namespace ipl { // clang-format on SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() { - unk_0x264 = 64; - unk_0x268 = 0; - unk_0x26C = 0; - unk_0x270 = 0; + mQueueCapacity = 64; + mQueueCount = 0; + mQueueRead = 0; + mQueueWrite = 0; mSettingArg = arg; mpLayout = NULL; mpLayoutFile = NULL; @@ -81,9 +81,9 @@ namespace ipl { FaderSceneCommand SettingButton::calcNormal() { if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() && - !mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && unk_0x268 != 0) { - Unk unk = unk_0x64[unk_0x26C]; - switch (unk.command) { + !mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mQueueCount != 0) { + CmdEntry entry = mCmdQueue[mQueueRead]; + switch (entry.command) { case CMD_SHOW_BTN: { showBtn(); break; @@ -93,16 +93,16 @@ namespace ipl { break; } case CMD_SET_TEXT: { - setText(unk.msgID); + setText(entry.msgID); break; } } - if (unk_0x268 != 0) { - if (++unk_0x26C >= unk_0x264) { - unk_0x26C = 0; + if (mQueueCount != 0) { + if (++mQueueRead >= mQueueCapacity) { + mQueueRead = 0; } - unk_0x268--; + mQueueCount--; } } @@ -225,16 +225,16 @@ namespace ipl { } void SettingButton::reserve(int command, u32 msgId) { - if (unk_0x264 != unk_0x268) { - int unk = unk_0x270; - unk_0x64[unk].command = command; - unk_0x64[unk].msgID = msgId; - unk_0x270++; + if (mQueueCapacity != mQueueCount) { + int writeIdx = mQueueWrite; + mCmdQueue[writeIdx].command = command; + mCmdQueue[writeIdx].msgID = msgId; + mQueueWrite++; - if (unk_0x270 >= unk_0x264) { - unk_0x270 = 0; + if (mQueueWrite >= mQueueCapacity) { + mQueueWrite = 0; } - unk_0x268++; + mQueueCount++; } } -- 2.49.1 From 63f4c7aeab3247b96dbe743f6fa5e058290d2eb3 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:10:50 -0500 Subject: [PATCH 5/7] cleanup(NWC24MsgObj): rename flags to headerSize (#873) Same 0x10 slot as MsgRead headerSize; Commit stamps body offset. --- libs/RevoEX/include/private/nwc24/NWC24MsgObj.h | 2 +- libs/RevoEX/src/nwc24/NWC24MBoxCtrl.c | 6 +++--- libs/RevoEX/src/nwc24/NWC24MsgCommit.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/RevoEX/include/private/nwc24/NWC24MsgObj.h b/libs/RevoEX/include/private/nwc24/NWC24MsgObj.h index 145cfa15..13b82ff4 100644 --- a/libs/RevoEX/include/private/nwc24/NWC24MsgObj.h +++ b/libs/RevoEX/include/private/nwc24/NWC24MsgObj.h @@ -24,7 +24,7 @@ typedef struct NWC24MsgObjPrivate { #ifdef NWC24_MSG_READ u32 headerSize; #elif defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT) - u32 flags; // 0x10 + u32 headerSize; // 0x10 #else u8 unk_0x10[0x4]; #endif diff --git a/libs/RevoEX/src/nwc24/NWC24MBoxCtrl.c b/libs/RevoEX/src/nwc24/NWC24MBoxCtrl.c index 62c5200b..3dd40e71 100644 --- a/libs/RevoEX/src/nwc24/NWC24MBoxCtrl.c +++ b/libs/RevoEX/src/nwc24/NWC24MBoxCtrl.c @@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms continue; } if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length && - entry->flags == msg->flags && (s32)entry->date == (s32)msg->date) { + entry->flags == msg->headerSize && (s32)entry->date == (s32)msg->date) { duplicateId = entry->msgId; duplicateOffset = offset; continue; @@ -956,7 +956,7 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr entry->type = msg->type; entry->length = msg->length; entry->appId = msg->appId; - entry->flags = msg->flags; + entry->flags = msg->headerSize; entry->tag = msg->tag; entry->ledPattern = msg->ledPattern; entry->crc = msg->unk_0x1C; @@ -1003,7 +1003,7 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms msg->type = entry->type; msg->length = entry->length; msg->appId = entry->appId; - msg->flags = entry->flags; + msg->headerSize = entry->flags; msg->tag = entry->tag; msg->ledPattern = entry->ledPattern; msg->unk_0x1C = entry->crc; diff --git a/libs/RevoEX/src/nwc24/NWC24MsgCommit.c b/libs/RevoEX/src/nwc24/NWC24MsgCommit.c index e2a737a9..b6469ede 100644 --- a/libs/RevoEX/src/nwc24/NWC24MsgCommit.c +++ b/libs/RevoEX/src/nwc24/NWC24MsgCommit.c @@ -330,7 +330,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty } CHECK_WRITE(WriteString(msg, buffer)); if (msg->type & 0x10000) { - msg->flags = msg->length; + msg->headerSize = msg->length; buffer = NWC24WorkP->stringWork; Mail_memset(buffer, 0, 1024); Mail_sprintf(buffer, "\r\n--%s", MultiPartDivider); @@ -339,7 +339,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty } CHECK_WRITE(WriteContentTypeField(msg)); if (!(msg->type & 0x10000)) - msg->flags = msg->length; + msg->headerSize = msg->length; text.ptr = (const void*)msg->length; { NWC24Err textResult = WritePlainText(msg); err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; } -- 2.49.1 From 0c780f6d1f433787a9602120b858b80ebdffea4d Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:11:17 -0500 Subject: [PATCH 6/7] cleanup(eZiText): rename work unk_0x1418 to formatCount (#874) Count of entries filled into formats[]; saved as savedCount. --- .../eZiText/include/zi8clib/zitypes.h | 2 +- .../RVLMiddleware/eZiText/src/clib/zi8getc2.c | 4 +-- .../RVLMiddleware/eZiText/src/clib/ziswordw.c | 26 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 33546c24..f5801c40 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -267,7 +267,7 @@ struct __zi8_work_data_s { ziU8 unk_0x140C[4]; ziU32 formats; // 0x1410 ziU8 unk_0x1414[4]; - ziU8 unk_0x1418; + ziU8 formatCount; ziU8 unk_0x1419; ziU16 unk_0x141A; ziU8 unk_0x141C; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c index 39a33f61..1b5272e5 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c @@ -51,10 +51,10 @@ ziBool Zi8ZHsetZYfuzzyPairs(ziFuzzyZYPairs pairs ZI_NEED_WORK) { ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) { if (searchArray == 0 || *searchArray == 0) { ZI_WORK->formats = (ziU32)Zi8SOdefaultArray; - ZI_WORK->unk_0x1418 = 9; + ZI_WORK->formatCount = 9; } else { ZI_WORK->formats = (ziU32)searchArray; - ZI_WORK->unk_0x1418 = searchSize; + ZI_WORK->formatCount = searchSize; } return 1; } diff --git a/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c b/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c index 487f3aae..00445424 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c +++ b/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c @@ -46,7 +46,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) { ziU8* data; ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0}; ziU32 savedFormats = ZI_WORK->formats; - ziU8 savedCount = ZI_WORK->unk_0x1418; + ziU8 savedCount = ZI_WORK->formatCount; ziSearchState search = {0}; Zi8LogError(100, __zi8_work_data); if (word == 0 || *word == 0) { @@ -75,20 +75,20 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) { request.firstCandidate = 0; ZI_WORK->formats = (ziU32)formats; if (ZI_WORK->unk_0x1C[0] == 2) { - ZI_WORK->unk_0x1418 = 0; - if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 1; - if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->unk_0x1418++] = 2; - if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->unk_0x1418++] = 3; - if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->unk_0x1418++] = 4; - if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 5; - if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->unk_0x1418++] = 6; - if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->unk_0x1418++] = 7; - if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->unk_0x1418++] = 8; - } else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->unk_0x1418 = 2; - else ZI_WORK->unk_0x1418 = 1; + ZI_WORK->formatCount = 0; + if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->formatCount++] = 1; + if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->formatCount++] = 2; + if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->formatCount++] = 3; + if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->formatCount++] = 4; + if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->formatCount++] = 5; + if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->formatCount++] = 6; + if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->formatCount++] = 7; + if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->formatCount++] = 8; + } else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->formatCount = 2; + else ZI_WORK->formatCount = 1; count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data); ZI_WORK->formats = savedFormats; - ZI_WORK->unk_0x1418 = savedCount; + ZI_WORK->formatCount = savedCount; if (count != 0) return 1; } if (language != 1) { -- 2.49.1 From 73795cb3fb78ab5e0d58b745bff97fc88a58083b Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:11:44 -0500 Subject: [PATCH 7/7] cleanup(ErrorHandler): name set() arg storage fields (#875) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename unused debug-ish stash fields to match ErrorHandler::set params: - unk_0x14 → mArg1 (char[4] from arg1) - unk_0x0C → mArg2 - unk_0x10 → mArg3 Verified: ErrorHandler 100%/100%, build/43U/ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d --- include/system/iplErrorHandler.h | 6 +++--- src/system/iplErrorHandler.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/system/iplErrorHandler.h b/include/system/iplErrorHandler.h index e8f48be1..a72d82cb 100644 --- a/include/system/iplErrorHandler.h +++ b/include/system/iplErrorHandler.h @@ -60,9 +60,9 @@ namespace ipl { int mMessageID; // 0x08 - int unk_0x0C; - int unk_0x10; - char unk_0x14[4]; + int mArg2; + int mArg3; + char mArg1[4]; u8* mpArcData; // 0x18 u32 mArcSize; // 0x1C diff --git a/src/system/iplErrorHandler.cpp b/src/system/iplErrorHandler.cpp index 3bc5533f..01922287 100644 --- a/src/system/iplErrorHandler.cpp +++ b/src/system/iplErrorHandler.cpp @@ -43,13 +43,13 @@ namespace ipl { mMessageID = msgId; // Debug related? (seems to be incomplete; unused) - unk_0x0C = arg2; - unk_0x10 = arg3; + mArg2 = arg2; + mArg3 = arg3; if (arg1) { - strncpy(unk_0x14, arg1, sizeof(unk_0x14)); - unk_0x14[sizeof(unk_0x14) - 1] = 0; + strncpy(mArg1, arg1, sizeof(mArg1)); + mArg1[sizeof(mArg1) - 1] = 0; } else { - memset(unk_0x14, 0, sizeof(unk_0x14)); + memset(mArg1, 0, sizeof(mArg1)); } curThread = OSGetCurrentThread(); -- 2.49.1