From 32417fe8a2bc3592a5b96449e38c848d00844cde Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:02:44 -0500 Subject: [PATCH 1/3] cleanup(eZiText): rename work unk_0x01 to countOnly (#855) Assigned/compared with options->countOnly in zi8getc2. --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c | 8 ++++---- 2 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 29706709..e986030b 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -205,7 +205,7 @@ typedef struct _ziUwdNode { struct __zi8_work_data_s { ziU8 unk_0x00; - ziU8 unk_0x01; + ziU8 countOnly; // 0x01 ziU8 unk_0x02[2]; ziLanguageEntry* langEntries; // 0x04 ziU8 unk_0x08; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c index 95741b9b..58b64a8f 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c @@ -339,11 +339,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) { switch (parameters->language) { case 1: - if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) { + if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) { switch(ZI_WORK->unk_0x00) { case '\0': if (parameters->elements[0] == 0xEF04) { - ZI_WORK->unk_0x01 = options->countOnly; + ZI_WORK->countOnly = options->countOnly; ZI_WORK->unk_0x00 = '\x01'; } break; @@ -400,11 +400,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option break; case 0x11: default: - if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) { + if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) { switch(ZI_WORK->unk_0x00) { case '\0': if (parameters->elements[0] == 0xEFF2) { - ZI_WORK->unk_0x01 = options->countOnly; + ZI_WORK->countOnly = options->countOnly; ZI_WORK->unk_0x00 = '\x01'; } break; -- 2.49.1 From 3e279ef189e21e9b1e166d5c86c64d8a14786d40 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:02:52 -0500 Subject: [PATCH 2/3] cleanup(eZiText): rename work unk_0x17F0 to dawgGroup (#856) Holds NextDawgGroup() cursor in Matching zi8dawg. --- .../eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c | 16 ++++++++-------- 2 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 e986030b..300ce3de 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -283,7 +283,7 @@ struct __zi8_work_data_s { ziU16 unk_0x17EA; ziU8 unk_0x17EC; ziU8 unk_0x17ED[3]; - ziU8* unk_0x17F0; + ziU8* dawgGroup; // 0x17F0 ziWChar unk_0x17F4[0x40]; // 0x17F4..0x1874 ziU16 unk_0x1874; ziU8 unk_0x1876; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c index 97d7f279..7241ef16 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c @@ -306,7 +306,7 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language, } else { if (status == 0) { ZI_WORK->unk_0x17EC = 0; - ZI_WORK->unk_0x17F0 = NextDawgGroup(0, language, ZI_WORK); + ZI_WORK->dawgGroup = NextDawgGroup(0, language, ZI_WORK); } else if (ZI_WORK->unk_0x17EC != 0) { Zi8LogError(100, ZI_WORK); goto finish_match; @@ -316,30 +316,30 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language, result = Zi8MatchROMdata2(elements, count, language, output, capacity, mode, status, reservedMode, 0, acceptPrefix, ZI_WORK); } else { - while (ZI_WORK->unk_0x17F0 != 0) { + while (ZI_WORK->dawgGroup != 0) { result = Zi8MatchROMdata2(elements, count, language, output, capacity, - mode, status, reservedMode, ZI_WORK->unk_0x17F0, + mode, status, reservedMode, ZI_WORK->dawgGroup, acceptPrefix, ZI_WORK); if ((ziU8)result != 0) break; status = 0; if (count <= 1 && language == 0x36) break; - ZI_WORK->unk_0x17F0 = NextDawgGroup(ZI_WORK->unk_0x17F0, language, ZI_WORK); + ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK); } } if ((ziU8)result == 0 && status == 0 && mode == 1 && count == 1 && capacity >= 1) { mode = 0; ZI_WORK->unk_0x17EC = 1; if (tableSize != 0) { - ZI_WORK->unk_0x17F0 = NextDawgGroup(0, language, ZI_WORK); - while (ZI_WORK->unk_0x17F0 != 0) { + ZI_WORK->dawgGroup = NextDawgGroup(0, language, ZI_WORK); + while (ZI_WORK->dawgGroup != 0) { if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity, - mode, status, reservedMode, ZI_WORK->unk_0x17F0, + mode, status, reservedMode, ZI_WORK->dawgGroup, acceptPrefix, ZI_WORK) != 0) { *output = *elements; result = 1; break; } - ZI_WORK->unk_0x17F0 = NextDawgGroup(ZI_WORK->unk_0x17F0, language, ZI_WORK); + ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK); } } else { if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity, -- 2.49.1 From 24e76ff0bb6c52411fffb4f6676b4eed16c4ea39 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:02:53 -0500 Subject: [PATCH 3/3] cleanup(iplUrlProcessor): rename collision and processor placeholders line_collision: unk_0x00/04/08 -> mLeft/mRight/mY url_collision: unk_0x00/04/08 -> mTagNo/mpStart/mpEnd UrlProcessor: unk_0x40..53 -> mHitYOffset/mMemoTranslateY/mCurTagNo/ mSelectedTagNo/mbColorPass/mbInTag/mbHoverOffset/mbFocusEnabled Rename setUnk/getUnk accessors; update FocusObject call sites. Byte-identical (DOL sha1 unchanged). Unit objdiff 100%. --- include/scene/board/iplUrlProcessor.h | 42 ++++++------ src/scene/board/iplFocusObject.cpp | 10 +-- src/scene/board/iplUrlProcessor.cpp | 96 +++++++++++++-------------- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/include/scene/board/iplUrlProcessor.h b/include/scene/board/iplUrlProcessor.h index 6019d2d5..e8b9d921 100644 --- a/include/scene/board/iplUrlProcessor.h +++ b/include/scene/board/iplUrlProcessor.h @@ -18,11 +18,11 @@ namespace ipl { class line_collision { public: - line_collision() : unk_0x00(0.0f), unk_0x04(0.0f), unk_0x08(0.0f) {} + line_collision() : mLeft(0.0f), mRight(0.0f), mY(0.0f) {} - f32 unk_0x00; - f32 unk_0x04; - f32 unk_0x08; + f32 mLeft; + f32 mRight; + f32 mY; nw4r::ut::Link mLinkList; // 0x0C }; @@ -31,9 +31,9 @@ namespace ipl { url_collision(); ~url_collision(); - int unk_0x00; - wchar_t* unk_0x04; - wchar_t* unk_0x08; + int mTagNo; + wchar_t* mpStart; + wchar_t* mpEnd; nw4r::ut::Link mLinkList; // 0x0C nw4r::ut::List mLineCollisions; // 0x14 }; @@ -53,19 +53,19 @@ namespace ipl { void parse(nw4r::ut::PrintContext* context); BOOL is_focused() const; - void select(int unk); + void select(int tagNo); int get_focused_tagno(int chan) const; url_collision* get_selected_col(); void get_url(char* urlOut, u32 urlLen); - void setUnk_0x40(f32 val) { unk_0x40 = val; } - void setUnk_0x44(f32 val) { unk_0x44 = val; } - void setUnk_0x53(bool val) { unk_0x53 = val; } + void setHitYOffset(f32 val) { mHitYOffset = val; } + void setMemoTranslateY(f32 val) { mMemoTranslateY = val; } + void setFocusEnabled(bool val) { mbFocusEnabled = val; } - u8 getUnk_0x50() const { return unk_0x50; } - void setUnk_0x50(u8 val) { unk_0x50 = val; } + u8 getColorPass() const { return mbColorPass; } + void setColorPass(u8 val) { mbColorPass = val; } private: typedef struct { @@ -75,14 +75,14 @@ namespace ipl { con_data mConData[WPAD_MAX_CONTROLLERS]; // 0x00 nw4r::ut::List mUrlCollisions; // 0x34 - f32 unk_0x40; - f32 unk_0x44; - int unk_0x48; - int unk_0x4C; - u8 unk_0x50; - u8 unk_0x51; - u8 unk_0x52; - u8 unk_0x53; + f32 mHitYOffset; + f32 mMemoTranslateY; + int mCurTagNo; + int mSelectedTagNo; + u8 mbColorPass; + u8 mbInTag; + u8 mbHoverOffset; + u8 mbFocusEnabled; }; } // namespace scene } // namespace ipl diff --git a/src/scene/board/iplFocusObject.cpp b/src/scene/board/iplFocusObject.cpp index bbc5d42a..90aab339 100644 --- a/src/scene/board/iplFocusObject.cpp +++ b/src/scene/board/iplFocusObject.cpp @@ -930,13 +930,13 @@ namespace ipl { math::VEC3 translate(mpLayout->FindPaneByName("N_Memo")->GetTranslate()); mURLProc.clear_prev_drawing(); - mURLProc.setUnk_0x44(translate.y); + mURLProc.setMemoTranslateY(translate.y); bool result = false; if (mState == STATE_NORMAL && mScroller.is_busy() == FALSE) { result = true; } - mURLProc.setUnk_0x53(result); + mURLProc.setFocusEnabled(result); if (translate.y < 500.0f) { mpLayout->draw("N_Header"); @@ -983,8 +983,8 @@ namespace ipl { mpLayout->draw("ReplyMask"); } - if (!mURLProc.getUnk_0x50()) { - mURLProc.setUnk_0x50(1); + if (!mURLProc.getColorPass()) { + mURLProc.setColorPass(1); } } @@ -1512,7 +1512,7 @@ namespace ipl { mURLProc.init(); if (mpBoardObj->mLetterType == BoardObject::TYPE_MEMO) { - mURLProc.setUnk_0x40(8.0f); + mURLProc.setHitYOffset(8.0f); } nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("T_Letter"); diff --git a/src/scene/board/iplUrlProcessor.cpp b/src/scene/board/iplUrlProcessor.cpp index d6692f9f..56be8327 100644 --- a/src/scene/board/iplUrlProcessor.cpp +++ b/src/scene/board/iplUrlProcessor.cpp @@ -15,16 +15,16 @@ namespace ipl { } void UrlProcessor::init() { - unk_0x52 = 0; - unk_0x51 = 0; - unk_0x50 = 0; - unk_0x53 = 1; + mbHoverOffset = 0; + mbInTag = 0; + mbColorPass = 0; + mbFocusEnabled = 1; - unk_0x40 = 0.0f; - unk_0x44 = 0.0f; + mHitYOffset = 0.0f; + mMemoTranslateY = 0.0f; - unk_0x48 = 0; - unk_0x4C = -1; + mCurTagNo = 0; + mSelectedTagNo = -1; for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) { mConData[i].valid = false; @@ -60,14 +60,14 @@ namespace ipl { } void UrlProcessor::clear_prev_drawing() { - unk_0x48 = 0; - unk_0x52 = 0; - unk_0x51 = 0; + mCurTagNo = 0; + mbHoverOffset = 0; + mbInTag = 0; } nw4r::ut::Operation UrlProcessor::Process(u16 code, nw4r::ut::PrintContext* context) { if (code == SEPERATOR || code == (u16)'\n') { - if (unk_0x50 == 0) { + if (mbColorPass == 0) { make_collision(context, code); } else if (code == SEPERATOR) { parse(context); @@ -78,42 +78,42 @@ namespace ipl { void UrlProcessor::make_collision(nw4r::ut::PrintContext* context, u16 code) { if (code == SEPERATOR) { - if (unk_0x51 == 0) { + if (mbInTag == 0) { url_collision* const url_col = new (System::getMem2App(), 4) url_collision(); line_collision* const line_col = new (System::getMem2App(), 4) line_collision(); - url_col->unk_0x00 = unk_0x48; - url_col->unk_0x04 = (wchar_t*)context->str; + url_col->mTagNo = mCurTagNo; + url_col->mpStart = (wchar_t*)context->str; - line_col->unk_0x00 = context->writer->GetCursorX(); + line_col->mLeft = context->writer->GetCursorX(); nw4r::ut::List_Append(&url_col->mLineCollisions, line_col); nw4r::ut::List_Append(&mUrlCollisions, url_col); - unk_0x51 = 1; + mbInTag = 1; } else { void* url_col_raw = nw4r::ut::List_GetPrev(&mUrlCollisions, NULL); void* line_col_raw = nw4r::ut::List_GetPrev(&((url_collision*)url_col_raw)->mLineCollisions, NULL); url_collision* url_col = (url_collision*)url_col_raw; line_collision* line_col = (line_collision*)line_col_raw; - line_col->unk_0x04 = context->writer->GetCursorX(); - line_col->unk_0x08 = context->writer->GetCursorY(); + line_col->mRight = context->writer->GetCursorX(); + line_col->mY = context->writer->GetCursorY(); - url_col->unk_0x08 = (wchar_t*)context->str; + url_col->mpEnd = (wchar_t*)context->str; - unk_0x51 = 0; - unk_0x48++; + mbInTag = 0; + mCurTagNo++; } } else { - if (unk_0x51 != 0) { + if (mbInTag != 0) { url_collision* url_col = (url_collision*)nw4r::ut::List_GetPrev(&mUrlCollisions, NULL); line_collision* line_col = (line_collision*)nw4r::ut::List_GetPrev(&url_col->mLineCollisions, NULL); - line_col->unk_0x04 = context->writer->GetCursorX(); - line_col->unk_0x08 = context->writer->GetCursorY(); + line_col->mRight = context->writer->GetCursorX(); + line_col->mY = context->writer->GetCursorY(); line_col = new (System::getMem2App(), 4) line_collision(); - line_col->unk_0x00 = -208.0f; + line_col->mLeft = -208.0f; nw4r::ut::List_Append(&url_col->mLineCollisions, line_col); } @@ -122,41 +122,41 @@ namespace ipl { void UrlProcessor::parse(nw4r::ut::PrintContext* context) { f32 curY = context->writer->GetCursorY(); - if (unk_0x51 == 0) { - if (unk_0x4C == unk_0x48) { + if (mbInTag == 0) { + if (mSelectedTagNo == mCurTagNo) { context->writer->SetTextColor(0xFFE664FF); - } else if (unk_0x53 != 0 && is_focused()) { + } else if (mbFocusEnabled != 0 && is_focused()) { context->writer->SetCursorY(curY - 2.0f); context->writer->SetTextColor(0xF06E28FF); - unk_0x52 = 1; + mbHoverOffset = 1; } else { context->writer->SetTextColor(0x34BEEDFF); } - unk_0x51 = 1; + mbInTag = 1; } else { - if (unk_0x52 != 0) { + if (mbHoverOffset != 0) { context->writer->SetCursorY(2.0f + curY); - unk_0x52 = 0; + mbHoverOffset = 0; } context->writer->SetTextColor(0x646464FF); - unk_0x51 = 0; - unk_0x48++; + mbInTag = 0; + mCurTagNo++; } } BOOL UrlProcessor::is_focused() const { for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) { - if (unk_0x48 == get_focused_tagno(i)) { + if (mCurTagNo == get_focused_tagno(i)) { return TRUE; } } return FALSE; } - void UrlProcessor::select(int unk) { - unk_0x4C = unk; + void UrlProcessor::select(int tagNo) { + mSelectedTagNo = tagNo; } int UrlProcessor::get_focused_tagno(int chan) const { @@ -174,13 +174,13 @@ namespace ipl { while (url_col = (url_collision*)nw4r::ut::List_GetNext(&mUrlCollisions, url_col), url_col != NULL) { while (line_col = (line_collision*)nw4r::ut::List_GetNext(&url_col->mLineCollisions, line_col), line_col != NULL) { - f32 left = line_col->unk_0x00 - var_f28; - f32 right = var_f28 + line_col->unk_0x04; - f32 temp_f0 = ((unk_0x44 + unk_0x40) - line_col->unk_0x08); + f32 left = line_col->mLeft - var_f28; + f32 right = var_f28 + line_col->mRight; + f32 temp_f0 = ((mMemoTranslateY + mHitYOffset) - line_col->mY); f32 top = (var_f29 + temp_f0) - var_f28; f32 bottom = var_f28 + (var_f30 + temp_f0); if (left <= var_f31 && var_f31 <= right && top <= -pos.y && -pos.y <= bottom) { - return url_col->unk_0x00; + return url_col->mTagNo; } } } @@ -194,7 +194,7 @@ namespace ipl { url_collision* url_col = NULL; while (got = (url_collision*)nw4r::ut::List_GetNext(&mUrlCollisions, got), got != NULL) { - if (got->unk_0x00 == unk_0x4C) { + if (got->mTagNo == mSelectedTagNo) { url_col = got; break; } @@ -210,10 +210,10 @@ namespace ipl { int chIdx2 = 0; int chIdx = 0; - u32 count = (u32)url_col->unk_0x08 - (u32)url_col->unk_0x04; + u32 count = (u32)url_col->mpEnd - (u32)url_col->mpStart; count >>= 1; for (u32 i = 0; i < count; i++) { - wchar_t wch = url_col->unk_0x04[i]; + wchar_t wch = url_col->mpStart[i]; if (wch != SEPERATOR && chIdx2 < 0x200) { url[chIdx2++] = wch; } @@ -226,9 +226,9 @@ namespace ipl { } UrlProcessor::url_collision::url_collision() { - unk_0x00 = 0; - unk_0x04 = NULL; - unk_0x08 = NULL; + mTagNo = 0; + mpStart = NULL; + mpEnd = NULL; nw4r::ut::List_Init(&mLineCollisions, offsetof(line_collision, mLinkList)); } -- 2.49.1