From bd50ad6fb2ce9461cd6c02980a4858dc73dc7331 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 1 Oct 2026 07:00:47 +0000 Subject: [PATCH] iplSDChannelSelect, tiCandidateBox: structural fixes (worker d5dcdbc0) --- README.md | 4 ++-- .../scene/sdChannelSelect/iplSDChannelSelect.h | 6 +++--- src/keyboard/tiCandidateBox.cpp | 17 ++++++----------- .../sdChannelSelect/iplSDChannelSelect.cpp | 16 ++++++++++------ 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 0e6edcfe..273f29f5 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ Progress | Decompiled | Matched | Linked | Data | |:---:|:---:|:---:|:---:| -| 99.10% | 86.60% | 60.61% | 91.11% | +| 99.10% | 86.62% | 60.61% | 91.11% | -units 911/1027 complete, functions 12163/12563 matched. +units 911/1027 complete, functions 12165/12563 matched. decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data diff --git a/include/scene/sdChannelSelect/iplSDChannelSelect.h b/include/scene/sdChannelSelect/iplSDChannelSelect.h index ec852e19..15b04ac3 100644 --- a/include/scene/sdChannelSelect/iplSDChannelSelect.h +++ b/include/scene/sdChannelSelect/iplSDChannelSelect.h @@ -395,9 +395,9 @@ namespace ipl { NandSDWorker* mpSDWorker; ESTitleId32* mpSDTitleIds; SDChannelSelectTitleInfo* mpSDTitleInfo; - NandSDWorker::TitleUsage* mpNandTitleInfo; - s32 mFirstTitleCount; - s32 mSecondTitleCount; + mutable NandSDWorker::TitleUsage* mpNandTitleInfo; + mutable s32 mFirstTitleCount; + mutable s32 mSecondTitleCount; SDChannelObj* mpCurrentLoadedChannel; u32 mSDTitleCount; u32 mNandTitleCount; diff --git a/src/keyboard/tiCandidateBox.cpp b/src/keyboard/tiCandidateBox.cpp index 623f8cd8..354e709f 100644 --- a/src/keyboard/tiCandidateBox.cpp +++ b/src/keyboard/tiCandidateBox.cpp @@ -1237,7 +1237,7 @@ namespace textinput { } void UITextArea::Draw(const nw4r::lyt::DrawInfo& drawInfo) { - // NONMATCHING + textdrawer::Base::ViewPort viewport; s32 selected = GetSelectedPaneIdx(); if (!IsScrolling()) { for (u32 i = 0; i < NUM_PANES; i++) { @@ -1247,10 +1247,6 @@ namespace textinput { } } - struct { - f32 left; - f32 width; - } scissor; nw4r::ut::Rect r = mpTextAreaPane->getPane()->GetPaneRect(drawInfo); // TODO - These vectors are zero-initialized using GPRs first... Vec v1 = {0, 0, 0}; @@ -1263,15 +1259,14 @@ namespace textinput { MTXMultVec(mpTextAreaPane->getTextPane()->GetGlobalMtx(), &v2, &v2); u32 left, top, wd, ht; GXGetScissor(&left, &top, &wd, &ht); - // TODO - These floats need to be stored to the stack f32 scale = 640.0f / mfScreenWidth; - scissor.left = v1.x + mfScreenWidth / 2.0f; - scissor.left += scissor.left * (scale - 1.0f); - scissor.width = scale * (v2.x - v1.x); - GXSetScissor(scissor.left, top, scissor.width, ht); + viewport.xOrig = v1.x + mfScreenWidth / 2.0f; + viewport.xOrig += viewport.xOrig * (scale - 1.0f); + viewport.wd = scale * (v2.x - v1.x); + GXSetScissor(viewport.xOrig, top, viewport.wd, ht); mpTextsPane->getPane()->Draw(drawInfo); if (!IsScrolling()) { - GXSetScissor(left, top, (scissor.width + scissor.left) - left, ht); + GXSetScissor(left, top, (viewport.wd + viewport.xOrig) - left, ht); for (u32 i = 0; i < NUM_PANES; i++) { if (i == selected || mpTextAnmPane[i]->getState() == ANM_FocusOut) { mpTextBoxPane[i]->getPane()->SetVisible(true); diff --git a/src/scene/sdChannelSelect/iplSDChannelSelect.cpp b/src/scene/sdChannelSelect/iplSDChannelSelect.cpp index c2d2c7da..7246d743 100644 --- a/src/scene/sdChannelSelect/iplSDChannelSelect.cpp +++ b/src/scene/sdChannelSelect/iplSDChannelSelect.cpp @@ -1275,12 +1275,17 @@ namespace ipl { } bool SDChannelSelect::isCurrentTitleUsageEnough(const s32* usage) const { - s32 blocks = mSecondTitleCount; - s32 bytes = mFirstTitleCount; - ESTitleId currentTitleId = SCGetTmpTitleID(); - - u32 titleCount = mNandTitleCount; + s32 bytes; + u32 titleCount; + s32 blocks; + ESTitleId currentTitleId; u32 index; + + bytes = mFirstTitleCount; + blocks = mSecondTitleCount; + currentTitleId = SCGetTmpTitleID(); + + titleCount = mNandTitleCount; for (index = 0; index < titleCount; ++index) { if (mpNandTitleInfo[index].curTitleId == currentTitleId) { break; @@ -1296,7 +1301,6 @@ namespace ipl { } return false; } - void SDChannelSelect::getCurrentTitleUsage(s32* bytes, s32* blocks) const { *bytes = mFirstTitleCount; *blocks = mSecondTitleCount; -- 2.49.1