From 375f318c8781f88ae095308134a945b6e349c356 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 9 Oct 2026 17:30:15 +0000 Subject: [PATCH] cleanup: Setting, KitayamaTest, AddressEdit (58 gotos, a pragma), snd_AxManager (worker 5a3e2e70) --- libs/NW4R/src/snd/snd_AxManager.cpp | 3 +- src/scene/address/iplAddressEdit.cpp | 627 +++++++++------------ src/scene/kitayamaTest/iplKitayamaTest.cpp | 11 +- src/scene/setting/iplSetting.cpp | 132 ++--- tools/decomp-assist/cleanup-c4.attempts.md | 158 ++++++ 5 files changed, 477 insertions(+), 454 deletions(-) create mode 100644 tools/decomp-assist/cleanup-c4.attempts.md diff --git a/libs/NW4R/src/snd/snd_AxManager.cpp b/libs/NW4R/src/snd/snd_AxManager.cpp index f9d0cace..0721718a 100644 --- a/libs/NW4R/src/snd/snd_AxManager.cpp +++ b/libs/NW4R/src/snd/snd_AxManager.cpp @@ -36,8 +36,9 @@ namespace nw4r { return instance; } + // MWCC needs IRO 0 to recompute voice addresses inside the initialization loop. #pragma push -#pragma ppc_iro_level 0 // uh +#pragma ppc_iro_level 0 void AxManager::Init() { if (mInitialized) { return; diff --git a/src/scene/address/iplAddressEdit.cpp b/src/scene/address/iplAddressEdit.cpp index 62efe62e..1dce262a 100644 --- a/src/scene/address/iplAddressEdit.cpp +++ b/src/scene/address/iplAddressEdit.cpp @@ -247,6 +247,7 @@ void ipl::scene::AddressEdit::prepare() { getSceneHeap(), "balloon.ash", false); } +// MWCC needs IRO 1 to preserve pane lookup lifetimes and call scheduling. #pragma push #pragma ppc_iro_level 1 void ipl::scene::AddressEdit::create() { @@ -306,20 +307,14 @@ void ipl::scene::AddressEdit::create() { mpEditGui = editManager; set_textbox(bLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_00", true), 0x2a); - set_textbox((mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_10", true), 0x2b); - set_textbox((mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_11", true), 0x2f); - set_textbox((mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_gry", true), 0x2a); - textPane = (mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_card_msg_00", true); + set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_10", true), 0x2b); + set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_11", true), 0x2f); + set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_crd_btn_gry", true), 0x2a); + textPane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_card_msg_00", true); set_textbox(textPane, L""); - textPane = (mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); + textPane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); set_textbox(textPane, L""); - textPane = (mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true); + textPane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true); set_textbox(textPane, L""); ipl::layout::Object* cLayout = @@ -351,11 +346,9 @@ void ipl::scene::AddressEdit::create() { new ipl::layout::Object(getHeap(), boardFile, "arc", "my_Back_a.brlyt"); mpBackgroundLayout = background; background->bind("my_Back_a_Apear.brlan", "Picture_00", false, true); - (mpBackgroundLayout) - ->bind("my_Back_a_Lost.brlan", "Picture_00", false, false); - (mpBackgroundLayout)->finishBinding(); - (mpBackgroundLayout) - ->getAnim(0)->initAnmFrame(); + mpBackgroundLayout->bind("my_Back_a_Lost.brlan", "Picture_00", false, false); + mpBackgroundLayout->finishBinding(); + mpBackgroundLayout->getAnim(0)->initAnmFrame(); mString.clear(); memset(&ipl::scene::sFriendInfo, 0, sizeof(ipl::scene::sFriendInfo)); @@ -371,47 +364,41 @@ void ipl::scene::AddressEdit::create() { get_friendinfo(); u32 friendIndex = mSelectedFriend; if (mpFriendCache->getInfo(friendIndex).attr.status == NWC24_FRIENDSTATUS_CONFIRMED) { - (mpCodeLayout)->getAnim(0x15)->initAnmFrame(); - (mpCodeLayout)->getAnim(0x1a)->initAnmFrame(); + mpCodeLayout->getAnim(0x15)->initAnmFrame(); + mpCodeLayout->getAnim(0x1a)->initAnmFrame(); } else { - (mpCodeLayout)->getAnim(0x10)->initAnmFrame(); - (mpCodeLayout)->getAnim(0x1b)->initAnmFrame(); + mpCodeLayout->getAnim(0x10)->initAnmFrame(); + mpCodeLayout->getAnim(0x1b)->initAnmFrame(); } - (mpCodeLayout)->getAnim(0)->play(); + mpCodeLayout->getAnim(0)->play(); friendText = mString.mName; - textPane = (mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); + textPane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); set_textbox(textPane, friendText); friendText = mString.mDisplayText; - textPane = (mpCodeLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true); + textPane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true); set_textbox(textPane, friendText); mState = 0; break; } case 1: { - (mpNameLayout)->getAnim(0)->play(); - (mpNameLayout)->getAnim(1)->play(); - (mpNameLayout)->getAnim(3)->play(); - (mpCodeLayout)->getAnim(0x1a)->initAnmFrame(); - (mpCodeLayout)->getAnim(0x10)->initAnmFrame(); - set_textbox((mpNameLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_question_00", true), 0x31); - set_textbox((mpNameLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true), 0x47); + mpNameLayout->getAnim(0)->play(); + mpNameLayout->getAnim(1)->play(); + mpNameLayout->getAnim(3)->play(); + mpCodeLayout->getAnim(0x1a)->initAnmFrame(); + mpCodeLayout->getAnim(0x10)->initAnmFrame(); + set_textbox(mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_question_00", true), 0x31); + set_textbox(mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true), 0x47); mState = 0x10; break; } case 2: { - (mpNameLayout)->getAnim(0)->play(); - (mpNameLayout)->getAnim(1)->play(); - (mpNameLayout)->getAnim(3)->play(); - (mpCodeLayout)->getAnim(0x1a)->initAnmFrame(); - (mpCodeLayout)->getAnim(0x10)->initAnmFrame(); - set_textbox((mpNameLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_question_00", true), 0x3f); - set_textbox((mpNameLayout) - ->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true), 0x48); + mpNameLayout->getAnim(0)->play(); + mpNameLayout->getAnim(1)->play(); + mpNameLayout->getAnim(3)->play(); + mpCodeLayout->getAnim(0x1a)->initAnmFrame(); + mpCodeLayout->getAnim(0x10)->initAnmFrame(); + set_textbox(mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_question_00", true), 0x3f); + set_textbox(mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true), 0x48); mState = 0x10; break; } @@ -419,8 +406,6 @@ void ipl::scene::AddressEdit::create() { break; } -create_mode_done: - s16 miiIndex[2]; if (RFLSearchOfficialData(&mCreateID, reinterpret_cast(miiIndex))) { @@ -954,27 +939,8 @@ void ipl::scene::AddressEdit::stt_ipt_input() { ipl::scene::Button* button = static_cast(ipl::System::getSceneManager()->getScene(ipl::SCENE_BUTTON)); s32 keyboardType = state->iplType; - if (keyboardType == ipl::keyboard::Manager::STATE_DISAPPEARING) { - goto state_disappearing; - } - if (keyboardType >= ipl::keyboard::Manager::STATE_DISAPPEARING) { - goto state_at_or_after_disappearing; - } - if (keyboardType >= ipl::keyboard::Manager::STATE_VISIBLE) { - goto done; - } - if (keyboardType >= ipl::keyboard::Manager::STATE_HIDDEN) { - goto state_hidden; - } - goto done; - -state_at_or_after_disappearing: - if (keyboardType >= 5) { - goto done; - } - goto state_hidden_after_disappear; - -state_disappearing: { + switch (keyboardType) { + case ipl::keyboard::Manager::STATE_DISAPPEARING: { BOOL nameWasEmpty = mString.mName[0] == 0; if (state->pressOK) { mString.setName(state->wcString); @@ -1009,23 +975,22 @@ state_disappearing: { button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); } } + break; } - goto done; - -state_hidden_after_disappear: { + case ipl::keyboard::Manager::STATE_HIDDEN_AFTER_DISAPPEAR: { mState = 0xd; if (static_cast(ipl::System::getRegion()) == SC_PRODUCT_AREA_KOR) { ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(false); } + break; } - goto done; - -state_hidden: { + case ipl::keyboard::Manager::STATE_HIDDEN: + case ipl::keyboard::Manager::STATE_APPEARING: setDefaultTitleText(NULL, ipl::System::getKeyboard()->baseMgr()->isVacancy()); + break; + default: + break; } - -done: - return; } void ipl::scene::AddressEdit::stt_ipt_wait_fadeout() { @@ -1071,7 +1036,7 @@ void ipl::scene::AddressEdit::stt_add_code_input() { } else { mString.setEMail(state->wcString); } - nw4r::lyt::Pane* label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); + nw4r::lyt::Pane* label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); set_textbox(label, mString.mDisplayText); } if (mString.mValue[0] == 0) { @@ -1196,13 +1161,13 @@ void ipl::scene::AddressEdit::stt_add_code_fadeout() { if (!pane->isPlaying()) { pane = mpNameLayout->getAnim(6); if (!pane->isPlaying()) { - nw4r::lyt::Pane* label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( + nw4r::lyt::Pane* label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( "T_question_00", true); set_textbox(label, ipl::System::getMessage(0x32)); - nw4r::lyt::Pane* messageLabel = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( + nw4r::lyt::Pane* messageLabel = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( "T_msg_00", true); set_textbox(messageLabel, ipl::System::getMessage(0x49)); - nw4r::lyt::Pane* nameLabel = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( + nw4r::lyt::Pane* nameLabel = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( "T_name_00", true); set_textbox(nameLabel, mString.mName); ipl::utility::FrameController* fade = mpNameLayout->getAnim(1); @@ -1245,27 +1210,8 @@ void ipl::scene::AddressEdit::stt_add_name_input() { ipl::keyboard::Manager::State* state = ipl::System::getKeyboard()->getState(); ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); s32 keyboardType = state->iplType; - if (keyboardType == ipl::keyboard::Manager::STATE_DISAPPEARING) { - goto state_disappearing; - } - if (keyboardType >= ipl::keyboard::Manager::STATE_DISAPPEARING) { - goto state_at_or_after_disappearing; - } - if (keyboardType >= ipl::keyboard::Manager::STATE_VISIBLE) { - goto done; - } - if (keyboardType >= ipl::keyboard::Manager::STATE_HIDDEN) { - goto state_hidden; - } - goto done; - -state_at_or_after_disappearing: - if (keyboardType >= 5) { - goto done; - } - goto state_visible; - -state_disappearing: { + switch (keyboardType) { + case ipl::keyboard::Manager::STATE_DISAPPEARING: { BOOL nameWasEmpty = mString.mName[0] == 0; if (state->pressOK) { mString.setName(state->wcString); @@ -1299,112 +1245,88 @@ state_disappearing: { button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); } } + break; } - goto done; - -state_visible: { + case ipl::keyboard::Manager::STATE_HIDDEN_AFTER_DISAPPEAR: { mState = 0x19; if (static_cast(ipl::System::getRegion()) == SC_PRODUCT_AREA_KOR) { ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(false); } + break; + } + case ipl::keyboard::Manager::STATE_HIDDEN: + case ipl::keyboard::Manager::STATE_APPEARING: + setDefaultTitleText(NULL, ipl::System::getKeyboard()->baseMgr()->isVacancy()); + break; + default: + break; } - goto done; - -state_hidden: - setDefaultTitleText(NULL, ipl::System::getKeyboard()->baseMgr()->isVacancy()); - -done: - return; } void ipl::scene::AddressEdit::stt_add_name_fadeout() { - if (!mpNameLayout->getAnim(5)->isPlaying() && !mpNameLayout->getAnim(7)->isPlaying() && !mpNameLayout->getAnim(6)->isPlaying() && !mpNameLayout->getAnim(9)->isPlaying()) { s32 state = mSubState; - if (state == 6) { - goto state_done; - } - if (state >= 6) { - goto state_six_or_more; - } - if (state >= 5) { - goto state_five; - } - goto state_done; + switch (state) { + case 5: { + ipl::layout::Animator* animator = mpNameLayout->getAnim(1); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(2); + animator->initFrame(); + animator->restart(); - state_six_or_more: - if (state >= 8) { - goto state_done; + s32 inputType = mMode; + switch (inputType) { + case SCENE_ADD_WII: { + nw4r::lyt::Pane* label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_question_00", true); + set_textbox(label, ipl::System::getMessage(0x31)); + label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_msg_00", true); + set_textbox(label, ipl::System::getMessage(0x47)); + break; + } + case SCENE_ADD_EMAIL: { + nw4r::lyt::Pane* label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_question_00", true); + set_textbox(label, ipl::System::getMessage(0x3f)); + label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_msg_00", true); + set_textbox(label, ipl::System::getMessage(0x48)); + break; + } + default: + break; + } + nw4r::lyt::Pane* label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_name_00", true); + set_textbox(label, mString.mDisplayText); + mState = 0x10; + break; } - goto state_seven; + case 7: { + ipl::layout::Animator* animator = mpNameLayout->getAnim(1); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(4); + animator->initFrame(); + animator->restart(); - state_five: { - ipl::layout::Animator* pane = mpNameLayout->getAnim(1); - pane->initFrame(); - pane->restart(); - pane = mpNameLayout->getAnim(2); - pane->initFrame(); - pane->restart(); - - s32 inputType = mMode; - switch (inputType) { - case 2: - goto address_type_two; - case 1: - goto address_type_one; - default: - goto address_type_common; - } - - address_type_one: { - nw4r::lyt::Pane* label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_question_00", true); - set_textbox(label, ipl::System::getMessage(0x31)); - label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_msg_00", true); - set_textbox(label, ipl::System::getMessage(0x47)); - } - goto address_type_common; - - address_type_two: { - nw4r::lyt::Pane* label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( + nw4r::lyt::Pane* label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( "T_question_00", true); - set_textbox(label, ipl::System::getMessage(0x3f)); - label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_msg_00", true); - set_textbox(label, ipl::System::getMessage(0x48)); - } - - address_type_common: { - nw4r::lyt::Pane* label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_name_00", true); - set_textbox(label, mString.mDisplayText); - mState = 0x10; - } - goto state_done; - } - - state_seven: { - ipl::layout::Animator* pane = mpNameLayout->getAnim(1); - pane->initFrame(); - pane->restart(); - pane = mpNameLayout->getAnim(4); - pane->initFrame(); - pane->restart(); - - nw4r::lyt::Pane* label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_question_00", true); - set_textbox(label, ipl::System::getMessage(0x55)); - label = (mpNameLayout)->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_mii_msg_00", true); - set_textbox(label, ipl::System::getMessage(MESG_TEXTWRITER_ADD_MII)); - mState = 0x1c; + set_textbox(label, ipl::System::getMessage(0x55)); + label = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_mii_msg_00", true); + set_textbox(label, ipl::System::getMessage(MESG_TEXTWRITER_ADD_MII)); + mState = 0x1c; + break; + } + default: + break; } - state_done: - ; } } @@ -1828,117 +1750,96 @@ void ipl::scene::AddressEdit::start_point_event( s32 state = mState; switch (state) { - case 0: - goto state0; - case 0x22: - goto state22; - default: - goto done; - } - -state0: - switch (buttonNo) { - case 0: - goto state0Button0; - case 1: - case 2: - goto state0Common; - case 3: - goto state0Button3; - case 4: - goto done; - default: - goto done; - } - -state0Button0: { - u32 friendIndex = mSelectedFriend; - u32 friendStatus = mpFriendCache->getInfo(friendIndex).attr.status; - if (friendStatus != NWC24_FRIENDSTATUS_CONFIRMED) { - goto done; - } - s32* count = &mPointCount[buttonNo]; - if (*count == 0) { - ipl::layout::Object* layout = mpCodeLayout; - ipl::layout::Animator* pane = layout->getAnim(buttonNo + 1); - pane->initFrame(); - pane->restart(); - ipl::snd::getSystem()->startSE( - "WIPL_SE_BT_TARGETTING"); - controller->rumble(1); - } - ++*count; - goto done; -} - -state0Button3: { - s32* count = &mPointCount[buttonNo]; - if (*count == 0) { - ipl::layout::Object* layout = mpCodeLayout; - nw4r::lyt::Pane* pane = layout->getNW4RLyt()->GetRootPane()->FindPaneByName(paneName, true); - ipl::math::VEC3 position(0.0f, 0.0f, 0.0f); - PSMTXMultVec(pane->GetGlobalMtx(), position, position); - f32 xOffset; - f32 scale; - f32 height; - xOffset = 15.0f; - height = 50.0f; - scale = 0.5f; - position.x = position.x + xOffset; - position.y = position.y + height * scale; - (mpBalloon) - ->setPos(position, false, 1); - (mpBalloon)->fadein(); - } -} - -state0Common: { - s32* count = &mPointCount[buttonNo]; - if (*count == 0) { - ipl::layout::Object* layout = mpCodeLayout; - ipl::layout::Animator* pane = layout->getAnim(buttonNo + 1); - pane->initFrame(); - pane->restart(); - ipl::snd::getSystem()->startSE( - "WIPL_SE_BT_TARGETTING"); - controller->rumble(1); - } - ++*count; - goto done; -} - -state22: - switch (buttonNo) { - case 3: - goto state22Button3; - default: - goto done; - } -state22Button3: - { - s32* count = &mPointCount[buttonNo]; - if (*count == 0) { - ipl::layout::Object* layout = mpCodeLayout; - nw4r::lyt::Pane* pane = layout->getNW4RLyt()->GetRootPane()->FindPaneByName(paneName, true); - ipl::math::VEC3 position(0.0f, 0.0f, 0.0f); - PSMTXMultVec(pane->GetGlobalMtx(), position, position); - f32 xOffset; - f32 scale; - f32 height; - xOffset = 15.0f; - height = 50.0f; - scale = 0.5f; - position.x = position.x + xOffset; - position.y = position.y + height * scale; - (mpBalloon) - ->setPos(position, false, 1); - (mpBalloon)->fadein(); + case 0: + switch (buttonNo) { + case 0: { + u32 friendIndex = mSelectedFriend; + u32 friendStatus = mpFriendCache->getInfo(friendIndex).attr.status; + if (friendStatus != NWC24_FRIENDSTATUS_CONFIRMED) { + break; + } + s32* count = &mPointCount[buttonNo]; + if (*count == 0) { + ipl::layout::Object* layout = mpCodeLayout; + ipl::layout::Animator* pane = layout->getAnim(buttonNo + 1); + pane->initFrame(); + pane->restart(); + ipl::snd::getSystem()->startSE( + "WIPL_SE_BT_TARGETTING"); + controller->rumble(1); + } + ++*count; + break; } - ++*count; + case 3: { + s32* count = &mPointCount[buttonNo]; + if (*count == 0) { + ipl::layout::Object* layout = mpCodeLayout; + nw4r::lyt::Pane* pane = layout->getNW4RLyt()->GetRootPane()->FindPaneByName(paneName, true); + ipl::math::VEC3 position(0.0f, 0.0f, 0.0f); + PSMTXMultVec(pane->GetGlobalMtx(), position, position); + f32 xOffset; + f32 scale; + f32 height; + xOffset = 15.0f; + height = 50.0f; + scale = 0.5f; + position.x = position.x + xOffset; + position.y = position.y + height * scale; + mpBalloon->setPos(position, false, 1); + mpBalloon->fadein(); + } + } + case 1: + case 2: { + s32* count = &mPointCount[buttonNo]; + if (*count == 0) { + ipl::layout::Object* layout = mpCodeLayout; + ipl::layout::Animator* pane = layout->getAnim(buttonNo + 1); + pane->initFrame(); + pane->restart(); + ipl::snd::getSystem()->startSE( + "WIPL_SE_BT_TARGETTING"); + controller->rumble(1); + } + ++*count; + break; + } + case 4: + default: + break; + } + break; + case 0x22: + switch (buttonNo) { + case 3: { + s32* count = &mPointCount[buttonNo]; + if (*count == 0) { + ipl::layout::Object* layout = mpCodeLayout; + nw4r::lyt::Pane* pane = layout->getNW4RLyt()->GetRootPane()->FindPaneByName(paneName, true); + ipl::math::VEC3 position(0.0f, 0.0f, 0.0f); + PSMTXMultVec(pane->GetGlobalMtx(), position, position); + f32 xOffset; + f32 scale; + f32 height; + xOffset = 15.0f; + height = 50.0f; + scale = 0.5f; + position.x = position.x + xOffset; + position.y = position.y + height * scale; + mpBalloon->setPos(position, false, 1); + mpBalloon->fadein(); + } + ++*count; + break; + } + default: + break; + } + break; + default: + break; } - -done: - return; } void ipl::scene::AddressEdit::start_left_event(const char* paneName) { @@ -2007,79 +1908,66 @@ void ipl::scene::AddressEdit::start_trig_event( s32 state = mState; switch (state) { + case 0: + switch (buttonNo) { case 0: { - if (buttonNo == 0) { - goto state0Friend; - } - if (buttonNo < 0) { - break; - } - if (buttonNo >= 5) { - break; - } - goto state0Event; - - state0Friend: { u32 friendIndex = mSelectedFriend; u32 friendStatus = mpFriendCache->getInfo(friendIndex).attr.status; - if (friendStatus != NWC24_FRIENDSTATUS_CONFIRMED) { - goto state0FriendError; + if (friendStatus == NWC24_FRIENDSTATUS_CONFIRMED) { + reset_gui(); + ipl::layout::Object* layout = mpCodeLayout; + ipl::layout::Animator* animator = layout->getAnim(buttonNo + 6); + animator->initFrame(); + animator->restart(); + mSelectedButton = buttonNo; + ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE"); + mState = 1; + break; + } else { + ipl::System::getDialog()->callBtn1(0x57, MESG_CMN_OK); + mpBalloon->fadeoutForce(); + reset_gui(); + mState = 0x2f; + break; } - reset_gui(); + } + case 1: + case 2: + case 3: + case 4: { ipl::layout::Object* layout = mpCodeLayout; - ipl::layout::Animator* pane = layout->getAnim(buttonNo + 6); - pane->initFrame(); - pane->restart(); + ipl::layout::Animator* animator = layout->getAnim(buttonNo + 6); + animator->initFrame(); + animator->restart(); mSelectedButton = buttonNo; ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE"); mState = 1; break; } - - state0FriendError: { - ipl::System::getDialog()->callBtn1(0x57, MESG_CMN_OK); - (mpBalloon)->fadeoutForce(); - reset_gui(); - mState = 0x2f; + default: break; } - - state0Event: { - ipl::layout::Object* layout = mpCodeLayout; - ipl::layout::Animator* pane = layout->getAnim(buttonNo + 6); - pane->initFrame(); - pane->restart(); - mSelectedButton = buttonNo; - ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE"); - mState = 1; - break; - } - } break; - - case 0x22: - switch (buttonNo) { - case 4: - goto state22Button4; - default: - break; - } - break; - - state22Button4: { - (mpBalloon)->fadeoutForce(); + case 0x22: + switch (buttonNo) { + case 4: { + mpBalloon->fadeoutForce(); for (s32 i = 0; i < 5; ++i) { mPointCount[i] = 0; } ipl::layout::Object* layout = mpCodeLayout; - ipl::layout::Animator* pane = layout->getAnim(10); - pane->initFrame(); - pane->restart(); + ipl::layout::Animator* animator = layout->getAnim(10); + animator->initFrame(); + animator->restart(); mSelectedButton = buttonNo; ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE"); mState = 0x24; break; } + default: + break; + } + break; } } @@ -2227,9 +2115,8 @@ void ipl::scene::AddressEdit::start_ipt_point_event( offset = 50.0f; y = position.y; position.y = y + offset; - (mpBalloon) - ->setPos(position, false, 0); - (mpBalloon)->fadein(); + mpBalloon->setPos(position, false, 0); + mpBalloon->fadein(); } break; } @@ -2247,7 +2134,7 @@ void ipl::scene::AddressEdit::start_ipt_left_event( case 0x1d: { char paneNameCopy[12] = "mii_icon_00"; if (strcmp(paneNameCopy, paneName) == 0) { - (mpBalloon)->fadeoutForce(); + mpBalloon->fadeoutForce(); } break; } @@ -2329,6 +2216,7 @@ void ipl::scene::AddressEdit::add_friendinfo() { } } +// MWCC needs IRO 1 to keep text addresses live across pane lookups. #pragma push #pragma ppc_iro_level 1 void ipl::scene::AddressEdit::get_friendinfo() { @@ -2360,6 +2248,7 @@ void ipl::scene::AddressEdit::delete_friendinfo() { static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); } +// MWCC needs IRO 1 to prepare the wcsncpy source before its destination. #pragma push #pragma ppc_iro_level 1 void ipl::scene::AddressEdit::update_friendinfo() { @@ -2394,22 +2283,20 @@ void ipl::scene::AddressEdit::wiiid_utf16(u64 value, wchar_t* output) { output[0x10] = 0; } -void ipl::scene::AddressEdit::setDefaultTitleText(const wchar_t* text, bool flag) { - if (!flag && (text == NULL || *text != L'\0')) { - goto set_empty_title; - } - switch (mState) { - case 0xe: - case 0x1a: - ipl::System::getKeyboard()->baseMgr()->setTitleText(ipl::System::getMessage(0x15e)); +void ipl::scene::AddressEdit::setDefaultTitleText(const wchar_t* text, bool hasVacancy) { + if (hasVacancy || (text != NULL && *text == L'\0')) { + switch (mState) { + case 0xe: + case 0x1a: + ipl::System::getKeyboard()->baseMgr()->setTitleText(ipl::System::getMessage(0x15e)); + return; + case 0x12: + ipl::System::getKeyboard()->baseMgr()->setTitleText(ipl::System::getMessage(0x15d)); + break; + } return; - case 0x12: - ipl::System::getKeyboard()->baseMgr()->setTitleText(ipl::System::getMessage(0x15d)); - break; } - return; -set_empty_title: ipl::System::getKeyboard()->baseMgr()->setTitleText(L""); } @@ -2445,7 +2332,7 @@ void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const i frame->restart(); mSubState = 5; ipl::snd::getSystem()->startSE("WIPL_SE_CANCEL"); - (mpBalloon)->fadeoutForce(); + mpBalloon->fadeoutForce(); mState = 0x30; break; } @@ -2543,7 +2430,7 @@ void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const i mSubState = 5; ipl::snd::getSystem()->startSE("WIPL_SE_CANCEL"); mState = 0x20; - (mpBalloon)->fadeoutForce(); + mpBalloon->fadeoutForce(); reset_gui(); break; } @@ -2557,7 +2444,7 @@ void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const i mSubState = 5; ipl::snd::getSystem()->startSE("WIPL_SE_CANCEL"); mState = 0x23; - (mpBalloon)->fadeoutForce(); + mpBalloon->fadeoutForce(); reset_gui(); break; } @@ -2629,7 +2516,7 @@ void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const i mSubState = 7; ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE"); mState = 0x20; - (mpBalloon)->fadeoutForce(); + mpBalloon->fadeoutForce(); reset_gui(); break; } @@ -2642,7 +2529,7 @@ void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const i mSubState = 7; ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE"); mState = 0x23; - (mpBalloon)->fadeoutForce(); + mpBalloon->fadeoutForce(); break; } } diff --git a/src/scene/kitayamaTest/iplKitayamaTest.cpp b/src/scene/kitayamaTest/iplKitayamaTest.cpp index aa6e8e1c..b4d99b2d 100644 --- a/src/scene/kitayamaTest/iplKitayamaTest.cpp +++ b/src/scene/kitayamaTest/iplKitayamaTest.cpp @@ -63,8 +63,6 @@ namespace ipl { void KitayamaTest::calcCommon() { } - #pragma push - #pragma ppc_iro_level 2 FaderSceneCommand KitayamaTest::calcNormal() { FaderSceneCommand command = FADER_SCN_CONTINUE; controller::Interface* controller = System::getMasterController(); @@ -82,16 +80,13 @@ namespace ipl { s32 result; NANDFileInfo bannerInfo; NANDFileInfo testInfo; - WIISaveBannerFile* buffer; ES_SetUid(0x0001000030303030); ISFS_CloseLib(); ISFS_OpenLib(); - // Delete old test file nand::wrapper::Delete("/title/00010000/30303030/data/banner.bin"); - // Create new test file result = nand::wrapper::Create("/title/00010000/30303030/data/banner.bin", NAND_PERM_ALL_RW, 0); if (result == NAND_RESULT_OK) { result = nand::wrapper::Open("/title/00010000/30303030/data/banner.bin", &bannerInfo, NAND_ACCESS_WRITE); @@ -100,8 +95,7 @@ namespace ipl { OSHalt("Terminated.\n", 173); } - // Write some data to test file - buffer = (WIISaveBannerFile*)mpHeap->alloc(sizeof(WIISaveBannerFile), 32); + WIISaveBannerFile* buffer = (WIISaveBannerFile*)mpHeap->alloc(sizeof(WIISaveBannerFile), 32); memset(buffer, 0x55, sizeof(WIISaveBannerFile)); buffer->signature = 'WIBN'; buffer->flags = 0; @@ -134,7 +128,7 @@ namespace ipl { OSHalt("Terminated.\n", 213); } - buffer = (WIISaveBannerFile*)mpHeap->alloc(sizeof(WIISaveBannerFile), 32); + WIISaveBannerFile* buffer = (WIISaveBannerFile*)mpHeap->alloc(sizeof(WIISaveBannerFile), 32); memset(buffer, 0x55, sizeof(WIISaveBannerFile)); buffer->signature = 'WIBN'; buffer->flags = 0; @@ -270,7 +264,6 @@ namespace ipl { return command; } - #pragma pop FaderSceneCommand KitayamaTest::calcFadeout() { if (mOption == KITAYAMA_OPT_INIT_NAND) { diff --git a/src/scene/setting/iplSetting.cpp b/src/scene/setting/iplSetting.cpp index 65f0f0da..7f2d250f 100644 --- a/src/scene/setting/iplSetting.cpp +++ b/src/scene/setting/iplSetting.cpp @@ -247,49 +247,32 @@ namespace ipl { char fontName[32]; char htmlPath[64]; char productArea = SCGetProductArea(); - if (productArea == 6) { - goto koreanFont; + switch (productArea) { + case SC_PRODUCT_AREA_JPN: + case SC_PRODUCT_AREA_USA: + case SC_PRODUCT_AREA_EUR: + case SC_PRODUCT_AREA_AUS: + snprintf(fontName, sizeof(fontName), "WiiNTLG-Regular.ttc"); + snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); + break; + case SC_PRODUCT_AREA_KOR: + snprintf(fontName, sizeof(fontName), "Wii-kr_Round Gothic B.ttf"); + snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); + break; + case SC_PRODUCT_AREA_CHN: + snprintf(fontName, sizeof(fontName), "Wii-cn_HeiTiW5.ttf"); + snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); + break; + case SC_PRODUCT_AREA_TWN: + snprintf(fontName, sizeof(fontName), "WiiNTLG-Regular.ttc"); + snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "TW2"); + break; + default: + snprintf(fontName, sizeof(fontName), "WiiNTLG-Regular.ttc"); + snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); + break; } - if (productArea < 6) { - if (productArea == 4) { - goto defaultFont; - } - if (productArea >= 4) { - goto europeFont; - } - if (productArea >= 0) { - goto standardFont; - } - } else if (productArea == 11) { - goto chineseFont; - } - goto defaultFont; - standardFont: - snprintf(fontName, sizeof(fontName), "WiiNTLG-Regular.ttc"); - snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); - goto loadFiles; - - koreanFont: - snprintf(fontName, sizeof(fontName), "Wii-kr_Round Gothic B.ttf"); - snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); - goto loadFiles; - - chineseFont: - snprintf(fontName, sizeof(fontName), "Wii-cn_HeiTiW5.ttf"); - snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); - goto loadFiles; - - europeFont: - snprintf(fontName, sizeof(fontName), "WiiNTLG-Regular.ttc"); - snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "TW2"); - goto loadFiles; - - defaultFont: - snprintf(fontName, sizeof(fontName), "WiiNTLG-Regular.ttc"); - snprintf(htmlPath, sizeof(htmlPath), "/html/%s/iplsetting.ash", "US2"); - - loadFiles: mpSettingHTMLFile = System::getNandManager()->readAsync( System::createMem1AppHeap(), htmlPath, 0, 0, false); mpWWWArchiveFile = System::getNandManager()->readAsync( @@ -673,7 +656,7 @@ namespace ipl { } break; default: - goto screenModeDispatch; + break; } } else if (mScreenModeChangeState == 1 && mDialogState == 8) { System::getFader()->fadeOut(); @@ -683,7 +666,6 @@ namespace ipl { return true; } - screenModeDispatch: switch (mScreenModeChangeState) { case 1: if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN) { @@ -1514,44 +1496,45 @@ namespace ipl { } if (mpWiiSettingFlag->smthMsgData >= 2 && mpWiiSettingFlag->smthMsgData <= 7) { - GXRenderModeObj* pRmode = System::getRenderModeObj(); + GXRenderModeObj* sourceMode = System::getRenderModeObj(); GXRenderModeObj renderMode; - volatile GXRenderModeObj* srcMode = pRmode; - volatile GXRenderModeObj* dstMode = &renderMode; - int n = 12; - u8* src; - u8* dst = &renderMode.aa; - src = &pRmode->aa; - dstMode->viTVmode = srcMode->viTVmode; - dstMode->fbWidth = srcMode->fbWidth; - dstMode->efbHeight = srcMode->efbHeight; - dstMode->xfbHeight = srcMode->xfbHeight; - dstMode->viXOrigin = srcMode->viXOrigin; - dstMode->viYOrigin = srcMode->viYOrigin; - dstMode->viWidth = srcMode->viWidth; - dstMode->viHeight = srcMode->viHeight; - dstMode->xFBmode = srcMode->xFBmode; - dstMode->field_rendering = srcMode->field_rendering; - dstMode->aa = srcMode->aa; - for (; n != 0; n--) { - dst[1] = src[1]; - dst[2] = src[2]; - src += 2; - dst += 2; + // Volatile accesses preserve MWCC's field-copy order and stores. + volatile GXRenderModeObj* sourceFields = sourceMode; + volatile GXRenderModeObj* copiedFields = &renderMode; + int samplePairsRemaining = 12; + u8* sourceSamples; + u8* destinationSamples = &renderMode.aa; + sourceSamples = &sourceMode->aa; + copiedFields->viTVmode = sourceFields->viTVmode; + copiedFields->fbWidth = sourceFields->fbWidth; + copiedFields->efbHeight = sourceFields->efbHeight; + copiedFields->xfbHeight = sourceFields->xfbHeight; + copiedFields->viXOrigin = sourceFields->viXOrigin; + copiedFields->viYOrigin = sourceFields->viYOrigin; + copiedFields->viWidth = sourceFields->viWidth; + copiedFields->viHeight = sourceFields->viHeight; + copiedFields->xFBmode = sourceFields->xFBmode; + copiedFields->field_rendering = sourceFields->field_rendering; + copiedFields->aa = sourceFields->aa; + for (; samplePairsRemaining != 0; samplePairsRemaining--) { + destinationSamples[1] = sourceSamples[1]; + destinationSamples[2] = sourceSamples[2]; + sourceSamples += 2; + destinationSamples += 2; } - dstMode->vfilter[0] = srcMode->vfilter[0]; - dstMode->vfilter[1] = srcMode->vfilter[1]; - dstMode->vfilter[2] = srcMode->vfilter[2]; - dstMode->vfilter[3] = srcMode->vfilter[3]; - dstMode->vfilter[4] = srcMode->vfilter[4]; - dstMode->vfilter[5] = srcMode->vfilter[5]; - dstMode->vfilter[6] = srcMode->vfilter[6]; + copiedFields->vfilter[0] = sourceFields->vfilter[0]; + copiedFields->vfilter[1] = sourceFields->vfilter[1]; + copiedFields->vfilter[2] = sourceFields->vfilter[2]; + copiedFields->vfilter[3] = sourceFields->vfilter[3]; + copiedFields->vfilter[4] = sourceFields->vfilter[4]; + copiedFields->vfilter[5] = sourceFields->vfilter[5]; + copiedFields->vfilter[6] = sourceFields->vfilter[6]; u32 left; u32 top; u32 width; u32 height; GXGetScissor(&left, &top, &width, &height); - GXSetScissor(0, dstMode->efbHeight / 2 - 0xA4, dstMode->fbWidth, 0x132); + GXSetScissor(0, copiedFields->efbHeight / 2 - 0xA4, copiedFields->fbWidth, 0x132); mpMainLayout->draw(); GXSetScissor(left, top, width, height); } @@ -2705,6 +2688,7 @@ namespace ipl { mUiStatus[2] = 0; } + // MWCC needs IRO 1 to load animation indices before layout addresses. #pragma push #pragma ppc_iro_level 1 void Setting::scanAP() { diff --git a/tools/decomp-assist/cleanup-c4.attempts.md b/tools/decomp-assist/cleanup-c4.attempts.md new file mode 100644 index 00000000..76cae8d8 --- /dev/null +++ b/tools/decomp-assist/cleanup-c4.attempts.md @@ -0,0 +1,158 @@ +# cleanup-c4 attempts + +Worktree `/mnt/drive2/projects/wii-ipl-workers/data-d4`, branch `agent/w1009/cleanup-c4`. +Baseline `f1db6b656e386063a8bc263fb75a299f36ae4803`. Existing untracked files retained. + +Acceptance: readable changes only in the four assigned files; every allocated object section and relocation stays identical; all four units remain Matching; final full build, objdiff report, DECOMPLETE_OK, and gate.py pass with zero regressions and DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. Commit each source file separately and this log. + +Baseline full build passed, report regenerated, DECOMPLETE_OK; code/data/link 100%, 12563/12563 functions; DOL SHA1 verified. + +## Trials + +- setting-remove-all-pragmas: REJECT, changed .rela.text, .text. +- kitayama-remove-all-pragmas: REJECT, changed .rela.text, .text. +- address-remove-all-pragmas: REJECT, changed .rela.data, .rela.text, .text. +- ax-remove-all-pragmas: REJECT, changed .rela.text, .text. +- setting-remove-all-pragmas instruction evidence: `scanAP__Q33ipl5scene7SettingFv` 14 differing instructions, 272/272 instruction counts. +- kitayama-remove-all-pragmas instruction evidence: `calcNormal__Q33ipl5scene12KitayamaTestFv` 3 differing instructions, 464/464 instruction counts. +- address-remove-all-pragmas instruction evidence: `create__Q33ipl5scene11AddressEditFv` 329 differing instructions, 818/820 instruction counts. +- address-remove-all-pragmas instruction evidence: `get_friendinfo__Q33ipl5scene11AddressEditFv` 68 differing instructions, 82/84 instruction counts. +- address-remove-all-pragmas instruction evidence: `update_friendinfo__Q33ipl5scene11AddressEditFv` 2 differing instructions, 38/38 instruction counts. +- ax-remove-all-pragmas instruction evidence: `Init__Q44nw4r3snd6detail9AxManagerFv` 52 differing instructions, 62/63 instruction counts. +- kitayama-controller-first: REJECT, changed .rela.text, .text. +- kitayama-controller-declare-first: REJECT, changed .rela.text, .text. +- kitayama-buffer-first: REJECT, changed .rela.text, .text. +- kitayama-result-last: REJECT, changed .rela.text, .text. +- kitayama-controller-reference: REJECT, changed .rela.text, .text. +- kitayama-buffer-scopes: REJECT, changed .rela.text. +- setting-scan-index-locals: REJECT, compilation failed. +- setting-scan-direct-predicate: REJECT, changed .rela.data, .rela.text, .text. +- setting-scan-state-local: REJECT, changed .rela.text, .text. +- ax-init-voice-pointer: REJECT, changed .rela.text, .text. +- ax-init-voice-local: REJECT, changed .rela.text, .text. +- ax-init-loop-scope: REJECT, changed .rela.text, .text. +- Relocation comparison now resolves local compiler labels by section/value, preserving global symbol names. Kitayama buffer scopes changed only local literal symbol names, with identical .text and .data. Retested below. +- kitayama-buffer-scopes-normalized-relocs: KEEP, all allocated sections and relocations identical. +- setting-scan-scoped-indices: REJECT, changed .text. +- setting-scan-animation-local: REJECT, changed .rela.data, .rela.text, .text. +- address-create-no-pragma: REJECT, changed .rela.data, .rela.text, .text. +- address-get-friendinfo-no-pragma: REJECT, changed .rela.data, .rela.text, .text. +- address-update-friendinfo-no-pragma: REJECT, changed .text. +- address-create-text-scopes: REJECT, changed .rela.data, .rela.text, .text. +- address-create-pane-last: REJECT, changed .rela.data, .rela.text, .text. +- address-get-pane-local: REJECT, changed .rela.data, .rela.text, .text. +- address-get-display-scope: REJECT, changed .rela.data, .rela.text, .text. +- address-update-destination-local: REJECT, changed .text. +- address-update-source-first: REJECT, changed .text. +- setting-screen-mode-remove-goto: KEEP, all allocated sections and relocations identical. +- address-create-remove-dead-label: KEEP, all allocated sections and relocations identical. +- address-title-structured-if: KEEP, all allocated sections and relocations identical. +- address-stt_ipt_input-switch: REJECT, compilation failed. +- address-stt_add_name_input-switch: REJECT, compilation failed. +- address-remove-member-parentheses: KEEP, all allocated sections and relocations identical. +- setting-copy-plain-source: REJECT, changed .text. +- setting-copy-plain-destination: REJECT, changed .text. +- setting-render-mode-copy: REJECT, changed .rela.data, .rela.text, .text. +- address-stt_ipt_input-structured-switch: KEEP, all allocated sections and relocations identical. +- address-stt_add_name_input-structured-switch: KEEP, all allocated sections and relocations identical. +- setting-prepare-font-switch: KEEP, all allocated sections and relocations identical. +- address-point-event-structured-switch: KEEP, all allocated sections and relocations identical. +- address-trigger-event-structured-switch: KEEP, all allocated sections and relocations identical. +- address-add-name-fadeout-structured-switch: KEEP, all allocated sections and relocations identical. +- address-polish-titles-and-layout-calls: KEEP, all allocated sections and relocations identical. +- setting-name-render-copy-locals: KEEP, all allocated sections and relocations identical. +- kitayama-remove-obvious-comments: KEEP, all allocated sections and relocations identical. +- ax-document-required-iro: KEEP, all allocated sections and relocations identical. +- setting-document-required-workarounds: KEEP, all allocated sections and relocations identical. +- address-document-required-iro: KEEP, all allocated sections and relocations identical. +- address-remove-unneeded-fadeout-scope: KEEP, all allocated sections and relocations identical. +- address-name-trigger-animators: KEEP, all allocated sections and relocations identical. +- setting-indent-compiler-note: KEEP, all allocated sections and relocations identical. +- ax-indent-compiler-note: KEEP, all allocated sections and relocations identical. +- Final setting: allocated sections and resolved relocations identical to baseline; 112/112 functions exact; every objdiff section 100%; POOL IDENTICAL up to 108 (mine=108 base=108). +- Final kitayama: allocated sections and resolved relocations identical to baseline; 12/12 functions exact; every objdiff section 100%; POOL IDENTICAL up to 17 (mine=17 base=17). +- Final address: allocated sections and resolved relocations identical to baseline; 94/94 functions exact; every objdiff section 100%; POOL IDENTICAL up to 57 (mine=57 base=57). +- Final ax: allocated sections and resolved relocations identical to baseline; 25/25 functions exact; every objdiff section 100%; POOL IDENTICAL up to 0 (mine=0 base=0). +- Final live report compared with the saved f1db6b65 baseline: 0 regressions across all 1028 units. +- Final ctxdiff `prepare__Q33ipl5scene7SettingFv`: src 0x2cc base 0x2cc insns 179/179. +- Final ctxdiff `updateScreenMode__Q33ipl5scene7SettingFv`: src 0x224 base 0x224 insns 137/137. +- Final ctxdiff `draw__Q33ipl5scene7SettingFv`: src 0x9e0 base 0x9e0 insns 632/632. +- Final ctxdiff `scanAP__Q33ipl5scene7SettingFv`: src 0x440 base 0x440 insns 272/272. +- Final ctxdiff `calcNormal__Q33ipl5scene12KitayamaTestFv`: src 0x740 base 0x740 insns 464/464. +- Final ctxdiff `create__Q33ipl5scene11AddressEditFv`: src 0xcd0 base 0xcd0 insns 820/820. +- Final ctxdiff `get_friendinfo__Q33ipl5scene11AddressEditFv`: src 0x150 base 0x150 insns 84/84. +- Final ctxdiff `update_friendinfo__Q33ipl5scene11AddressEditFv`: src 0x98 base 0x98 insns 38/38. +- Final ctxdiff `stt_ipt_input__Q33ipl5scene11AddressEditFv`: src 0x20c base 0x20c insns 131/131. +- Final ctxdiff `stt_add_name_input__Q33ipl5scene11AddressEditFv`: src 0x20c base 0x20c insns 131/131. +- Final ctxdiff `stt_add_name_fadeout__Q33ipl5scene11AddressEditFv`: src 0x35c base 0x35c insns 215/215. +- One ctxdiff invocation used the wrong mangled spelling for start_point_event. Corrected from the object symbol table below. +- Final ctxdiff `start_point_event__Q33ipl5scene11AddressEditFPCcPQ33ipl10controller9Interface`: src 0x2d8 base 0x2d8 insns 182/182, diffs 0. +- Final ctxdiff `start_trig_event__Q33ipl5scene11AddressEditFPCc`: src 0x1c0 base 0x1c0 insns 112/112, diffs 0. +- Final ctxdiff `setDefaultTitleText__Q33ipl5scene11AddressEditFPCwb`: src 0xfc base 0xfc insns 63/63, diffs 0. +- Final ctxdiff `Init__Q44nw4r3snd6detail9AxManagerFv`: src 0xfc base 0xfc insns 63/63, diffs 0. +- Source commit setting: `3f946af9e6f68553d12314dab89652fd9d0b56be`. +- Source commit kitayama: `3896bec3f879af024b8042fe76eaea1284acb85b`. +- Source commit address: `7d74f57dec6e658a3e371dbc5e8658e1cf7bd9ab`. +- Source commit ax: `fa054a047ec782a46d68ff170a03300d4d67cdb4`. + +## Retained result + +- iplSetting.cpp: removed 11 gotos through region-constant font selection and screen-mode dispatch; renamed render-copy locals. scanAP IRO 1 stays because removal changes 14 instructions. The volatile render copy stays because removing either qualifier changes .text and a normal struct copy also changes sizes and relocations. Both have one-line compiler notes. +- iplKitayamaTest.cpp: removed push/IRO 2/pop by giving each write branch its own buffer local. Removed three comments that repeated the statements. Default compiler settings now reproduce the same 464 calcNormal instructions, data, and resolved relocations; only local compiler label names change. +- iplAddressEdit.cpp: removed all 47 gotos, dead create_mode_done label, unnecessary common-block scope, and redundant member parentheses. Structured title, keyboard state, fadeout, point, and trigger dispatch retain the original fallthrough and call order. Uses existing keyboard, region, and address-mode constants. All three IRO 1 pragmas stay; removal changes create 329 instructions, get_friendinfo 68, and update_friendinfo 2. Added concise notes explaining the retained settings. +- snd_AxManager.cpp: retained IRO 0 because default lowering hoists the indexed voice address and removes one instruction. Three readable loop rewrites also changed bytes. Replaced the unclear uh comment with the specific compiler requirement. +- Final full build and report generation passed; DECOMPLETE_OK; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. All 243 owned functions and all owned sections remain 100%; fresh baseline comparison found 0 regressions in all 1028 units. All 15 focused ctxdiff checks have diffs 0 and equal instruction counts. + +## Final gate + +Command: `python3 /mnt/drive2/projects/wii-ipl-workers/_restore0928-tools/gate.py src/scene/setting/iplSetting src/scene/kitayamaTest/iplKitayamaTest src/scene/address/iplAddressEdit libs/NW4R/src/snd/snd_AxManager --quick`. The cleanup brief explicitly requires --quick. + +```text +full build: ok +main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d +[src/scene/setting/iplSetting] pool: IDENTICAL +[src/scene/setting/iplSetting] objdiff: code 37884/37884 data 5696/5696 functions 112/112 fuzzy 100.0000 linked code 37884 +[src/scene/setting/iplSetting] instruction-exact functions: 112/112 +[src/scene/setting/iplSetting] section .bss size 456 match 100.0 +[src/scene/setting/iplSetting] section .data size 4016 match 100.0 +[src/scene/setting/iplSetting] section .rodata size 640 match 100.0 +[src/scene/setting/iplSetting] section .sbss size 16 match 100.0 +[src/scene/setting/iplSetting] section .sdata size 504 match 100.0 +[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0 +[src/scene/setting/iplSetting] section .text size 37884 match 100.0 +[src/scene/setting/iplSetting] baseline: code 37884/37884 data 5696 functions 112 fuzzy 100.0000 +[src/scene/kitayamaTest/iplKitayamaTest] pool: IDENTICAL +[src/scene/kitayamaTest/iplKitayamaTest] objdiff: code 2520/2520 data 632/632 functions 12/12 fuzzy 100.0000 linked code 2520 +[src/scene/kitayamaTest/iplKitayamaTest] instruction-exact functions: 12/12 +[src/scene/kitayamaTest/iplKitayamaTest] section .data size 632 match 100.0 +[src/scene/kitayamaTest/iplKitayamaTest] section .text size 2520 match 100.0 +[src/scene/kitayamaTest/iplKitayamaTest] baseline: code 2520/2520 data 632 functions 12 fuzzy 100.0000 +[src/scene/address/iplAddressEdit] pool: IDENTICAL +[src/scene/address/iplAddressEdit] objdiff: code 27112/27112 data 2560/2560 functions 94/94 fuzzy 100.0000 linked code 27112 +[src/scene/address/iplAddressEdit] instruction-exact functions: 94/94 +[src/scene/address/iplAddressEdit] section .bss size 320 match 100.0 +[src/scene/address/iplAddressEdit] section .data size 2152 match 100.0 +[src/scene/address/iplAddressEdit] section .rodata size 40 match 100.0 +[src/scene/address/iplAddressEdit] section .sdata size 24 match 100.0 +[src/scene/address/iplAddressEdit] section .sdata2 size 24 match 100.0 +[src/scene/address/iplAddressEdit] section .text size 27112 match 100.0 +[src/scene/address/iplAddressEdit] baseline: code 27112/27112 data 2560 functions 94 fuzzy 100.0000 +[libs/NW4R/src/snd/snd_AxManager] pool: IDENTICAL +[libs/NW4R/src/snd/snd_AxManager] objdiff: code 6364/6364 data 42040/42040 functions 25/25 fuzzy 100.0000 linked code 6364 +[libs/NW4R/src/snd/snd_AxManager] instruction-exact functions: 25/25 +[libs/NW4R/src/snd/snd_AxManager] section .bss size 42008 match 100.0 +[libs/NW4R/src/snd/snd_AxManager] section .sbss size 8 match 100.0 +[libs/NW4R/src/snd/snd_AxManager] section .sdata2 size 24 match 100.0 +[libs/NW4R/src/snd/snd_AxManager] section .text size 6364 match 100.0 +[libs/NW4R/src/snd/snd_AxManager] baseline: code 6364/6364 data 42040 functions 25 fuzzy 100.0000 +regressions vs baseline: 0 +global matched_code_percent: 100.00000 -> 100.00000 +global fuzzy_match_percent: 99.99989 -> 99.99989 +global complete_code_percent: 100.00000 -> 100.00000 +global matched_data_percent: 100.00000 -> 100.00000 +forbidden patterns added (net, per file): 0 +readability warnings (net, per file; must be 0 in the final result): 0 +GATE PASS +``` + +Post-gate report regenerated; DECOMPLETE_OK; DOL SHA1 verified again. Only the assigned source files and this log are committed. Existing untracked files remain untouched. No push, PR, merge, rebase, or cross-worktree edit. -- 2.49.1