diff --git a/README.md b/README.md index b4ff464a..7a0beb8a 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ Progress | Decompiled | Matched | Linked | Data | |:---:|:---:|:---:|:---:| -| 96.64% | 83.04% | 58.19% | 89.89% | +| 96.69% | 83.11% | 58.19% | 89.93% | -units 777/1027 complete, functions 11993/12563 matched. +units 777/1027 complete, functions 11997/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/setting/iplSetting.h b/include/scene/setting/iplSetting.h index 5f590cdf..e36d0db6 100644 --- a/include/scene/setting/iplSetting.h +++ b/include/scene/setting/iplSetting.h @@ -39,11 +39,6 @@ namespace ipl { Setting* mpSetting; }; - struct SettingAnimation { - u8 unknown[0x14]; - int state; - }; - struct SettingAPScanList { u8 unknown[0x14]; u16 count; @@ -86,7 +81,7 @@ namespace ipl { void initHTMLText(); void initMessage(); void initKeyboard(const char* text); - bool checkInputString(const wchar_t* text); + bool checkInputString(const wchar_t* text) NO_INLINE; int checkIPString(const wchar_t* text); void setDefaultBackString(); void calcKeyboard(); @@ -158,7 +153,6 @@ namespace ipl { virtual void destroy(); virtual void prepare(); virtual void create(); - virtual void calc(); virtual void draw(); virtual FaderSceneCommand calcFadein(); virtual FaderSceneCommand calcNormal(); @@ -208,8 +202,8 @@ namespace ipl { layout::Object* mpChangeLayout; layout::Object* mpMainLayout; layout::Object* mpWaitLayout; - SettingAnimation* mpFirstAnimation; - SettingAnimation* mpSecondAnimation; + utility::FrameController* mpFirstAnimation; + utility::FrameController* mpSecondAnimation; APEvent* mpEventHandler; gui::PaneManager* mpPaneManager; void* mpUSBAPThread; diff --git a/include/system/iplSaveDataManager.h b/include/system/iplSaveDataManager.h index b910175c..c99259d3 100644 --- a/include/system/iplSaveDataManager.h +++ b/include/system/iplSaveDataManager.h @@ -65,6 +65,10 @@ namespace ipl { void setDidntGotoSDMenu(BOOL value) { mData.didntGotoSDMenu = value; } #endif +#ifdef IPL_SDMEMORY_TITLE_CACHE_ACCESS + const ESTitleId* getTitleCache() const { return &mData.titleCache[0][0]; } +#endif + bool hasPhotoMP3Dummy() { return mbPhotoMP3; } bool hasPhoto2Title() { return mbPhoto2; } bool hasPhoto2DummyCheck() { return mbPhoto2Check; } diff --git a/libs/NW4R/include/nw4r/lyt/pane.h b/libs/NW4R/include/nw4r/lyt/pane.h index 3bff5dc5..f2806d81 100644 --- a/libs/NW4R/include/nw4r/lyt/pane.h +++ b/libs/NW4R/include/nw4r/lyt/pane.h @@ -93,7 +93,11 @@ namespace nw4r { #else void SetTranslate(const math::VEC3& translate) { mTranslate = translate; } #endif +#ifdef IPL_SDMEMORY_SET_TRANSLATE_OUT_OF_LINE + void SetTranslate(const math::VEC2& translate); +#else void SetTranslate(const math::VEC2& translate) { SetTranslate(math::VEC3(translate.x, translate.y, 0.0f)); } +#endif const math::VEC3& GetRotate() const { return mRotate; } void SetRotate(const math::VEC3& rotate) { mRotate = rotate; } diff --git a/src/scene/sdChannelMemory/iplSDMemory.cpp b/src/scene/sdChannelMemory/iplSDMemory.cpp index 26611c63..e66b06f5 100644 --- a/src/scene/sdChannelMemory/iplSDMemory.cpp +++ b/src/scene/sdChannelMemory/iplSDMemory.cpp @@ -1,3 +1,4 @@ +#define IPL_SDMEMORY_TITLE_CACHE_ACCESS #define IPL_SDMEMORY_SCROLLER_INIT_OUT_OF_LINE #define IPL_SDMEMORY_SET_TRANSLATE_OUT_OF_LINE #define IPL_SDMEMORY_DIALOG_STATE_ACCESSOR @@ -60,6 +61,8 @@ namespace ipl { typedef ::gui::PaneComponent GuiPaneComponent; typedef controller::Interface ControllerInterface; + void writeFourFlagBytes(u8* flags, u8 first, u8 second, u8 third, u8 fourth); + void setTitleRowColors(nw4r::lyt::TextBox* textBox, const nw4r::ut::Color& first, const nw4r::ut::Color& second); @@ -78,7 +81,7 @@ namespace ipl { void SDMemory::create(EGG::Heap* heap, nand::LayoutFile* layoutFile, SDChannelSelect* channelSelect) { mpSDChannelSelect = channelSelect; - mpMainLayout = new (heap) layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_a.brlyt"); + mpMainLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_a.brlyt"); mpMainLayout->bindToGroup("mn_DialogWindow_ChChange_a_DialogIn.brlan", "G_InOut", false, true); mpMainLayout->bindToGroup("mn_DialogWindow_ChChange_a_DialogOut.brlan", "G_InOut", false, true); mpMainLayout->bindToGroup("mn_DialogWindow_ChChange_a_FocusBtn_on.brlan", "G_FocusBtnA", false, true); @@ -105,7 +108,7 @@ namespace ipl { textBox = nw4r::ut::DynamicCast(mpMainLayout->FindPaneByName("T_BtnA")); textBox->SetString(System::getMessage(0x25)); - mpTitleLayout = new (heap) layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_b.brlyt"); + mpTitleLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_b.brlyt"); mpTitleLayout->bindToGroup("mn_DialogWindow_ChChange_b_DialogIn.brlan", "G_InOut", false, true); mpTitleLayout->bindToGroup("mn_DialogWindow_ChChange_b_DialogOut.brlan", "G_InOut", false, true); mpTitleLayout->bindToGroup("mn_DialogWindow_ChChange_b_FocusBtn_on.brlan", "G_FocusBtnA", false, true); @@ -150,7 +153,27 @@ namespace ipl { textBox = nw4r::ut::DynamicCast(mpTitleLayout->FindPaneByName("TextBox_07")); textBox->SetString(System::getMessage(0xBA)); - mpDialogLayout = new (heap) layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_c.brlyt"); + const ESTitleId* cachedTitles = System::getSaveData()->getTitleCache(); + s32 cachedTitleCount = 0; + for (s32 i = 0; i < 48; ++i) { + if (cachedTitles[i] == 0) { + break; + } + ++cachedTitleCount; + } + if (cachedTitleCount >= 5) { + mpTitleLayout->FindPaneByName("N_Btn_3")->SetVisible(false); + mpTitleLayout->FindPaneByName("N_Btn_4")->SetVisible(true); + mDisplayMode = 4; + } else { + mpTitleLayout->FindPaneByName("N_Btn_3")->SetVisible(true); + mpTitleLayout->FindPaneByName("N_Btn_4")->SetVisible(false); + mDisplayMode = 3; + } + textBox = nw4r::ut::DynamicCast(mpTitleLayout->FindPaneByName("T_BtnA")); + textBox->SetString(System::getMessage(0xA5)); + + mpDialogLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_ChChange_c.brlyt"); static_cast(mpDialogLayout->FindPaneByName("T_Letter"))->AllocStringBuffer(0x840); mpDialogLayout->bindToGroup("mn_DialogWindow_ChChange_c_Dialog_FadeIn.brlan", "G_Fede", false, true); mpDialogLayout->bindToGroup("mn_DialogWindow_ChChange_c_Dialog_FadeOut.brlan", "G_Fede", false, true); @@ -190,7 +213,7 @@ namespace ipl { textBox = nw4r::ut::DynamicCast(mpDialogLayout->FindPaneByName("T_CalExit_00")); textBox->SetString(System::getMessage(0xC4)); - mpProgressLayout = new (heap) layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_Background.brlyt"); + mpProgressLayout = new layout::Object(heap, layoutFile, "arc", "mn_DialogWindow_Background.brlyt"); mpProgressLayout->bindToGroup("mn_DialogWindow_Background_DialogIn.brlan", "G_InOut", false, true); mpProgressLayout->bindToGroup("mn_DialogWindow_Background_DialogOut.brlan", "G_InOut", false, true); mpProgressLayout->finishBinding(); @@ -245,20 +268,14 @@ namespace ipl { void SDMemory::setScrollLimit() { nw4r::lyt::Pane* headerPane = mpDialogLayout->FindPaneByName("N_Header"); - nw4r::lyt::Pane* buttonPane = mpDialogLayout->FindPaneByName("T_BtnA"); + nw4r::lyt::Pane* buttonPane = mpDialogLayout->FindPaneByName("N_Body"); nw4r::lyt::Pane* footerPane = mpDialogLayout->FindPaneByName("N_Footer"); nw4r::ut::Rect projection; System::getProjectionRect(&projection); - f32 itemCount = static_cast(mButtonState); - f32 buttonHeight = buttonPane->GetSize().height; - f32 headerHeight = headerPane->GetSize().height; - f32 footerHeight = footerPane->GetSize().height; - f32 contentHeight = headerHeight + footerHeight; - f32 itemHeight = itemCount * buttonHeight; - f32 contentHeightWithItems = itemHeight + contentHeight; - f32 downLimit = contentHeightWithItems - projection.GetHeight() + 1.0f; + f32 downLimit = 160.0f + (static_cast(mButtonState) * buttonPane->GetSize().height + + (headerPane->GetSize().height + footerPane->GetSize().height) - projection.GetHeight()); if (downLimit < 0.0f) { downLimit = 0.0f; } @@ -743,6 +760,26 @@ namespace ipl { } } + void SDMemory::onDialogState7() { + if (!mpTitleLayout->isPlaying(-1)) { + switch (mProcessState) { + case 4: + mDialogState = 0; + mpMainLayout->getAnim(0)->play(); + snd::getSystem()->startSE("WIPL_SE_INFO_WINDOW"); + break; + default: + mTransferStartTime = 0; + mTransferFrame = 0; + System::getDialog()->callBtn0NoShade(0xCC, 0, true); + mDialogState = 8; + break; + } + } + } + + + void SDMemory::onDialogState8() { if (System::getDialog()->getStateForSDMemory() == 2) { if (mTransferStartTime == 0) { @@ -790,26 +827,6 @@ namespace ipl { } } - void SDMemory::onDialogState7() { - if (!mpTitleLayout->isPlaying(-1)) { - switch (mProcessState) { - case 4: - mDialogState = 0; - mpMainLayout->getAnim(0)->play(); - snd::getSystem()->startSE("WIPL_SE_INFO_WINDOW"); - break; - default: - mTransferStartTime = 0; - mTransferFrame = 0; - System::getDialog()->callBtn0NoShade(0xCC, 0, true); - mDialogState = 8; - break; - } - } - } - - - void SDMemory::onDialogState9() { if (!mpDialogLayout->isPlaying(0)) { for (int i = 0; i < 4; i++) { @@ -1230,23 +1247,25 @@ namespace ipl { } void SDMemory::drawTransferTitles() { - nw4r::lyt::Pane* memoPane = mpDialogLayout->FindPaneByName("N_Memo"); - nw4r::lyt::Pane* headerPane = mpDialogLayout->FindPaneByName("header_header"); + const nw4r::math::VEC3& translation = mpDialogLayout->FindPaneByName("N_Memo")->GetTranslate(); + nw4r::math::VEC3 memoPosition(translation.x, translation.y, translation.z); + mpDialogLayout->FindPaneByName("header_header"); nw4r::lyt::Pane* bodyPane = mpDialogLayout->FindPaneByName("header_body"); - f32 bodyY = headerPane->GetTranslate().y; - if (bodyY < 0.0f) { + f32 bodyY = memoPosition.y; + if (bodyY < 500.0f) { mpDialogLayout->draw("header_header"); } + u8 alpha = mpDialogLayout->FindPaneByName("N_Memo")->GetAlpha(); nw4r::ut::LinkList::Iterator child = bodyPane->GetChildList().GetBeginIter(); while (child != bodyPane->GetChildList().GetEndIter()) { - child->SetAlpha(memoPane->GetAlpha()); + child->SetAlpha(alpha); ++child; } - u32 lineCount = 0; + s32 lineCount = 0; f32 messageOffset = 0.0f; f32 bodyHeight = bodyPane->GetSize().height; if (mNandTitleCount != 0) { @@ -1260,17 +1279,18 @@ namespace ipl { const wchar_t* messageLine = System::getMessage(0xCB); nw4r::lyt::TextBox* messageText = static_cast( mpDialogLayout->FindPaneByName("T_Header_body")); - u32 lineIndex = 0; - while (lineIndex <= lineCount) { + s32 totalLines = lineCount + 1; + s32 lineIndex = 0; + while (lineIndex < totalLines) { const wchar_t* lineEnd = wcsstr(messageLine, L"\n"); - if (lineEnd != NULL) { + if (lineEnd == NULL) { + utility::layout::set_string(messageText, messageLine); + } else { u32 lineLength = static_cast(lineEnd - messageLine); wcsncpy(mCurrentTitleName, messageLine, lineLength); mCurrentTitleName[lineLength] = L'\0'; utility::layout::set_string(messageText, mCurrentTitleName); messageLine = lineEnd + 1; - } else { - utility::layout::set_string(messageText, messageLine); } if (bodyY < 500.0f) { @@ -1286,64 +1306,87 @@ namespace ipl { } messageOffset += bodyHeight; - f32 titleOffset = messageOffset; + f32 backgroundOffset = 40.0f + messageOffset; + f32 titleOffset = 79.5f + messageOffset; - nw4r::lyt::TextBox* titleSizePane = static_cast( - mpDialogLayout->FindPaneByName("T_Letter")); + nw4r::lyt::Pane* titleSizePane = mpDialogLayout->FindPaneByName("N_Body"); f32 rowHeight = titleSizePane->GetSize().height; nw4r::lyt::PaneList::Iterator titleChild = titleSizePane->GetChildList().GetBeginIter(); while (titleChild != titleSizePane->GetChildList().GetEndIter()) { - titleChild->SetAlpha(memoPane->GetAlpha()); + titleChild->SetAlpha(alpha); ++titleChild; } nw4r::lyt::TextBox* titleText = static_cast( mpDialogLayout->FindPaneByName("T_Letter")); - titleText->SetAlpha(memoPane->GetAlpha()); + titleText->SetAlpha(alpha); - nw4r::ut::Color activeTitleColor(0x34, 0xBE, 0xED, 0xFF); - nw4r::ut::Color inactiveTitleColor(0x64, 0x64, 0x64, 0xFF); + u32 nandTitleIndex = 0; for (u32 titleIndex = 0; titleIndex < mTitleCount; ++titleIndex) { utility::layout::set_string(titleText, mTitleNames[titleIndex]); - if (titleIndex < mNandTitleCount && mTitleIds[titleIndex] == mNandTitleIds[titleIndex]) { + if (nandTitleIndex < mNandTitleCount && mTitleIds[titleIndex] == mNandTitleIds[nandTitleIndex]) { + nw4r::ut::Color activeTitleColor; + writeFourFlagBytes(&activeTitleColor.r, 0x34, 0xBE, 0xED, 0xFF); + ++nandTitleIndex; setTitleRowColors(titleText, activeTitleColor, activeTitleColor); } else { + nw4r::ut::Color inactiveTitleColor; + writeFourFlagBytes(&inactiveTitleColor.r, 0x64, 0x64, 0x64, 0xFF); setTitleRowColors(titleText, inactiveTitleColor, inactiveTitleColor); } - nw4r::ut::Rect textRect = mpDialogLayout->getTextDrawRect("T_Header_body"); + nw4r::ut::Rect textRect = mpDialogLayout->getTextDrawRect("T_Letter"); f32 rowTop = textRect.bottom - textRect.top; - u32 visibleRows = static_cast(ceil(-rowTop / rowHeight)); - for (u32 row = 0; row < visibleRows; ++row) { - f32 rowOffset = titleOffset + static_cast(row) * rowHeight; - f32 rowY = bodyY + rowOffset; + s32 visibleRows = static_cast(static_cast(ceil(-rowTop / titleSizePane->GetSize().height))); + for (s32 row = 0; row < visibleRows; ++row) { + f32 rowY = bodyY + backgroundOffset; if (rowY > -500.0f && rowY < 500.0f) { - nw4r::math::VEC2 translation(0.0f, rowOffset); - titleText->SetTranslate(translation); - titleText->CalculateMtx(*mpDialogLayout->getDrawInfo()); - mpDialogLayout->draw(titleText); + nw4r::math::VEC2 translation(0.0f, backgroundOffset); + titleSizePane->SetTranslate(translation); + titleSizePane->CalculateMtx(*mpDialogLayout->getDrawInfo()); + mpDialogLayout->draw(titleSizePane); } + backgroundOffset -= rowHeight; + } + if (bodyY + titleOffset > -500.0f && bodyY + titleOffset < 500.0f) { + nw4r::math::VEC2 translation(0.0f, titleOffset); + titleText->SetTranslate(translation); + titleText->CalculateMtx(*mpDialogLayout->getDrawInfo()); + mpDialogLayout->draw(titleText); } titleOffset -= rowHeight * static_cast(visibleRows); } + backgroundOffset += rowHeight; nw4r::lyt::Pane* footerPane = mpDialogLayout->FindPaneByName("N_Footer"); nw4r::lyt::PaneList::Iterator footerChild = footerPane->GetChildList().GetBeginIter(); while (footerChild != footerPane->GetChildList().GetEndIter()) { - footerChild->SetAlpha(memoPane->GetAlpha()); + footerChild->SetAlpha(alpha); ++footerChild; } - if (bodyY + titleOffset > -500.0f) { - nw4r::math::VEC2 translation(0.0f, titleOffset); + if (bodyY + backgroundOffset > -500.0f) { + nw4r::math::VEC2 translation(0.0f, backgroundOffset); footerPane->SetTranslate(translation); footerPane->CalculateMtx(*mpDialogLayout->getDrawInfo()); mpDialogLayout->draw(footerPane); } - mpDialogLayout->draw("header_body"); mpDialogLayout->draw("N_TopBtn_00"); - mpDialogLayout->draw("N_Memo"); + mpDialogLayout->draw("N_Back"); + mpDialogLayout->draw("N_Move"); + } + + void writeFourFlagBytes(u8* flags, u8 first, u8 second, u8 third, u8 fourth) { + flags[0] = first; + flags[1] = second; + flags[2] = third; + flags[3] = fourth; + } + + void setTitleRowColors(nw4r::lyt::TextBox* textBox, const nw4r::ut::Color& first, + const nw4r::ut::Color& second) { + textBox->SetTextColors(first, second); } s32 SDMemory::getControlPaneIndex(const char* paneName) { @@ -1788,16 +1831,5 @@ namespace ipl { } } - void writeFourFlagBytes(u8* flags, u8 first, u8 second, u8 third, u8 fourth) { - flags[0] = first; - flags[1] = second; - flags[2] = third; - flags[3] = fourth; - } - - void setTitleRowColors(nw4r::lyt::TextBox* textBox, const nw4r::ut::Color& first, - const nw4r::ut::Color& second) { - textBox->SetTextColors(first, second); - } } } diff --git a/src/scene/sdChannelSelect/iplSDChannelSelect.cpp b/src/scene/sdChannelSelect/iplSDChannelSelect.cpp index c60081f2..10ea123b 100644 --- a/src/scene/sdChannelSelect/iplSDChannelSelect.cpp +++ b/src/scene/sdChannelSelect/iplSDChannelSelect.cpp @@ -105,38 +105,15 @@ namespace ipl { 11, 7, 3, 10, 6, 2, 9, 5, 1, 8, 4, 0, }; - void SDChannelSelect::onButtonEvent(const char* paneName, u32 event, - const controller::Interface* controller) { - if (controller != NULL && - controller != System::getControllerManager()->getController(mControllerChannel)) { - return; - } - switch (event) { - case ::gui::EventHandler::ON_LEFT: - if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_LEFT]) == 0) { - if (mCurrentPage > 0) { - mPendingIndex = -1; - } - } else if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_RIGHT]) == 0) { - if (mCurrentPage < mPageCount - 1) { - mPendingPage = -1; - } - } - break; - case ::gui::EventHandler::ON_POINT: - if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_LEFT]) == 0) { - if (mCurrentPage > 0 && mPendingIndex < 0) { - mPendingIndex = 0; - } - } else if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_RIGHT]) == 0) { - if (mCurrentPage < mPageCount - 1 && mPendingPage < 0) { - mPendingPage = 0; - } - } - break; - } - } + + extern "C" bool iplSDChannelSelect_813DD240( + SDChannelSelect* scene, const s32* requiredBytes, const s32* requiredBlocks, + ESTitleId* titleIds, char* titleNames, u32* titleCount); + + + + extern "C" void iplSDChannelObj_813E3534(SDChannelObj* channel, int enabled); SDChannelSelect::SDChannelSelect(EGG::Heap* heap) : FaderSceneBase(heap), @@ -227,18 +204,6 @@ namespace ipl { SDChannelSelect::~SDChannelSelect() { } - BOOL SDChannelSelect::isResetProcessDone() { - switch (mLastOperation) { - case 5: - case 6: - case 7: - case 8: - return FALSE; - default: - return TRUE; - } - } - void SDChannelSelect::prepare() { System::getBS2Manager()->abort(); mpLayoutFile = System::getNandManager()->readLayoutAsync(getSceneHeap(), "sdChanSel.ash"); @@ -483,219 +448,6 @@ namespace ipl { } } - void SDChannelSelect::handleWorkerStartup() { - if (!mpSDWorker->is_working()) { - if (mpSDWorker->get_async_result() == NandSDWorker::RESULT_OK) { - if (mOperationState == 0) { - setDialogMessage(8, 0xaa); - } - enqueueFinishNotice(); - mWorkerCommand = 1; - } - mpSDWorker->startup_async(); - mWorkerState = 2; - } else if (mPreviousSDState != mCurrentSDState && mCurrentSDState == 7) { - setDialogMessage(8, 0xaa); - } - } - - void SDChannelSelect::handleNandTitleCount() { - if (!mpSDWorker->is_working()) { - int result = mpSDWorker->get_async_result(); - if (result == NandSDWorker::RESULT_NAND_CORRUPT) { - System::getErrorHandler()->set(ErrorHandler::DEFAULT, 1); - return; - } - - mNandTitleCount = mpSDWorker->get_nand_app_num(); - if (mNandTitleCount > 0x60) { - mNandTitleCount = 0x60; - } - if (mNandTitleCount != 0) { - mpSDWorker->list_nand_apps_usage_async( - mpNandTitleInfo, reinterpret_cast(mNandTitleCount)); - mWorkerState = 3; - } else { - mWorkerState = 4; - } - } - } - - void SDChannelSelect::handleNandTitleUsage() { - if (!mpSDWorker->is_working()) { - if (mpSDWorker->get_async_result() == NandSDWorker::RESULT_OK) { - qsort(mpNandTitleInfo, mNandTitleCount, sizeof(NandSDWorker::TitleUsage), - compareTitleUsage); - for (u32 index = 0; index < mNandTitleCount; ++index) { - mpNandTitleInfo[index].size -= 0x4000; - --mpNandTitleInfo[index].inode; - } - mWorkerState = 4; - } else { - System::getErrorHandler()->set(ErrorHandler::DEFAULT, 2); - } - } - } - - void SDChannelSelect::handleNandTitleUsageComplete() { - if (!mpSDWorker->is_working()) { - mLastOperation = 14; - mWorkerCommand = 1; - } - } - - void SDChannelSelect::handleSDTitleList() { - if (mpSDWorker->is_working()) { - return; - } - - mLastOperation = 14; - if (mSDTitleCount == 0) { - if (mDialogState == 0) { - setDialogMessage(1, 0); - mWorkerCommand = 15; - } - return; - } - - if (mpSDWorker->get_async_result() == NandSDWorker::RESULT_OK) { - for (u32 index = 0; index < mSDTitleCount; ++index) { - mpSDTitleInfo[index].titleId = mpSDTitleIds[index]; - if (mpSDTitleIds[index] == 0x48415A41) { - mbHazardTitleFound = true; - } - } - qsort(mpSDTitleInfo, mSDTitleCount, sizeof(SDChannelSelectTitleInfo), - compareTitleInfo); - enqueuePageNotice(); - mWorkerCommand = 1; - } else if (mDialogState == 0) { - setDialogMessage(2, 0xc3); - mWorkerCommand = 15; - } - } - - bool SDChannelSelect::setDialogMessage(u32 state, u32 message) { - if (mDialogState == 0) { - mDialogState = state; - mAnimationTarget = message; - return true; - } - return false; - } - - int SDChannelSelect::compareTitleUsage(const void* lhs, const void* rhs) { - const NandSDWorker::TitleUsage* left = - static_cast(lhs); - const NandSDWorker::TitleUsage* right = - static_cast(rhs); - if ((s32)left->size < (s32)right->size) { - return -1; - } - return left->size != right->size; - } - - int SDChannelSelect::compareTitleInfo(const void* lhs, const void* rhs) { - const SDChannelSelectTitleInfo* left = - static_cast(lhs); - const SDChannelSelectTitleInfo* right = - static_cast(rhs); - if (left->titleId < right->titleId) { - return -1; - } - return left->titleId != right->titleId; - } - - void SDChannelSelect::handleSDTitleListResult() { - if (mpSDWorker->is_working()) { - return; - } - - mLastOperation = 14; - if (mDialogState != 0) { - return; - } - - if (OSGetTime() - mOperationStartTime < OS_TIMER_CLOCK) { - return; - } - setDialogMessage(1, 0); - int result = mpSDWorker->get_async_result(); - if (result == NandSDWorker::RESULT_OK || - result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) { - for (int channelIndex = 0; channelIndex < mPageCount * 12; - ++channelIndex) { - if (mpChannelTitleIds[channelIndex] != 0) { - SDChannelSelectTitleInfo* info = - static_cast( - bsearch(mpChannelTitleIds + channelIndex, mpSDTitleInfo, - mSDTitleCount, sizeof(SDChannelSelectTitleInfo), - compareTitleInfo)); - if (info != NULL) { - info->used = true; - } else { - mpChannelTitleIds[channelIndex] = 0; - } - } - } - - int channelIndex = 0; - u32 titleIndex = 0; - bool addedTitle = false; - for (; channelIndex < mPageCount * 12; ++channelIndex) { - if (mpChannelTitleIds[channelIndex] == 0) { - if (titleIndex == mSDTitleCount) { - break; - } - - for (; titleIndex < mSDTitleCount; ++titleIndex) { - SDChannelSelectTitleInfo* info = &mpSDTitleInfo[titleIndex]; - if (info->used) { - continue; - } - if (info->titleId == 0x48415A41) { - continue; - } - mpChannelTitleIds[channelIndex] = info->titleId; - addedTitle = true; - ++titleIndex; - break; - } - } - } - - if (addedTitle || result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) { - enqueueLoadNotice(); - } - } else { - int channelCount = 0; - int channelIndex = 0; - u32 titleIndex = 0; - for (; titleIndex < mSDTitleCount; ++titleIndex) { - u32 titleId = mpSDTitleInfo[titleIndex].titleId; - if (titleId != 0x48415A41) { - ++channelCount; - mpChannelTitleIds[channelIndex++] = titleId; - if (channelCount == mPageCount * 12) { - break; - } - } - } - enqueueLoadNotice(); - } - - mWorkerCommand = 1; - mbNeedsRefresh = true; - u32 titleCount = mbHazardTitleFound ? mSDTitleCount - 1 : mSDTitleCount; - if (titleCount > static_cast(mPageCount * 12)) { - mbOperationActive = true; - } - if (titleCount >= static_cast(mPageCount * 12)) { - mbSDCardBroken = true; - } - refreshAfterSDTitleList(); - } - void SDChannelSelect::processWorkerCommands() { switch (mCurrentSDState) { case 1: @@ -873,6 +625,210 @@ namespace ipl { } } + void SDChannelSelect::handleWorkerStartup() { + if (!mpSDWorker->is_working()) { + if (mpSDWorker->get_async_result() == NandSDWorker::RESULT_OK) { + if (mOperationState == 0) { + setDialogMessage(8, 0xaa); + } + enqueueFinishNotice(); + mWorkerCommand = 1; + } + mpSDWorker->startup_async(); + mWorkerState = 2; + } else if (mPreviousSDState != mCurrentSDState && mCurrentSDState == 7) { + setDialogMessage(8, 0xaa); + } + } + + void SDChannelSelect::handleNandTitleCount() { + if (!mpSDWorker->is_working()) { + int result = mpSDWorker->get_async_result(); + if (result == NandSDWorker::RESULT_NAND_CORRUPT) { + System::getErrorHandler()->set(ErrorHandler::DEFAULT, 1); + return; + } + + mNandTitleCount = mpSDWorker->get_nand_app_num(); + if (mNandTitleCount > 0x60) { + mNandTitleCount = 0x60; + } + if (mNandTitleCount != 0) { + mpSDWorker->list_nand_apps_usage_async( + mpNandTitleInfo, reinterpret_cast(mNandTitleCount)); + mWorkerState = 3; + } else { + mWorkerState = 4; + } + } + } + + void SDChannelSelect::handleNandTitleUsageComplete() { + if (!mpSDWorker->is_working()) { + mLastOperation = 14; + mWorkerCommand = 1; + } + } + + void SDChannelSelect::handleNandTitleUsage() { + if (!mpSDWorker->is_working()) { + if (mpSDWorker->get_async_result() == NandSDWorker::RESULT_OK) { + qsort(mpNandTitleInfo, mNandTitleCount, sizeof(NandSDWorker::TitleUsage), + compareTitleUsage); + for (u32 index = 0; index < mNandTitleCount; ++index) { + mpNandTitleInfo[index].size -= 0x4000; + --mpNandTitleInfo[index].inode; + } + mWorkerState = 4; + } else { + System::getErrorHandler()->set(ErrorHandler::DEFAULT, 2); + } + } + } + + int SDChannelSelect::compareTitleUsage(const void* lhs, const void* rhs) { + const NandSDWorker::TitleUsage* left = + static_cast(lhs); + const NandSDWorker::TitleUsage* right = + static_cast(rhs); + if ((s32)left->size < (s32)right->size) { + return -1; + } + return left->size != right->size; + } + + void SDChannelSelect::handleSDTitleList() { + if (mpSDWorker->is_working()) { + return; + } + + mLastOperation = 14; + if (mSDTitleCount == 0) { + if (mDialogState == 0) { + setDialogMessage(1, 0); + mWorkerCommand = 15; + } + return; + } + + if (mpSDWorker->get_async_result() == NandSDWorker::RESULT_OK) { + for (u32 index = 0; index < mSDTitleCount; ++index) { + mpSDTitleInfo[index].titleId = mpSDTitleIds[index]; + if (mpSDTitleIds[index] == 0x48415A41) { + mbHazardTitleFound = true; + } + } + qsort(mpSDTitleInfo, mSDTitleCount, sizeof(SDChannelSelectTitleInfo), + compareTitleInfo); + enqueuePageNotice(); + mWorkerCommand = 1; + } else if (mDialogState == 0) { + setDialogMessage(2, 0xc3); + mWorkerCommand = 15; + } + } + + int SDChannelSelect::compareTitleInfo(const void* lhs, const void* rhs) { + const SDChannelSelectTitleInfo* left = + static_cast(lhs); + const SDChannelSelectTitleInfo* right = + static_cast(rhs); + if (left->titleId < right->titleId) { + return -1; + } + return left->titleId != right->titleId; + } + + void SDChannelSelect::handleSDTitleListResult() { + if (mpSDWorker->is_working()) { + return; + } + + mLastOperation = 14; + if (mDialogState != 0) { + return; + } + + if (OSGetTime() - mOperationStartTime < OS_TIMER_CLOCK) { + return; + } + setDialogMessage(1, 0); + int result = mpSDWorker->get_async_result(); + if (result == NandSDWorker::RESULT_OK || + result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) { + for (int channelIndex = 0; channelIndex < mPageCount * 12; + ++channelIndex) { + if (mpChannelTitleIds[channelIndex] != 0) { + SDChannelSelectTitleInfo* info = + static_cast( + bsearch(mpChannelTitleIds + channelIndex, mpSDTitleInfo, + mSDTitleCount, sizeof(SDChannelSelectTitleInfo), + compareTitleInfo)); + if (info != NULL) { + info->used = true; + } else { + mpChannelTitleIds[channelIndex] = 0; + } + } + } + + int channelIndex = 0; + u32 titleIndex = 0; + bool addedTitle = false; + for (; channelIndex < mPageCount * 12; ++channelIndex) { + if (mpChannelTitleIds[channelIndex] == 0) { + if (titleIndex == mSDTitleCount) { + break; + } + + for (; titleIndex < mSDTitleCount; ++titleIndex) { + SDChannelSelectTitleInfo* info = &mpSDTitleInfo[titleIndex]; + if (info->used) { + continue; + } + if (info->titleId == 0x48415A41) { + continue; + } + mpChannelTitleIds[channelIndex] = info->titleId; + addedTitle = true; + ++titleIndex; + break; + } + } + } + + if (addedTitle || result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) { + enqueueLoadNotice(); + } + } else { + int channelCount = 0; + int channelIndex = 0; + u32 titleIndex = 0; + for (; titleIndex < mSDTitleCount; ++titleIndex) { + u32 titleId = mpSDTitleInfo[titleIndex].titleId; + if (titleId != 0x48415A41) { + ++channelCount; + mpChannelTitleIds[channelIndex++] = titleId; + if (channelCount == mPageCount * 12) { + break; + } + } + } + enqueueLoadNotice(); + } + + mWorkerCommand = 1; + mbNeedsRefresh = true; + u32 titleCount = mbHazardTitleFound ? mSDTitleCount - 1 : mSDTitleCount; + if (titleCount > static_cast(mPageCount * 12)) { + mbOperationActive = true; + } + if (titleCount >= static_cast(mPageCount * 12)) { + mbSDCardBroken = true; + } + refreshAfterSDTitleList(); + } + void SDChannelSelect::handleSDMountComplete() { if (!mpSDWorker->is_working()) { mLastOperation = 14; @@ -931,6 +887,27 @@ namespace ipl { mpCurrentLoadedChannel = NULL; } + void SDChannelSelect::handleSDCardReady() { + if (mpSDWorker->get_sd_state() == NandSDWorker::SD_STATE_INSERTED && + mDialogState == 0) { + setDialogMessage(1, 0); + mWorkerCommand = 1; + } + } + + void SDChannelSelect::handleCardCommand() { + if (mDialogState != 0) { + return; + } + + if (mpSDWorker->get_sd_state() == NandSDWorker::SD_STATE_EJECTED) { + setDialogMessage(2, 0xa9); + mWorkerCommand = 6; + } else if (mpSDWorker->get_sd_state() == NandSDWorker::SD_STATE_INSERTED) { + mWorkerCommand = 1; + } + } + void SDChannelSelect::handleCopyComplete() { if (!mpSDWorker->is_working()) { mLastOperation = 14; @@ -949,6 +926,20 @@ namespace ipl { } } + void SDChannelSelect::handleSDLocationUpdateComplete() { + if (!mpSDWorker->is_working()) { + mLastOperation = 14; + mWorkerCommand = 1; + } + } + + void SDChannelSelect::handleSDLocationReadComplete() { + if (!mpSDWorker->is_working()) { + mLastOperation = 14; + mWorkerCommand = 1; + } + } + void SDChannelSelect::handleMoveComplete() { if (!mpSDWorker->is_working()) { mLastOperation = 14; @@ -968,41 +959,6 @@ namespace ipl { } } - void SDChannelSelect::handleCardCommand() { - if (mDialogState != 0) { - return; - } - - if (mpSDWorker->get_sd_state() == NandSDWorker::SD_STATE_EJECTED) { - setDialogMessage(2, 0xa9); - mWorkerCommand = 6; - } else if (mpSDWorker->get_sd_state() == NandSDWorker::SD_STATE_INSERTED) { - mWorkerCommand = 1; - } - } - - void SDChannelSelect::handleSDCardReady() { - if (mpSDWorker->get_sd_state() == NandSDWorker::SD_STATE_INSERTED && - mDialogState == 0) { - setDialogMessage(1, 0); - mWorkerCommand = 1; - } - } - - void SDChannelSelect::handleSDLocationUpdateComplete() { - if (!mpSDWorker->is_working()) { - mLastOperation = 14; - mWorkerCommand = 1; - } - } - - void SDChannelSelect::handleSDLocationReadComplete() { - if (!mpSDWorker->is_working()) { - mLastOperation = 14; - mWorkerCommand = 1; - } - } - void SDChannelSelect::handleBackupFitComplete() { if (!mpSDWorker->is_working()) { mLastOperation = 14; @@ -1315,6 +1271,15 @@ namespace ipl { } } + bool SDChannelSelect::setDialogMessage(u32 state, u32 message) { + if (mDialogState == 0) { + mDialogState = state; + mAnimationTarget = message; + return true; + } + return false; + } + bool SDChannelSelect::isCurrentTitleUsageEnough(const s32* usage) const { s32 blocks = mSecondTitleCount; s32 bytes = mFirstTitleCount; @@ -1429,49 +1394,6 @@ namespace ipl { return false; } - bool SDChannelSelect::findAdjacentChannel(int direction, int* page, int* index) const { - int currentPage = mCurrentPage; - int currentIndex = mCurrentChannelIndex; - int pageSize = MAX_CHANNEL_INDEX; - int currentSlot = currentPage * pageSize + currentIndex; - int step = direction == 1 ? -1 : 1; - int slotCount = mPageCount * pageSize; - int slot = currentSlot + step; - - if (slot < 0) { - slot = slotCount - 1; - } - if (slot >= slotCount) { - slot = 0; - } - - while (slot != currentSlot) { - int candidatePage = slot / pageSize; - int candidateIndex = slot % pageSize; - if (mpChannelTitleIds[slot] != 0) { - *page = candidatePage; - *index = candidateIndex; - return true; - } - - slot += step; - if (slot < 0) { - slot = slotCount - 1; - } - if (slot >= slotCount) { - slot = 0; - } - } - - *page = currentPage; - *index = currentIndex; - return false; - } - - extern "C" bool iplSDChannelSelect_813DD240( - SDChannelSelect* scene, const s32* requiredBytes, const s32* requiredBlocks, - ESTitleId* titleIds, char* titleNames, u32* titleCount); - bool SDChannelSelect::collectTitlesByChannelOrder( const s32* firstUsage, const s32* secondUsage, ESTitleId* titleIds, char* titleNames, u32* titleCount) { @@ -1527,9 +1449,6 @@ namespace ipl { bool SDChannelSelect::collectTitlesBySpecialChannels( const s32* firstUsage, const s32* secondUsage, ESTitleId* titleIds, char* titleNames, u32* titleCount) { - const ESTitleId hateTitle = ES_TITLE_ID(0x00010001, 0x48415445); - const ESTitleId hadeTitle = ES_TITLE_ID(0x00010001, 0x48414445); - const ESTitleId hazardTitle = 0x48415A41; int hateUsageIndex = -1; int hatePage = 0; int hateChannelIndex = 0; @@ -1542,14 +1461,14 @@ namespace ipl { for (u32 usageIndex = 0; usageIndex < mNandTitleCount; ++usageIndex) { ESTitleId titleId = mpNandTitleInfo[usageIndex].curTitleId; - if (titleId == hateTitle) { + if (titleId == ES_TITLE_ID(0x00010001, 0x48415445)) { hateUsageIndex = usageIndex; System::getChannelManager()->hasChannel( - hateTitle, &hatePage, &hateChannelIndex); - } else if (titleId == hadeTitle) { + ES_TITLE_ID(0x00010001, 0x48415445), &hatePage, &hateChannelIndex); + } else if (titleId == ES_TITLE_ID(0x00010001, 0x48414445)) { hadeUsageIndex = usageIndex; System::getChannelManager()->hasChannel( - hadeTitle, &hadePage, &hadeChannelIndex); + ES_TITLE_ID(0x00010001, 0x48414445), &hadePage, &hadeChannelIndex); } } @@ -1557,7 +1476,7 @@ namespace ipl { for (int usageIndex = mNandTitleCount - 1; usageIndex >= 0; --usageIndex) { NandSDWorker::TitleUsage& usage = mpNandTitleInfo[usageIndex]; ESTitleId titleId = usage.curTitleId; - if (titleId == hazardTitle || titleId == hateTitle || titleId == hadeTitle) { + if (titleId == 0x48415A41 || titleId == ES_TITLE_ID(0x00010001, 0x48415445) || titleId == ES_TITLE_ID(0x00010001, 0x48414445)) { continue; } @@ -1616,7 +1535,7 @@ namespace ipl { NandSDWorker::TitleUsage& usage = mpNandTitleInfo[hadeUsageIndex]; bytes += usage.size; blocks += usage.inode; - titleIds[*titleCount] = hadeTitle; + titleIds[*titleCount] = ES_TITLE_ID(0x00010001, 0x48414445); wchar_t* titleName = System::getChannelManager()->getTitleName( hadePage, hadeChannelIndex, 0); @@ -1632,7 +1551,7 @@ namespace ipl { NandSDWorker::TitleUsage& usage = mpNandTitleInfo[hateUsageIndex]; bytes += usage.size; blocks += usage.inode; - titleIds[*titleCount] = hateTitle; + titleIds[*titleCount] = ES_TITLE_ID(0x00010001, 0x48415445); wchar_t* titleName = System::getChannelManager()->getTitleName( hatePage, hateChannelIndex, 0); @@ -1671,6 +1590,82 @@ namespace ipl { } } + bool SDChannelSelect::findAdjacentChannel(int direction, int* page, int* index) const { + int currentPage = mCurrentPage; + int currentIndex = mCurrentChannelIndex; + int pageSize = MAX_CHANNEL_INDEX; + int currentSlot = currentPage * pageSize + currentIndex; + int step = direction == 1 ? -1 : 1; + int slotCount = mPageCount * pageSize; + int slot = currentSlot + step; + + if (slot < 0) { + slot = slotCount - 1; + } + if (slot >= slotCount) { + slot = 0; + } + + while (slot != currentSlot) { + int candidatePage = slot / pageSize; + int candidateIndex = slot % pageSize; + if (mpChannelTitleIds[slot] != 0) { + *page = candidatePage; + *index = candidateIndex; + return true; + } + + slot += step; + if (slot < 0) { + slot = slotCount - 1; + } + if (slot >= slotCount) { + slot = 0; + } + } + + *page = currentPage; + *index = currentIndex; + return false; + } + + void SDChannelSelect::setCurrentPageAndRefresh(int page, int index, + SDChannelObj* keepChannel) { + mCurrentPage = page; + mCurrentChannelIndex = index; + refreshPageObjects(page, keepChannel, index); + } + + void SDChannelSelect::handleFourPageDialog() { + if (System::getDialog()->callBtn2Multi(sFourPageDialogPages, 4, 10)) { + mState = 25; + } + } + + void SDChannelSelect::flushSaveDataAndMountSD() { + if (System::getDialog()->getLastResult() != DialogWindow::RESULT_NONE) { + mpPointerLayout->getAnim(0)->initAnmFrame(); + System::getSaveData()->setDidntGotoSDMenu(FALSE); + mpSaveDataFile = System::getSaveData()->flushAsync(System::getMem2App()); + mState = 1; + mpSDWorker->mount_sd_async(); + mWorkerState = 1; + } + } + + void SDChannelSelect::handleThreePageDialog() { + if (System::getDialog()->callBtn2Multi(sThreePageDialogPages, 3, 10)) { + mState = 27; + } + } + + void SDChannelSelect::finishCardDialog() { + if (System::getDialog()->getLastResult() != DialogWindow::RESULT_NONE) { + mpPointerLayout->getAnim(0)->initAnmFrame(); + mState = 1; + } + } + void SDChannelSelect::finishDialogOperation() { if (System::getDialog()->getLastResult() != DialogWindow::RESULT_NONE) { mbOperationActive = false; @@ -1684,137 +1679,18 @@ namespace ipl { } } - void SDChannelSelect::updateChannelObjects() { - SDChannelObj* channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - updateChannelObject(channel); + BOOL SDChannelSelect::isResetProcessDone() { + switch (mLastOperation) { + case 5: + case 6: + case 7: + case 8: + return FALSE; + default: + return TRUE; } } - void SDChannelSelect::updateChannelObject(SDChannelObj* channel) { - iplSDChannelObj_813E3104(channel); - iplSDChannelObj_813E311C(channel, mpDialogHeap, mpChannelHeap); - iplSDChannelObj_813E3178(channel, - getChannelBasePane(channel->getPage(), channel->getIndex(), - mCurrentPage)); - iplSDChannelObj_813E3180(channel, mpLayoutFile); - } - - void SDChannelSelect::calcChannelObjects() { - SDChannelObj* channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - iplSDChannelObj_813E322C(channel); - } - } - - void SDChannelSelect::drawChannelTransitionObjects() { - int index; - int page; - SDChannelObj* channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - page = channel->getPage(); - index = channel->getIndex(); - if (!hasChannelObject(page, index) || !isChannelReady(channel)) { - continue; - } - - setChannelScissor(channel); - iplSDChannelObj_813E32C8(channel); - - if (iplSDChannelObj_813E3330(channel)) { - if (mState < 24 && mState >= 15 && - (page != mSourcePage || index != mSourceIndex)) { - nw4r::math::VEC3 position(channel->getTranslate()); - mpPageLayouts[0]->GetRootPane()->SetTranslate(position); - mpPageLayouts[0]->calcMtx(); - mpPageLayouts[0]->draw(); - } - } else if (channel->mState == 2) { - nw4r::math::VEC3 position(channel->getTranslate()); - mpErrorLayout->GetRootPane()->SetTranslate(position); - mpErrorLayout->calcMtx(); - mpErrorLayout->draw(); - } - - switch (mState) { - case 15: - case 16: - case 19: - case 20: - case 21: - case 22: - case 23: - if (page == mSourcePage && index == mSourceIndex) { - nw4r::math::VEC3 position(channel->getTranslate()); - mpStateLayout->GetRootPane()->SetTranslate(position); - mpStateLayout->calcMtx(); - mpStateLayout->draw(); - } - break; - } - - if (mState < 22 && mState >= 19 && - page == mDestinationPage && index == mDestinationIndex) { - mpPageLayouts[2]->draw(); - mpPointerLayout->draw(); - } - } - } - - void SDChannelSelect::drawChannelObjects() { - SDChannelObj* channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - if (hasChannelObject(channel->getPage(), channel->getIndex())) { - iplSDChannelObj_813E3304(channel); - } - } - - channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - if (hasChannelObject(channel->getPage(), channel->getIndex())) { - iplSDChannelObj_813E330C(channel); - } - } - } - - void SDChannelSelect::updateArrowVisibility() { - int leftPageOffset; - if (mState == 10 || mState == 22) { - leftPageOffset = 1; - } else { - leftPageOffset = 0; - } - - if (mCurrentPage - 1 - leftPageOffset >= 0) { - mpLayout->FindPaneByName(mscEdgePaneNames[0])->SetVisible(true); - mpLayout->FindPaneByName(mscEdgePaneNames[1])->SetVisible(true); - } else { - mpLayout->FindPaneByName(mscEdgePaneNames[1 - leftPageOffset])->SetVisible(false); - } - - int rightPageOffset; - if (mState == 11 || mState == 23) { - rightPageOffset = 1; - } else { - rightPageOffset = 0; - } - if (mCurrentPage + rightPageOffset + 1 < mPageCount) { - mpLayout->FindPaneByName(mscEdgePaneNames[3])->SetVisible(true); - mpLayout->FindPaneByName(mscEdgePaneNames[4])->SetVisible(true); - } else { - mpLayout->FindPaneByName(mscEdgePaneNames[rightPageOffset + 3])->SetVisible(false); - } - } - - FaderSceneCommand SDChannelSelect::calcFadein() { - return mpLayout->isPlaying(0) ? FADER_SCN_CONTINUE : FADER_SCN_NEXT; - } - void SDChannelSelect::calcCommon() { if (mState == 2 && !mpLayout->isPlaying(0)) { SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); @@ -1857,7 +1733,9 @@ namespace ipl { processWorkerState(); } - extern "C" void iplSDChannelObj_813E3534(SDChannelObj* channel, int enabled); + FaderSceneCommand SDChannelSelect::calcFadein() { + return mpLayout->isPlaying(0) ? FADER_SCN_CONTINUE : FADER_SCN_NEXT; + } FaderSceneCommand SDChannelSelect::calcNormal() { int state = mState; @@ -2044,56 +1922,6 @@ namespace ipl { } } - void SDChannelSelect::destroyChannelObject(SDChannelObj* channel) { - EGG::Heap* heap = channel->getHeap(); - delete channel; - if (heap != NULL) { - heap->destroy(); - } - } - - bool SDChannelSelect::hasChannelObject(int page, int index) const { - if (page == mCurrentPage) { - return true; - } - - if (page == mCurrentPage - 1) { - if (mState == 10 || mState == 22) { - return true; - } - for (int current = 3; current < MAX_CHANNEL_INDEX; current += 4) { - if (current == index) { - return true; - } - } - } else if (page == mCurrentPage - 2) { - if (mState == 10 || mState == 22) { - for (int current = 3; current < MAX_CHANNEL_INDEX; current += 4) { - if (current == index) { - return true; - } - } - } - } else if (page == mCurrentPage + 1) { - if (mState == 11 || mState == 23) { - return true; - } - for (int current = 0; current < MAX_CHANNEL_INDEX; current += 4) { - if (current == index) { - return true; - } - } - } else if (page == mCurrentPage + 2 && (mState == 11 || mState == 23)) { - for (int current = 0; current < MAX_CHANNEL_INDEX; current += 4) { - if (current == index) { - return true; - } - } - } - - return false; - } - void SDChannelSelect::destroy() { System::getBS2Manager()->restart(); @@ -2216,29 +2044,254 @@ namespace ipl { } } - bool SDChannelSelect::isChannelInCalc(int page, int index, int currentPage) const { - int relativePage = page - currentPage; - if (relativePage <= -3 || relativePage >= 3 || - strcmp(mscChannelPaneNames[relativePage + 2][index], "") == 0) { - return false; + void SDChannelSelect::updateChannelObjects() { + SDChannelObj* channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + updateChannelObject(channel); } - return true; } - nw4r::lyt::Pane* SDChannelSelect::getChannelBasePane(int page, int index, - int currentPage) const { - if (isChannelInCalc(page, index, currentPage)) { - return mpLayout->FindPaneByName(mscChannelPaneNames[page - currentPage + 2][index]); + void SDChannelSelect::updateChannelObject(SDChannelObj* channel) { + iplSDChannelObj_813E3104(channel); + iplSDChannelObj_813E311C(channel, mpDialogHeap, mpChannelHeap); + iplSDChannelObj_813E3178(channel, + getChannelBasePane(channel->getPage(), channel->getIndex(), + mCurrentPage)); + iplSDChannelObj_813E3180(channel, mpLayoutFile); + } + + void SDChannelSelect::calcChannelObjects() { + SDChannelObj* channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + iplSDChannelObj_813E322C(channel); } - return mpLayout->FindPaneByName("Picture_16"); } - nw4r::lyt::Pane* SDChannelSelect::getCenterChannelPane(int index) const { - return mpLayout->FindPaneByName(mscChannelPaneNames[2][index]); + void SDChannelSelect::drawChannelTransitionObjects() { + int index; + int page; + SDChannelObj* channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + page = channel->getPage(); + index = channel->getIndex(); + if (!hasChannelObject(page, index) || !isChannelReady(channel)) { + continue; + } + + setChannelScissor(channel); + iplSDChannelObj_813E32C8(channel); + + if (iplSDChannelObj_813E3330(channel)) { + if (mState < 24 && mState >= 15 && + (page != mSourcePage || index != mSourceIndex)) { + nw4r::math::VEC3 position(channel->getTranslate()); + mpPageLayouts[0]->GetRootPane()->SetTranslate(position); + mpPageLayouts[0]->calcMtx(); + mpPageLayouts[0]->draw(); + } + } else if (channel->mState == 2) { + nw4r::math::VEC3 position(channel->getTranslate()); + mpErrorLayout->GetRootPane()->SetTranslate(position); + mpErrorLayout->calcMtx(); + mpErrorLayout->draw(); + } + + switch (mState) { + case 15: + case 16: + case 19: + case 20: + case 21: + case 22: + case 23: + if (page == mSourcePage && index == mSourceIndex) { + nw4r::math::VEC3 position(channel->getTranslate()); + mpStateLayout->GetRootPane()->SetTranslate(position); + mpStateLayout->calcMtx(); + mpStateLayout->draw(); + } + break; + } + + if (mState < 22 && mState >= 19 && + page == mDestinationPage && index == mDestinationIndex) { + mpPageLayouts[2]->draw(); + mpPointerLayout->draw(); + } + } } - nw4r::lyt::Pane* SDChannelSelect::getChannelPane(int index) const { - return mpLayout->FindPaneByName(mscChannelPaneNames[2][index]); +#pragma dont_inline on + BOOL SDChannelSelect::isChannelReady(const SDChannelObj* channel) { + return channel->mState == 3; + } +#pragma dont_inline reset + + void SDChannelSelect::drawChannelObjects() { + SDChannelObj* channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + if (hasChannelObject(channel->getPage(), channel->getIndex())) { + iplSDChannelObj_813E3304(channel); + } + } + + channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + if (hasChannelObject(channel->getPage(), channel->getIndex())) { + iplSDChannelObj_813E330C(channel); + } + } + } + + void SDChannelSelect::processNormalInput() { + if (mbOperationActive && System::getDialog()->callBtn1(0xc1, 0x2e)) { + mState = 28; + } + + SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); + if (button != NULL && button->isActive()) { + button->update(); + } + + if (mState == 1) { + controller::Interface* controller = System::getMasterController(); + if (controller->down(0x30001000)) { + if (mCurrentPage > 0) { + setStateAndPlaySelectSound(8); + return; + } + } else if (controller->down(0x06000010) && mCurrentPage < mPageCount - 1) { + setStateAndPlaySelectSound(9); + return; + } + + } + + mpPaneManager->update(); + } + + void SDChannelSelect::setPageActionFrame() { + if (mState == 8) { + setLayoutFrame(10); + } else { + setLayoutFrame(11); + } + } + + void SDChannelSelect::finishPageScroll() { + if (mpLayout->isPlaying(0)) { + return; + } + + SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); + if (mState == 10) { + --mCurrentPage; + if (mCurrentPage == 0) { + button->animation(15); + mbLeftArrowVisible = false; + } else if (!mbRightArrowVisible) { + button->animation(14); + mbRightArrowVisible = true; + } + } else { + ++mCurrentPage; + if (mCurrentPage == mPageCount - 1) { + button->animation(16); + mbRightArrowVisible = false; + } else if (!mbLeftArrowVisible) { + button->animation(13); + mbLeftArrowVisible = true; + } + } + + mpLayout->finishBinding(); + refreshPageObjects(mCurrentPage, NULL, -1); + mState = 1; + } + + void SDChannelSelect::advancePageAnimation() { + calcPageAnimations(); + updatePageTransform(); + if (!mpPageAnimations[0]->isPlaying()) { + mState = 12; + } + } + + void SDChannelSelect::initializeNormalPage() { + if (!mpPageAnimations[0]->isPlaying() && + System::getSceneManager()->getScene(0x23) == NULL) { + SDButton* button = static_cast( + System::getSceneManager()->getScene(0x24)); + button->enableBtn(); + + if (mCurrentPage > 0) { + button->animation(SDButton::IDANIM_ARROW_LEFT_APPEAR); + mbLeftArrowVisible = true; + } else { + mbLeftArrowVisible = false; + } + + if (mPageCount > 1 && mCurrentPage < mPageCount - 1) { + button->animation(SDButton::IDANIM_ARROW_RIGHT_APPEAR); + mbRightArrowVisible = true; + } else { + mbRightArrowVisible = false; + } + + button->setEventHandler(mpButtonEventHandler, NULL); + TVRCManager::getHandle()->setEnable(TRUE); + snd::getSystem()->startBGM("WIPL_BGM_MENU"); + clearNoticeQueue(); + updateChannelNotices(0, -1); + updateChannelNotices(-1, -1); + updateChannelNotices(1, -1); + updateChannelNotices(-2, -1); + updateChannelNotices(2, -1); + mState = 1; + } else { + calcPageAnimations(); + updatePageTransform(); + } + } + + void SDChannelSelect::refreshPageObjects(int page, SDChannelObj* keepChannel, + int noticeIndex) { + destroyUnusedChannelObjects(page, keepChannel); + createChannelList(page, false); + if (page < mPageCount - 1) { + createChannelList(page + 1, false); + } + if (page > 0) { + createChannelList(page - 1, false); + } + + updateChannelObjectOrder(page); + + SDChannelObj* channel = NULL; + while (channel = static_cast( + nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + int titleIndex = channel->getPage() * MAX_CHANNEL_INDEX + channel->getIndex(); + if (!iplSDChannelObj_813E3330(channel) && mpChannelTitleIds[titleIndex] != 0 && + mbNeedsRefresh) { + channel->mStateFlags = 2; + } + } + + updateChannelObjects(); + if (mbNeedsRefresh) { + clearNoticeQueue(); + updateChannelNotices(0, noticeIndex); + updateChannelNotices(-1, -1); + updateChannelNotices(1, -1); + updateChannelNotices(-2, -1); + updateChannelNotices(2, -1); + } } void SDChannelSelect::createChannelList(int page, bool force) { @@ -2265,6 +2318,12 @@ namespace ipl { } } + void SDChannelSelect::createChannelObject(int page, int index) { + EGG::FrmHeap* objectHeap = EGG::FrmHeap::create(0x212B8, mpLayoutHeap, 2); + SDChannelObj* channel = new (mpThumbnailHeap, 4) SDChannelObj(objectHeap, page, index); + nw4r::ut::List_Append(&mChannelObjects, channel); + } + void SDChannelSelect::destroyUnusedChannelObjects(int currentPage, SDChannelObj* keepChannel) { int keepPage; @@ -2308,174 +2367,6 @@ namespace ipl { } } - void SDChannelSelect::createChannelObject(int page, int index) { - EGG::FrmHeap* objectHeap = EGG::FrmHeap::create(0x212B8, mpLayoutHeap, 2); - SDChannelObj* channel = new (mpThumbnailHeap, 4) SDChannelObj(objectHeap, page, index); - nw4r::ut::List_Append(&mChannelObjects, channel); - } - -#pragma dont_inline on - BOOL SDChannelSelect::isChannelReady(const SDChannelObj* channel) { - return channel->mState == 3; - } -#pragma dont_inline reset - - BOOL SDChannelSelect::isPageCreated(int page) const { - for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) { - SDChannelObj* channel = findChannelObject(page, index); - if (channel == NULL || !isChannelReady(channel)) { - return FALSE; - } - } - - if (page + 1 < mPageCount) { - for (int index = 0; index < MAX_CHANNEL_INDEX; index += 4) { - SDChannelObj* channel = findChannelObject(page + 1, index); - if (channel == NULL || !isChannelReady(channel)) { - return FALSE; - } - } - } - - if (page - 1 >= 0) { - for (int index = 3; index < MAX_CHANNEL_INDEX; index += 4) { - SDChannelObj* channel = findChannelObject(page - 1, index); - if (channel == NULL || !isChannelReady(channel)) { - return FALSE; - } - } - } - - return TRUE; - } - - BOOL SDChannelSelect::prepareRestarting(int page) { - if (page == mCurrentPage) { - return isPageCreated(page); - } - - mCurrentPage = page; - refreshPageObjects(page, NULL, -1); - return isPageCreated(page); - } - - void SDChannelSelect::startPageTransition(int page, int index) { - mCurrentPage = page; - mCurrentChannelIndex = index; - mpLayout->setAnmType(ANIM_TYPE_BACKWARD, -1); - mpLayout->start(-1); - - nw4r::math::VEC3 position(0.0f, 0.0f, 0.0f); - nw4r::lyt::Pane* pane = getCenterChannelPane(index); - PSMTXMultVec(pane->GetGlobalMtx(), position, position); - math::VEC3 animationPosition(position); - initPageAnimations(animationPosition, 1); - updatePageTransform(); - mState = 14; - } - - void SDChannelSelect::moveChannelObjectsToDrawOrder(int page, int mode) { - for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) { - if (mode == -1) { - if ((index & 3) == 0) { - continue; - } - } else if (mode == 1 && (index & 3) == 3) { - continue; - } - - SDChannelObj* channel = findChannelObject(page, index); - if (channel != NULL) { - nw4r::ut::List_Remove(&mChannelObjects, channel); - nw4r::ut::List_Append(&mChannelObjects, channel); - } - } - - if (mode != 1 && page + 1 < mPageCount) { - for (int index = 0; index < MAX_CHANNEL_INDEX; index += 4) { - SDChannelObj* channel = findChannelObject(page + 1, index); - if (channel != NULL) { - nw4r::ut::List_Remove(&mChannelObjects, channel); - nw4r::ut::List_Append(&mChannelObjects, channel); - } - } - } - - if (mode != -1 && page - 1 >= 0) { - for (int index = 3; index < MAX_CHANNEL_INDEX; index += 4) { - SDChannelObj* channel = findChannelObject(page - 1, index); - if (channel != NULL) { - nw4r::ut::List_Remove(&mChannelObjects, channel); - nw4r::ut::List_Append(&mChannelObjects, channel); - } - } - } - } - - void SDChannelSelect::updateChannelObjectOrder(int page) { - moveChannelObjectsToDrawOrder(page, 0); - if (page < mPageCount - 1) { - moveChannelObjectsToDrawOrder(page + 1, -1); - } - if (page > 0) { - moveChannelObjectsToDrawOrder(page - 1, 1); - } - } - - void SDChannelSelect::refreshPageObjects(int page, SDChannelObj* keepChannel, - int noticeIndex) { - destroyUnusedChannelObjects(page, keepChannel); - createChannelList(page, false); - if (page < mPageCount - 1) { - createChannelList(page + 1, false); - } - if (page > 0) { - createChannelList(page - 1, false); - } - - updateChannelObjectOrder(page); - - SDChannelObj* channel = NULL; - while (channel = static_cast( - nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - int titleIndex = channel->getPage() * MAX_CHANNEL_INDEX + channel->getIndex(); - if (!iplSDChannelObj_813E3330(channel) && mpChannelTitleIds[titleIndex] != 0 && - mbNeedsRefresh) { - channel->mStateFlags = 2; - } - } - - updateChannelObjects(); - if (mbNeedsRefresh) { - clearNoticeQueue(); - updateChannelNotices(0, noticeIndex); - updateChannelNotices(-1, -1); - updateChannelNotices(1, -1); - updateChannelNotices(-2, -1); - updateChannelNotices(2, -1); - } - } - - void SDChannelSelect::setCurrentPageAndRefresh(int page, int index, - SDChannelObj* keepChannel) { - mCurrentPage = page; - mCurrentChannelIndex = index; - refreshPageObjects(page, keepChannel, index); - } - - void SDChannelSelect::handleFourPageDialog() { - if (System::getDialog()->callBtn2Multi(sFourPageDialogPages, 4, 10)) { - mState = 25; - } - } - - void SDChannelSelect::handleThreePageDialog() { - if (System::getDialog()->callBtn2Multi(sThreePageDialogPages, 3, 10)) { - mState = 27; - } - } - void SDChannelSelect::refreshChannelList() { SDChannelObj* channel = NULL; while (channel = static_cast( @@ -2522,6 +2413,62 @@ namespace ipl { updateChannelNotices(2, -1); } + void SDChannelSelect::destroyChannelObject(SDChannelObj* channel) { + EGG::Heap* heap = channel->getHeap(); + delete channel; + if (heap != NULL) { + heap->destroy(); + } + } + + void SDChannelSelect::updateChannelObjectOrder(int page) { + moveChannelObjectsToDrawOrder(page, 0); + if (page < mPageCount - 1) { + moveChannelObjectsToDrawOrder(page + 1, -1); + } + if (page > 0) { + moveChannelObjectsToDrawOrder(page - 1, 1); + } + } + + void SDChannelSelect::moveChannelObjectsToDrawOrder(int page, int mode) { + for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) { + if (mode == -1) { + if ((index & 3) == 0) { + continue; + } + } else if (mode == 1 && (index & 3) == 3) { + continue; + } + + SDChannelObj* channel = findChannelObject(page, index); + if (channel != NULL) { + nw4r::ut::List_Remove(&mChannelObjects, channel); + nw4r::ut::List_Append(&mChannelObjects, channel); + } + } + + if (mode != 1 && page + 1 < mPageCount) { + for (int index = 0; index < MAX_CHANNEL_INDEX; index += 4) { + SDChannelObj* channel = findChannelObject(page + 1, index); + if (channel != NULL) { + nw4r::ut::List_Remove(&mChannelObjects, channel); + nw4r::ut::List_Append(&mChannelObjects, channel); + } + } + } + + if (mode != -1 && page - 1 >= 0) { + for (int index = 3; index < MAX_CHANNEL_INDEX; index += 4) { + SDChannelObj* channel = findChannelObject(page - 1, index); + if (channel != NULL) { + nw4r::ut::List_Remove(&mChannelObjects, channel); + nw4r::ut::List_Append(&mChannelObjects, channel); + } + } + } + } + SDChannelObj* SDChannelSelect::findChannelObject(int page, int index) const { SDChannelObj* channel = NULL; while (channel = static_cast( @@ -2536,221 +2483,113 @@ namespace ipl { return NULL; } - math::VEC3 SDChannelSelect::getChannelPanePosition(SDChannelSelect* scene, int index) { - math::VEC3 position(0.0f, 0.0f, 0.0f); - MTXMultVec(scene->getCenterChannelPane(index)->GetGlobalMtx(), position, position); - return position; - } + void SDChannelSelect::updateArrowVisibility() { + int leftPageOffset; + if (mState == 10 || mState == 22) { + leftPageOffset = 1; + } else { + leftPageOffset = 0; + } - void SDChannelSelect::calcPageAnimations() { - for (int index = 0; index < 4; ++index) { - math::HermiteIntp* animation = mpPageAnimations[index]; - animation->calc(); + if (mCurrentPage - 1 - leftPageOffset >= 0) { + mpLayout->FindPaneByName(mscEdgePaneNames[0])->SetVisible(true); + mpLayout->FindPaneByName(mscEdgePaneNames[1])->SetVisible(true); + } else { + mpLayout->FindPaneByName(mscEdgePaneNames[1 - leftPageOffset])->SetVisible(false); + } + + int rightPageOffset; + if (mState == 11 || mState == 23) { + rightPageOffset = 1; + } else { + rightPageOffset = 0; + } + if (mCurrentPage + rightPageOffset + 1 < mPageCount) { + mpLayout->FindPaneByName(mscEdgePaneNames[3])->SetVisible(true); + mpLayout->FindPaneByName(mscEdgePaneNames[4])->SetVisible(true); + } else { + mpLayout->FindPaneByName(mscEdgePaneNames[rightPageOffset + 3])->SetVisible(false); } } - void SDChannelSelect::startResetting() { - snd::getSystem()->resetAllSound(); - clearCommandQueue(); - clearNoticeQueue(); + bool SDChannelSelect::hasChannelObject(int page, int index) const { + if (page == mCurrentPage) { + return true; + } + + if (page == mCurrentPage - 1) { + if (mState == 10 || mState == 22) { + return true; + } + for (int current = 3; current < MAX_CHANNEL_INDEX; current += 4) { + if (current == index) { + return true; + } + } + } else if (page == mCurrentPage - 2) { + if (mState == 10 || mState == 22) { + for (int current = 3; current < MAX_CHANNEL_INDEX; current += 4) { + if (current == index) { + return true; + } + } + } + } else if (page == mCurrentPage + 1) { + if (mState == 11 || mState == 23) { + return true; + } + for (int current = 0; current < MAX_CHANNEL_INDEX; current += 4) { + if (current == index) { + return true; + } + } + } else if (page == mCurrentPage + 2 && (mState == 11 || mState == 23)) { + for (int current = 0; current < MAX_CHANNEL_INDEX; current += 4) { + if (current == index) { + return true; + } + } + } + + return false; } - void SDChannelSelectCommand::copyFrom(const SDChannelSelectCommand& other) { - type = other.type; - titleId = other.titleId; - arguments.values[0] = other.arguments.values[0]; - arguments.values[1] = other.arguments.values[1]; - arguments.values[2] = other.arguments.values[2]; - } - - bool SDChannelSelectCommandQueue::push(const SDChannelSelectCommand& command) { - if (capacity == count) { + bool SDChannelSelect::isChannelInCalc(int page, int index, int currentPage) const { + int relativePage = page - currentPage; + if (relativePage <= -3 || relativePage >= 3 || + strcmp(mscChannelPaneNames[relativePage + 2][index], "") == 0) { return false; } - - commands[writeIndex].copyFrom(command); - ++writeIndex; - if (writeIndex >= capacity) { - writeIndex = 0; - } - ++count; return true; } - bool SDChannelSelectCommandQueue::pop() { - bool result = true; - if (count == 0) { - result = false; - } else { - ++readIndex; - if (readIndex >= capacity) { - readIndex = 0; - } - --count; - } - return result; - } - - bool SDChannelSelectNoticeQueue::pop() { - bool result = true; - if (count == 0) { - result = false; - } else { - ++readIndex; - if (readIndex >= capacity) { - readIndex = 0; - } - --count; - } - return result; - } - - void SDChannelSelect::updatePageTransform() { - math::VEC3 frames[3]; - for (int index = 0; index < 3; ++index) { - frames[index] = mpPageAnimations[index]->get(); - } - - nw4r::ut::Rect projection; - System::getProjectionRect(&projection); - - mPosition = math::VEC3((frames[0].x + frames[1].x) / 2.0f, - (frames[0].y + frames[2].y) / 2.0f, 0.0f); - mScale = math::VEC2(projection.GetWidth() / (frames[1].x - frames[0].x), - projection.GetHeight() / (frames[0].y - frames[2].y)); - } - - void SDChannelSelect::advancePageAnimation() { - calcPageAnimations(); - updatePageTransform(); - if (!mpPageAnimations[0]->isPlaying()) { - mState = 12; - } - } - - void SDChannelSelect::finishPageScroll() { - if (mpLayout->isPlaying(0)) { - return; - } - - SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); - if (mState == 10) { - --mCurrentPage; - if (mCurrentPage == 0) { - button->animation(15); - mbLeftArrowVisible = false; - } else if (!mbRightArrowVisible) { - button->animation(14); - mbRightArrowVisible = true; - } - } else { - ++mCurrentPage; - if (mCurrentPage == mPageCount - 1) { - button->animation(16); - mbRightArrowVisible = false; - } else if (!mbLeftArrowVisible) { - button->animation(13); - mbLeftArrowVisible = true; + BOOL SDChannelSelect::isPageCreated(int page) const { + for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) { + SDChannelObj* channel = findChannelObject(page, index); + if (channel == NULL || !isChannelReady(channel)) { + return FALSE; } } - mpLayout->finishBinding(); - refreshPageObjects(mCurrentPage, NULL, -1); - mState = 1; - } - - void SDChannelSelect::finishCardDialog() { - if (System::getDialog()->getLastResult() != DialogWindow::RESULT_NONE) { - mpPointerLayout->getAnim(0)->initAnmFrame(); - mState = 1; - } - } - - void SDChannelSelect::flushSaveDataAndMountSD() { - if (System::getDialog()->getLastResult() != DialogWindow::RESULT_NONE) { - mpPointerLayout->getAnim(0)->initAnmFrame(); - System::getSaveData()->setDidntGotoSDMenu(FALSE); - mpSaveDataFile = System::getSaveData()->flushAsync(System::getMem2App()); - mState = 1; - mpSDWorker->mount_sd_async(); - mWorkerState = 1; - } - } - - int SDChannelSelect::getCenterChannelIndex(const char* paneName) const { - int index = 0; - while (index < MAX_CHANNEL_INDEX) { - if (strcmp(paneName, mscChannelPaneNames[2][index]) == 0) { - break; - } - ++index; - } - - return index < MAX_CHANNEL_INDEX ? index : -1; - } - - void SDChannelSelect::initializeNormalPage() { - if (!mpPageAnimations[0]->isPlaying() && - System::getSceneManager()->getScene(0x23) == NULL) { - SDButton* button = static_cast( - System::getSceneManager()->getScene(0x24)); - button->enableBtn(); - - if (mCurrentPage > 0) { - button->animation(SDButton::IDANIM_ARROW_LEFT_APPEAR); - mbLeftArrowVisible = true; - } else { - mbLeftArrowVisible = false; - } - - if (mPageCount > 1 && mCurrentPage < mPageCount - 1) { - button->animation(SDButton::IDANIM_ARROW_RIGHT_APPEAR); - mbRightArrowVisible = true; - } else { - mbRightArrowVisible = false; - } - - button->setEventHandler(mpButtonEventHandler, NULL); - TVRCManager::getHandle()->setEnable(TRUE); - snd::getSystem()->startBGM("WIPL_BGM_MENU"); - clearNoticeQueue(); - updateChannelNotices(0, -1); - updateChannelNotices(-1, -1); - updateChannelNotices(1, -1); - updateChannelNotices(-2, -1); - updateChannelNotices(2, -1); - mState = 1; - } else { - calcPageAnimations(); - updatePageTransform(); - } - } - - void SDChannelSelect::processNormalInput() { - if (mbOperationActive && System::getDialog()->callBtn1(0xc1, 0x2e)) { - mState = 28; - } - - SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); - if (button != NULL && button->isActive()) { - button->update(); - } - - if (mState == 1) { - controller::Interface* controller = System::getMasterController(); - if (controller->down(0x30001000)) { - if (mCurrentPage > 0) { - setStateAndPlaySelectSound(8); - return; + if (page + 1 < mPageCount) { + for (int index = 0; index < MAX_CHANNEL_INDEX; index += 4) { + SDChannelObj* channel = findChannelObject(page + 1, index); + if (channel == NULL || !isChannelReady(channel)) { + return FALSE; } - } else if (controller->down(0x06000010) && mCurrentPage < mPageCount - 1) { - setStateAndPlaySelectSound(9); - return; } - } - mpPaneManager->update(); + if (page - 1 >= 0) { + for (int index = 3; index < MAX_CHANNEL_INDEX; index += 4) { + SDChannelObj* channel = findChannelObject(page - 1, index); + if (channel == NULL || !isChannelReady(channel)) { + return FALSE; + } + } + } + + return TRUE; } void SDChannelSelect::setStateAndPlaySelectSound(int state) { @@ -2758,6 +2597,19 @@ namespace ipl { snd::getSystem()->startSE("WSD_SELECT"); } + void SDChannelSelect::setLayoutFrame(int state) { + if (state == 10) { + mpLayout->setMinFrame(0.0f); + mpLayout->setMaxFrame(20.0f); + } else { + mpLayout->setMinFrame(40.0f); + mpLayout->setMaxFrame(60.0f); + } + mpLayout->setAnmType(ANIM_TYPE_FORWARD); + mpLayout->start(); + mState = state; + } + void SDChannelSelect::selectChannel(int page, int index) { SDChannelObj* channel = findChannelObject(page, index); initPageAnimations( @@ -2790,67 +2642,51 @@ namespace ipl { return TRUE; } - void SDChannelSelect::setPageActionFrame() { - if (mState == 8) { - setLayoutFrame(10); - } else { - setLayoutFrame(11); + BOOL SDChannelSelect::prepareRestarting(int page) { + if (page == mCurrentPage) { + return isPageCreated(page); } + + mCurrentPage = page; + refreshPageObjects(page, NULL, -1); + return isPageCreated(page); } - void SDChannelSelect::setLayoutFrame(int state) { - if (state == 10) { - mpLayout->setMinFrame(0.0f); - mpLayout->setMaxFrame(20.0f); - } else { - mpLayout->setMinFrame(40.0f); - mpLayout->setMaxFrame(60.0f); - } - mpLayout->setAnmType(ANIM_TYPE_FORWARD); - mpLayout->start(); - mState = state; + void SDChannelSelect::startPageTransition(int page, int index) { + mCurrentPage = page; + mCurrentChannelIndex = index; + mpLayout->setAnmType(ANIM_TYPE_BACKWARD, -1); + mpLayout->start(-1); + + nw4r::math::VEC3 position(0.0f, 0.0f, 0.0f); + nw4r::lyt::Pane* pane = getCenterChannelPane(index); + PSMTXMultVec(pane->GetGlobalMtx(), position, position); + math::VEC3 animationPosition(position); + initPageAnimations(animationPosition, 1); + updatePageTransform(); + mState = 14; } - void SDChannelSelect::initPageAnimations(const math::VEC3& position, int direction) { - nw4r::ut::Rect projection; - System::getProjectionRect(&projection); - - math::VEC3 topLeft(projection.left, -projection.top, 0.0f); - math::VEC3 lowerLeft(position.x - mThumbOffsetX, position.y + mThumbOffsetY, 0.0f); - math::VEC3 topRight(projection.right, -projection.top, 0.0f); - math::VEC3 lowerRight(position.x + mThumbOffsetX, position.y + mThumbOffsetY, 0.0f); - math::VEC3 bottomLeft(projection.left, -projection.bottom, 0.0f); - math::VEC3 upperLeft(position.x - mThumbOffsetX, position.y - mThumbOffsetY, 0.0f); - math::VEC3 bottomRight(projection.right, -projection.bottom, 0.0f); - math::VEC3 upperRight(position.x + mThumbOffsetX, position.y - mThumbOffsetY, 0.0f); - - if (direction == 0) { - mpPageAnimations[0]->init(topLeft, lowerLeft, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - mpPageAnimations[1]->init(topRight, lowerRight, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - mpPageAnimations[2]->init(bottomLeft, upperLeft, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - mpPageAnimations[3]->init(bottomRight, upperRight, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - } else { - mpPageAnimations[0]->init(lowerLeft, topLeft, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - mpPageAnimations[1]->init(lowerRight, topRight, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - mpPageAnimations[2]->init(upperLeft, bottomLeft, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); - mpPageAnimations[3]->init(upperRight, bottomRight, 28.0f, 0.0f, 0.0f, - ANIM_TYPE_FORWARD, 1.0f); + nw4r::lyt::Pane* SDChannelSelect::getChannelBasePane(int page, int index, + int currentPage) const { + if (isChannelInCalc(page, index, currentPage)) { + return mpLayout->FindPaneByName(mscChannelPaneNames[page - currentPage + 2][index]); } + return mpLayout->FindPaneByName("Picture_16"); + } - math::HermiteIntp* animation; - int index = 0; - do { - animation = mpPageAnimations[index]; - animation->play(); - ++index; - } while (index < 4); + nw4r::lyt::Pane* SDChannelSelect::getCenterChannelPane(int index) const { + return mpLayout->FindPaneByName(mscChannelPaneNames[2][index]); + } + + nw4r::lyt::Pane* SDChannelSelect::getChannelPane(int index) const { + return mpLayout->FindPaneByName(mscChannelPaneNames[2][index]); + } + + math::VEC3 SDChannelSelect::getChannelPanePosition(SDChannelSelect* scene, int index) { + math::VEC3 position(0.0f, 0.0f, 0.0f); + MTXMultVec(scene->getCenterChannelPane(index)->GetGlobalMtx(), position, position); + return position; } void SDChannelSelect::setChannelScissor(const SDChannelObj* channel) const { @@ -2930,6 +2766,82 @@ namespace ipl { } } + void SDChannelSelect::initPageAnimations(const math::VEC3& position, int direction) { + nw4r::ut::Rect projection; + System::getProjectionRect(&projection); + + math::VEC3 topLeft(projection.left, -projection.top, 0.0f); + math::VEC3 lowerLeft(position.x - mThumbOffsetX, position.y + mThumbOffsetY, 0.0f); + math::VEC3 topRight(projection.right, -projection.top, 0.0f); + math::VEC3 lowerRight(position.x + mThumbOffsetX, position.y + mThumbOffsetY, 0.0f); + math::VEC3 bottomLeft(projection.left, -projection.bottom, 0.0f); + math::VEC3 upperLeft(position.x - mThumbOffsetX, position.y - mThumbOffsetY, 0.0f); + math::VEC3 bottomRight(projection.right, -projection.bottom, 0.0f); + math::VEC3 upperRight(position.x + mThumbOffsetX, position.y - mThumbOffsetY, 0.0f); + + if (direction == 0) { + mpPageAnimations[0]->init(topLeft, lowerLeft, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + mpPageAnimations[1]->init(topRight, lowerRight, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + mpPageAnimations[2]->init(bottomLeft, upperLeft, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + mpPageAnimations[3]->init(bottomRight, upperRight, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + } else { + mpPageAnimations[0]->init(lowerLeft, topLeft, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + mpPageAnimations[1]->init(lowerRight, topRight, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + mpPageAnimations[2]->init(upperLeft, bottomLeft, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + mpPageAnimations[3]->init(upperRight, bottomRight, 28.0f, 0.0f, 0.0f, + ANIM_TYPE_FORWARD, 1.0f); + } + + math::HermiteIntp* animation; + int index = 0; + do { + animation = mpPageAnimations[index]; + animation->play(); + ++index; + } while (index < 4); + } + + void SDChannelSelect::calcPageAnimations() { + for (int index = 0; index < 4; ++index) { + math::HermiteIntp* animation = mpPageAnimations[index]; + animation->calc(); + } + } + + void SDChannelSelect::updatePageTransform() { + math::VEC3 frames[3]; + for (int index = 0; index < 3; ++index) { + frames[index] = mpPageAnimations[index]->get(); + } + + nw4r::ut::Rect projection; + System::getProjectionRect(&projection); + + mPosition = math::VEC3((frames[0].x + frames[1].x) / 2.0f, + (frames[0].y + frames[2].y) / 2.0f, 0.0f); + mScale = math::VEC2(projection.GetWidth() / (frames[1].x - frames[0].x), + projection.GetHeight() / (frames[0].y - frames[2].y)); + } + + int SDChannelSelect::getCenterChannelIndex(const char* paneName) const { + int index = 0; + while (index < MAX_CHANNEL_INDEX) { + if (strcmp(paneName, mscChannelPaneNames[2][index]) == 0) { + break; + } + ++index; + } + + return index < MAX_CHANNEL_INDEX ? index : -1; + } + void SDChannelSelect::createSceneLayouts() { GXTexObj widescreenTexture; @@ -2988,157 +2900,6 @@ namespace ipl { sThreePageDialogPages[2].layoutObj = mpPointerLayout; } - BOOL SDChannelSelect::isChannelMoveTarget(int page, int index) const { - if (page < 0 || page >= mPageCount) { - return FALSE; - } - if (index < 0 || index >= MAX_CHANNEL_INDEX) { - return FALSE; - } - if (page == mSourcePage && index == mSourceIndex) { - return TRUE; - } - u32 titleId = mpChannelTitleIds[page * MAX_CHANNEL_INDEX + index]; - return titleId == 0; - } - - BOOL SDChannelSelect::onEventDerived(const char* paneName, u32 event, - controller::Interface* controller) { - if (controller != NULL && - controller != System::getControllerManager()->getController(mControllerChannel)) { - return TRUE; - } - - int index = getCenterChannelIndex(paneName); - if (index >= 0) { - s32 eventType = event; - if (eventType != 2) { - if (eventType >= 2) { - if (eventType == 5 && !controller->pinch()) { - mDestinationIndex = index; - mDestinationPage = mCurrentPage; - mbButtonEnabled = true; - } - } else if (eventType >= 1) { - if (isChannelMoveTarget(mCurrentPage, index) || - (mCurrentPage == mSourcePage && index == mSourceIndex)) { - SDChannelObj* channel = findChannelObject(mCurrentPage, index); - iplSDChannelObj_813E3354(channel, 2); - snd::getSystem()->startSE("WIPL_SE_CH_TARGETTING"); - controller->rumble(1); - } - } - } else if (isChannelMoveTarget(mCurrentPage, index) || - (mCurrentPage == mSourcePage && index == mSourceIndex)) { - SDChannelObj* channel = findChannelObject(mCurrentPage, index); - iplSDChannelObj_813E33EC(channel, 2); - } - } - - return TRUE; - } - - void SDChannelSelect::startDrag(const controller::Interface* controller, - int page, int index) { - if (controller->getChannel() < 0) { - return; - } - - if (controller->isValidDpd()) { - mPointerPosition = controller->getDpdPos(); - } else { - mPointerPosition = math::VEC2(0.0f, 0.0f); - } - - mControllerChannel = controller->getChannel(); - mSourcePage = page; - mSourceIndex = index; - mDestinationPage = -1; - mDestinationIndex = -1; - mPendingPage = -1; - mPendingIndex = -1; - mMoveState = 0; - mbButtonEnabled = false; - mbDialogActive = false; - - System::getPointer()->changeType(controller->getChannel(), 1); - mpPageLayouts[0]->getAnim(0)->play(); - mpPageLayouts[1]->getAnim(0)->play(); - - SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); - button->disableBtn(); - - SDChannelObj* channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - int channelPage = channel->getPage(); - int channelIndex = channel->getIndex(); - bool selected = channelPage == page && channelIndex == index; - iplSDChannelObj_813E3480(channel, selected); - } - - snd::getSystem()->startSEwithPos("WIPL_SE_CH_HOLD", mPointerPosition.x); - mState = 15; - } - - void SDChannelSelect::finishDrag() { - if (isChannelMoveTarget(mDestinationPage, mDestinationIndex) && !mbDialogActive) { - SDChannelObj* channel = findChannelObject(mDestinationPage, mDestinationIndex); - nw4r::math::VEC3 position = channel->getTranslate(); - mpPageLayouts[2]->GetRootPane()->SetTranslate(position); - mpPageLayouts[2]->getAnim(0)->play(); - mpPointerLayout->GetRootPane()->SetTranslate(position); - mpPointerLayout->calcMtx(); - mpPointerLayout->getAnim(0)->play(); - snd::getSystem()->startSEwithPos("WIPL_SE_CH_SET", mPointerPosition.x); - mpPageLayouts[0]->getAnim(1)->play(); - mState = 19; - } else { - snd::getSystem()->startSEwithPos("WIPL_SE_CH_NOT_MOVE", mPointerPosition.x); - mState = 17; - } - - System::getPointer()->changeType(mControllerChannel, 0); - mpPageLayouts[1]->getAnim(1)->play(); - - SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); - button->enableBtn(); - - mbButtonEnabled = false; - mbDialogActive = false; - - SDChannelObj* channel = NULL; - while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), - channel != NULL) { - iplSDChannelObj_813E34E8(channel, 1); - } - - for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) { - mpPaneManager->initPane(getChannelPane(index)); - } - } - - void SDChannelSelect::moveDrag() { - if (System::getControllerManager()->getController(mControllerChannel) != NULL && - System::getControllerManager()->getController(mControllerChannel)->isValidDpd()) { - math::VEC2 position = System::getControllerManager() - ->getController(mControllerChannel) - ->getDpdProjectionPos(); - nw4r::math::VEC3 translation(position.x, -position.y, 0.0f); - mpPageLayouts[1]->GetRootPane()->SetTranslate(translation); - mpPageLayouts[1]->calcMtx(); - - math::VEC2 delta; - delta.y = position.y - mPointerPosition.y; - delta.x = position.x - mPointerPosition.x; - f32 distance = delta.x * delta.x + delta.y * delta.y; - f32 speed = distance <= 0.0f ? 0.0f : distance * nw4r::math::FrSqrt(distance); - - snd::getSystem()->holdSEwithPosDis("WIPL_SE_CH_DRAG", position.x, speed); - mPointerPosition = position; - } - } - void SDChannelSelect::updateDragState() { SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); if (button != NULL && button->isActive()) { @@ -3403,6 +3164,259 @@ namespace ipl { mState = 16; } + BOOL SDChannelSelect::onEventDerived(const char* paneName, u32 event, + controller::Interface* controller) { + if (controller != NULL && + controller != System::getControllerManager()->getController(mControllerChannel)) { + return TRUE; + } + + int index = getCenterChannelIndex(paneName); + if (index >= 0) { + s32 eventType = event; + if (eventType != 2) { + if (eventType >= 2) { + if (eventType == 5 && !controller->pinch()) { + mDestinationIndex = index; + mDestinationPage = mCurrentPage; + mbButtonEnabled = true; + } + } else if (eventType >= 1) { + if (isChannelMoveTarget(mCurrentPage, index) || + (mCurrentPage == mSourcePage && index == mSourceIndex)) { + SDChannelObj* channel = findChannelObject(mCurrentPage, index); + iplSDChannelObj_813E3354(channel, 2); + snd::getSystem()->startSE("WIPL_SE_CH_TARGETTING"); + controller->rumble(1); + } + } + } else if (isChannelMoveTarget(mCurrentPage, index) || + (mCurrentPage == mSourcePage && index == mSourceIndex)) { + SDChannelObj* channel = findChannelObject(mCurrentPage, index); + iplSDChannelObj_813E33EC(channel, 2); + } + } + + return TRUE; + } + + void SDChannelSelect::onButtonEvent(const char* paneName, u32 event, + const controller::Interface* controller) { + if (controller != NULL && + controller != System::getControllerManager()->getController(mControllerChannel)) { + return; + } + + switch (event) { + case ::gui::EventHandler::ON_LEFT: + if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_LEFT]) == 0) { + if (mCurrentPage > 0) { + mPendingIndex = -1; + } + } else if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_RIGHT]) == 0) { + if (mCurrentPage < mPageCount - 1) { + mPendingPage = -1; + } + } + break; + case ::gui::EventHandler::ON_POINT: + if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_LEFT]) == 0) { + if (mCurrentPage > 0 && mPendingIndex < 0) { + mPendingIndex = 0; + } + } else if (strcmp(paneName, SDButton::smButtonName[SDButton::BTN_ARROW_RIGHT]) == 0) { + if (mCurrentPage < mPageCount - 1 && mPendingPage < 0) { + mPendingPage = 0; + } + } + break; + } + } + + void SDChannelSelect::startDrag(const controller::Interface* controller, + int page, int index) { + if (controller->getChannel() < 0) { + return; + } + + if (controller->isValidDpd()) { + mPointerPosition = controller->getDpdPos(); + } else { + mPointerPosition = math::VEC2(0.0f, 0.0f); + } + + mControllerChannel = controller->getChannel(); + mSourcePage = page; + mSourceIndex = index; + mDestinationPage = -1; + mDestinationIndex = -1; + mPendingPage = -1; + mPendingIndex = -1; + mMoveState = 0; + mbButtonEnabled = false; + mbDialogActive = false; + + System::getPointer()->changeType(controller->getChannel(), 1); + mpPageLayouts[0]->getAnim(0)->play(); + mpPageLayouts[1]->getAnim(0)->play(); + + SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); + button->disableBtn(); + + SDChannelObj* channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + int channelPage = channel->getPage(); + int channelIndex = channel->getIndex(); + bool selected = channelPage == page && channelIndex == index; + iplSDChannelObj_813E3480(channel, selected); + } + + snd::getSystem()->startSEwithPos("WIPL_SE_CH_HOLD", mPointerPosition.x); + mState = 15; + } + + void SDChannelSelect::finishDrag() { + if (isChannelMoveTarget(mDestinationPage, mDestinationIndex) && !mbDialogActive) { + SDChannelObj* channel = findChannelObject(mDestinationPage, mDestinationIndex); + nw4r::math::VEC3 position = channel->getTranslate(); + mpPageLayouts[2]->GetRootPane()->SetTranslate(position); + mpPageLayouts[2]->getAnim(0)->play(); + mpPointerLayout->GetRootPane()->SetTranslate(position); + mpPointerLayout->calcMtx(); + mpPointerLayout->getAnim(0)->play(); + snd::getSystem()->startSEwithPos("WIPL_SE_CH_SET", mPointerPosition.x); + mpPageLayouts[0]->getAnim(1)->play(); + mState = 19; + } else { + snd::getSystem()->startSEwithPos("WIPL_SE_CH_NOT_MOVE", mPointerPosition.x); + mState = 17; + } + + System::getPointer()->changeType(mControllerChannel, 0); + mpPageLayouts[1]->getAnim(1)->play(); + + SDButton* button = static_cast(System::getSceneManager()->getScene(0x24)); + button->enableBtn(); + + mbButtonEnabled = false; + mbDialogActive = false; + + SDChannelObj* channel = NULL; + while (channel = static_cast(nw4r::ut::List_GetNext(&mChannelObjects, channel)), + channel != NULL) { + iplSDChannelObj_813E34E8(channel, 1); + } + + for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) { + mpPaneManager->initPane(getChannelPane(index)); + } + } + + BOOL SDChannelSelect::isChannelMoveTarget(int page, int index) const { + if (page < 0 || page >= mPageCount) { + return FALSE; + } + if (index < 0 || index >= MAX_CHANNEL_INDEX) { + return FALSE; + } + if (page == mSourcePage && index == mSourceIndex) { + return TRUE; + } + u32 titleId = mpChannelTitleIds[page * MAX_CHANNEL_INDEX + index]; + return titleId == 0; + } + + void SDChannelSelect::moveDrag() { + if (System::getControllerManager()->getController(mControllerChannel) != NULL && + System::getControllerManager()->getController(mControllerChannel)->isValidDpd()) { + math::VEC2 position = System::getControllerManager() + ->getController(mControllerChannel) + ->getDpdProjectionPos(); + nw4r::math::VEC3 translation(position.x, -position.y, 0.0f); + mpPageLayouts[1]->GetRootPane()->SetTranslate(translation); + mpPageLayouts[1]->calcMtx(); + + math::VEC2 delta; + delta.y = position.y - mPointerPosition.y; + delta.x = position.x - mPointerPosition.x; + f32 distance = delta.x * delta.x + delta.y * delta.y; + f32 speed = distance <= 0.0f ? 0.0f : distance * nw4r::math::FrSqrt(distance); + + snd::getSystem()->holdSEwithPosDis("WIPL_SE_CH_DRAG", position.x, speed); + mPointerPosition = position; + } + } + + void SDChannelSelectEventHandler::onEvent(u32 compId, u32 event, void* data) { + gui::PaneComponent* component = static_cast( + mpManager->getComponent(compId)); + const char* paneName = component->getPane()->GetName(); + controller::Interface* controller = static_cast(data); + + BOOL handled = FALSE; + switch (mpScene->mState) { + case 15: + case 16: + handled = mpScene->onEventDerived(paneName, event, controller); + break; + default: + break; + } + + handle_channel_event: + if (handled) { + return; + } + + int index = mpScene->getCenterChannelIndex(paneName); + if (index < 0) { + return; + } + + SDChannelObj* channel = mpScene->findChannelObject(mpScene->mCurrentPage, index); + if (channel == NULL) { + return; + } + + switch (event) { + case ::gui::EventHandler::ON_TRIG: + if (mpScene->mState == 1 && controller != NULL) { + BOOL writeProtected = mpScene->mpSDWorker->is_sd_write_protected(); + if (controller->pinchTrg() && SDChannelSelect::isChannelReady(channel) && + !mpScene->mbSDCardBroken) { + if (!writeProtected) { + mpScene->startDrag(controller, mpScene->mCurrentPage, index); + } else if (!mpScene->mbChannelLimitReached && + System::getDialog()->callBtn1(0xC6, 0x2E)) { + mpScene->mbChannelLimitReached = true; + mpScene->mState = 29; + } + } + } + break; + case ::gui::EventHandler::ON_DRAG: + if (mpScene->mState == 1 && controller != NULL && controller->decide() && + SDChannelSelect::isChannelReady(channel)) { + mpScene->selectChannel(channel->getPage(), channel->getIndex()); + TVRCManager::getHandle()->setEnable(FALSE); + } + break; + case ::gui::EventHandler::ON_POINT: + if (mpScene->mState == 1 && SDChannelSelect::isChannelReady(channel)) { + iplSDChannelObj_813E3354(channel, 0); + snd::getSystem()->startSE("WIPL_SE_CH_TARGETTING"); + controller->rumble(1); + } + break; + case ::gui::EventHandler::ON_LEFT: + if (mpScene->mState == 1 && SDChannelSelect::isChannelReady(channel)) { + iplSDChannelObj_813E33EC(channel, 0); + } + break; + } + } + void SDChannelSelectButtonEventHandler::onEventDerived( u32 compId, u32 event, const controller::Interface* con) { gui::PaneComponent* component = static_cast( @@ -3478,73 +3492,60 @@ namespace ipl { } } - void SDChannelSelectEventHandler::onEvent(u32 compId, u32 event, void* data) { - gui::PaneComponent* component = static_cast( - mpManager->getComponent(compId)); - const char* paneName = component->getPane()->GetName(); - controller::Interface* controller = static_cast(data); + void SDChannelSelect::startResetting() { + snd::getSystem()->resetAllSound(); + clearCommandQueue(); + clearNoticeQueue(); + } - BOOL handled = FALSE; - switch (mpScene->mState) { - case 15: - case 16: - handled = mpScene->onEventDerived(paneName, event, controller); - break; - default: - break; - } - - handle_channel_event: - if (handled) { - return; - } - - int index = mpScene->getCenterChannelIndex(paneName); - if (index < 0) { - return; - } - - SDChannelObj* channel = mpScene->findChannelObject(mpScene->mCurrentPage, index); - if (channel == NULL) { - return; - } - - switch (event) { - case ::gui::EventHandler::ON_TRIG: - if (mpScene->mState == 1 && controller != NULL) { - BOOL writeProtected = mpScene->mpSDWorker->is_sd_write_protected(); - if (controller->pinchTrg() && SDChannelSelect::isChannelReady(channel) && - !mpScene->mbSDCardBroken) { - if (!writeProtected) { - mpScene->startDrag(controller, mpScene->mCurrentPage, index); - } else if (!mpScene->mbChannelLimitReached && - System::getDialog()->callBtn1(0xC6, 0x2E)) { - mpScene->mbChannelLimitReached = true; - mpScene->mState = 29; - } - } + bool SDChannelSelectNoticeQueue::pop() { + bool result = true; + if (count == 0) { + result = false; + } else { + ++readIndex; + if (readIndex >= capacity) { + readIndex = 0; } - break; - case ::gui::EventHandler::ON_DRAG: - if (mpScene->mState == 1 && controller != NULL && controller->decide() && - SDChannelSelect::isChannelReady(channel)) { - mpScene->selectChannel(channel->getPage(), channel->getIndex()); - TVRCManager::getHandle()->setEnable(FALSE); - } - break; - case ::gui::EventHandler::ON_POINT: - if (mpScene->mState == 1 && SDChannelSelect::isChannelReady(channel)) { - iplSDChannelObj_813E3354(channel, 0); - snd::getSystem()->startSE("WIPL_SE_CH_TARGETTING"); - controller->rumble(1); - } - break; - case ::gui::EventHandler::ON_LEFT: - if (mpScene->mState == 1 && SDChannelSelect::isChannelReady(channel)) { - iplSDChannelObj_813E33EC(channel, 0); - } - break; + --count; } + return result; + } + + bool SDChannelSelectCommandQueue::push(const SDChannelSelectCommand& command) { + if (capacity == count) { + return false; + } + + commands[writeIndex].copyFrom(command); + ++writeIndex; + if (writeIndex >= capacity) { + writeIndex = 0; + } + ++count; + return true; + } + + bool SDChannelSelectCommandQueue::pop() { + bool result = true; + if (count == 0) { + result = false; + } else { + ++readIndex; + if (readIndex >= capacity) { + readIndex = 0; + } + --count; + } + return result; + } + + void SDChannelSelectCommand::copyFrom(const SDChannelSelectCommand& other) { + type = other.type; + titleId = other.titleId; + arguments.values[0] = other.arguments.values[0]; + arguments.values[1] = other.arguments.values[1]; + arguments.values[2] = other.arguments.values[2]; } } } diff --git a/src/scene/setting/iplSetting.cpp b/src/scene/setting/iplSetting.cpp index 611317fb..4adc2452 100644 --- a/src/scene/setting/iplSetting.cpp +++ b/src/scene/setting/iplSetting.cpp @@ -31,6 +31,9 @@ #include #include +#undef abs +extern "C" int abs(int value); + extern "C" void __VISetAdjustingValues(s32 horizontal, s32 vertical); namespace ipl { @@ -196,7 +199,7 @@ namespace ipl { } bool Setting::isAnimating() { - return mpSecondAnimation->state == 1 || mpFirstAnimation->state == 1 || mState != 20; + return mpSecondAnimation->isPlaying() || mpFirstAnimation->isPlaying() || mState != 20; } void Setting::getFuncMsgQ() { @@ -337,8 +340,8 @@ namespace ipl { delete writtenArchive; mpChangeLayout = new layout::Object(getSceneHeap(), mpSettingLayoutFile, "arc", "SceenChange_b.brlyt"); - mpFirstAnimation = reinterpret_cast(mpChangeLayout->bind("SceenChange_b_Right.brlan")); - mpSecondAnimation = reinterpret_cast(mpChangeLayout->bind("SceenChange_b_Left.brlan")); + mpFirstAnimation = mpChangeLayout->bind("SceenChange_b_Right.brlan"); + mpSecondAnimation = mpChangeLayout->bind("SceenChange_b_Left.brlan"); mpChangeLayout->finishBinding(); mpMainLayout = new layout::Object(getSceneHeap(), mpSettingLayoutFile, "arc", "my_AP_a.brlyt"); @@ -499,10 +502,12 @@ namespace ipl { } OSReport("***********************************\n"); - OSReport(" RSO PLACED : %p %d\n", static_cast(mpWWWLibraryFile)->getBuffer(), - static_cast(mpWWWLibraryFile)->getLength()); + OSReport("%s\n", browserPath); + OSReport("***********************************\n"); ICInvalidateRange(static_cast(mpWWWLibraryFile)->getBuffer(), static_cast(mpWWWLibraryFile)->getLength()); + OSReport(" RSO PLACED : %p %d\n", static_cast(mpWWWLibraryFile)->getBuffer(), + static_cast(mpWWWLibraryFile)->getLength()); ext_ead::www::SurfaceManager::CreateManager(width, height, width, height, mem1Buffer_, mem1Size, mem2Buffer_, mem2Size, static_cast(mpWWWLibraryFile)->getBuffer(), @@ -639,7 +644,7 @@ namespace ipl { } } - while (mpSecondAnimation->state == 1 || mpFirstAnimation->state == 1) { + while (mpSecondAnimation->isPlaying() || mpFirstAnimation->isPlaying()) { mpChangeLayout->calc(); } @@ -1314,7 +1319,7 @@ namespace ipl { } __OSLaunchTitlelForSystem(mUpdateTitleId, 0, NULL); for (;;) { - OSReport(NULL); + OSReport("hoge"); } } else if (surfaceState != 0 && ext_ead::www::SurfaceManager::GetInstance()->IsThreadStopped()) { OSReport("reserve destroy\n"); @@ -1379,8 +1384,8 @@ namespace ipl { } bool showBrowserWindow = - mpSecondAnimation->state == 1 || mpFirstAnimation->state == 1; - mpChangeLayout->FindPaneByName("hoge")->SetVisible(showBrowserWindow); + mpSecondAnimation->isPlaying() || mpFirstAnimation->isPlaying(); + mpChangeLayout->FindPaneByName("N_Tra0")->SetVisible(showBrowserWindow); WWWRect* wideRect = NULL; WWWRect* standardRect = NULL; @@ -1403,13 +1408,36 @@ namespace ipl { GXInitTexObjLOD(&wideTexture, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1); if (browserScrollDirection != 0) { - mpChangeLayout->FindPaneByName("hoge")->SetVisible(true); + nw4r::lyt::Material* standardMaterial = + mpChangeLayout->FindPaneByName("N_Tra0")->FindMaterialByName("Tex0"); + nw4r::lyt::Material* firstWideMaterial = + mpChangeLayout->FindPaneByName("N_Tra0")->FindMaterialByName("Tex1"); + nw4r::lyt::Material* secondWideMaterial = + mpChangeLayout->FindPaneByName("N_Tra0")->FindMaterialByName("Tex2"); + standardMaterial->SetTexture(0, standardTexture); + firstWideMaterial->SetTexture(0, wideTexture); + secondWideMaterial->SetTexture(0, wideTexture); + mpChangeLayout->FindPaneByName("N_Tra0")->SetVisible(true); + if (browserScrollDirection == 1) { + mpSecondAnimation->initFrame(); + mpSecondAnimation->restart(); + } else { + mpFirstAnimation->initFrame(); + mpFirstAnimation->restart(); + } + mpChangeLayout->calc(); + browserScrollDirection = 0; } utility::Graphics::setOrtho(0); - GXColor color = {0xFF, 0xFF, 0xFF, (u8)(mState * 0xFF / 20)}; - utility::Graphics::drawTexture(projection4x3, standardTexture, color, 1); - utility::Graphics::drawTexture(projection16x9, wideTexture, color, 1); + GXColor opaqueColor = {0xFF, 0xFF, 0xFF, 0xFF}; + GXColor fadeColor = {0xFF, 0xFF, 0xFF, (u8)(mState * 0xFF / 20)}; + int screenWidth = abs(static_cast(projection4x3.GetWidth())); + int screenHeight = abs(static_cast(projection4x3.GetHeight())); + nw4r::ut::Rect screenRect(-screenWidth / 2, screenHeight / 2, + screenWidth / 2, -screenHeight / 2); + utility::Graphics::drawTexture(screenRect, standardTexture, opaqueColor, 1); + utility::Graphics::drawTexture(projection16x9, wideTexture, fadeColor, 1); if (mpWiiSettingData->data[0x12] == 0x1E && unk_0x92C > 3) { SensitivityDrawing::draw(static_cast(mpBackgroundTPLFile)); @@ -2477,7 +2505,10 @@ namespace ipl { int Setting::checkIPString(const wchar_t* text) { wchar_t zeroAddress[16] = L"000.000.000.000"; - return memcmp(text, zeroAddress, sizeof(zeroAddress)) == 0 || checkInputString(text); + if (memcmp(text, zeroAddress, sizeof(zeroAddress)) == 0 || checkInputString(text)) { + return 1; + } + return 0; } bool Setting::calcSafeMode() { @@ -2602,17 +2633,17 @@ namespace ipl { setAPDraw(); mpMainLayout->getAnim(unk_0x91C[0] == 0 ? 0xb : 0xa)->initAnmFrame(); if (unk_0x914 == 0) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[0])->SetVisible(false); + mpMainLayout->FindPaneByName("N_AP1")->SetVisible(false); } else if (unk_0x914 == 1) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[0])->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP1")->SetVisible(true); } if (mAPScanList.count == unk_0x914 + 4) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[1])->SetVisible(false); + mpMainLayout->FindPaneByName("N_AP6")->SetVisible(false); } else if (mAPScanList.count == unk_0x914 + 5) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[1])->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP6")->SetVisible(true); } - mpMainLayout->FindPaneByName(sSettingAPTextNames[0])->SetVisible(true); - mpMainLayout->FindPaneByName(sSettingAPTextNames[1])->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP0")->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP7")->SetVisible(true); } break; case 7: @@ -2643,44 +2674,45 @@ namespace ipl { if (unk_0x91C[2] == 0) { return; } - mpMainLayout->FindPaneByName(sSettingAPNumberNames[1])->SetVisible(true); - mpMainLayout->FindPaneByName(sSettingAPNumberNames[2])->SetVisible(true); - mpMainLayout->FindPaneByName(sSettingAPNumberNames[3])->SetVisible(true); - mpMainLayout->FindPaneByName(sSettingAPNumberNames[4])->SetVisible(true); - mpMainLayout->FindPaneByName(sSettingAPNumberNames[0])->SetVisible(true); - mpMainLayout->FindPaneByName(sSettingAPNumberNames[5])->SetVisible(true); - u16 count = mAPScanList.count; - if (count == 2) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[3])->SetVisible(false); - } else if (count < 2) { - if (count == 0) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[1])->SetVisible(false); - } - mpMainLayout->FindPaneByName(sSettingAPNumberNames[2])->SetVisible(false); - mpMainLayout->FindPaneByName(sSettingAPNumberNames[3])->SetVisible(false); - } - if (count < 4) { - for (int index = 4; index < 6; ++index) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[index])->SetVisible(false); - } + mpMainLayout->FindPaneByName("N_AP2")->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP3")->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP4")->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP5")->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP6")->SetVisible(true); + mpMainLayout->FindPaneByName("N_AP7")->SetVisible(true); + switch (mAPScanList.count) { + case 0: + mpMainLayout->FindPaneByName("N_AP2")->SetVisible(false); + case 1: + mpMainLayout->FindPaneByName("N_AP3")->SetVisible(false); + case 2: + mpMainLayout->FindPaneByName("N_AP4")->SetVisible(false); + case 3: + mpMainLayout->FindPaneByName("N_AP5")->SetVisible(false); + mpMainLayout->FindPaneByName("N_AP6")->SetVisible(false); mpMainLayout->FindPaneByName("N_AP7")->SetVisible(false); + break; } - mpMainLayout->getAnim(0x14)->initFrame(); - mpMainLayout->getAnim(0x14)->restart(); + layout::Animator* animation = mpMainLayout->getAnim(0x14); + animation->initFrame(); + animation->restart(); mpMainLayout->getAnim(0)->initAnmFrame(); - mpMainLayout->FindPaneByName(sSettingAPPaneNames[0])->SetVisible(false); - mpMainLayout->FindPaneByName(sSettingAPPaneNames[1])->SetVisible(false); - if (count > unk_0x914 + 4) { - mpMainLayout->FindPaneByName(sSettingAPPaneNames[3])->SetVisible(true); - mpMainLayout->getAnim(1)->initFrame(); - mpMainLayout->getAnim(1)->restart(); - for (int index = 1; index < 6; ++index) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[index])->SetVisible(true); + mpMainLayout->FindPaneByName(sSettingArrowNames[0])->SetVisible(false); + mpMainLayout->FindPaneByName(sSettingAPNumberNames[0])->SetVisible(false); + if (mAPScanList.count <= unk_0x914 + 4) { + mpMainLayout->FindPaneByName("N_ArwB")->SetVisible(false); + mpMainLayout->FindPaneByName(sSettingArrowNames[1])->SetVisible(false); + for (int index = mAPScanList.count + 1; index < 6; ++index) { + mpMainLayout->FindPaneByName(sSettingAPNumberNames[index])->SetVisible(false); } } else { - mpMainLayout->FindPaneByName(sSettingAPPaneNames[3])->SetVisible(false); - for (int index = count + 1; index < 6; ++index) { - mpMainLayout->FindPaneByName(sSettingAPNumberNames[index])->SetVisible(false); + mpMainLayout->FindPaneByName("N_ArwB")->SetVisible(true); + mpMainLayout->FindPaneByName(sSettingArrowNames[1])->SetVisible(true); + animation = mpMainLayout->getAnim(1); + animation->initFrame(); + animation->restart(); + for (int index = 1; index < 6; ++index) { + mpMainLayout->FindPaneByName(sSettingAPNumberNames[index])->SetVisible(true); } } unk_0x78 = 6; @@ -3005,12 +3037,12 @@ namespace ipl { System::getDialog()->callBtn2(0x180, 0x2e, 0x25); } else if (result == 0) { if (!utility::ESMisc::ContentExist(titleView, 1, &contentResult) && contentResult != 0) { - System::getErrorHandler()->log("error", contentResult, "iplSetting.cpp", 0x10fc); + System::getErrorHandler()->log("ES", contentResult, "iplSetting.cpp", 0x10fc); System::getErrorHandler()->set(ErrorHandler::DEFAULT, 2); } valid = true; } else { - System::getErrorHandler()->log("error", result, "iplSetting.cpp", 0x10f1); + System::getErrorHandler()->log("ES", result, "iplSetting.cpp", 0x10f1); System::getErrorHandler()->set(ErrorHandler::DEFAULT, 2); } if (titleView != NULL) { @@ -3293,8 +3325,6 @@ namespace ipl { } } - static const wchar_t errorFormat[] = L"%d\n"; - void Setting::makeErrorMessage() { const wchar_t* prefix = System::getMessage(400); int messageId = getErrorNum(); @@ -3303,7 +3333,7 @@ namespace ipl { OSReport("error:%d\n", error); wchar_t errorText[8]; wchar_t message[0x140]; - swprintf(errorText, 8, errorFormat, error); + swprintf(errorText, 8, L"%d\n", error); memset(message, 0, sizeof(message)); size_t prefixLength = wcslen(prefix); wcsncat(message, prefix, prefixLength); @@ -3318,7 +3348,7 @@ namespace ipl { if (static_cast(System::getRegion()) == 2 && static_cast(System::getLanguage()) == 2 && static_cast(getErrorNum()) == 0x1b6) { - System::getDialog()->callBtn1(message, 0x2e, 46.0f); + System::getDialog()->callBtn1(message, 0x2e, 78.0f); } else { System::getDialog()->callBtn1(message, 0x2e); } @@ -3326,7 +3356,7 @@ namespace ipl { if (static_cast(System::getRegion()) == 2 && static_cast(System::getLanguage()) == 2 && static_cast(getErrorNum()) == 0x1b6) { - System::getDialog()->callBtn1(message, 0x2e, 46.0f); + System::getDialog()->callBtn1(message, 0x2e, 78.0f); } else { System::getDialog()->callBtn1(message, 0x2e); } @@ -3394,7 +3424,7 @@ namespace ipl { const wchar_t* codeLabel = System::getMessage(0x1b9); wchar_t supportCode[12]; wchar_t message[0x100]; - swprintf(supportCode, 12, errorFormat, unk_0x930); + swprintf(supportCode, 12, L"%d\n", unk_0x930); memset(message, 0, sizeof(message)); size_t messageLength = wcslen(title); wcsncat(message, title, messageLength); diff --git a/tools/decomp-assist/sol-low-scenes-round2.md b/tools/decomp-assist/sol-low-scenes-round2.md new file mode 100644 index 00000000..ad5ec1ad --- /dev/null +++ b/tools/decomp-assist/sol-low-scenes-round2.md @@ -0,0 +1,719 @@ +# Scenes round 2 attempts + +Baseline: merged main `4f78910f`. Original function symbols present: Setting 112/112, SDChannelSelect 129/129, SDMemory 66/66; no missing functions or assembly bodies. + +## Retained changes + +- `checkIPString`: NO_INLINE alone produced 38/38 instructions and 28 register differences. Explicit conditional returns produced 38/38, diffs 0, objdiff 100%. +- `calcFadeout`: restored the actual `hoge` OSReport argument. Raw instructions were already identical; the relocation was wrong. Objdiff now 100%. +- Setting vtable: removed an undefined calc override from the owner-only header branch; original vtable uses inherited FaderSceneBase::calc. +- SDMemory create: restored cache-count branching, N_Btn_3/N_Btn_4 visibility, display mode and button label. Trial 1:1085/1064 instructions; ordinary new trial 2:1078/1064; advancing cache pointer trial 3:1076/1064. Retained ordinary typed new and indexed cache loop. +- SDMemory setScrollLimit: original pane is N_Body and offset is 160.0. Direct arithmetic trial matched 81/81 with diffs 0; named item-height trial had 12 differences; loading heights before count had 9. Retained direct arithmetic. +- SDMemory drawTransferTitles: target-derived rewrite 419/451 instructions; componentwise memo translation, VEC2 out-of-line declaration, actual color helper, and corrected 500/40/79.5 literals:422/451. Its subsequent three condition-lifetime trials are below. All small data sections now match. +- SDChannelSelect: moved existing functions to original object order, preserved isChannelReady dont_inline pair; .sdata2 first 80 bytes became identical. Replaced three local const title-ID objects with their ordinary comparison literals; section is now exactly 80 bytes and 100%. +- Setting createBrowser: restored separator/path/separator reporting and RSO reporting after ICInvalidateRange. +- Setting draw: restored N_Tra0 and Tex0/Tex1/Tex2 material lookups, texture assignments and transition restart. Replaced opaque animation structure with actual FrameController pointers under IPL_SETTING_IMPLEMENTATION. Corrected opaque and fade colors and centered screen rectangle from integer absolute dimensions. +- Setting initScroll: re-derived all 277 instructions block by block: show AP2..AP7; switch 0/1/2/3 falls through hide calls; initialize animation; hide arrow and AP1; <= count branch first; indexed visibility loops; final state stores. 277/277, diffs 0, objdiff 100%. +- Setting scanAP: restored actual N_AP1/N_AP6/N_AP0/N_AP7 pane literals. validateEULA error tag is ES. Error-dialog spacing is 78.0, not 46.0. Used ordinary wide format literals. Both .sdata and .sdata2 now match. +- SDMemory: placed onDialogState7 before 8 and transfer-drawing helpers immediately after drawTransferTitles. + +## Remaining functions and new attempts + +Every remaining objdiff function has at least three distinct successful source builds this round. Trials were restored unless recorded above. Counts below come from the final retained source. Compiler-folded condition/temporary changes are explicitly recorded without claiming progress. + +### src/scene/setting/iplSetting + +- `makeSupportCode` 99.078950%: 76/76 instructions; register allocation or operand scheduling differs. + - retain title length separately from appended length: build 0; src 0x130 base 0x130 insns 76/76; diffs 13: [30, 32, 35, 38, 40, 46, 49, 51, 54, 56, 58, 61, 63]; POOL IDENTICAL up to 108 (mine=108 base=108). + - measure support code before appending label: build 0; src 0x130 base 0x130 insns 76/76; diffs 19: [6, 17, 38, 40, 42, 46, 47, 48, 49, 50, 51, 52, 54, 56, 57, 58, 59, 61, 63]; POOL IDENTICAL up to 108 (mine=108 base=108). + - use named append cursors: build 0; src 0x12c base 0x130 insns 75/76; --- replace mine 38:39 base 38:39; POOL IDENTICAL up to 108 (mine=108 base=108). +- `convertRevIP` 98.150690%: 73/73 instructions; register allocation or operand scheduling differs. + - name branch condition 6: build 0; src 0x124 base 0x124 insns 73/73; diffs 21: [6, 8, 12, 15, 16, 17, 18, 19, 21, 28, 29, 30, 36, 38, 45, 46, 47, 48, 50, 64]; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 5: build 0; src 0x134 base 0x124 insns 77/73; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 4: build 0; src 0x124 base 0x124 insns 73/73; diffs 21: [6, 8, 12, 15, 16, 17, 18, 19, 21, 28, 29, 30, 36, 38, 45, 46, 47, 48, 50, 64]; POOL IDENTICAL up to 108 (mine=108 base=108). +- `updateScroll` 94.469280%: 183/179 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 5: build 0; src 0x2dc base 0x2cc insns 183/179; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 4: build 0; src 0x2dc base 0x2cc insns 183/179; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 3: build 0; src 0x2dc base 0x2cc insns 183/179; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 8:9 target 8:9, replace mine 12:13 target 12:13, replace mine 17:18 target 17:18, delete mine 20:22 target 20:20, insert mine 23:23 target 21:22, replace mine 24:25 target 23:24. +- `createBrowser` 93.687706%: 308/301 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 6: build 0; src 0x4b8 base 0x4b4 insns 302/301; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 5: build 0; src 0x4b4 base 0x4b4 insns 301/301; diffs 143: [0, 2, 3, 16, 18, 20, 45, 65, 67, 69, 71, 135, 136, 137, 138, 139, 140, 141, 142, 143]; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 4: build 0; src 0x4b4 base 0x4b4 insns 301/301; diffs 143: [0, 2, 3, 16, 18, 20, 45, 65, 67, 69, 71, 135, 136, 137, 138, 139, 140, 141, 142, 143]; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 0:1 target 0:1, replace mine 2:4 target 2:4, replace mine 16:17 target 16:17, replace mine 18:19 target 18:19, replace mine 20:21 target 20:21, replace mine 45:46 target 45:46. +- `scanAP` 88.106620%: 255/272 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 9: build 0; src 0x424 base 0x440 insns 265/272; --- delete mine 5:6 base 5:5; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 8: build 0; src 0x424 base 0x440 insns 265/272; --- delete mine 5:6 base 5:5; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 7: build 0; src 0x424 base 0x440 insns 265/272; --- delete mine 5:6 base 5:5; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 7:8 target 7:8, replace mine 38:39 target 38:39, replace mine 49:50 target 49:50, replace mine 90:91 target 90:91, replace mine 94:95 target 94:95, replace mine 99:100 target 99:100. +- `setUSBAP` 78.421050%: 55/57 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 5: build 0; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 4: build 0; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 3: build 0; src 0xdc base 0xe4 insns 55/57; --- replace mine 7:9 base 7:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 7:9 target 7:9, replace mine 10:11 target 10:12, replace mine 14:15 target 15:16, replace mine 19:25 target 20:21, replace mine 39:40 target 35:44, delete mine 41:43 target 45:45. +- `calcKeyboard` 75.624140%: 293/290 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 6: build 0; src 0x494 base 0x488 insns 293/290; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 5: build 0; src 0x4ac base 0x488 insns 299/290; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 4: build 0; src 0x494 base 0x488 insns 293/290; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 0:1 target 0:1, replace mine 2:5 target 2:6, delete mine 6:7 target 7:7, replace mine 8:9 target 8:18, replace mine 11:12 target 20:21, replace mine 13:17 target 22:25. +- `calcNormal` 67.917960%: 1096/1158 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 63: build 0; src 0x1120 base 0x1218 insns 1096/1158; --- replace mine 36:37 base 36:37; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 62: build 0; src 0x1130 base 0x1218 insns 1100/1158; --- replace mine 36:37 base 36:37; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 61: build 0; src 0x1120 base 0x1218 insns 1096/1158; --- replace mine 36:37 base 36:37; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 36:37 target 36:37, replace mine 125:127 target 125:127, replace mine 166:167 target 166:167, delete mine 173:176 target 173:173, replace mine 181:182 target 178:179, replace mine 187:188 target 184:185. +- `initKeyboard` 67.309860%: 211/213 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 6: build 0; src 0x34c base 0x354 insns 211/213; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 5: build 0; src 0x34c base 0x354 insns 211/213; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 4: build 0; src 0x34c base 0x354 insns 211/213; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 8:9 target 8:9, delete mine 17:18 target 17:17, delete mine 19:20 target 18:18, replace mine 26:27 target 24:25, replace mine 33:34 target 31:32, replace mine 35:44 target 33:40. +- `validateEULA_` 64.414894%: 93/94 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 3: build 0; src 0x174 base 0x178 insns 93/94; --- replace mine 5:6 base 5:8; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 2: build 0; src 0x188 base 0x178 insns 98/94; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 1: build 0; src 0x188 base 0x178 insns 98/94; --- replace mine 5:6 base 5:8; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 5:6 target 5:8, replace mine 7:10 target 9:10, replace mine 11:12 target 11:12, insert mine 16:16 target 16:17, delete mine 17:18 target 18:18, replace mine 37:38 target 37:53. +- `setAPDraw` 62.204678%: 148/171 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 3: build 0; src 0x250 base 0x2ac insns 148/171; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 2: build 0; src 0x260 base 0x2ac insns 152/171; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 1: build 0; src 0x250 base 0x2ac insns 148/171; --- replace mine 6:7 base 6:7; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 6:7 target 6:7, replace mine 8:22 target 8:23, replace mine 25:26 target 26:27, replace mine 27:28 target 28:29, replace mine 30:32 target 31:33, insert mine 33:33 target 34:35. +- `draw` 49.120255%: 412/632 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 10: build 0; src 0x460 base 0x9e0 insns 280/632; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 9: build 0; src 0x450 base 0x9e0 insns 276/632; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - name branch condition 8: build 0; src 0x460 base 0x9e0 insns 280/632; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 108 (mine=108 base=108). + - Target/source block differences: replace mine 0:1 target 0:1, replace mine 2:4 target 2:8, replace mine 8:9 target 12:13, replace mine 10:12 target 14:16, replace mine 14:15 target 18:19, replace mine 21:22 target 25:26. + +### src/scene/sdChannelSelect/iplSDChannelSelect + +- `startPageTransition` 99.888885%: 45/45 instructions; two vector stack slots are reversed, 5 operand differences. + - initialize transform input by components: build 0; src 0xb0 base 0xb4 insns 44/45; --- replace mine 16:17 base 16:21; POOL IDENTICAL up to 101 (mine=101 base=101). + - resolve channel pane before constructing transform input: build 0; src 0xb8 base 0xb4 insns 46/45; --- insert mine 16:16 base 16:21; POOL IDENTICAL up to 101 (mine=101 base=101). + - copy through vector base reference: build 0; src 0xb4 base 0xb4 insns 45/45; diffs 5: [17, 24, 28, 29, 32]; POOL IDENTICAL up to 101 (mine=101 base=101). +- `flushSaveDataAndMountSD` 99.657140%: 35/35 instructions; heap/manager loads are reversed, 2 instruction differences. + - name branch condition 1: build 0; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101). + - cache flush heap before looking up manager: build 0; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101). + - retain save manager across flag update and flush: build 0; src 0x88 base 0x8c insns 34/35; --- replace mine 11:12 base 11:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - use manager and heap references for flush: build 0; src 0x8c base 0x8c insns 35/35; diffs 2: [20, 21]; POOL IDENTICAL up to 101 (mine=101 base=101). +- `handleSDTitleListResult` 99.152050%: 170/171 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 15: build 0; src 0x2a8 base 0x2ac insns 170/171; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 14: build 0; src 0x2a8 base 0x2ac insns 170/171; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 13: build 0; src 0x2a8 base 0x2ac insns 170/171; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 9:10 target 9:10, replace mine 14:15 target 14:15, replace mine 30:31 target 30:32, replace mine 115:116 target 116:117, replace mine 121:123 target 122:124, replace mine 126:128 target 127:129. +- `calcCommon` 99.074070%: 109/108 instructions; unused SDButton event-handler second argument emits an extra li r5,0. + - name branch condition 6: build 0; src 0x1b4 base 0x1b0 insns 109/108; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 5: build 0; src 0x1cc base 0x1b0 insns 115/108; --- delete mine 4:5 base 4:4; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0x1c4 base 0x1b0 insns 113/108; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 8:9 target 8:9, replace mine 13:14 target 13:14, replace mine 21:22 target 21:22, delete mine 23:24 target 23:23. +- `initializeNormalPage` 98.936170%: 95/94 instructions; unused SDButton event-handler second argument emits an extra li r5,0. + - name branch condition 3: build 0; src 0x18c base 0x178 insns 99/94; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 2: build 0; src 0x17c base 0x178 insns 95/94; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 1: build 0; src 0x194 base 0x178 insns 101/94; --- delete mine 4:5 base 4:4; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 9:10 target 9:10, replace mine 16:17 target 16:17, delete mine 50:51 target 50:50. +- `selectChannel` 98.305084%: 60/59 instructions; unused SDButton event-handler second argument emits an extra li r5,0. + - name branch condition 2: build 0; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 1: build 0; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101). + - cache base pane translation before animation setup: build 0; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101). + - resolve button before updating selected channel: build 0; src 0xf4 base 0xec insns 61/59; --- replace mine 5:7 base 5:7; POOL IDENTICAL up to 101 (mine=101 base=101). + - compare arrow visibility explicitly: build 0; src 0xf0 base 0xec insns 60/59; --- delete mine 41:42 base 41:41; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: delete mine 41:42 target 41:41. +- `collectTitlesFromNandUsage` 97.833336%: 102/102 instructions; output-count increment and usage loads are scheduled differently, 4 differences. + - name branch condition 4: build 0; src 0x194 base 0x198 insns 101/102; --- insert mine 69:69 base 69:72; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0x1a8 base 0x198 insns 106/102; --- replace mine 23:24 base 23:24; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 2: build 0; src 0x1a0 base 0x198 insns 104/102; --- replace mine 23:24 base 23:24; POOL IDENTICAL up to 101 (mine=101 base=101). +- `collectTitlesByUsage` 97.811880%: 101/101 instructions; output-count increment and usage loads are scheduled differently, 4 differences. + - name branch condition 4: build 0; src 0x190 base 0x194 insns 100/101; --- insert mine 67:67 base 67:70; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0x1a4 base 0x194 insns 105/101; --- replace mine 21:22 base 21:22; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 2: build 0; src 0x19c base 0x194 insns 103/101; --- replace mine 21:22 base 21:22; POOL IDENTICAL up to 101 (mine=101 base=101). +- `enqueueNotice` 97.511110%: 46/45 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0xb8 base 0xb4 insns 46/45; --- replace mine 10:11 base 10:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0xb8 base 0xb4 insns 46/45; --- replace mine 10:11 base 10:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0xb8 base 0xb4 insns 46/45; --- replace mine 10:11 base 10:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 10:11 target 10:12, delete mine 12:13 target 13:13, delete mine 18:19 target 18:18. +- `onEventDerived` 95.680560%: 140/144 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 10: build 0; src 0x240 base 0x240 insns 144/144; diffs 110: [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 9: build 0; src 0x230 base 0x240 insns 140/144; --- insert mine 20:20 base 20:27; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 8: build 0; src 0x234 base 0x240 insns 141/144; --- insert mine 20:20 base 20:27; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: insert mine 20:20 target 20:27, replace mine 21:25 target 28:29, replace mine 32:33 target 36:38, replace mine 34:35 target 39:40, replace mine 43:44 target 48:49, replace mine 45:46 target 50:51. +- `enqueueLoadNotice` 95.652176%: 24/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:8 target 7:8, delete mine 17:18 target 17:17. +- `enqueuePageNotice` 95.652176%: 24/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:8 target 7:8, delete mine 17:18 target 17:17. +- `enqueueResultNotice` 95.652176%: 24/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:8 target 7:8, delete mine 17:18 target 17:17. +- `enqueueMoveNotice` 95.652176%: 24/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:8 target 7:8, delete mine 17:18 target 17:17. +- `enqueueErrorNotice` 95.652176%: 24/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:8 target 7:8, delete mine 17:18 target 17:17. +- `enqueueStateNotice` 95.130430%: 24/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:11 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x60 base 0x5c insns 24/23; --- replace mine 7:8 base 7:9; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:8 target 7:9, delete mine 9:10 target 10:10, delete mine 17:18 target 17:17. +- `destroy` 95.097565%: 203/205 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 7: build 0; src 0x32c base 0x334 insns 203/205; --- insert mine 11:11 base 11:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 6: build 0; src 0x32c base 0x334 insns 203/205; --- insert mine 11:11 base 11:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 5: build 0; src 0x32c base 0x334 insns 203/205; --- insert mine 11:11 base 11:12; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: insert mine 11:11 target 11:12, replace mine 13:14 target 14:15, insert mine 20:20 target 21:22, delete mine 21:22 target 23:23, replace mine 61:62 target 62:63, insert mine 98:98 target 99:101. +- `drawChannelTransitionObjects` 94.974846%: 153/159 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 5: build 0; src 0x294 base 0x27c insns 165/159; --- replace mine 6:10 base 6:20; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0x274 base 0x27c insns 157/159; --- replace mine 6:10 base 6:20; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0x294 base 0x27c insns 165/159; --- replace mine 6:10 base 6:20; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 6:10 target 6:20, replace mine 12:13 target 22:26, replace mine 15:29 target 28:29, replace mine 31:32 target 31:32, replace mine 33:34 target 33:35, replace mine 35:36 target 36:37. +- `applyChannelMove` 94.669230%: 130/130 instructions; register allocation or operand scheduling differs. + - name branch condition 4: build 0; src 0x208 base 0x208 insns 130/130; diffs 61: [41, 43, 46, 50, 51, 52, 57, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0x208 base 0x208 insns 130/130; diffs 61: [41, 43, 46, 50, 51, 52, 57, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 2: build 0; src 0x218 base 0x208 insns 134/130; --- replace mine 12:13 base 12:13; POOL IDENTICAL up to 101 (mine=101 base=101). +- `enqueueFinishNotice` 94.444440%: 19/18 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x4c base 0x48 insns 19/18; --- replace mine 2:3 base 2:3; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x4c base 0x48 insns 19/18; --- replace mine 2:3 base 2:3; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x4c base 0x48 insns 19/18; --- insert mine 8:8 base 8:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: delete mine 12:13 target 12:12. +- `create` 94.239720%: 146/146 instructions; register allocation or operand scheduling differs. + - name branch condition 3: build 0; src 0x248 base 0x248 insns 146/146; diffs 84: [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 2: build 0; src 0x248 base 0x248 insns 146/146; diffs 84: [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 1: build 0; src 0x248 base 0x248 insns 146/146; diffs 84: [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]; POOL IDENTICAL up to 101 (mine=101 base=101). +- `enqueueStartNotice` 94.117645%: 18/17 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x48 base 0x44 insns 18/17; --- replace mine 2:3 base 2:3; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x48 base 0x44 insns 18/17; --- replace mine 2:3 base 2:3; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x48 base 0x44 insns 18/17; --- insert mine 8:8 base 8:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: delete mine 12:13 target 12:12. +- `onEventDerived` 94.085720%: 103/105 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 6: build 0; src 0x1ac base 0x1a4 insns 107/105; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 5: build 0; src 0x1ac base 0x1a4 insns 107/105; --- replace mine 7:10 base 7:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0x19c base 0x1a4 insns 103/105; --- replace mine 19:20 base 19:20; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 19:20 target 19:20, replace mine 25:26 target 25:26, replace mine 27:29 target 27:32, replace mine 30:31 target 33:35, replace mine 37:38 target 41:42, replace mine 43:46 target 47:48. +- `onButtonEvent` 93.736270%: 87/91 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 7: build 0; src 0x16c base 0x16c insns 91/91; diffs 50: [22, 24, 26, 27, 33, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 6: build 0; src 0x16c base 0x16c insns 91/91; diffs 39: [22, 24, 26, 27, 33, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 5: build 0; src 0x160 base 0x16c insns 88/91; --- replace mine 17:18 base 17:18; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 17:18 target 17:18, replace mine 20:21 target 20:21, replace mine 22:25 target 22:25, replace mine 26:28 target 26:28, replace mine 33:34 target 33:34, replace mine 36:38 target 36:38. +- `setChannelScissor` 93.484980%: 233/233 instructions; register allocation or operand scheduling differs. + - name branch condition 6: build 0; src 0x3ac base 0x3a4 insns 235/233; --- replace mine 38:42 base 38:42; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 5: build 0; src 0x3ac base 0x3a4 insns 235/233; --- replace mine 38:42 base 38:42; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0x3ac base 0x3a4 insns 235/233; --- replace mine 38:42 base 38:42; POOL IDENTICAL up to 101 (mine=101 base=101). +- `isCurrentTitleUsageEnough` 93.078430%: 50/51 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 2: build 0; src 0xc8 base 0xcc insns 50/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 1: build 0; src 0xc8 base 0xcc insns 50/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101). + - for loop with explicit while and increment: build 0; src 0xc8 base 0xcc insns 50/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 5:6 target 5:6, replace mine 7:9 target 7:9, replace mine 35:37 target 35:44, delete mine 38:44 target 45:45. +- `enqueueChannelNotice` 90.869570%: 25/23 instructions; command stores and zero/type registers differ. + - initialize command payload in reverse order: build 0; src 0x64 base 0x5c insns 25/23; --- replace mine 7:12 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in payload first order: build 0; src 0x64 base 0x5c insns 25/23; --- replace mine 7:12 base 7:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - initialize command payload in title before flags order: build 0; src 0x64 base 0x5c insns 25/23; --- replace mine 7:8 base 7:8; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 7:9 target 7:9, delete mine 10:11 target 10:10, replace mine 15:16 target 14:15, delete mine 18:19 target 17:17. +- `handleSDChannelUpdateComplete` 86.824070%: 105/108 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 5: build 0; src 0x1a4 base 0x1b0 insns 105/108; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0x1a4 base 0x1b0 insns 105/108; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0x1ac base 0x1b0 insns 107/108; --- replace mine 9:10 base 9:10; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 9:10 target 9:10, replace mine 11:12 target 11:12, replace mine 15:19 target 15:19, insert mine 26:26 target 26:27, delete mine 27:28 target 28:28, replace mine 33:34 target 33:34. +- `getCurrentTitleUsage` 86.823530%: 49/51 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 2: build 0; src 0xc4 base 0xcc insns 49/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 1: build 0; src 0xc4 base 0xcc insns 49/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101). + - for loop with explicit while and increment: build 0; src 0xc4 base 0xcc insns 49/51; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 5:6 target 5:6, insert mine 7:7 target 7:10, delete mine 8:11 target 11:11, replace mine 31:32 target 31:32, replace mine 33:38 target 33:38, replace mine 39:42 target 39:44. +- `collectTitlesByChannelOrder` 86.555560%: 118/126 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 5: build 0; src 0x1d4 base 0x1f8 insns 117/126; --- replace mine 5:11 base 5:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0x1e8 base 0x1f8 insns 122/126; --- replace mine 5:11 base 5:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0x1d8 base 0x1f8 insns 118/126; --- replace mine 5:11 base 5:11; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 5:11 target 5:11, replace mine 15:30 target 15:30, replace mine 32:34 target 32:34, replace mine 35:38 target 35:41, replace mine 39:56 target 42:59, replace mine 57:59 target 60:62. +- `processWorkerCommands` 83.055214%: 327/326 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 11: build 0; src 0x52c base 0x518 insns 331/326; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 10: build 0; src 0x51c base 0x518 insns 327/326; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 9: build 0; src 0x51c base 0x518 insns 327/326; --- replace mine 8:9 base 8:9; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 8:9 target 8:9, replace mine 17:18 target 17:18, replace mine 26:27 target 26:27, replace mine 28:29 target 28:29, replace mine 33:34 target 33:34, replace mine 36:37 target 36:37. +- `updateDialogAnimation` 77.247190%: 263/267 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 9: build 0; src 0x41c base 0x42c insns 263/267; --- replace mine 15:16 base 15:16; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 8: build 0; src 0x41c base 0x42c insns 263/267; --- replace mine 15:16 base 15:16; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 7: build 0; src 0x41c base 0x42c insns 263/267; --- replace mine 15:16 base 15:16; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 15:16 target 15:16, delete mine 44:47 target 44:44, replace mine 48:54 target 45:46, replace mine 56:58 target 48:50, replace mine 59:60 target 51:53, replace mine 62:63 target 55:56. +- `updatePageTransform` 76.606450%: 151/155 instructions; instruction count and block scheduling/control flow differ. + - for loop with explicit while and increment: build 0; src 0x25c base 0x26c insns 151/155; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101). + - name channel frame center coordinates: build 0; src 0x25c base 0x26c insns 151/155; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101). + - sample three frame animations explicitly: build 0; src 0x108 base 0x26c insns 66/155; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101). + - cache projection dimensions before computing transform: build 0; src 0x25c base 0x26c insns 151/155; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 0:1 target 0:1, replace mine 2:15 target 2:13, replace mine 25:26 target 23:24, replace mine 41:43 target 39:40, replace mine 44:46 target 41:44, insert mine 47:47 target 45:55. +- `collectTitlesBySpecialChannels` 71.639890%: 331/361 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 13: build 0; src 0x528 base 0x5a4 insns 330/361; --- replace mine 5:20 base 5:13; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 12: build 0; src 0x53c base 0x5a4 insns 335/361; --- replace mine 5:20 base 5:13; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 11: build 0; src 0x52c base 0x5a4 insns 331/361; --- replace mine 5:20 base 5:13; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: replace mine 5:20 target 5:13, insert mine 21:21 target 14:35, replace mine 22:43 target 36:43, replace mine 44:47 target 44:49, replace mine 50:51 target 52:96, delete mine 52:93 target 97:97. +- `findAdjacentChannel` 48.044445%: 48/45 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 5: build 0; src 0xc0 base 0xb4 insns 48/45; --- delete mine 2:3 base 2:2; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 4: build 0; src 0xc0 base 0xb4 insns 48/45; --- delete mine 2:3 base 2:2; POOL IDENTICAL up to 101 (mine=101 base=101). + - name branch condition 3: build 0; src 0xc0 base 0xb4 insns 48/45; --- delete mine 2:3 base 2:2; POOL IDENTICAL up to 101 (mine=101 base=101). + - Target/source block differences: delete mine 2:3 target 2:2, replace mine 5:9 target 4:8, replace mine 12:14 target 11:15, replace mine 15:17 target 16:18, replace mine 18:22 target 19:28, replace mine 23:24 target 29:30. + +### src/scene/sdChannelMemory/iplSDMemory + +- `onDialogState8` 99.778480%: 158/158 instructions; header pointer and row-count registers differ, 6 differences. + - name branch condition 5: build 0; src 0x27c base 0x278 insns 159/158; --- replace mine 49:50 base 49:50; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 4: build 0; src 0x278 base 0x278 insns 158/158; diffs 6: [83, 89, 91, 137, 142, 143]; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 3: build 0; src 0x284 base 0x278 insns 161/158; --- replace mine 11:12 base 11:12; POOL IDENTICAL up to 90 (mine=90 base=90). +- `create` 95.456764%: 1078/1064 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 3: build 0; src 0x10d8 base 0x10a0 insns 1078/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 2: build 0; src 0x10d8 base 0x10a0 insns 1078/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 1: build 0; src 0x10d8 base 0x10a0 insns 1078/1064; --- replace mine 5:6 base 5:6; POOL IDENTICAL up to 90 (mine=90 base=90). + - Target/source block differences: replace mine 5:6 target 5:6, replace mine 10:11 target 10:11, replace mine 17:18 target 17:18, replace mine 21:22 target 21:22, replace mine 27:28 target 27:28, replace mine 33:35 target 33:35. +- `onDialogState21` 90.060974%: 79/82 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 2: build 0; src 0x13c base 0x148 insns 79/82; --- replace mine 5:8 base 5:8; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 1: build 0; src 0x14c base 0x148 insns 83/82; --- replace mine 5:8 base 5:8; POOL IDENTICAL up to 90 (mine=90 base=90). + - nested short-circuit branch guards: build 0; src 0x13c base 0x148 insns 79/82; --- replace mine 5:8 base 5:8; POOL IDENTICAL up to 90 (mine=90 base=90). + - Target/source block differences: replace mine 5:8 target 5:8, replace mine 9:10 target 9:10, replace mine 13:14 target 13:14, replace mine 16:17 target 16:22, replace mine 21:25 target 26:36, replace mine 26:38 target 37:41. +- `drawTransferTitles` 85.421290%: 422/451 instructions; instruction count and block scheduling/control flow differ. + - name branch condition 8: build 0; src 0x6a0 base 0x70c insns 424/451; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 7: build 0; src 0x6a8 base 0x70c insns 426/451; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 90 (mine=90 base=90). + - name branch condition 6: build 0; src 0x6a8 base 0x70c insns 426/451; --- replace mine 0:1 base 0:1; POOL IDENTICAL up to 90 (mine=90 base=90). + - Target/source block differences: replace mine 0:1 target 0:1, replace mine 2:20 target 2:20, replace mine 23:24 target 23:24, replace mine 26:27 target 26:27, replace mine 33:35 target 33:35, replace mine 36:38 target 36:38. + +## Data limits and measurement uncertainty + +- Setting: .sdata 504 bytes and .sdata2 64 bytes 100%; .bss/.sbss 100%. Original .rodata includes two trailing 20-byte UTF-16 digit maps with no object-code references. They were not fabricated as unused padding. Animation bindings and pointer tables are present; original symbol scAnmTable aggregates adjoining tables. +- SDChannelSelect: .rodata 64 bytes, .sdata 80 bytes, .sdata2 80 bytes 100%. +- SDMemory: .sdata 152 bytes and .sdata2 48 bytes 100%. +- Remaining .data differences include original zero-filled deduplicated weak vtables versus compiler-emitted vtable relocations, symbol grouping and layout. No replacement zero arrays, force-active entries or linker changes were used. +- Gate instruction counts differ from objdiff counts by one in Setting and SDMemory. Raw relocation handling and the conditional CR1 decoder affect these counts; objdiff 100% remains the function authority. The pre-existing SDMemory updateState discrepancy was not hidden by changing tooling. + +## Gate blocks + +All captured gate blocks are copied below, including rejected trial states. Only gate-passing retained source was committed. The final block is a full clean gate over all three units. + +### sol-r2-baseline-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 21896/37884 data 472/5696 functions 97/112 fuzzy 86.6897 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 97/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data None/3344 functions 61/66 fuzzy 94.5922 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-vtable-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 21896/37884 data 472/5696 functions 97/112 fuzzy 86.6897 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 97/112 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-input-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 21896/37884 data 472/5696 functions 97/112 fuzzy 86.6331 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 97/112 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-input2-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22048/37884 data 472/5696 functions 98/112 fuzzy 86.8151 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate1.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22048/37884 data 472/5696 functions 98/112 fuzzy 86.8151 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data None/3344 functions 61/66 fuzzy 94.5922 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-fade-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate2.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data None/3344 functions 61/66 fuzzy 94.5922 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-create-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data None/3344 functions 61/66 fuzzy 95.8476 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-data-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data None/3344 functions 61/66 fuzzy 95.9891 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-draw-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data None/3344 functions 61/66 fuzzy 97.5115 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-draw2-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data 48/3344 functions 61/66 fuzzy 97.6334 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate3.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13528/20872 data 48/3344 functions 61/66 fuzzy 97.6334 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 60/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate4.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-reorder-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-reorder2-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-reorder3-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-reorder4-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE FAIL: full build failed +``` + +### sol-r2-reorder5-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 144/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-select-data-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate5.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.8157 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-setting-data-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.9371 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-setting-material-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 86.9371 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE FAIL: full build failed +``` + +### sol-r2-setting-material2-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 87.6831 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate6.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 22712/37884 data 472/5696 functions 99/112 fuzzy 87.6831 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 98/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-init-scroll-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 472/5696 functions 100/112 fuzzy 89.3403 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate7.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 976/5696 functions 100/112 fuzzy 89.3403 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-setting-colors-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 976/5696 functions 100/112 fuzzy 89.3669 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate8.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 976/5696 functions 100/112 fuzzy 89.3669 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-setting-rect-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 976/5696 functions 100/112 fuzzy 89.3669 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE FAIL: full build failed +``` + +### sol-r2-setting-rect2-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 976/5696 functions 100/112 fuzzy 89.3669 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE FAIL: full build failed +``` + +### sol-r2-setting-rect3-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 1040/5696 functions 100/112 fuzzy 89.3668 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-gate9.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 1040/5696 functions 100/112 fuzzy 89.3668 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-memory-order-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 1040/5696 functions 100/112 fuzzy 89.3668 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` + +### sol-r2-final-gate.txt + +``` +[src/scene/setting/iplSetting] objdiff: code 23820/37884 data 1040/5696 functions 100/112 fuzzy 89.3668 linked code 0 +[src/scene/setting/iplSetting] instruction-exact functions: 99/112 +[src/scene/sdChannelSelect/iplSDChannelSelect] objdiff: code 19192/33828 data 224/2960 functions 94/129 fuzzy 95.1933 linked code 0 +[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 94/129 +[src/scene/sdChannelMemory/iplSDMemory] objdiff: code 13852/20872 data 200/3344 functions 62/66 fuzzy 97.6506 linked code 0 +[src/scene/sdChannelMemory/iplSDMemory] instruction-exact functions: 61/66 +regressions vs baseline: 0 +GATE PASS +``` +