From 741c9263e39aeaf75d7552e2bfaaede0113df7b4 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:00:18 -0500 Subject: [PATCH 1/4] cleanup(iplSDButton): rename unk_0x54 to mAnimWait (#852) Same pattern as Button: wait flag while help-button click anim plays. --- include/scene/sdButton/iplSDButton.h | 2 +- src/scene/sdButton/iplSDButton.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/scene/sdButton/iplSDButton.h b/include/scene/sdButton/iplSDButton.h index 01ce34ed..271ef07f 100644 --- a/include/scene/sdButton/iplSDButton.h +++ b/include/scene/sdButton/iplSDButton.h @@ -145,7 +145,7 @@ namespace ipl { ANIM_MAX, }; - int unk_0x54; + int mAnimWait; layout::Object* mpLayout; // 0x58 nand::LayoutFile* mpLayoutFile; // 0x5C diff --git a/src/scene/sdButton/iplSDButton.cpp b/src/scene/sdButton/iplSDButton.cpp index 69dcd093..ca9aa78f 100644 --- a/src/scene/sdButton/iplSDButton.cpp +++ b/src/scene/sdButton/iplSDButton.cpp @@ -31,7 +31,7 @@ namespace ipl { }; // clang-format on - SDButton::SDButton(EGG::Heap* heap) : Base(heap), unk_0x54(0) { + SDButton::SDButton(EGG::Heap* heap) : Base(heap), mAnimWait(0) { setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW); for (int i = 0; i < 2; i++) { @@ -114,10 +114,10 @@ namespace ipl { } void SDButton::calc() { - if (unk_0x54 == 1) { + if (mAnimWait == 1) { if (!mpLayout->isPlaying(ANIM_HELP_BTN_ROLL_ON)) { reset_gui(); - unk_0x54 = 0; + mAnimWait = 0; } } @@ -347,7 +347,7 @@ namespace ipl { switch (animNo) { case IDANIM_HELP_BTN_CLICK: { anim = mpLayout->getAnim(ANIM_HELP_BTN_ROLL_ON); - unk_0x54 = 1; + mAnimWait = 1; break; } case IDANIM_ARROW_RIGHT_CLICK: { -- 2.49.1 From 23db5e05e1576eae6bc27cfd29b967c4e32e34ff Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:00:24 -0500 Subject: [PATCH 2/4] cleanup(CDBCryptBuf): rename unk_0x3EC00/04 to size/offset (#853) Decrypt fills size; Matching CDBRecordFile uses offset for seek/tell/read. --- libs/RevoEX/include/private/cdb/CDBCrypt.h | 4 ++-- libs/RevoEX/src/cdb/CDBRecord.c | 8 ++++---- libs/RevoEX/src/cdb/CDBRecordFile.c | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libs/RevoEX/include/private/cdb/CDBCrypt.h b/libs/RevoEX/include/private/cdb/CDBCrypt.h index 215e8b48..8cad3f03 100644 --- a/libs/RevoEX/include/private/cdb/CDBCrypt.h +++ b/libs/RevoEX/include/private/cdb/CDBCrypt.h @@ -13,8 +13,8 @@ typedef struct _CDBCryptBuf { u32 buffer32[0xFB00]; }; // 0x00 - u32 unk_0x3EC00; - u32 unk_0x3EC04; + u32 size; // 0x3EC00 + u32 offset; // 0x3EC04 BOOL allocated; // 0x3EC08 u8 unk_0x3EC0C[0x34]; } CDBCryptBuf; diff --git a/libs/RevoEX/src/cdb/CDBRecord.c b/libs/RevoEX/src/cdb/CDBRecord.c index b2d94a1c..64439b37 100644 --- a/libs/RevoEX/src/cdb/CDBRecord.c +++ b/libs/RevoEX/src/cdb/CDBRecord.c @@ -164,7 +164,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) { goto open_result_ready; open_location_ok: if (CDBFSSDIsMounted()) { - err = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->unk_0x3EC00, NULL); + err = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->size, NULL); } else { err = CDB_ERROR_SD_IS_NOT_MOUNTED; } @@ -174,7 +174,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) { CDBCryptBufFree((CDBCryptBuf**)&record->cryptBuf); return err; } - cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf); + cryptBuf->offset = sizeof(CDBAttrBuf); } return CDB_ERROR_OK; } @@ -223,7 +223,7 @@ CDBErr CDBRecordOpenReadOnly_(CDBRecord* record) { goto result_ready; location_ok: if (CDBFSSDIsMounted()) { - result = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->unk_0x3EC00, NULL); + result = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->size, NULL); } else { result = CDB_ERROR_SD_IS_NOT_MOUNTED; } @@ -233,7 +233,7 @@ CDBErr CDBRecordOpenReadOnly_(CDBRecord* record) { CDBCryptBufFree((CDBCryptBuf**)&record->cryptBuf); return result; } - cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf); + cryptBuf->offset = sizeof(CDBAttrBuf); } return CDB_ERROR_OK; } diff --git a/libs/RevoEX/src/cdb/CDBRecordFile.c b/libs/RevoEX/src/cdb/CDBRecordFile.c index b7aacb29..fa50cdeb 100644 --- a/libs/RevoEX/src/cdb/CDBRecordFile.c +++ b/libs/RevoEX/src/cdb/CDBRecordFile.c @@ -264,8 +264,8 @@ CDBErr CDBRecordFileReadData(CDBRecord* record, void* buffer, u32 size, u32* rea CDBCryptBuf* cryptBuf = record->cryptBuf; if (cryptBuf != NULL) { - u32 unk = cryptBuf->unk_0x3EC00 - cryptBuf->unk_0x3EC04; - if (cryptBuf->unk_0x3EC00 < unk) { + u32 unk = cryptBuf->size - cryptBuf->offset; + if (cryptBuf->size < unk) { unk = 0; } @@ -274,8 +274,8 @@ CDBErr CDBRecordFileReadData(CDBRecord* record, void* buffer, u32 size, u32* rea } if (unk != 0) { - memcpy(buffer, (u8*)&cryptBuf->buffer[cryptBuf->unk_0x3EC04], unk); - cryptBuf->unk_0x3EC04 += unk; + memcpy(buffer, (u8*)&cryptBuf->buffer[cryptBuf->offset], unk); + cryptBuf->offset += unk; } if (readSize != NULL) { @@ -300,16 +300,16 @@ CDBErr CDBRecordFileSeekData(CDBRecord* record, u32 offset, CDBSeek seek) { if (cryptBuf != NULL) { switch (seek) { case CDB_SEEK_BEGIN: { - cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf); - cryptBuf->unk_0x3EC04 += offset; + cryptBuf->offset = sizeof(CDBAttrBuf); + cryptBuf->offset += offset; break; } case CDB_SEEK_END: { - cryptBuf->unk_0x3EC04 = (cryptBuf->unk_0x3EC00 - 1) - offset; + cryptBuf->offset = (cryptBuf->size - 1) - offset; break; } case CDB_SEEK_CUR: { - cryptBuf->unk_0x3EC04 += offset; + cryptBuf->offset += offset; break; } } @@ -329,7 +329,7 @@ int CDBRecordFileTellData(CDBRecord* record) { CDBCryptBuf* cryptBuf = record->cryptBuf; if (cryptBuf != NULL) { - return cryptBuf->unk_0x3EC04 - sizeof(CDBAttrBuf); + return cryptBuf->offset - sizeof(CDBAttrBuf); } return CDBFTellData(&recordFile->bridgeFile, record->key.location); } -- 2.49.1 From 2d9e3ee14a8e317750bffb7fe41d92328e393422 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:00:30 -0500 Subject: [PATCH 3/4] cleanup(eZiText): rename work unk_0x1A to separator (#854) Init to space (0x20); Matching zi8space emits it; zi8cgetc saves as separator. --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c | 12 ++++++------ libs/RVLMiddleware/eZiText/src/clib/zi8initd.c | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8space.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index e4bf1bba..29706709 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -219,7 +219,7 @@ struct __zi8_work_data_s { ziU8 unk_0x17; ziU8 subLanguage; // 0x18 ziU8 unk_0x19; - ziU16 unk_0x1A; + ziU16 separator; // 0x1A ziU8 unk_0x1C[3]; ziU8 unk_0x1F; ziU16 unk_0x20[0x40]; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c b/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c index f72e5f87..957856d7 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c @@ -18,7 +18,7 @@ static Zi8UInt Zi8SetFindCand(ziU8* foundCandidates, Zi8UInt ordinal, ziPtr work } ziWChar* ZiGetNextPhonetic(ziWChar* spelling, ziWChar* end ZI_NEED_WORK) { - while (*spelling && *spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360 && spelling < end) { + while (*spelling && *spelling != ZI_WORK->separator && *spelling != 0xF360 && spelling < end) { ++spelling; } if (!*spelling || spelling == end) { @@ -37,8 +37,8 @@ int ZiPartialMatch(ziWChar* spelling, ziWChar* spellingEnd, if (spelling == spellingEnd || candidate == candidateEnd || !*spelling || !*candidate) { return 1; } - while (*spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360) { - if (*candidate == ZI_WORK->unk_0x1A || *candidate == 0xF360) { + while (*spelling != ZI_WORK->separator && *spelling != 0xF360) { + if (*candidate == ZI_WORK->separator || *candidate == 0xF360) { break; } if (*spelling != *candidate) { @@ -2868,7 +2868,7 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_ ziU8 count; ziWChar spacedElements[256]; struct { ziWChar separator; } savedState; - savedState.separator = ZI_WORK->unk_0x1A; + savedState.separator = ZI_WORK->separator; if (elementCount <= 1 || !charCount) { return elementCount; } @@ -2881,9 +2881,9 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_ if (spacedIndex == elementCount) { return elementCount; } - ZI_WORK->unk_0x1A = 0xF360; + ZI_WORK->separator = 0xF360; Zi8ZHaddSpace(elements, elementCount, spacedElements, 256, __zi8_work_data); - ZI_WORK->unk_0x1A = savedState.separator; + ZI_WORK->separator = savedState.separator; spacedIndex = elementIndex = count = 0; while (charCount && elementIndex < elementCount) { if (spacedElements[spacedIndex] == 0xF360) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c index dae27d7e..37ac1de7 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c @@ -21,7 +21,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) { ZI_WORK->unk_0x0A = 0xFF; ZI_WORK->unk_0x10 = 0x64; *(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF; - ZI_WORK->unk_0x1A = 0x20; + ZI_WORK->separator = 0x20; ZI_WORK->unk_0x1C[2] = 0; ZI_WORK->unk_0x1B30 = 0; ZI_WORK->unk_0x1B3A = 0; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8space.c b/libs/RVLMiddleware/eZiText/src/clib/zi8space.c index 07902a35..eb8e03d3 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8space.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8space.c @@ -68,7 +68,7 @@ ziU8 Zi8ZHaddSpace(ziWChar* src, ziU8 count, ziWChar* dst, } if (pdst[k - 1] != 0xF360 && (pdst[k - 1] < 0xF331 || pdst[k - 1] > 0xF335)) { - pdst[k++] = ZI_WORK->unk_0x1A; + pdst[k++] = ZI_WORK->separator; } psrc += i; n -= i; -- 2.49.1 From 51212aa9b8375819119c89e538904ad06a38e622 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:01:27 -0500 Subject: [PATCH 4/4] cleanup(iplContest): name session NAT/HTTP unk fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename clear Contest session placeholders from usage: - unk_0x030 → natState (GameSpy/NAT detect state machine) - unk_0x034 → gsAvailable - unk_0x038 → natTimedOut - unk_0x03c → natFailed - unk_0x7f0 → httpBuf (NHTTP response buffer) Verified: iplContest 100%/100%, build/43U/ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d --- src/scene/nakamuraTest/iplContest.c | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/scene/nakamuraTest/iplContest.c b/src/scene/nakamuraTest/iplContest.c index 3759f411..f4e86863 100644 --- a/src/scene/nakamuraTest/iplContest.c +++ b/src/scene/nakamuraTest/iplContest.c @@ -25,16 +25,16 @@ typedef struct { undefined4 result; undefined4 errCode; HTTPTestState httpTestState; - undefined4 unk_0x030; - undefined4 unk_0x034; - undefined4 unk_0x038; - undefined4 unk_0x03c; + undefined4 natState; + undefined4 gsAvailable; + undefined4 natTimedOut; + undefined4 natFailed; OSTime detectStartTime; NHTTPConnection httpConnection; NHTTPRequest* httpRequest; NHTTPResponse* httpResponse; NCDProxyProfile proxy; - void* unk_0x7f0; + void* httpBuf; NAT nat; } StaticSession; @@ -64,14 +64,14 @@ void IPLContestInitialize(void* heapBuf, NCDProxyProfile* proxy) { g_session.result = 0xFF00; g_session.errCode = 0; g_session.httpTestState = HTTP_TEST_NOT_STARTED; - g_session.unk_0x030 = 0; + g_session.natState = 0; g_session.detectStartTime = 0; g_session.httpConnection = 0; g_session.httpRequest = 0; g_session.httpResponse = NULL; - g_session.unk_0x034 = 0; - g_session.unk_0x038 = 0; - g_session.unk_0x03c = 1; + g_session.gsAvailable = 0; + g_session.natTimedOut = 0; + g_session.natFailed = 1; g_session.proxy = *proxy; } @@ -100,7 +100,7 @@ int IPLContestProcess() { g_session.errCode = g_session.errCode != 0 ? g_session.errCode : -52200; OSReport("[error] Failed to start up NHTTP.\n"); } else { - g_session.unk_0x7f0 = IPLContestAlloc(0x400); + g_session.httpBuf = IPLContestAlloc(0x400); g_session.httpTestState = HTTP_TEST_STARTED; OSReport("Starting HTTP conectting test.\n"); } @@ -108,7 +108,7 @@ int IPLContestProcess() { } case HTTP_TEST_STARTED: { g_session.httpRequest = - NHTTPCreateRequest("http://conntest.nintendowifi.net/", 0, g_session.unk_0x7f0, 0x400, sNHTTPReqCallback, 0); + NHTTPCreateRequest("http://conntest.nintendowifi.net/", 0, g_session.httpBuf, 0x400, sNHTTPReqCallback, 0); if (g_session.httpRequest == 0) { g_session.httpTestState = HTTP_TEST_RESPONSE_ERRORED; g_session.result |= 4; @@ -156,9 +156,9 @@ int IPLContestProcess() { NHTTPDestroyResponse(g_session.httpResponse); g_session.httpResponse = NULL; } - if (g_session.unk_0x7f0 != NULL) { - IPLContestFree(g_session.unk_0x7f0, 0); - g_session.unk_0x7f0 = NULL; + if (g_session.httpBuf != NULL) { + IPLContestFree(g_session.httpBuf, 0); + g_session.httpBuf = NULL; } g_session.httpTestState = HTTP_TEST_DONE; NHTTPCleanupAsync(sNHTTPCleanupCallback); @@ -176,9 +176,9 @@ int IPLContestProcess() { NHTTPDestroyResponse(g_session.httpResponse); g_session.httpResponse = NULL; } - if (g_session.unk_0x7f0 != NULL) { - IPLContestFree(g_session.unk_0x7f0, 0); - g_session.unk_0x7f0 = NULL; + if (g_session.httpBuf != NULL) { + IPLContestFree(g_session.httpBuf, 0); + g_session.httpBuf = NULL; } g_session.httpTestState = HTTP_TEST_DONE; NHTTPCleanupAsync(sNHTTPCleanupCallback); @@ -198,11 +198,11 @@ int IPLContestProcess() { OSReport("Port mapping detectioning test has been skipped.\n"); } else - switch (g_session.unk_0x030) { + switch (g_session.natState) { case 0: { gsiMemoryCallbacksSet(IPLContestGSMalloc, IPLContestGSFree, IPLContestGSRealloc, IPLContestGSMemalign); GSIStartAvailableCheckA("wiinat"); - g_session.unk_0x030 = 1; + g_session.natState = 1; OSReport("Starting GameSpy available check.\n"); break; } @@ -212,14 +212,14 @@ int IPLContestProcess() { break; } case GSIACAvailable: { - g_session.unk_0x034 = 1; - g_session.unk_0x030 = 2; + g_session.gsAvailable = 1; + g_session.natState = 2; OSReport("GameSpy server is currently available.\n"); break; } default: { - g_session.unk_0x034 = 0; - g_session.unk_0x030 = 5; + g_session.gsAvailable = 0; + g_session.natState = 5; OSReport("GameSpy server is currently unavailable.\n"); break; } @@ -228,7 +228,7 @@ int IPLContestProcess() { } case 2: { NNStartNatDetection(onNatDetectionDone); - g_session.unk_0x030 = 3; + g_session.natState = 3; OSReport("Port mapping detectioning test has been started.\n"); g_session.detectStartTime = OSGetTime(); break; @@ -238,8 +238,8 @@ int IPLContestProcess() { if (OSGetTime() - g_session.detectStartTime < OSMillisecondsToTicks((OSTime)90000)) { break; } - g_session.unk_0x030 = 5; - g_session.unk_0x038 = 1; + g_session.natState = 5; + g_session.natTimedOut = 1; OSReport("[error] NAT timeout.\n"); break; } @@ -289,10 +289,10 @@ int IPLGetNATSupportCode(int conntype) { nat = g_session.nat; - if (g_session.unk_0x034 != 0) { - if (g_session.unk_0x038 != 0) { + if (g_session.gsAvailable != 0) { + if (g_session.natTimedOut != 0) { code = 11180; - } else if (g_session.unk_0x03c != 0) { + } else if (g_session.natFailed != 0) { code = 11170; } else { if (nat.mappingScheme == 0 && nat.mappings[2].publicPort == nat.mappings[1].publicPort * 2 - nat.mappings[0].publicPort) { @@ -464,10 +464,10 @@ void sNHTTPCleanupCallback() { void onNatDetectionDone(gsi_bool success, NAT nat) { if (success) { g_session.nat = nat; - g_session.unk_0x03c = 0; + g_session.natFailed = 0; } else { - g_session.unk_0x03c = 1; + g_session.natFailed = 1; } - g_session.unk_0x030 = 4; + g_session.natState = 4; return; } -- 2.49.1