From f429cd07cc536743b9a79bf3a3c3796edb68bee8 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:23:55 -0500 Subject: [PATCH 01/12] cleanup(CDBRecord): rename unk_0x00 to database (#894) Held as CDBDatabase*; copied to recordFile->database. --- libs/RevoEX/include/revolution/cdb/CDBRecord.h | 2 +- libs/RevoEX/src/cdb/CDBRecord.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/RevoEX/include/revolution/cdb/CDBRecord.h b/libs/RevoEX/include/revolution/cdb/CDBRecord.h index 4be8dfc6..9ad06240 100644 --- a/libs/RevoEX/include/revolution/cdb/CDBRecord.h +++ b/libs/RevoEX/include/revolution/cdb/CDBRecord.h @@ -62,7 +62,7 @@ typedef struct _CDBRecordKey { } CDBRecordKey; typedef struct _CDBRecord { - u32 unk_0x00; + u32 database; // 0x00 void* cryptBuf; // 0x04 CDBRecordKey key; // 0x08 void* file; // 0x38 diff --git a/libs/RevoEX/src/cdb/CDBRecord.c b/libs/RevoEX/src/cdb/CDBRecord.c index 0d8ee5f2..9c207a23 100644 --- a/libs/RevoEX/src/cdb/CDBRecord.c +++ b/libs/RevoEX/src/cdb/CDBRecord.c @@ -58,7 +58,7 @@ void CDBRecordInstanceInit(CDBRecordFile* recordFile, CDBRecord* record, int typ recordFile->used = 1; OSUnlockMutex((OSMutex*)recordFile); recordFile->allocFlag = type; - recordFile->database = record->unk_0x00; + recordFile->database = record->database; CDBAttrInit(&recordFile->attr); CDBRecordKeyCopy(&recordFile->key, &record->key); } @@ -73,7 +73,7 @@ BOOL CDBRecordInstanceIsUsed(CDBRecordFile* recordFile) { void CDBRecordInitDescriptor(CDBRecord* record, CDBDatabase* database, CDBRecordKey* key) { CDBLock(); - record->unk_0x00 = (u32)database; + record->database = (u32)database; CDBRecordKeyCopy(&record->key, key); record->cryptBuf = NULL; record->file = NULL; @@ -95,7 +95,7 @@ CDBErr CDBRecordCreateAtOnce(CDBRecord* record, CDBDatabase* database, const cha CDBRecordKeyInit(&key, epoch, gameCode, makerCode, 0, fileType, CDB_FS_LOCATION_NAND); CDBLock(); - record->unk_0x00 = (u32)database; + record->database = (u32)database; CDBRecordKeyCopy(&record->key, &key); record->cryptBuf = NULL; record->file = NULL; @@ -128,7 +128,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) { CDBDatabase* database; CDBRecordDatabaseState* instance; - database = (CDBDatabase*)record->unk_0x00; + database = (CDBDatabase*)record->database; instance = database->instance; record->cryptBuf = NULL; if (instance == NULL) { @@ -292,7 +292,7 @@ CDBErr CDBRecordWrite_(CDBRecord* record, void* buffer, u32 size) { CDBErr result; CDBRecordDatabaseState* instance; - database = (CDBDatabase*)record->unk_0x00; + database = (CDBDatabase*)record->database; instance = database->instance; recordFile = record->file; if (record->key.location == CDB_FS_LOCATION_SD) { @@ -508,7 +508,7 @@ CDBErr CDBRecordUpdateModifiedDate(CDBRecord* record) { ticks = OSGetTime(); modifiedDate = ticks / (OS_BUS_CLOCK / 4); recordFile = record->file; - if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->unk_0x00)->instance)->openFlags & 2) == 0) { + if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->database)->instance)->openFlags & 2) == 0) { CDBReportError("can't set modified time of the record; the database is opened as READONLY\n"); return CDB_ERROR_26; } @@ -570,7 +570,7 @@ CDBErr CDBRecordBackupToSD_(CDBRecord* record) { CDBRecordKeyCopy(&localRecord.key, &record->key); localRecord.file = NULL; localRecord.key.location = CDB_FS_LOCATION_SD; - localRecord.unk_0x00 = record->unk_0x00; + localRecord.database = record->database; err = CDBRecordFileCreateBlank(&localRecord); if (err != CDB_ERROR_OK) { CDBLock(); @@ -614,7 +614,7 @@ CDBErr CDBRecordBackupToSD_(CDBRecord* record) { CDBLock(); recordFile = localRecord.file; CDBRecordKeyCopy(&record->key, &localRecord.key); - record->unk_0x00 = localRecord.unk_0x00; + record->database = localRecord.database; record->file = localRecord.file; record->cryptBuf = localRecord.cryptBuf; CDBRecordKeyCopy(&recordFile->key, &localRecord.key); -- 2.49.1 From 1f3d89772ee7ea7ca49ee5db524aae10a9c55b94 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:24:22 -0500 Subject: [PATCH 02/12] cleanup(iplChannelScriptManager): name CSData mbHasNewMessage (#895) unk_0x1A -> mbHasNewMessage Set true when starting channel script, cleared when the title has no new NWC24 message (isNewMessageThere). Touched channelSelect / channelTitle / sdChannelTitle writers. Matching 100% before/after; DOL sha1 unchanged. --- include/system/iplChannelScriptManager.h | 2 +- src/scene/channelSelect/iplChannelObj.cpp | 4 ++-- src/scene/channelTitle/iplChannelTitle.cpp | 2 +- src/scene/sdChannelTitle/iplSDChannelTitle.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/system/iplChannelScriptManager.h b/include/system/iplChannelScriptManager.h index adff9730..eeb11d08 100644 --- a/include/system/iplChannelScriptManager.h +++ b/include/system/iplChannelScriptManager.h @@ -33,7 +33,7 @@ namespace ipl { u64 titleId; // 0x10 bool threadTerminated; // 0x18 bool unk_0x19; - bool unk_0x1A; + bool mbHasNewMessage; // 0x1A EGG::ExpHeap* getHeap() { return heap; } } CSData; diff --git a/src/scene/channelSelect/iplChannelObj.cpp b/src/scene/channelSelect/iplChannelObj.cpp index 664e3df2..0b36222f 100644 --- a/src/scene/channelSelect/iplChannelObj.cpp +++ b/src/scene/channelSelect/iplChannelObj.cpp @@ -436,10 +436,10 @@ namespace ipl { data.titleId = System::getChannelManager()->getTitleID(mChanPage, mChanIndex); data.threadTerminated = mbModuleTerminated; data.unk_0x19 = true; - data.unk_0x1A = true; + data.mbHasNewMessage = true; if (!(System::getNwc24Manager() != NULL && System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.titleId)))) { - data.unk_0x1A = false; + data.mbHasNewMessage = false; } System::getCSManager()->setData(data); diff --git a/src/scene/channelTitle/iplChannelTitle.cpp b/src/scene/channelTitle/iplChannelTitle.cpp index 2e9cb6e2..9965a247 100644 --- a/src/scene/channelTitle/iplChannelTitle.cpp +++ b/src/scene/channelTitle/iplChannelTitle.cpp @@ -1767,7 +1767,7 @@ namespace ipl { data.threadTerminated = mbModuleTerminated; if (System::getNwc24Manager() == NULL || !System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.titleId))) { - data.unk_0x1A = false; + data.mbHasNewMessage = false; } System::getCSManager()->setData(data); if (!System::getCSManager()->init(mpModuleFile, mpModuleThread)) { diff --git a/src/scene/sdChannelTitle/iplSDChannelTitle.cpp b/src/scene/sdChannelTitle/iplSDChannelTitle.cpp index 1c89bc11..1a7dc893 100644 --- a/src/scene/sdChannelTitle/iplSDChannelTitle.cpp +++ b/src/scene/sdChannelTitle/iplSDChannelTitle.cpp @@ -1118,7 +1118,7 @@ extern "C" void iplSDChannelTitle_updateScriptLoad(SDChannelTitle* scene) { data.titleId = scene->mTitleId; data.threadTerminated = scene->mbScriptFailed; if (!System::getNwc24Manager() || !System::getNwc24Manager()->isNewMessageThere(static_cast(data.titleId & 0xffffffffULL))) { - data.unk_0x1A = false; + data.mbHasNewMessage = false; } System::getCSManager()->setData(data); if (!System::getCSManager()->init(scene->mpScriptFile, scene->mpRsoThread)) { -- 2.49.1 From 2080aeb0cf9d0b5086dc89bdb580eb7f5e6cd3a1 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:24:50 -0500 Subject: [PATCH 03/12] cleanup(NWC24FriendList): rename FLHeader unk_0x10 to confirmedBits (#896) Per-friend bitfield; GetUnkFlag==1 sets NWC24_FRIENDSTATUS_CONFIRMED. --- libs/RevoEX/include/private/nwc24/NWC24FriendList.h | 2 +- libs/RevoEX/src/nwc24/NWC24FriendList.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/RevoEX/include/private/nwc24/NWC24FriendList.h b/libs/RevoEX/include/private/nwc24/NWC24FriendList.h index de6c9d86..5e8137b4 100644 --- a/libs/RevoEX/include/private/nwc24/NWC24FriendList.h +++ b/libs/RevoEX/include/private/nwc24/NWC24FriendList.h @@ -17,7 +17,7 @@ typedef struct NWC24FLHeader { u32 version; // 0x04 u32 infoCount; // 0x08 u32 registeredCount; // 0x0C - u32 unk_0x10[4]; + u32 confirmedBits[4]; // 0x10 u32 unk_0x20[7]; u32 unk_0x3C; NWC24UserId friendIds[NWC24_FRIEND_INFO_MAX]; // 0x40 diff --git a/libs/RevoEX/src/nwc24/NWC24FriendList.c b/libs/RevoEX/src/nwc24/NWC24FriendList.c index 3dfa5c42..43ec2d36 100644 --- a/libs/RevoEX/src/nwc24/NWC24FriendList.c +++ b/libs/RevoEX/src/nwc24/NWC24FriendList.c @@ -37,7 +37,7 @@ static u32 GetUnkFlag(u32 index) { return result; } - data = header->unk_0x10[index >> 5] >> (index & 0x1f) & 1; + data = header->confirmedBits[index >> 5] >> (index & 0x1f) & 1; return (NWC24Err)data; } @@ -50,7 +50,7 @@ static NWC24Err SetUnkFlag(u32 index, int flag) { return result; } - header->unk_0x10[index >> 5] = ~(1 << (index & 0x1f)) & header->unk_0x10[index >> 5] | flag << (index & 0x1f); + header->confirmedBits[index >> 5] = ~(1 << (index & 0x1f)) & header->confirmedBits[index >> 5] | flag << (index & 0x1f); return NWC24_OK; } @@ -629,10 +629,10 @@ NWC24Err NWC24iCreateFriendList() { header->version = FRIEND_LIST_VERSION; header->infoCount = NWC24_FRIEND_INFO_MAX; header->registeredCount = 0; - header->unk_0x10[0] = 0; - header->unk_0x10[1] = 0; - header->unk_0x10[2] = 0; - header->unk_0x10[3] = 0; + header->confirmedBits[0] = 0; + header->confirmedBits[1] = 0; + header->confirmedBits[2] = 0; + header->confirmedBits[3] = 0; result = NWC24FOpen(&file, FLFilePath, NWC24_OPEN_WRITE); if (result != NWC24_OK) { -- 2.49.1 From 402687106bb1a7ff3bf04ebe4cd07d525f3a5359 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:25:17 -0500 Subject: [PATCH 04/12] cleanup(NWC24FriendList): rename Get/SetUnkFlag helpers (#897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetUnkFlag/SetUnkFlag → GetConfirmedBit/SetConfirmedBit; SetUnkFlag2 → SetListFlag (writes FLHeader unk_0x3C). --- libs/RevoEX/src/nwc24/NWC24FriendList.c | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/RevoEX/src/nwc24/NWC24FriendList.c b/libs/RevoEX/src/nwc24/NWC24FriendList.c index 43ec2d36..14baf27a 100644 --- a/libs/RevoEX/src/nwc24/NWC24FriendList.c +++ b/libs/RevoEX/src/nwc24/NWC24FriendList.c @@ -27,7 +27,7 @@ static NWC24Err GetCachedFLHeader(NWC24FLHeader** header); static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength); static inline NWC24Err CheckFriendInfo(const NWC24FriendInfo* friendInfo); -static u32 GetUnkFlag(u32 index) { +static u32 GetConfirmedBit(u32 index) { NWC24Err result; NWC24FLHeader* header; u32 data; @@ -41,7 +41,7 @@ static u32 GetUnkFlag(u32 index) { return (NWC24Err)data; } -static NWC24Err SetUnkFlag(u32 index, int flag) { +static NWC24Err SetConfirmedBit(u32 index, int flag) { NWC24Err result; NWC24FLHeader* header; @@ -54,7 +54,7 @@ static NWC24Err SetUnkFlag(u32 index, int flag) { return NWC24_OK; } -static NWC24Err SetUnkFlag2(int flag) { +static NWC24Err SetListFlag(int flag) { NWC24Err result; NWC24FLHeader* header; @@ -101,7 +101,7 @@ NWC24Err NWC24ReadFriendInfo(NWC24FriendInfo* info, u32 index) { Mail_memset(&info->addr.mailAddr[sizeof(NWC24UserId)], 0, sizeof(NWC24UserMailAddr) - sizeof(NWC24UserId)); } - result = GetUnkFlag(index); + result = GetConfirmedBit(index); if (result == 1) { info->attr.status = NWC24_FRIENDSTATUS_CONFIRMED; } @@ -189,9 +189,9 @@ NWC24Err NWC24WriteFriendInfo(const NWC24FriendInfo* friendInfo, u32 index) { tmpFriendAddr = (NWC24FriendAddr*)&friendInfo->addr; } - SetUnkFlag2(1); + SetListFlag(1); - result = SetUnkFlag(index, 0); + result = SetConfirmedBit(index, 0); if (result != NWC24_OK) { return result; } @@ -347,7 +347,7 @@ NWC24Err NWC24DeleteFriendInfo(u32 index) { if (resultWrite == NWC24_OK) { header->friendIds[index] = 0; header->registeredCount--; - result = SetUnkFlag(index, 0); + result = SetConfirmedBit(index, 0); if (result == NWC24_OK) { NWC24FSeek(&file, 0, NWC24_SEEK_BEG); resultWrite = NWC24FWrite(header, sizeof(NWC24FLHeader), &file); @@ -374,8 +374,8 @@ NWC24Err NWC24SwapFriendInfos(u32 index1, u32 index2) { u32 fileOffset1; u32 fileOffset2; - int friendUnkFlag1; - int friendUnkFlag2; + int confirmedBit1; + int confirmedBit2; if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool()) { return NWC24_ERR_LIB_NOT_OPENED; @@ -429,10 +429,10 @@ NWC24Err NWC24SwapFriendInfos(u32 index1, u32 index2) { header->friendIds[index2] = tmp; // Swap some flag - friendUnkFlag1 = GetUnkFlag(index1); - friendUnkFlag2 = GetUnkFlag(index2); - SetUnkFlag(index1, friendUnkFlag2); - SetUnkFlag(index2, friendUnkFlag1); + confirmedBit1 = GetConfirmedBit(index1); + confirmedBit2 = GetConfirmedBit(index2); + SetConfirmedBit(index1, confirmedBit2); + SetConfirmedBit(index2, confirmedBit1); // Write new header NWC24FSeek(&file, 0, NWC24_SEEK_BEG); -- 2.49.1 From 8870c4aa75839f3a268a499c477f5afcdafaa4c1 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:25:44 -0500 Subject: [PATCH 05/12] cleanup(NWC24FriendList): rename FLHeader unk_0x3C to listFlags (#898) Written by SetListFlag (OR of flag bits on add). --- libs/RevoEX/include/private/nwc24/NWC24FriendList.h | 2 +- libs/RevoEX/src/nwc24/NWC24FriendList.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/RevoEX/include/private/nwc24/NWC24FriendList.h b/libs/RevoEX/include/private/nwc24/NWC24FriendList.h index 5e8137b4..e80cd57c 100644 --- a/libs/RevoEX/include/private/nwc24/NWC24FriendList.h +++ b/libs/RevoEX/include/private/nwc24/NWC24FriendList.h @@ -19,7 +19,7 @@ typedef struct NWC24FLHeader { u32 registeredCount; // 0x0C u32 confirmedBits[4]; // 0x10 u32 unk_0x20[7]; - u32 unk_0x3C; + u32 listFlags; // 0x3C NWC24UserId friendIds[NWC24_FRIEND_INFO_MAX]; // 0x40 } NWC24FLHeader; diff --git a/libs/RevoEX/src/nwc24/NWC24FriendList.c b/libs/RevoEX/src/nwc24/NWC24FriendList.c index 14baf27a..4f3a5454 100644 --- a/libs/RevoEX/src/nwc24/NWC24FriendList.c +++ b/libs/RevoEX/src/nwc24/NWC24FriendList.c @@ -63,7 +63,7 @@ static NWC24Err SetListFlag(int flag) { return result; } - header->unk_0x3C |= flag; + header->listFlags |= flag; return NWC24_OK; } -- 2.49.1 From 6cb5ac9dedfbf99dc591e2cabc9d62d2c849a69d Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:26:31 -0500 Subject: [PATCH 06/12] cleanup(eZiText): name unicode map range fields in work (#900) Zi8Uni2Ptr OEM remap table + two char ranges + subLanguage gate. --- .../eZiText/include/zi8clib/zitypes.h | 12 ++++++------ libs/RVLMiddleware/eZiText/src/clib/zi8misc.c | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 6300f04c..16cb8859 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -309,12 +309,12 @@ struct __zi8_work_data_s { ziWChar unk_0x1A92[0x41]; ziU8 unk_0x1B14; ziU8 unk_0x1B15[3]; - ziU16* unk_0x1B18; - ziU16 unk_0x1B1C; - ziU16 unk_0x1B1E; - ziU16 unk_0x1B20; - ziU16 unk_0x1B22; - ziU8 unk_0x1B24; + ziU16* unicodeMap; // 0x1B18 + ziU16 unicodeRange1Min; // 0x1B1C + ziU16 unicodeRange1Max; // 0x1B1E + ziU16 unicodeRange2Min; // 0x1B20 + ziU16 unicodeRange2Max; // 0x1B22 + ziU8 unicodeMapSubLang; // 0x1B24 ziU8 unk_0x1B25[3]; union { ziU32 word; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c b/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c index cf788c63..b11d8856 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c @@ -65,19 +65,19 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) { } } e = (ziU8*)table; - if (WORKP->unk_0x1B18 != ZI8_NULL && WORKP->unk_0x1B24 == WORKP->subLanguage) { - if ((ziU16)ch >= WORKP->unk_0x1B1C && (ziU16)ch <= WORKP->unk_0x1B1E) { - i = (ziU16)(ch - WORKP->unk_0x1B1C); + if (WORKP->unicodeMap != ZI8_NULL && WORKP->unicodeMapSubLang == WORKP->subLanguage) { + if ((ziU16)ch >= WORKP->unicodeRange1Min && (ziU16)ch <= WORKP->unicodeRange1Max) { + i = (ziU16)(ch - WORKP->unicodeRange1Min); goto map; } - if ((ziU16)ch >= WORKP->unk_0x1B20 && (ziU16)ch <= WORKP->unk_0x1B22) { - i = (ziU16)(WORKP->unk_0x1B1E + (ch - WORKP->unk_0x1B20) - - WORKP->unk_0x1B1C + 1); + if ((ziU16)ch >= WORKP->unicodeRange2Min && (ziU16)ch <= WORKP->unicodeRange2Max) { + i = (ziU16)(WORKP->unicodeRange1Max + (ch - WORKP->unicodeRange2Min) - + WORKP->unicodeRange1Min + 1); goto map; } return 0xFFFF; map: - i = WORKP->unk_0x1B18[i]; + i = WORKP->unicodeMap[i]; if (i != 0xFFFF) { e = (ziU8*)table + i * 0xC; if (hi == e[6] && lo == e[7]) { -- 2.49.1 From 401d0c88e763fb890bc4ff7c189b79cc64d41169 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:26:58 -0500 Subject: [PATCH 07/12] cleanup(eZiText): rename work unk_0x12C to uwdPtrCount (#901) Count of ZH user-word ptr stack entries (distinct from uwdCount @ 0x1C7). --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8ZHuwd.c | 6 +++--- libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 16cb8859..b1bbe34a 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -226,7 +226,7 @@ struct __zi8_work_data_s { ziU16 unk_0xA0[0x42]; ziU16* unk_0x124[1]; ziU8* unk_0x128; - ziU8 unk_0x12C; + ziU8 uwdPtrCount; // 0x12C ziU8 unk_0x12D; ziU8 unk_0x12E; ziU8 unk_0x12F; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8ZHuwd.c b/libs/RVLMiddleware/eZiText/src/clib/zi8ZHuwd.c index 3611b6fb..b4eadef0 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8ZHuwd.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8ZHuwd.c @@ -2,14 +2,14 @@ #include ziU32 Zi8GetZHuwdPtr(ziU32* arg0, ziU16* arg1 ZI_NEED_WORK) { - if (ZI_WORK->unk_0x12C == 0) { + if (ZI_WORK->uwdPtrCount == 0) { *arg0 = 0; *arg1 = 0; Zi8LogError(0x1A5, ZI_WORK); return 0; } else { - *arg1 = ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1][1] / 3; - *arg0 = (ziU32)ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1]; + *arg1 = ZI_WORK->unk_0x124[ZI_WORK->uwdPtrCount - 1][1] / 3; + *arg0 = (ziU32)ZI_WORK->unk_0x124[ZI_WORK->uwdPtrCount - 1]; *arg0 += 8; Zi8LogError(0x64, ZI_WORK); return 1; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c b/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c index 94ebb4d4..59287a5a 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c @@ -1752,7 +1752,7 @@ tone_candidates: } } user_character_search: - if (((struct __zi8_work_data_s*)work)->unk_0x12C && (getMode != 0 || !firstPhoneticPass) && + if (((struct __zi8_work_data_s*)work)->uwdPtrCount && (getMode != 0 || !firstPhoneticPass) && !options->countOnly && (match.nCand <= 1 || (getMode != 1 && getMode != 2)) && Zi8GetZHuwdPtr(&userEntries, &userCount, work) && (getMode != 0 || match.nSeg <= 1)) { userIndex = 0; -- 2.49.1 From c7ceb3efe077dca7dd49508cf4e2bd1faab56b54 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:27:25 -0500 Subject: [PATCH 08/12] cleanup(WPAD): name FS/CL stick min/max calib fields (#903) DEBUGPrint labels X/Y max/min beside stick centers in calibration. --- .../include/private/wpad/WPADInternal.h | 24 +++++----- libs/RVL_SDK/src/wpad/WPADHIDParser.c | 48 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/libs/RVL_SDK/include/private/wpad/WPADInternal.h b/libs/RVL_SDK/include/private/wpad/WPADInternal.h index 266f103d..13d7dee0 100644 --- a/libs/RVL_SDK/include/private/wpad/WPADInternal.h +++ b/libs/RVL_SDK/include/private/wpad/WPADInternal.h @@ -133,11 +133,11 @@ typedef struct WPADExtConfig { union { struct WPADFSConfig { s16 stickXCenter; // 0x00 - s16 unk_0x02; // 0x02 - s16 unk_0x04; // 0x04 + s16 stickXMin; // 0x02 + s16 stickXMax; // 0x04 s16 stickYCenter; // 0x06 - s16 unk_0x08; // 0x08 - s16 unk_0x0A; // 0x0A + s16 stickYMin; // 0x08 + s16 stickYMax; // 0x0A s16 accX0g; // 0x0C s16 accY0g; // 0x0E @@ -150,18 +150,18 @@ typedef struct WPADExtConfig { struct WPADCLConfig { s16 lStickXCenter; // 0x00 - s16 unk_0x02; // 0x02 - s16 unk_0x04; // 0x04 + s16 lStickXMin; // 0x02 + s16 lStickXMax; // 0x04 s16 lStickYCenter; // 0x06 - s16 unk_0x08; // 0x08 - s16 unk_0x0A; // 0x0A + s16 lStickYMin; // 0x08 + s16 lStickYMax; // 0x0A s16 rStickXCenter; // 0x0C - s16 unk_0x0E; // 0x0E - s16 unk_0x10; // 0x10 + s16 rStickXMin; // 0x0E + s16 rStickXMax; // 0x10 s16 rStickYCenter; // 0x12 - s16 unk_0x14; // 0x14 - s16 unk_0x16; // 0x16 + s16 rStickYMin; // 0x14 + s16 rStickYMax; // 0x16 u8 triggerLZero; // 0x18 u8 triggerRZero; // 0x19 diff --git a/libs/RVL_SDK/src/wpad/WPADHIDParser.c b/libs/RVL_SDK/src/wpad/WPADHIDParser.c index cea48c48..61e23778 100644 --- a/libs/RVL_SDK/src/wpad/WPADHIDParser.c +++ b/libs/RVL_SDK/src/wpad/WPADHIDParser.c @@ -393,48 +393,48 @@ static void getExtConfig(s32 chan, s32 result) { p_wpd->extConfig.u.fs.accX1g = (s16)((u16)(((u16)(p_buf[index + 4]) << 2) & 0xFFFC) | (u16)(((u16)(p_buf[index + 7]) >> 4) & 3)); p_wpd->extConfig.u.fs.accY1g = (s16)((u16)(((u16)(p_buf[index + 5]) << 2) & 0xFFFC) | (u16)(((u16)(p_buf[index + 7]) >> 2) & 3)); p_wpd->extConfig.u.fs.accZ1g = (s16)((u16)(((u16)(p_buf[index + 6]) << 2) & 0xFFFC) | (u16)(((u16)(p_buf[index + 7])) & 3)); - p_wpd->extConfig.u.fs.unk_0x04 = (s8)p_buf[index + 8]; - p_wpd->extConfig.u.fs.unk_0x02 = (s8)p_buf[index + 9]; + p_wpd->extConfig.u.fs.stickXMax = (s8)p_buf[index + 8]; + p_wpd->extConfig.u.fs.stickXMin = (s8)p_buf[index + 9]; p_wpd->extConfig.u.fs.stickXCenter = (s8)p_buf[index + 10]; - p_wpd->extConfig.u.fs.unk_0x0A = (s8)p_buf[index + 11]; - p_wpd->extConfig.u.fs.unk_0x08 = (s8)p_buf[index + 12]; + p_wpd->extConfig.u.fs.stickYMax = (s8)p_buf[index + 11]; + p_wpd->extConfig.u.fs.stickYMin = (s8)p_buf[index + 12]; p_wpd->extConfig.u.fs.stickYCenter = (s8)p_buf[index + 13]; DEBUGPrint("0G: fsaccX = %d, fsaccY = %d, fsaccZ = %d\n", p_wpd->extConfig.u.fs.accX0g, p_wpd->extConfig.u.fs.accY0g, p_wpd->extConfig.u.fs.accZ0g); DEBUGPrint("1G: fsaccX = %d, fsaccY = %d, fsaccZ = %d\n", p_wpd->extConfig.u.fs.accX1g, p_wpd->extConfig.u.fs.accY1g, p_wpd->extConfig.u.fs.accZ1g); - DEBUGPrint("FS: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.fs.stickXCenter, p_wpd->extConfig.u.fs.unk_0x04, - p_wpd->extConfig.u.fs.unk_0x02); - DEBUGPrint("FS: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.fs.stickYCenter, p_wpd->extConfig.u.fs.unk_0x0A, - p_wpd->extConfig.u.fs.unk_0x08); + DEBUGPrint("FS: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.fs.stickXCenter, p_wpd->extConfig.u.fs.stickXMax, + p_wpd->extConfig.u.fs.stickXMin); + DEBUGPrint("FS: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.fs.stickYCenter, p_wpd->extConfig.u.fs.stickYMax, + p_wpd->extConfig.u.fs.stickYMin); } break; case WPAD_DEV_CLASSIC: - p_wpd->extConfig.u.cl.unk_0x04 = (s8)p_buf[index + 0]; - p_wpd->extConfig.u.cl.unk_0x02 = (s8)p_buf[index + 1]; + p_wpd->extConfig.u.cl.lStickXMax = (s8)p_buf[index + 0]; + p_wpd->extConfig.u.cl.lStickXMin = (s8)p_buf[index + 1]; p_wpd->extConfig.u.cl.lStickXCenter = (s8)p_buf[index + 2]; - p_wpd->extConfig.u.cl.unk_0x0A = (s8)p_buf[index + 3]; - p_wpd->extConfig.u.cl.unk_0x08 = (s8)p_buf[index + 4]; + p_wpd->extConfig.u.cl.lStickYMax = (s8)p_buf[index + 3]; + p_wpd->extConfig.u.cl.lStickYMin = (s8)p_buf[index + 4]; p_wpd->extConfig.u.cl.lStickYCenter = (s8)p_buf[index + 5]; - p_wpd->extConfig.u.cl.unk_0x10 = (s8)p_buf[index + 6]; - p_wpd->extConfig.u.cl.unk_0x0E = (s8)p_buf[index + 7]; + p_wpd->extConfig.u.cl.rStickXMax = (s8)p_buf[index + 6]; + p_wpd->extConfig.u.cl.rStickXMin = (s8)p_buf[index + 7]; p_wpd->extConfig.u.cl.rStickXCenter = (s8)p_buf[index + 8]; - p_wpd->extConfig.u.cl.unk_0x16 = (s8)p_buf[index + 9]; - p_wpd->extConfig.u.cl.unk_0x14 = (s8)p_buf[index + 10]; + p_wpd->extConfig.u.cl.rStickYMax = (s8)p_buf[index + 9]; + p_wpd->extConfig.u.cl.rStickYMin = (s8)p_buf[index + 10]; p_wpd->extConfig.u.cl.rStickYCenter = (s8)p_buf[index + 11]; p_wpd->extConfig.u.cl.triggerLZero = p_buf[index + 12]; p_wpd->extConfig.u.cl.triggerRZero = p_buf[index + 13]; - DEBUGPrint("CL: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.lStickXCenter, p_wpd->extConfig.u.cl.unk_0x04, - p_wpd->extConfig.u.cl.unk_0x02); - DEBUGPrint("CL: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.lStickYCenter, p_wpd->extConfig.u.cl.unk_0x0A, - p_wpd->extConfig.u.cl.unk_0x08); - DEBUGPrint("CR: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.rStickXCenter, p_wpd->extConfig.u.cl.unk_0x10, - p_wpd->extConfig.u.cl.unk_0x0E); - DEBUGPrint("CR: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.rStickYCenter, p_wpd->extConfig.u.cl.unk_0x16, - p_wpd->extConfig.u.cl.unk_0x14); + DEBUGPrint("CL: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.lStickXCenter, p_wpd->extConfig.u.cl.lStickXMax, + p_wpd->extConfig.u.cl.lStickXMin); + DEBUGPrint("CL: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.lStickYCenter, p_wpd->extConfig.u.cl.lStickYMax, + p_wpd->extConfig.u.cl.lStickYMin); + DEBUGPrint("CR: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.rStickXCenter, p_wpd->extConfig.u.cl.rStickXMax, + p_wpd->extConfig.u.cl.rStickXMin); + DEBUGPrint("CR: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.rStickYCenter, p_wpd->extConfig.u.cl.rStickYMax, + p_wpd->extConfig.u.cl.rStickYMin); DEBUGPrint("LR: L = %d, R = %d\n", p_wpd->extConfig.u.cl.triggerLZero, p_wpd->extConfig.u.cl.triggerRZero); break; } -- 2.49.1 From f65fac33513682ee42382a814dccf1d110a115f3 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:29:12 -0500 Subject: [PATCH 09/12] cleanup(WPAD): rename CB unk_0x910 to suppressDisconnect (#907) When set, comm-timeout path skips WPADiDisconnect and reports TRANSFER. --- libs/RVL_SDK/include/private/wpad/WPADInternal.h | 2 +- libs/RVL_SDK/src/wpad/WPAD.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/RVL_SDK/include/private/wpad/WPADInternal.h b/libs/RVL_SDK/include/private/wpad/WPADInternal.h index 13d7dee0..810ebfaf 100644 --- a/libs/RVL_SDK/include/private/wpad/WPADInternal.h +++ b/libs/RVL_SDK/include/private/wpad/WPADInternal.h @@ -223,7 +223,7 @@ typedef struct WPADCB { u16 filterDiffExt; // 0x900 u16 filterSameExt; // 0x902 s64 lastReportSendTime; // 0x908 - u8 unk_0x910; + u8 suppressDisconnect; // 0x910 u8 calibrated; // 0x911 u16 comboHeld; // 0x912 u8 encryptionKey[16]; // 0x914 diff --git a/libs/RVL_SDK/src/wpad/WPAD.c b/libs/RVL_SDK/src/wpad/WPAD.c index dc1c3c3c..b7a426b0 100644 --- a/libs/RVL_SDK/src/wpad/WPAD.c +++ b/libs/RVL_SDK/src/wpad/WPAD.c @@ -190,7 +190,7 @@ static s32 WPADiSendData(s32 chan, WPADCommand command) { if (status == WPAD_ERR_COMMUNICATION_ERROR) { if ((s32)OSTicksToSeconds(__OSGetSystemTime() - p->lastReportSendTime) > 1 && _sleepTime != 0) { - if (!p->unk_0x910) { + if (!p->suppressDisconnect) { p->lastReportSendTime = __OSGetSystemTime(); WPADiDisconnect(chan, FALSE); } else { @@ -1263,7 +1263,7 @@ static void __ClearControlBlock(s32 chan) { p->lastControllerDataUpdate = __OSGetSystemTime(); p->lastReportSendTime = __OSGetSystemTime(); - p->unk_0x910 = 0; + p->suppressDisconnect = 0; p->unk_0x8C9 = 0; p->unk_0x8C4 = 0; p->wmReadDataPtr = NULL; @@ -2692,7 +2692,7 @@ static void __SendData(s32 chan, WPADCommand command) { u32 time; memcpy(&time, command.dataBuf, sizeof(u32)); p->lastReportSendTime = __OSGetSystemTime() + time; - p->unk_0x910 = 1; + p->suppressDisconnect = 1; return; } default: { @@ -2704,7 +2704,7 @@ static void __SendData(s32 chan, WPADCommand command) { p->cmdBlkCB = command.cmdCB; p->lastReportID = reportID; p->lastReportSendTime = __OSGetSystemTime() + OSSecondsToTicks(2); - p->unk_0x910 = 0; + p->suppressDisconnect = 0; OSRestoreInterrupts(enabled); } -- 2.49.1 From 77439a326861fc7e0fee45e944f84d5c32d57f6e Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:29:40 -0500 Subject: [PATCH 10/12] cleanup(iplChannelManager): name mbDiskChannelReady (#908) unk_0x1B81 -> mbDiskChannelReady isUnk_0x1B81 -> isDiskChannelReady setUnk_0x1B81 -> setDiskChannelReady Set when BS2 enters RVL_GAME and disk banner info is applied; cleared when disk banner data is consumed or channel UI dismisses it. Touched channelSelect / channelTitle callers. Matching 100% before/after; DOL sha1 unchanged. --- include/system/iplChannelManager.h | 6 +++--- src/scene/channelSelect/iplChannelSelect.cpp | 4 ++-- src/scene/channelTitle/iplChannelTitle.cpp | 6 +++--- src/system/iplChannelManager.cpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/system/iplChannelManager.h b/include/system/iplChannelManager.h index 693eed99..94a6baeb 100644 --- a/include/system/iplChannelManager.h +++ b/include/system/iplChannelManager.h @@ -365,8 +365,8 @@ namespace ipl { int getChJumpChanPage() { return mChJumpPage; } int getChJumpChanIndex() { return mChJumpIndex; } - void setUnk_0x1B81(bool flag) { unk_0x1B81 = flag; } - bool isUnk_0x1B81() { return unk_0x1B81; } + void setDiskChannelReady(bool flag) { mbDiskChannelReady = flag; } + bool isDiskChannelReady() { return mbDiskChannelReady; } void resetChJumpLoad() { mbLoadedChJump = false; } bool hasLoadedChJump() { return mbLoadedChJump; } @@ -399,7 +399,7 @@ namespace ipl { int mBS2State; // 0x1B7C bool mbCanRefresh; // 0x1B80 - bool unk_0x1B81; + bool mbDiskChannelReady; u8* mpDiskIconBuf; // 0x1B84 u8* mpDiskBannerBuf; // 0x1B88 diff --git a/src/scene/channelSelect/iplChannelSelect.cpp b/src/scene/channelSelect/iplChannelSelect.cpp index b98e0b4c..61bff581 100644 --- a/src/scene/channelSelect/iplChannelSelect.cpp +++ b/src/scene/channelSelect/iplChannelSelect.cpp @@ -1844,7 +1844,7 @@ namespace ipl { initChanZoomParam(myVec, 1); setChanZoomOrtho(); - if (System::getChannelManager()->isUnk_0x1B81()) { + if (System::getChannelManager()->isDiskChannelReady()) { if (System::getBS2Manager()->getIPLState() == bs2::IPL_STATE_RVL_GAME || System::getBS2Manager()->getIPLState() == bs2::IPL_STATE_DISK_UPDATE) { if (mspDiskID != NULL) { @@ -1856,7 +1856,7 @@ namespace ipl { if (strncmp(diskID, mspDiskID, 4) == 0) { if (strncmp(diskMaker, mspDiskMaker, 2) == 0) { - System::getChannelManager()->setUnk_0x1B81(false); + System::getChannelManager()->setDiskChannelReady(false); } } } diff --git a/src/scene/channelTitle/iplChannelTitle.cpp b/src/scene/channelTitle/iplChannelTitle.cpp index 9965a247..8f2c127f 100644 --- a/src/scene/channelTitle/iplChannelTitle.cpp +++ b/src/scene/channelTitle/iplChannelTitle.cpp @@ -467,7 +467,7 @@ namespace ipl { mpDiskBnrLayout->calc(); } else { calcModuleChannel(); - System::getChannelManager()->setUnk_0x1B81(false); + System::getChannelManager()->setDiskChannelReady(false); } if ((mState == STATE_NORMAL || mState == STATE_WAIT_TMD || mState == STATE_PREPARE_BOOT || mState == STATE_BOOT_SCENE) && !unk_0x90 && @@ -1220,7 +1220,7 @@ namespace ipl { #pragma ppc_iro_level 0 void ChannelTitle::calcNormalParentalDialog() { if (mChanSceneID == SCENE_DISK_CHANNEL && - (System::getBS2Manager()->getIPLState() != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isUnk_0x1B81())) { + (System::getBS2Manager()->getIPLState() != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isDiskChannelReady())) { mParentalState = PARENTAL_STATE_FAILED; } @@ -2064,7 +2064,7 @@ namespace ipl { break; } case DISK_STATE_WII_DISK_IDLE: { - if (BS2State != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isUnk_0x1B81()) { + if (BS2State != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isDiskChannelReady()) { mDiskState = DISK_STATE_EJECT; mpDiskBnrAnims[DISK_ANIM_GRP_ALL][DISK_ANIM_DISK_EJECT]->play(); mpDiskBnrLayout->GetRootPane()->SetVisible(true); diff --git a/src/system/iplChannelManager.cpp b/src/system/iplChannelManager.cpp index f8775b65..40238409 100644 --- a/src/system/iplChannelManager.cpp +++ b/src/system/iplChannelManager.cpp @@ -91,7 +91,7 @@ namespace ipl { extern "C" const u32 scLangLookup__Q23ipl7channel[][16]; Manager::Manager(EGG::Heap* heap) - : mpHeap(heap), mState(INIT), mbCanRefresh(0), unk_0x1B81(false), mbSetDiskBannerInfo(false), mPrevNandResult(NAND_RESULT_OK), + : mpHeap(heap), mState(INIT), mbCanRefresh(0), mbDiskChannelReady(false), mbSetDiskBannerInfo(false), mPrevNandResult(NAND_RESULT_OK), mbLoadedChJump(false) { mpLockedMsgFile = NULL; @@ -951,7 +951,7 @@ namespace ipl { int state = System::getBS2Manager()->getIPLState(); if (state == bs2::IPL_STATE_RVL_GAME && mBS2State != bs2::IPL_STATE_RVL_GAME) { mbSetDiskBannerInfo = setDiskBannerInfo(false); - unk_0x1B81 = true; + mbDiskChannelReady = true; } else if (state != bs2::IPL_STATE_RVL_GAME && state != mBS2State) { setDiskBannerInfo(true); } @@ -1076,7 +1076,7 @@ namespace ipl { ARCFileInfo readFile; if (unk) { - unk_0x1B81 = false; + mbDiskChannelReady = false; } int diskPage, diskIndex; -- 2.49.1 From 299a6ca724996b8616fcf5f19668af9963a753db Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:30:27 -0500 Subject: [PATCH 11/12] cleanup(puh_ker_sem): name semaphore manager fields (#910) initCount/flags from create args; usedCount active slots; lockSem manager lock. --- libs/RVL_SDK/src/usbcmn/puh_ker_sem.c | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libs/RVL_SDK/src/usbcmn/puh_ker_sem.c b/libs/RVL_SDK/src/usbcmn/puh_ker_sem.c index 4db0892c..d69696aa 100644 --- a/libs/RVL_SDK/src/usbcmn/puh_ker_sem.c +++ b/libs/RVL_SDK/src/usbcmn/puh_ker_sem.c @@ -7,12 +7,12 @@ static struct { struct { OSSemaphore* sem; // 0x00 - u32 unk_0x04; - u32 unk_0x08; + u32 initCount; + u32 flags; } entries[MAX_PUH_SEM]; // 0x00 - u32 unk_0x90; - OSSemaphore* unk_0x94; - u8 unk_0x98[0x0C]; + u32 usedCount; + OSSemaphore* lockSem; + u8 pad[0x0C]; } st_uhs_ker_sem_mng; static OSSemaphore st_uhf_ker_sem[MAX_PUH_SEM]; @@ -20,17 +20,17 @@ static OSSemaphore st_uhf_ker_sem[MAX_PUH_SEM]; static s32 st_uhs_ker_sem_status; static int uhf_ker_sem_inline_0() { - if (st_uhs_ker_sem_status != 1 || st_uhs_ker_sem_mng.unk_0x94 == 0) { + if (st_uhs_ker_sem_status != 1 || st_uhs_ker_sem_mng.lockSem == 0) { return -1; } else { - OSWaitSemaphore(st_uhs_ker_sem_mng.unk_0x94); + OSWaitSemaphore(st_uhs_ker_sem_mng.lockSem); return 0; } } static void uhf_ker_sem_inline_1() { - if (st_uhs_ker_sem_status == 1 && st_uhs_ker_sem_mng.unk_0x94 != 0) { - OSSignalSemaphore(st_uhs_ker_sem_mng.unk_0x94); + if (st_uhs_ker_sem_status == 1 && st_uhs_ker_sem_mng.lockSem != 0) { + OSSignalSemaphore(st_uhs_ker_sem_mng.lockSem); } } @@ -48,7 +48,7 @@ s32 uhf_ker_create_sem(u32 initCount, int flags) { return -5; } - if (st_uhs_ker_sem_mng.unk_0x90 == 12) { + if (st_uhs_ker_sem_mng.usedCount == 12) { uhf_ker_sem_inline_1(); return -24; } @@ -65,9 +65,9 @@ s32 uhf_ker_create_sem(u32 initCount, int flags) { } st_uhs_ker_sem_mng.entries[i].sem = sem; - st_uhs_ker_sem_mng.entries[i].unk_0x04 = initCount; - st_uhs_ker_sem_mng.entries[i].unk_0x08 = flags; - st_uhs_ker_sem_mng.unk_0x90++; + st_uhs_ker_sem_mng.entries[i].initCount = initCount; + st_uhs_ker_sem_mng.entries[i].flags = flags; + st_uhs_ker_sem_mng.usedCount++; uhf_ker_sem_inline_1(); @@ -97,9 +97,9 @@ s32 uhf_ker_delete_sem(int sem) { } st_uhs_ker_sem_mng.entries[sem - 1].sem = NULL; - st_uhs_ker_sem_mng.entries[sem - 1].unk_0x04 = 0; - st_uhs_ker_sem_mng.entries[sem - 1].unk_0x08 = 0; - st_uhs_ker_sem_mng.unk_0x90--; + st_uhs_ker_sem_mng.entries[sem - 1].initCount = 0; + st_uhs_ker_sem_mng.entries[sem - 1].flags = 0; + st_uhs_ker_sem_mng.usedCount--; uhf_ker_sem_inline_1(); -- 2.49.1 From f00aad57c9eae1d3410a010c50ea0601e3085555 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:30:32 -0500 Subject: [PATCH 12/12] cleanup(iplChannelSelect): rename ortho translate/scale fields unk_0xD8 -> mOrthoTrans; unk_0xE4 -> mOrthoScale (setOrthoTransAndScale). Byte-identical. --- .../scene/channelSelect/iplChannelSelect.h | 4 +-- src/scene/channelSelect/iplChannelSelect.cpp | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/scene/channelSelect/iplChannelSelect.h b/include/scene/channelSelect/iplChannelSelect.h index 556e6b5f..29e3932a 100644 --- a/include/scene/channelSelect/iplChannelSelect.h +++ b/include/scene/channelSelect/iplChannelSelect.h @@ -259,8 +259,8 @@ namespace ipl { f32 mChanThumbOff_X; // 0xD0 f32 mChanThumbOff_Y; // 0xD4 - math::VEC3 unk_0xD8; - math::VEC2 unk_0xE4; + math::VEC3 mOrthoTrans; + math::VEC2 mOrthoScale; f32 mScaleAdjust; // 0xEC int mDiskState; // 0xF0 diff --git a/src/scene/channelSelect/iplChannelSelect.cpp b/src/scene/channelSelect/iplChannelSelect.cpp index b98e0b4c..5e756efe 100644 --- a/src/scene/channelSelect/iplChannelSelect.cpp +++ b/src/scene/channelSelect/iplChannelSelect.cpp @@ -329,8 +329,8 @@ namespace ipl { setSceneParentFlags(SCN_PARENTFLAG_DRAW | SCN_PARENTFLAG_CALC); - unk_0xD8 = math::VEC3(0.0f, 0.0f, 0.0f); - unk_0xE4 = math::VEC2(1.0f, 1.0f); + mOrthoTrans = math::VEC3(0.0f, 0.0f, 0.0f); + mOrthoScale = math::VEC2(1.0f, 1.0f); nw4r::ut::Rect proj4x3; System::getProjectionRect4x3(&proj4x3); @@ -647,7 +647,7 @@ namespace ipl { void ChannelSelect::draw() { if (mState != STATE_INACTIVE && System::getSceneManager()->onDrawLayer(scene::DRAW_LAYER_DEFAULT)) { if (mState == STATE_NORMAL_FADE_ZOOM || mState == STATE_NORMAL_DONE_FADE_ZOOM || mState == STATE_NORMAL_RESTART) { - utility::Graphics::setOrthoTransAndScale(unk_0xD8, unk_0xE4); + utility::Graphics::setOrthoTransAndScale(mOrthoTrans, mOrthoScale); } utility::Graphics::setOrtho(); @@ -1909,10 +1909,10 @@ namespace ipl { u16 efbHeight; if (mState == STATE_NORMAL_FADE_ZOOM || mState == STATE_NORMAL_DONE_FADE_ZOOM || mState == STATE_NORMAL_RESTART) { nw4r::math::MTX44 mtx; - f32 right = unk_0xD8.x + projRect.right / unk_0xE4.x; - f32 left = unk_0xD8.x + projRect.left / unk_0xE4.x; - f32 bottom = unk_0xD8.y - projRect.bottom / unk_0xE4.y; - f32 top = unk_0xD8.y - projRect.top / unk_0xE4.y; + f32 right = mOrthoTrans.x + projRect.right / mOrthoScale.x; + f32 left = mOrthoTrans.x + projRect.left / mOrthoScale.x; + f32 bottom = mOrthoTrans.y - projRect.bottom / mOrthoScale.y; + f32 top = mOrthoTrans.y - projRect.top / mOrthoScale.y; MTXOrtho(mtx, top, bottom, left, right, -100.0f, 100.0f); nw4r::math::VEC4 vec4_in(vec.x, vec.y, 0.0f, 1.0f); nw4r::math::VEC4 vec4; @@ -1920,10 +1920,10 @@ namespace ipl { fbWidth = rMode->fbWidth; efbHeight = rMode->efbHeight; f32 projectionWidth = projRect.GetWidth(); - scissorX = ((1.0f + vec4.x) * fbWidth / 2) - ((mChanThumbOff_X * unk_0xE4.x) * (fbWidth / projectionWidth)); - scissorY = (efbHeight - ((1.0f + vec4.y) * efbHeight / 2)) - (mChanThumbOff_Y * unk_0xE4.y); - scissorWidth = 2.0f * (mChanThumbOff_X * unk_0xE4.x) * (fbWidth / projectionWidth); - scissorHeight = 2.0f * (mChanThumbOff_Y * unk_0xE4.y); + scissorX = ((1.0f + vec4.x) * fbWidth / 2) - ((mChanThumbOff_X * mOrthoScale.x) * (fbWidth / projectionWidth)); + scissorY = (efbHeight - ((1.0f + vec4.y) * efbHeight / 2)) - (mChanThumbOff_Y * mOrthoScale.y); + scissorWidth = 2.0f * (mChanThumbOff_X * mOrthoScale.x) * (fbWidth / projectionWidth); + scissorHeight = 2.0f * (mChanThumbOff_Y * mOrthoScale.y); } else { fbWidth = rMode->fbWidth; efbHeight = rMode->efbHeight; @@ -2002,8 +2002,8 @@ namespace ipl { nw4r::ut::Rect projRect; System::getProjectionRect(&projRect); - unk_0xD8 = math::VEC3((frames[0].x + frames[1].x) / 2, (frames[0].y + frames[2].y) / 2, 0.0f); - unk_0xE4 = math::VEC2(projRect.GetWidth() / (frames[1].x - frames[0].x), projRect.GetHeight() / (frames[0].y - frames[2].y)); + mOrthoTrans = math::VEC3((frames[0].x + frames[1].x) / 2, (frames[0].y + frames[2].y) / 2, 0.0f); + mOrthoScale = math::VEC2(projRect.GetWidth() / (frames[1].x - frames[0].x), projRect.GetHeight() / (frames[0].y - frames[2].y)); } int ChannelSelect::isInChannelPaneNames(const char* name) const { -- 2.49.1