From 1d147243db6e62a403656ef3b3362c55e3c64616 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 8 Oct 2026 23:45:23 +0000 Subject: [PATCH] decomp(address): link iplAddressEdit (definition order, get_button_no table) (worker d1e93825) --- configure.py | 2 +- include/keyboard/tiManager.h | 2 +- src/scene/address/iplAddressEdit.cpp | 2757 ++++++++++++------------ tools/decomp-assist/sol-l1.attempts.md | 808 +++++++ 4 files changed, 2154 insertions(+), 1415 deletions(-) create mode 100644 tools/decomp-assist/sol-l1.attempts.md diff --git a/configure.py b/configure.py index ae192e06..7c98f8e4 100644 --- a/configure.py +++ b/configure.py @@ -729,7 +729,7 @@ config.libs = [ IPLSection("address", [ Object(Matching, "scene/address/iplAddress.cpp"), Object(Matching, "scene/address/iplAddressAddSel.cpp"), - Object(NonMatching, "scene/address/iplAddressEdit.cpp"), + Object(Matching, "scene/address/iplAddressEdit.cpp"), ] ), IPLSection("backMenu", [ diff --git a/include/keyboard/tiManager.h b/include/keyboard/tiManager.h index fed99bed..ca5b64bd 100644 --- a/include/keyboard/tiManager.h +++ b/include/keyboard/tiManager.h @@ -129,7 +129,7 @@ namespace textinput { #ifdef TIHWKEYBOARD_IMPLEMENTATION EventObserver* getEventObserverForHardware() const { return mpEventObserver; } #endif -#ifdef TISIGNWINDOW_IMPLEMENTATION +#if defined(TISIGNWINDOW_IMPLEMENTATION) || defined(IPL_ADDRESS_EDIT_CPP) virtual InputForm* getInputForm(); #else virtual InputForm* getInputForm() { return mpInputForm; } diff --git a/src/scene/address/iplAddressEdit.cpp b/src/scene/address/iplAddressEdit.cpp index 85366bb1..62efe62e 100644 --- a/src/scene/address/iplAddressEdit.cpp +++ b/src/scene/address/iplAddressEdit.cpp @@ -69,12 +69,151 @@ namespace ipl { } } -ipl::keyboard::Manager::KeyboardSetting::KeyboardSetting( - ipl::keyboard::Manager::KeyboardType keyboardType, const wchar_t* value, u32 limit, u32 rows) { - type = keyboardType; - wcString = value; - stringLimit = limit; - rowLimit = rows; +extern "C" BOOL RFLSearchOfficialData(const RFLCreateID*, u16*); + +namespace ipl { + namespace scene { + NWC24FriendInfo sFriendInfo; + } +} +extern "C" const char* smButtonName__Q33ipl5scene6Button[]; + +int ipl::scene::AddressEdit::get_button_no(const char*); + +extern "C" NWC24Err NWC24CheckPublicMailAddr_(const char*); + +inline void ipl::scene::AddressEdit::set_textbox(nw4r::lyt::Pane* pane, u32 msgId) { + set_textbox(pane, ipl::System::getMessage(msgId)); +} + +static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength) { + int i; + BOOL foundDot; + + // Parameter check + if (hostNameLength == 0) { + return CHECK_HOSTNAME_BAD_LENGTH; + } + + // Is null or empty check + if (hostName == NULL) { + return CHECK_HOSTNAME_IS_NULL; + } + if (*hostName == 0) { + return CHECK_HOSTNAME_IS_EMPTY; + } + + // Verify check + if (*hostName == '.') { + return CHECK_HOSTNAME_INCORRECT; + } + + foundDot = FALSE; + + for (i = 0; i < hostNameLength; i++) { + char ch = hostName[i]; + + // Stop on NULL + if (ch == 0) { + break; + } + + if (ch == '.') { + // Check if we already found one again after the previous character. + if (foundDot) { + return CHECK_HOSTNAME_MULTIPLE_DOTS; + } + foundDot = TRUE; + continue; + } + + // Check if there are invalid characters + if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z') && (ch != '-' && ch != '_')) { + return CHECK_HOSTNAME_INVALID_CHARACTERS; + } + + foundDot = FALSE; + } + + // Check if we are out of range + if (i == hostNameLength) { + return CHECK_HOSTNAME_OUT_OF_RANGE; + } + + // Check if the end of hostname has a dot + if (i > 0 && hostName[i - 1] == '.') { + return CHECK_HOSTNAME_DOT_AT_END; + } + + return CHECK_HOSTNAME_SUCCESS; +} + +/* + This is a modified version of NWC24CheckPublicMailAddr. + Changes: + - Uses strnicmp instead of NWC24's Mail_strnicmp + - ... That's it!! +*/ +extern "C" NWC24Err NWC24CheckPublicMailAddr_(const char* addr) { + int i, j; + int len; + BOOL readingDomain; + + static const char specials[] = {'(', ')', '<', '>', '[', ']', ':', ';', '\\', ',', '"'}; + + // Check parameters + if (addr == NULL) { + return NWC24_ERR_NULL; + } + + // Check address length + len = STD_strnlen(addr, sizeof(NWC24UserMailAddr)); + if (len == (int)sizeof(NWC24UserMailAddr)) { + return NWC24_ERR_STRING_END; + } + if (len == 0) { + return NWC24_ERR_FORMAT; + } + + readingDomain = FALSE; + + for (i = 0; i < len; i++) { + char ch = addr[i]; + + // If we found '@' + if (ch == '@') { + // If it was at the beginning of the address, invalid! + if (i == 0) { + return NWC24_ERR_FORMAT; + } + readingDomain = TRUE; + break; + } + + // If the character is not a letter or symbol, invalid! + if (ch <= ' ' || ch >= '~' + 1) { + return NWC24_ERR_FORMAT; + } + + // If the character is special, invalid! + for (j = 0; j < sizeof(specials); j++) { + if (ch == specials[j]) { + return NWC24_ERR_FORMAT; + } + } + } + + // If we are have not found '@', invalid! + if (!readingDomain) { + return NWC24_ERR_FORMAT; + } + + // If the hostname is not valid, invalid! + if (CheckHostName(&addr[i + 1], (len - i)) < CHECK_HOSTNAME_SUCCESS) { + return NWC24_ERR_FORMAT; + } + + return strnicmp(&addr[i], NWC24GetAccountDomain(), (len - i) + 1) == 0 ? NWC24_ERR_PROTECTED : NWC24_OK; } ipl::scene::AddressEdit::AddressEdit(EGG::Heap* heap, int friendCode) @@ -103,286 +242,11 @@ ipl::scene::AddressEdit::~AddressEdit() { } } -void ipl::scene::AddressEdit::stt_msg_code_add() { - if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { - mState = 0x22; - } -} - -void ipl::scene::AddressEdit::stt_msg_code_edit() { - if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { - mState = 0; - } -} - -void ipl::scene::AddressEdit::stt_msg_parental() { - if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { - mState = 0; - } -} - -void ipl::scene::AddressEdit::stt_msg_nwc24_error() { - if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { - mState = 0; - } -} - -void ipl::scene::AddressEdit::reset_gui() { - mpEditGui->init(); - mpInputGui->init(); - for (s32 i = 0; i < 5; ++i) { - if (mPointCount[i] > 0) { - ipl::layout::Animator* animator = mpCodeLayout->getAnim(i + 0xb); - animator->play(); - mPointCount[i] = 0; - } - } -} - - -extern "C" BOOL RFLSearchOfficialData(const RFLCreateID*, u16*); - -namespace ipl { - namespace scene { - NWC24FriendInfo sFriendInfo; - } -} -extern "C" const char* smButtonName__Q33ipl5scene6Button[]; - - - - - - - - - - -int ipl::scene::AddressEdit::get_button_no(const char*); - - - - - - - - -extern "C" NWC24Err NWC24CheckPublicMailAddr_(const char*); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void ipl::scene::AddressEdit::stt_msg_no_established() { - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - reset_gui(); - mState = 0; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_code_invalid() { - ipl::System::getScene(ipl::SCENE_BUTTON); - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - mState = 0x11; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_dup_wii_no() { - ipl::System::getScene(ipl::SCENE_BUTTON); - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - mState = 0x11; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_dup_email() { - ipl::System::getScene(ipl::SCENE_BUTTON); - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - mState = 0x11; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_my_wii_no() { - ipl::System::getScene(ipl::SCENE_BUTTON); - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - mState = 0x11; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_no_mii_add() { - ipl::System::getScene(ipl::SCENE_BUTTON); - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - mState = 0x1d; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_add_rlt() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); - mState = 0x30; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_add_code_normal() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - if (button->isActive()) { - button->update(); - } - if (mState == 0x11) { - mpInputGui->update(); - } -} - -void ipl::scene::AddressEdit::stt_add_name_normal() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - if (button->isActive()) { - button->update(); - } - if (mState == 0x19) { - mpInputGui->update(); - } -} - -const wchar_t* ipl::scene::AddressEdit::String::getDispCodeLong() const { - if (!mbHasWiiNo) { - return; - } - return mDisplayText; -} - -void ipl::scene::AddressEdit::String::clear() { - memset(mValue, 0, sizeof(mValue)); - memset(mName, 0, sizeof(mName)); - memset(mDisplayText, 0, sizeof(mDisplayText)); - mbValidMail = false; - mbNameNotEmpty = false; - mbHasWiiNo = false; -} - - - -void ipl::scene::AddressEdit::String::setWiiNo(const wchar_t* value) { - mbHasWiiNo = true; - memset(mValue, 0, sizeof(mValue)); - wcsncpy(mValue, value, 0x10); - memset(mDisplayText, 0, sizeof(mDisplayText)); - - for (s32 i = 0; i < 0x10; ++i) { - wchar_t digit = value[i]; - if (digit >= L'0' && digit <= L'9') { - mDisplayText[i + i / 4] = digit; - } else { - mDisplayText[i + i / 4] = L'?'; - } - } - mDisplayText[14] = L' '; - mDisplayText[9] = L' '; - mDisplayText[4] = L' '; - - bool valid = false; - if (wcslen(value) == 0x10) { - u64 userId = AddressEdit::utf16_wiiid(value); - if (mpCallbackOwner->mpFriendCache->isValidId(userId)) { - valid = true; - } - } - mbValidMail = valid; -} - -BOOL ipl::scene::AddressEdit::String::isDupCode() const { - if (mbHasWiiNo) { - u64 userId = AddressEdit::utf16_wiiid(mValue); - return mpCallbackOwner->mpFriendCache->isDupId(userId); - } - - u8 mail[0x101]; - memset(mail, 0, sizeof(mail)); - ipl::utility::CharacterCode::UTF16ToANSI(mail, mValue, 0x100); - return mpCallbackOwner->mpFriendCache->isDupMail(reinterpret_cast(mail)); -} - -BOOL ipl::scene::AddressEdit::String::isMyCode() const { - if (mbHasWiiNo) { - NWC24UserId myUserId = mpCallbackOwner->mpFriendCache->getMyUserId(); - return AddressEdit::utf16_wiiid(mValue) == myUserId; - } - return false; -} - void ipl::scene::AddressEdit::prepare() { mpBalloonFile = ipl::System::getNandManager()->readLayoutAsync( getSceneHeap(), "balloon.ash", false); } -inline void ipl::scene::AddressEdit::set_textbox(nw4r::lyt::Pane* pane, u32 msgId) { - set_textbox(pane, ipl::System::getMessage(msgId)); -} - #pragma push #pragma ppc_iro_level 1 void ipl::scene::AddressEdit::create() { @@ -572,734 +436,6 @@ create_mode_done: } #pragma pop -void ipl::scene::AddressEdit::stt_wait_decide_anm() { - nw4r::lyt::Pane* textPane; - bool complete = true; - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - for (s32 i = 0; i < 5; ++i) { - u16 index = static_cast(mSelectedButton + 6); - complete = (complete & !mpCodeLayout->getAnim(index)->isPlaying()) != 0; - } - if (!complete) { - return; - } - - switch (mSelectedButton) { - case 2: { - if (mpFriendCache->getInfo(mSelectedFriend).attr.status == NWC24_FRIENDSTATUS_CONFIRMED) { - ipl::layout::Animator* statusAnimator = mpCodeLayout->getAnim(0x15); - statusAnimator->initFrame(); - statusAnimator->restart(); - } else { - ipl::layout::Animator* statusAnimator = mpCodeLayout->getAnim(0x1b); - statusAnimator->initFrame(); - statusAnimator->restart(); - } - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x16); - animator->initFrame(); - animator->restart(); - animator = mpCodeLayout->getAnim(0x17); - animator->initFrame(); - animator->restart(); - button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); - mState = 3; - mpBalloon->fadeoutForce(); - reset_gui(); - break; - } - case 1: { - button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); - button->reserveText(1, MESG_CMN_OK); - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); - ipl::layout::Animator* animator = mpNameLayout->getAnim(0); - animator->initFrame(); - animator->restart(); - animator = mpNameLayout->getAnim(1); - animator->initFrame(); - animator->restart(); - animator = mpNameLayout->getAnim(2); - animator->initFrame(); - animator->restart(); - mpNameLayout->getAnim(3)->initAnmFrame(); - animator = mpBackgroundLayout->getAnim(0); - animator->initFrame(); - animator->restart(); - textPane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_question_00", true); - set_textbox(textPane, ipl::System::getMessage(0x32)); - textPane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); - set_textbox(textPane, mString.mName); - textPane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true); - set_textbox(textPane, ipl::System::getMessage(0x49)); - mpBalloon->fadeoutForce(); - reset_gui(); - mState = 0xc; - break; - } - case 3: { - if (mNigaoeState != 1) { - mNigaoeState = 0; - if (RFLGetAvailableOfficialDataNum() != 0) { - button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); - createChildScene(ipl::SCENE_FACE_SELECT, this, 0, reinterpret_cast(1)); - mState = 0xb; - } else { - ipl::System::getDialog()->callBtn1(MESG_TEXTWRITER_NO_MII, MESG_CMN_OK); - mState = 0xa; - } - mpBalloon->fadeoutForce(); - } - break; - } - case 0: { - SCParentalControlsInfo parentalInfo; - BOOL parentalResult = SCGetParentalControl(&parentalInfo); - if (!ipl::ncd::NCDSetting::getConnectEnableFlag()) { - button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); - ipl::System::getDialog()->callBtn2(MESG_NETWORK_NO_CONFIG, MESG_NETWORK_SETTINGS_BTN, MESG_CMN_QUIT, false); - mState = 0x27; - } else if ((SCGetWCFlags() & SC_WC_FLAGS_ENABLED) == 0) { - button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); - ipl::System::getDialog()->callBtn2(MESG_NETWORK_NO_WC24_CONFIG, MESG_NETWORK_SETTINGS_BTN, MESG_CMN_QUIT, false); - mState = 0x2a; - } else if (parentalResult != 0 && (parentalInfo.enable & SC_PARENTAL_FLAG_ENABLED) != 0 && - (SCGetNetContentRestrictions() & SC_NET_RESTRICTIONS_MSG_BOARD) != 0) { - button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); - ipl::System::getDialog()->callBtn1(MESG_NETWORK_PARENTAL_RESTRICT, MESG_CMN_OK); - mState = 0x2d; - } else { - s32 friendError = mpFriendCache->check(); - if (friendError == NWC24_ERR_NETWORK || - mpFriendCache->getLastErr() == NWC24_ERR_SERVER || - mpFriendCache->getLastErr() == NWC24_ERR_FULL) { - wchar_t errorMessage[0x400]; - wchar_t* errorMessagePointer = errorMessage - 1; - for (s32 i = 0; i < 0x200; i++) { - errorMessagePointer[1] = 0; - errorMessagePointer += 2; - *errorMessagePointer = 0; - } - set_err_msg(errorMessage, 0x400, - static_cast(mpFriendCache->getLastErr())); - ipl::System::getDialog()->callBtn1(errorMessage, MESG_CMN_OK); - button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); - mState = 0x2e; - } else { - button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); - button->reserveText(1, MESG_BOARD_SEND); - button->reserveText(0, MESG_CMN_BACK_ALT_2); - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); - requestSceneChange(ipl::SCENE_LETTER_WRITER, reinterpret_cast(1)); - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1e); - animator->initFrame(); - animator->restart(); - mState = 0x30; - } - } - mpBalloon->fadeoutForce(); - reset_gui(); - break; - } - case 4: { - ipl::System::getDialog()->callBtn1(mString.getDispCodeLong(), MESG_CMN_OK); - mpBalloon->fadeoutForce(); - reset_gui(); - mState = 9; - break; - } - default: - mState = 0; - break; - } -} - -void ipl::scene::AddressEdit::stt_wait_delete() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - switch (ipl::System::getDialog()->getLastResult()) { - case 2: { - delete_friendinfo(); - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1d); - animator->initFrame(); - animator->restart(); - mState = 6; - break; - } - case 1: { - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1d); - animator->initFrame(); - animator->restart(); - mState = 5; - break; - } - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_add_confirm_fadein() { - if (!mpCodeLayout->getAnim(0)->isPlaying()) { - mState = 0x22; - } -} - -void ipl::scene::AddressEdit::stt_add_name_fadein() { - if (!mpNameLayout->getAnim(1)->isPlaying() && - !mpNameLayout->getAnim(3)->isPlaying() && - !mpNameLayout->getAnim(2)->isPlaying()) { - mState = 0x19; - } -} - -void ipl::scene::AddressEdit::stt_add_mii_fadein() { - if (!mpNameLayout->getAnim(1)->isPlaying() && - !mpNameLayout->getAnim(4)->isPlaying() && - !mpNameLayout->getAnim(0)->isPlaying()) { - mState = 0x1d; - } -} - -void ipl::scene::AddressEdit::stt_add_code_fadein() { - if (!mpNameLayout->getAnim(0)->isPlaying() && - !mpNameLayout->getAnim(1)->isPlaying() && - !mpNameLayout->getAnim(3)->isPlaying() && - !mpNameLayout->getAnim(4)->isPlaying() && - !mpNameLayout->getAnim(2)->isPlaying()) { - mState = 0x11; - } -} - -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: { - BOOL nameWasEmpty = mString.mName[0] == 0; - if (state->pressOK) { - mString.setName(state->wcString); - nw4r::lyt::Pane* pane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( - "T_name_00", true); - set_textbox(pane, mString.mName); - } - if (mString.mName[0] == 0) { - if (!nameWasEmpty) { - ipl::layout::Animator* animator = mpNameLayout->getAnim(6); - animator->initFrame(); - animator->restart(); - animator = mpNameLayout->getAnim(3); - animator->initFrame(); - animator->restart(); - } - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); - } else { - if (nameWasEmpty) { - ipl::layout::Animator* animator = mpNameLayout->getAnim(2); - animator->initFrame(); - animator->restart(); - animator = mpNameLayout->getAnim(7); - animator->initFrame(); - animator->restart(); - } - if (mString.mbNameNotEmpty) { - button->reserveText(1, MESG_CMN_OK); - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); - } else { - button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); - } - } - } - goto done; - -state_visible: { - mState = 0x19; - if (static_cast(ipl::System::getRegion()) == SC_PRODUCT_AREA_KOR) { - ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(false); - } - } - goto done; - -state_hidden: - setDefaultTitleText(NULL, ipl::System::getKeyboard()->baseMgr()->isVacancy()); - -done: - return; -} - -void ipl::scene::AddressEdit::stt_add_mii_normal() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - if (button->isActive()) { - button->update(); - } - if (mState == 0x1d) { - mpInputGui->update(); - } -} - -void ipl::scene::AddressEdit::stt_add_mii_input() { - ipl::scene::Base* child = getChild(); - if (child != NULL) { - ipl::scene::FaceSelect* faceSelect = static_cast(getChild()); - int faceId = faceSelect->getSelectedFaceId(); - if (faceId >= 0 && ipl::System::getMiiManager()->isAvalable(faceId) && - mNigaoeState == 0) { - RFLAdditionalInfo additionalInfo; - RFLGetAdditionalInfo(&additionalInfo, RFLDataSource_Official, NULL, faceId); - if (!RFLiIsSameID(&mCreateID, &additionalInfo.createID)) { - memcpy(&mCreateID, &additionalInfo.createID, sizeof(mCreateID)); - ipl::System::getMiiManager()->create(ipl::System::getMem2App(), 0x4c, 0x4c, faceId, - ipl::scene::AddressEdit::nigaoe_create_callback_add, - this); - mNigaoeState = 1; - mpInputGui->init(); - mpBalloon->fadeoutForce(); - } - } - } - - if (getChild() == NULL && - ipl::System::getSceneManager()->getReservedScene() == NULL) { - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); - mState = 0x1d; - mNigaoeState = 0; - } -} - -void ipl::scene::AddressEdit::stt_add_mii_fadeout() { - if (!mpNameLayout->getAnim(9)->isPlaying() && - !mpNameLayout->getAnim(5)->isPlaying() && - !mpNameLayout->getAnim(8)->isPlaying()) { - switch (mSubState) { - case 5: { - ipl::layout::Animator* animator = mpNameLayout->getAnim(1); - animator->initFrame(); - animator->restart(); - animator = mpNameLayout->getAnim(2); - animator->initFrame(); - animator->restart(); - - nw4r::lyt::Pane* pane = - mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_question_00", true); - set_textbox(pane, ipl::System::getMessage(0x32)); - pane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); - set_textbox(pane, mString.mName); - pane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true); - set_textbox(pane, ipl::System::getMessage(0x49)); - mState = 0x18; - break; - } - - case 7: { - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0); - animator->initFrame(); - animator->restart(); - mpCodeLayout->getAnim(0x10)->initAnmFrame(); - mpCodeLayout->getAnim(0x11)->initAnmFrame(); - mpCodeLayout->getAnim(0x12)->initAnmFrame(); - animator = mpCodeLayout->getAnim(0x1c); - animator->initFrame(); - animator->restart(); - - nw4r::lyt::Pane* pane = - mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_card_msg_00", true); - set_textbox(pane, ipl::System::getMessage(0x44)); - pane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); - set_textbox(pane, mString.mName); - pane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true); - set_textbox(pane, mString.mDisplayText); - mState = 0x21; - break; - } - default: - break; - } - } -} - -void ipl::scene::AddressEdit::stt_ipt_wait_fadeout() { - if (!mpNameLayout->getAnim(5)->isPlaying() && - !mpNameLayout->getAnim(7)->isPlaying() && - !mpNameLayout->getAnim(6)->isPlaying() && - !mpNameLayout->getAnim(8)->isPlaying() && - !mpNameLayout->getAnim(9)->isPlaying() && - !mpBackgroundLayout->getAnim(1)->isPlaying()) { - mState = 0; - } -} - -void ipl::scene::AddressEdit::stt_wait_del_msg_fadeout() { - if (!mpCodeLayout->getAnim(0x1d)->isPlaying()) { - u32 friendIndex = mSelectedFriend; - u32 status = mpFriendCache->getInfo(friendIndex).attr.status; - if (status == 2) { - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x10); - animator->initFrame(); - animator->restart(); - } else { - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1a); - animator->initFrame(); - animator->restart(); - } - ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x11); - animator->initFrame(); - animator->restart(); - animator = mpCodeLayout->getAnim(0x12); - animator->initFrame(); - animator->restart(); - mState = 2; - } -} - -void ipl::scene::AddressEdit::stt_msg_no_mii() { - switch (ipl::System::getDialog()->getLastResult()) { - case 1: - mpEditGui->init(); - for (u32 i = 0; i < 5; ++i) { - mPointCount[i] = 0; - } - mState = 0; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_add_confirm_fadeout() { - if (mpCodeLayout->getAnim(0x1e)->isPlaying()) { - return; - } - - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - switch (mSubState) { - case 5: { - ipl::utility::FrameController* animator = mpNameLayout->getAnim(0); - animator->initFrame(); - animator->restart(); - mState = 0x1c; - break; - } - case 7: - add_friendinfo(); - button->reserveText(1, MESG_ADDRESS_REGISTER); - static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); - ipl::System::getDialog()->callBtn1(0x4a, MESG_CMN_OK); - mState = 0x26; - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_wait_decide_anm_add() { - bool complete = true; - for (s32 i = 0; i < 5; ++i) { - u16 index = static_cast(mSelectedButton + 6); - complete = (complete & !mpCodeLayout->getAnim(index)->isPlaying()) != 0; - } - if (complete) { - switch (mSelectedButton) { - case 4: - mpEditGui->init(); - ipl::System::getDialog()->callBtn1(mString.getDispCodeLong(), MESG_CMN_OK); - mState = 0x25; - break; - default: - break; - } - } -} - -void ipl::scene::AddressEdit::stt_add_confirm_normal() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - if (button->isActive()) { - button->update(); - } - if (mState == 0x22) { - mpEditGui->update(); - } -} - -void ipl::scene::AddressEdit::stt_wait_parental() { - ipl::scene::ParentalDialog* parental = - static_cast(ipl::System::getScene(ipl::SCENE_PARENTAL_DIALOG)); - if (parental != NULL) { - switch (parental->getResult()) { - case 1: - mbParentalOK = true; - mState = 0x29; - break; - case 2: - case 3: - mbParentalOK = false; - mState = 0x29; - break; - default: - break; - } - } -} - -void ipl::scene::AddressEdit::stt_wait_parental_wc() { - ipl::scene::ParentalDialog* parental = - static_cast(ipl::System::getScene(ipl::SCENE_PARENTAL_DIALOG)); - if (parental != NULL) { - switch (parental->getResult()) { - case 1: - mbParentalOK = true; - mState = 0x2c; - break; - case 2: - case 3: - mbParentalOK = false; - mState = 0x2c; - break; - default: - break; - } - } -} - -void ipl::scene::AddressEdit::stt_wait_parental_dst() { - if (getChild() == NULL) { - if (mbParentalOK) { - ipl::System::getFader()->fadeOut(); - reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(1)); - mState = 0x30; - } else { - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); - mState = 0; - } - } -} - -void ipl::scene::AddressEdit::stt_wait_parental_dst_wc() { - if (getChild() == NULL) { - if (mbParentalOK) { - ipl::System::getFader()->fadeOut(); - reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(4)); - mState = 0x30; - } else { - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); - mState = 0; - } - } -} - -void ipl::scene::AddressEdit::stt_msg_net() { - switch (ipl::System::getDialog()->getLastResult()) { - case 2: - mState = 0; - break; - case 1: { - SCParentalControlsInfo info; - if (SCGetParentalControl(&info) && (info.enable & SC_PARENTAL_FLAG_ENABLED)) { - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(NULL, NULL); - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); - createChildScene(ipl::SCENE_PARENTAL_DIALOG, this, NULL, reinterpret_cast(1)); - mbParentalOK = false; - mState = 0x28; - } else { - ipl::System::getFader()->fadeOut(); - reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(1)); - mState = 0x30; - } - break; - } - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_msg_wc() { - switch (ipl::System::getDialog()->getLastResult()) { - case 2: - mState = 0; - break; - case 1: { - SCParentalControlsInfo info; - if (SCGetParentalControl(&info) && (info.enable & SC_PARENTAL_FLAG_ENABLED)) { - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(NULL, NULL); - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); - createChildScene(ipl::SCENE_PARENTAL_DIALOG, this, NULL, reinterpret_cast(1)); - mbParentalOK = false; - mState = 0x2b; - } else { - ipl::System::getFader()->fadeOut(); - reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(4)); - mState = 0x30; - } - break; - } - default: - break; - } -} - -void ipl::scene::AddressEdit::stt_select_mii() { - if (getChild() != NULL) { - ipl::scene::FaceSelect* faceSelect = - static_cast(getChild()); - int faceId = faceSelect->getSelectedFaceId(); - if (faceId >= 0 && ipl::System::getMiiManager()->isAvalable(faceId) && - mNigaoeState == 0) { - RFLAdditionalInfo info; - RFLGetAdditionalInfo(&info, RFLDataSource_Official, NULL, faceId); - if (!RFLiIsSameID(&mCreateID, &info.createID)) { - memcpy(&mCreateID, &info.createID, sizeof(mCreateID)); - ipl::System::getMiiManager()->create( - ipl::System::getMem2App(), 0x4c, 0x4c, faceId, - ipl::scene::AddressEdit::nigaoe_create_callback_edit, - this); - mNigaoeState = 1; - update_friendinfo(); - } - } - } - - if (getChild() == NULL && ipl::System::getReservedScene() == NULL) { - static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); - mState = 0; - mNigaoeState = 0; - mpEditGui->init(); - for (u32 i = 0; i < 5; ++i) { - mPointCount[i] = 0; - } - } -} - -void ipl::scene::AddressEdit::set_textbox(nw4r::lyt::Pane* pane, const wchar_t* text) { - nw4r::lyt::TextBox* textBox = nw4r::ut::DynamicCast(pane); - textBox->SetString(text, 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)); - return; - case 0x12: - ipl::System::getKeyboard()->baseMgr()->setTitleText(ipl::System::getMessage(0x15d)); - break; - } - return; - -set_empty_title: - ipl::System::getKeyboard()->baseMgr()->setTitleText(L""); -} - -void ipl::scene::AddressEditEvent::onEvent(u32 componentId, u32 event, void* data) { - s32 signedEvent = static_cast(event); - ::gui::Manager* manager = mpManager; - ::gui::PaneComponent* component = - static_cast< ::gui::PaneComponent*>(manager->getComponent(componentId)); - const char* paneName = component->getPane()->GetName(); - - switch (signedEvent) { - case 1: - if (data != NULL) { - mpParent->start_point_event(paneName, static_cast(data)); - } - break; - case 2: - mpParent->start_left_event(paneName); - break; - case 0: - if (data != NULL && - static_cast(data)->downTrg(ipl::controller::BTN_INTERACT)) { - mpParent->start_trig_event(paneName); - } - break; - default: - break; - } -} - -void ipl::scene::AddressInputEvent::onEvent(u32 componentId, u32 event, void* data) { - s32 signedEvent = static_cast(event); - ::gui::Manager* manager = mpManager; - ::gui::PaneComponent* component = - static_cast< ::gui::PaneComponent*>(manager->getComponent(componentId)); - const char* paneName = component->getPane()->GetName(); - - switch (signedEvent) { - case 0: - if (data != NULL && - static_cast(data)->downTrg(ipl::controller::BTN_INTERACT)) { - mpParent->start_ipt_trig_event( - paneName, static_cast(data)->getChannel()); - } - break; - case 1: - if (data != NULL) { - mpParent->start_ipt_point_event( - paneName, static_cast(data)->getChannel()); - } - break; - case 2: - if (data != NULL) { - mpParent->start_ipt_left_event( - paneName, static_cast(data)->getChannel()); - } - break; - default: - break; - } -} - -void ipl::scene::AddressEdit::nigaoe_create_callback_edit(ipl::nigaoe::Object* object, void* callbackWork) { - ipl::scene::AddressEdit* self = static_cast(callbackWork); - if (self->mpNigaoe != NULL) { - delete self->mpNigaoe; - } - self->mpNigaoe = object; - nw4r::lyt::Pane* pane = self->mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( - "mii_icon_00", true); - pane->GetMaterial()->SetTexture(0, object->getIconTexture()); - self->mNigaoeState = 2; - self->mpBalloon->init(object->getName(), 0xa); -} - -void ipl::scene::AddressEdit::nigaoe_create_callback_add(ipl::nigaoe::Object* object, void* callbackWork) { - ipl::scene::AddressEdit* self = static_cast(callbackWork); - if (self->mpNigaoe != NULL) { - delete self->mpNigaoe; - } - self->mpNigaoe = object; - nw4r::lyt::Pane* pane = self->mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( - "mii_icon_00", true); - pane->GetMaterial()->SetTexture(0, object->getIconTexture()); - pane = self->mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("mii_icon_00", true); - pane->GetMaterial()->SetTexture(0, object->getIconTexture()); - self->mNigaoeState = 2; - self->mpBalloon->init(object->getName(), 0xa); -} - ipl::scene::FaderSceneCommand ipl::scene::AddressEdit::calcFadein() { FaderSceneCommand command = FADER_SCN_CONTINUE; if (!mpCodeLayout->getAnim(0)->isPlaying() && !mpNameLayout->getAnim(0)->isPlaying()) { @@ -1484,165 +620,11 @@ ipl::scene::FaderSceneCommand ipl::scene::AddressEdit::calcNormal() { : ipl::scene::FADER_SCN_CONTINUE; } -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; - - state_six_or_more: - if (state >= 8) { - goto state_done; - } - goto state_seven; - - 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( - "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; - } - state_done: - ; - } -} - void ipl::scene::AddressEdit::initCalcFadeout() { static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(NULL); mpBalloon->calc(); } -void ipl::scene::AddressEdit::calcCommonAfter() { - mpEditGui->calc(); - mpCodeLayout->calc(); - mpInputGui->calc(); - mpNameLayout->calc(); - mpBackgroundLayout->calc(); -} - -void ipl::scene::AddressEdit::stt_normal() { - ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); - if (button->isActive()) { - button->update(); - } - if (mState == 0) { - mpEditGui->update(); - } -} - -void ipl::scene::AddressEdit::stt_wait_del_msg_fadein() { - if (!mpCodeLayout->getAnim(0x1c)->isPlaying()) { - mState = 7; - } -} - -void ipl::scene::AddressEdit::delete_friendinfo() { - mpFriendCache->del(mSelectedFriend); - static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); -} - -u64 ipl::scene::AddressEdit::utf16_wiiid(const wchar_t* value) { - u64 result = 0; - u64 multiplier = 1; - for (int i = 0; i < 0x10; i++) { - result += static_cast(value[0xf - i] - L'0') * multiplier; - multiplier *= 10; - } - return result; -} - -void ipl::scene::AddressEdit::wiiid_utf16(u64 value, wchar_t* output) { - u64 multiplier = 1; - for (int i = 0; i < 0x10; ++i) { - output[0xf - i] = static_cast((value / multiplier) % 10 + L'0'); - multiplier *= 10; - } - output[0x10] = 0; -} - -void ipl::scene::AddressEdit::String::setName(const wchar_t* value) { - wcsncpy(mName, value, 0xa); - u32 length = wcslen(value); - mbNameNotEmpty = false; - for (u32 i = 0; i < length; i++) { - if (value[i] == 0) { - break; - } - if (value[i] != L' ' && value[i] != 0x3000) { - mbNameNotEmpty = true; - break; - } - } -} - ipl::scene::FaderSceneCommand ipl::scene::AddressEdit::calcFadeout() { mpBalloon->calc(); if (ipl::System::getFader()->getStatus() == EGG::Fader::PREPARE_OUT) { @@ -1656,6 +638,14 @@ ipl::scene::FaderSceneCommand ipl::scene::AddressEdit::calcFadeout() { : FADER_SCN_CONTINUE; } +void ipl::scene::AddressEdit::calcCommonAfter() { + mpEditGui->calc(); + mpCodeLayout->calc(); + mpInputGui->calc(); + mpNameLayout->calc(); + mpBackgroundLayout->calc(); +} + void ipl::scene::AddressEdit::draw() { if (ipl::System::onDefaultDrawLayer()) { ipl::utility::Graphics::setOrtho(0); @@ -1666,6 +656,165 @@ void ipl::scene::AddressEdit::draw() { } } +void ipl::scene::AddressEdit::stt_normal() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + if (button->isActive()) { + button->update(); + } + if (mState == 0) { + mpEditGui->update(); + } +} + +void ipl::scene::AddressEdit::stt_wait_decide_anm() { + nw4r::lyt::Pane* textPane; + bool complete = true; + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + for (s32 i = 0; i < 5; ++i) { + u16 index = static_cast(mSelectedButton + 6); + complete = (complete & !mpCodeLayout->getAnim(index)->isPlaying()) != 0; + } + if (!complete) { + return; + } + + switch (mSelectedButton) { + case 2: { + if (mpFriendCache->getInfo(mSelectedFriend).attr.status == NWC24_FRIENDSTATUS_CONFIRMED) { + ipl::layout::Animator* statusAnimator = mpCodeLayout->getAnim(0x15); + statusAnimator->initFrame(); + statusAnimator->restart(); + } else { + ipl::layout::Animator* statusAnimator = mpCodeLayout->getAnim(0x1b); + statusAnimator->initFrame(); + statusAnimator->restart(); + } + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x16); + animator->initFrame(); + animator->restart(); + animator = mpCodeLayout->getAnim(0x17); + animator->initFrame(); + animator->restart(); + button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); + mState = 3; + mpBalloon->fadeoutForce(); + reset_gui(); + break; + } + case 1: { + button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); + button->reserveText(1, MESG_CMN_OK); + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); + ipl::layout::Animator* animator = mpNameLayout->getAnim(0); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(1); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(2); + animator->initFrame(); + animator->restart(); + mpNameLayout->getAnim(3)->initAnmFrame(); + animator = mpBackgroundLayout->getAnim(0); + animator->initFrame(); + animator->restart(); + textPane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_question_00", true); + set_textbox(textPane, ipl::System::getMessage(0x32)); + textPane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); + set_textbox(textPane, mString.mName); + textPane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true); + set_textbox(textPane, ipl::System::getMessage(0x49)); + mpBalloon->fadeoutForce(); + reset_gui(); + mState = 0xc; + break; + } + case 3: { + if (mNigaoeState != 1) { + mNigaoeState = 0; + if (RFLGetAvailableOfficialDataNum() != 0) { + button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); + createChildScene(ipl::SCENE_FACE_SELECT, this, 0, reinterpret_cast(1)); + mState = 0xb; + } else { + ipl::System::getDialog()->callBtn1(MESG_TEXTWRITER_NO_MII, MESG_CMN_OK); + mState = 0xa; + } + mpBalloon->fadeoutForce(); + } + break; + } + case 0: { + SCParentalControlsInfo parentalInfo; + BOOL parentalResult = SCGetParentalControl(&parentalInfo); + if (!ipl::ncd::NCDSetting::getConnectEnableFlag()) { + button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); + ipl::System::getDialog()->callBtn2(MESG_NETWORK_NO_CONFIG, MESG_NETWORK_SETTINGS_BTN, MESG_CMN_QUIT, false); + mState = 0x27; + } else if ((SCGetWCFlags() & SC_WC_FLAGS_ENABLED) == 0) { + button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); + ipl::System::getDialog()->callBtn2(MESG_NETWORK_NO_WC24_CONFIG, MESG_NETWORK_SETTINGS_BTN, MESG_CMN_QUIT, false); + mState = 0x2a; + } else if (parentalResult != 0 && (parentalInfo.enable & SC_PARENTAL_FLAG_ENABLED) != 0 && + (SCGetNetContentRestrictions() & SC_NET_RESTRICTIONS_MSG_BOARD) != 0) { + button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); + ipl::System::getDialog()->callBtn1(MESG_NETWORK_PARENTAL_RESTRICT, MESG_CMN_OK); + mState = 0x2d; + } else { + s32 friendError = mpFriendCache->check(); + if (friendError == NWC24_ERR_NETWORK || + mpFriendCache->getLastErr() == NWC24_ERR_SERVER || + mpFriendCache->getLastErr() == NWC24_ERR_FULL) { + wchar_t errorMessage[0x400]; + wchar_t* errorMessagePointer = errorMessage - 1; + for (s32 i = 0; i < 0x200; i++) { + errorMessagePointer[1] = 0; + errorMessagePointer += 2; + *errorMessagePointer = 0; + } + set_err_msg(errorMessage, 0x400, + static_cast(mpFriendCache->getLastErr())); + ipl::System::getDialog()->callBtn1(errorMessage, MESG_CMN_OK); + button->animation(ipl::scene::Button::IDANIM_SELECT_CREATE_R); + mState = 0x2e; + } else { + button->reserveAnm(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); + button->reserveText(1, MESG_BOARD_SEND); + button->reserveText(0, MESG_CMN_BACK_ALT_2); + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); + requestSceneChange(ipl::SCENE_LETTER_WRITER, reinterpret_cast(1)); + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1e); + animator->initFrame(); + animator->restart(); + mState = 0x30; + } + } + mpBalloon->fadeoutForce(); + reset_gui(); + break; + } + case 4: { + ipl::System::getDialog()->callBtn1(mString.getDispCodeLong(), MESG_CMN_OK); + mpBalloon->fadeoutForce(); + reset_gui(); + mState = 9; + break; + } + default: + mState = 0; + break; + } +} + +const wchar_t* ipl::scene::AddressEdit::String::getDispCodeLong() const { + if (!mbHasWiiNo) { + return; + } + return mDisplayText; +} + void ipl::scene::AddressEdit::stt_wait_btn_fadein() { u32 friendStatus = mpFriendCache->getInfo(mSelectedFriend).attr.status; bool finished; @@ -1707,6 +856,59 @@ void ipl::scene::AddressEdit::stt_wait_btn_fadeout() { } } +void ipl::scene::AddressEdit::stt_wait_del_msg_fadein() { + if (!mpCodeLayout->getAnim(0x1c)->isPlaying()) { + mState = 7; + } +} + +void ipl::scene::AddressEdit::stt_wait_del_msg_fadeout() { + if (!mpCodeLayout->getAnim(0x1d)->isPlaying()) { + u32 friendIndex = mSelectedFriend; + u32 status = mpFriendCache->getInfo(friendIndex).attr.status; + if (status == 2) { + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x10); + animator->initFrame(); + animator->restart(); + } else { + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1a); + animator->initFrame(); + animator->restart(); + } + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x11); + animator->initFrame(); + animator->restart(); + animator = mpCodeLayout->getAnim(0x12); + animator->initFrame(); + animator->restart(); + mState = 2; + } +} + +void ipl::scene::AddressEdit::stt_wait_delete() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + switch (ipl::System::getDialog()->getLastResult()) { + case 2: { + delete_friendinfo(); + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1d); + animator->initFrame(); + animator->restart(); + mState = 6; + break; + } + case 1: { + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1d); + animator->initFrame(); + animator->restart(); + mState = 5; + break; + } + default: + break; + } +} + void ipl::scene::AddressEdit::stt_wait_del_msg_fadeout_to_rlt() { if (!mpCodeLayout->getAnim(0x1d)->isPlaying()) { mState = 8; @@ -1826,6 +1028,37 @@ done: return; } +void ipl::scene::AddressEdit::stt_ipt_wait_fadeout() { + if (!mpNameLayout->getAnim(5)->isPlaying() && + !mpNameLayout->getAnim(7)->isPlaying() && + !mpNameLayout->getAnim(6)->isPlaying() && + !mpNameLayout->getAnim(8)->isPlaying() && + !mpNameLayout->getAnim(9)->isPlaying() && + !mpBackgroundLayout->getAnim(1)->isPlaying()) { + mState = 0; + } +} + +void ipl::scene::AddressEdit::stt_add_code_fadein() { + if (!mpNameLayout->getAnim(0)->isPlaying() && + !mpNameLayout->getAnim(1)->isPlaying() && + !mpNameLayout->getAnim(3)->isPlaying() && + !mpNameLayout->getAnim(4)->isPlaying() && + !mpNameLayout->getAnim(2)->isPlaying()) { + mState = 0x11; + } +} + +void ipl::scene::AddressEdit::stt_add_code_normal() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + if (button->isActive()) { + button->update(); + } + if (mState == 0x11) { + mpInputGui->update(); + } +} + void ipl::scene::AddressEdit::stt_add_code_input() { ipl::keyboard::Manager::State* state = ipl::System::getKeyboard()->getState(); ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); @@ -1914,6 +1147,50 @@ void ipl::scene::AddressEdit::stt_add_code_input() { } } +void ipl::scene::AddressEdit::stt_msg_code_invalid() { + ipl::System::getScene(ipl::SCENE_BUTTON); + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + mState = 0x11; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_msg_dup_wii_no() { + ipl::System::getScene(ipl::SCENE_BUTTON); + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + mState = 0x11; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_msg_dup_email() { + ipl::System::getScene(ipl::SCENE_BUTTON); + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + mState = 0x11; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_msg_my_wii_no() { + ipl::System::getScene(ipl::SCENE_BUTTON); + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + mState = 0x11; + break; + default: + break; + } +} + void ipl::scene::AddressEdit::stt_add_code_fadeout() { ipl::utility::FrameController* pane = mpNameLayout->getAnim(5); if (!pane->isPlaying()) { @@ -1946,139 +1223,604 @@ void ipl::scene::AddressEdit::stt_add_code_fadeout() { } } -/* - This is a modified version of NWC24CheckPublicMailAddr. - Changes: - - Uses strnicmp instead of NWC24's Mail_strnicmp - - ... That's it!! -*/ -extern "C" NWC24Err NWC24CheckPublicMailAddr_(const char* addr) { - int i, j; - int len; - BOOL readingDomain; - - static const char specials[] = {'(', ')', '<', '>', '[', ']', ':', ';', '\\', ',', '"'}; - - // Check parameters - if (addr == NULL) { - return NWC24_ERR_NULL; +void ipl::scene::AddressEdit::stt_add_name_fadein() { + if (!mpNameLayout->getAnim(1)->isPlaying() && + !mpNameLayout->getAnim(3)->isPlaying() && + !mpNameLayout->getAnim(2)->isPlaying()) { + mState = 0x19; } - - // Check address length - len = STD_strnlen(addr, sizeof(NWC24UserMailAddr)); - if (len == (int)sizeof(NWC24UserMailAddr)) { - return NWC24_ERR_STRING_END; - } - if (len == 0) { - return NWC24_ERR_FORMAT; - } - - readingDomain = FALSE; - - for (i = 0; i < len; i++) { - char ch = addr[i]; - - // If we found '@' - if (ch == '@') { - // If it was at the beginning of the address, invalid! - if (i == 0) { - return NWC24_ERR_FORMAT; - } - readingDomain = TRUE; - break; - } - - // If the character is not a letter or symbol, invalid! - if (ch <= ' ' || ch >= '~' + 1) { - return NWC24_ERR_FORMAT; - } - - // If the character is special, invalid! - for (j = 0; j < sizeof(specials); j++) { - if (ch == specials[j]) { - return NWC24_ERR_FORMAT; - } - } - } - - // If we are have not found '@', invalid! - if (!readingDomain) { - return NWC24_ERR_FORMAT; - } - - // If the hostname is not valid, invalid! - if (CheckHostName(&addr[i + 1], (len - i)) < CHECK_HOSTNAME_SUCCESS) { - return NWC24_ERR_FORMAT; - } - - return strnicmp(&addr[i], NWC24GetAccountDomain(), (len - i) + 1) == 0 ? NWC24_ERR_PROTECTED : NWC24_OK; } -static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength) { - int i; - BOOL foundDot; - - // Parameter check - if (hostNameLength == 0) { - return CHECK_HOSTNAME_BAD_LENGTH; +void ipl::scene::AddressEdit::stt_add_name_normal() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + if (button->isActive()) { + button->update(); } - - // Is null or empty check - if (hostName == NULL) { - return CHECK_HOSTNAME_IS_NULL; + if (mState == 0x19) { + mpInputGui->update(); } - if (*hostName == 0) { - return CHECK_HOSTNAME_IS_EMPTY; - } - - // Verify check - if (*hostName == '.') { - return CHECK_HOSTNAME_INCORRECT; - } - - foundDot = FALSE; - - for (i = 0; i < hostNameLength; i++) { - char ch = hostName[i]; - - // Stop on NULL - if (ch == 0) { - break; - } - - if (ch == '.') { - // Check if we already found one again after the previous character. - if (foundDot) { - return CHECK_HOSTNAME_MULTIPLE_DOTS; - } - foundDot = TRUE; - continue; - } - - // Check if there are invalid characters - if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z') && (ch != '-' && ch != '_')) { - return CHECK_HOSTNAME_INVALID_CHARACTERS; - } - - foundDot = FALSE; - } - - // Check if we are out of range - if (i == hostNameLength) { - return CHECK_HOSTNAME_OUT_OF_RANGE; - } - - // Check if the end of hostname has a dot - if (i > 0 && hostName[i - 1] == '.') { - return CHECK_HOSTNAME_DOT_AT_END; - } - - return CHECK_HOSTNAME_SUCCESS; } +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: { + BOOL nameWasEmpty = mString.mName[0] == 0; + if (state->pressOK) { + mString.setName(state->wcString); + nw4r::lyt::Pane* pane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "T_name_00", true); + set_textbox(pane, mString.mName); + } + if (mString.mName[0] == 0) { + if (!nameWasEmpty) { + ipl::layout::Animator* animator = mpNameLayout->getAnim(6); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(3); + animator->initFrame(); + animator->restart(); + } + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); + } else { + if (nameWasEmpty) { + ipl::layout::Animator* animator = mpNameLayout->getAnim(2); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(7); + animator->initFrame(); + animator->restart(); + } + if (mString.mbNameNotEmpty) { + button->reserveText(1, MESG_CMN_OK); + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); + } else { + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); + } + } + } + goto done; +state_visible: { + mState = 0x19; + if (static_cast(ipl::System::getRegion()) == SC_PRODUCT_AREA_KOR) { + ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(false); + } + } + 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; + + state_six_or_more: + if (state >= 8) { + goto state_done; + } + goto state_seven; + + 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( + "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; + } + state_done: + ; + } +} + +void ipl::scene::AddressEdit::stt_add_mii_fadein() { + if (!mpNameLayout->getAnim(1)->isPlaying() && + !mpNameLayout->getAnim(4)->isPlaying() && + !mpNameLayout->getAnim(0)->isPlaying()) { + mState = 0x1d; + } +} + +void ipl::scene::AddressEdit::stt_add_mii_normal() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + if (button->isActive()) { + button->update(); + } + if (mState == 0x1d) { + mpInputGui->update(); + } +} + +void ipl::scene::AddressEdit::stt_add_mii_input() { + ipl::scene::Base* child = getChild(); + if (child != NULL) { + ipl::scene::FaceSelect* faceSelect = static_cast(getChild()); + int faceId = faceSelect->getSelectedFaceId(); + if (faceId >= 0 && ipl::System::getMiiManager()->isAvalable(faceId) && + mNigaoeState == 0) { + RFLAdditionalInfo additionalInfo; + RFLGetAdditionalInfo(&additionalInfo, RFLDataSource_Official, NULL, faceId); + if (!RFLiIsSameID(&mCreateID, &additionalInfo.createID)) { + memcpy(&mCreateID, &additionalInfo.createID, sizeof(mCreateID)); + ipl::System::getMiiManager()->create(ipl::System::getMem2App(), 0x4c, 0x4c, faceId, + ipl::scene::AddressEdit::nigaoe_create_callback_add, + this); + mNigaoeState = 1; + mpInputGui->init(); + mpBalloon->fadeoutForce(); + } + } + } + + if (getChild() == NULL && + ipl::System::getSceneManager()->getReservedScene() == NULL) { + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); + mState = 0x1d; + mNigaoeState = 0; + } +} + +void ipl::scene::AddressEdit::stt_msg_no_mii_add() { + ipl::System::getScene(ipl::SCENE_BUTTON); + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + mState = 0x1d; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_add_mii_fadeout() { + if (!mpNameLayout->getAnim(9)->isPlaying() && + !mpNameLayout->getAnim(5)->isPlaying() && + !mpNameLayout->getAnim(8)->isPlaying()) { + switch (mSubState) { + case 5: { + ipl::layout::Animator* animator = mpNameLayout->getAnim(1); + animator->initFrame(); + animator->restart(); + animator = mpNameLayout->getAnim(2); + animator->initFrame(); + animator->restart(); + + nw4r::lyt::Pane* pane = + mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_question_00", true); + set_textbox(pane, ipl::System::getMessage(0x32)); + pane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); + set_textbox(pane, mString.mName); + pane = mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_msg_00", true); + set_textbox(pane, ipl::System::getMessage(0x49)); + mState = 0x18; + break; + } + + case 7: { + ipl::layout::Animator* animator = mpCodeLayout->getAnim(0); + animator->initFrame(); + animator->restart(); + mpCodeLayout->getAnim(0x10)->initAnmFrame(); + mpCodeLayout->getAnim(0x11)->initAnmFrame(); + mpCodeLayout->getAnim(0x12)->initAnmFrame(); + animator = mpCodeLayout->getAnim(0x1c); + animator->initFrame(); + animator->restart(); + + nw4r::lyt::Pane* pane = + mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_card_msg_00", true); + set_textbox(pane, ipl::System::getMessage(0x44)); + pane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true); + set_textbox(pane, mString.mName); + pane = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true); + set_textbox(pane, mString.mDisplayText); + mState = 0x21; + break; + } + default: + break; + } + } +} + +void ipl::scene::AddressEdit::stt_add_confirm_fadein() { + if (!mpCodeLayout->getAnim(0)->isPlaying()) { + mState = 0x22; + } +} + +void ipl::scene::AddressEdit::stt_add_confirm_normal() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + if (button->isActive()) { + button->update(); + } + if (mState == 0x22) { + mpEditGui->update(); + } +} + +void ipl::scene::AddressEdit::stt_add_confirm_fadeout() { + if (mpCodeLayout->getAnim(0x1e)->isPlaying()) { + return; + } + + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + switch (mSubState) { + case 5: { + ipl::utility::FrameController* animator = mpNameLayout->getAnim(0); + animator->initFrame(); + animator->restart(); + mState = 0x1c; + break; + } + case 7: + add_friendinfo(); + button->reserveText(1, MESG_ADDRESS_REGISTER); + static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); + ipl::System::getDialog()->callBtn1(0x4a, MESG_CMN_OK); + mState = 0x26; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_wait_decide_anm_add() { + bool complete = true; + for (s32 i = 0; i < 5; ++i) { + u16 index = static_cast(mSelectedButton + 6); + complete = (complete & !mpCodeLayout->getAnim(index)->isPlaying()) != 0; + } + if (complete) { + switch (mSelectedButton) { + case 4: + mpEditGui->init(); + ipl::System::getDialog()->callBtn1(mString.getDispCodeLong(), MESG_CMN_OK); + mState = 0x25; + break; + default: + break; + } + } +} + +void ipl::scene::AddressEdit::stt_msg_code_add() { + if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { + mState = 0x22; + } +} + +void ipl::scene::AddressEdit::stt_msg_code_edit() { + if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { + mState = 0; + } +} + +void ipl::scene::AddressEdit::stt_msg_no_mii() { + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + mpEditGui->init(); + for (u32 i = 0; i < 5; ++i) { + mPointCount[i] = 0; + } + mState = 0; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_select_mii() { + if (getChild() != NULL) { + ipl::scene::FaceSelect* faceSelect = + static_cast(getChild()); + int faceId = faceSelect->getSelectedFaceId(); + if (faceId >= 0 && ipl::System::getMiiManager()->isAvalable(faceId) && + mNigaoeState == 0) { + RFLAdditionalInfo info; + RFLGetAdditionalInfo(&info, RFLDataSource_Official, NULL, faceId); + if (!RFLiIsSameID(&mCreateID, &info.createID)) { + memcpy(&mCreateID, &info.createID, sizeof(mCreateID)); + ipl::System::getMiiManager()->create( + ipl::System::getMem2App(), 0x4c, 0x4c, faceId, + ipl::scene::AddressEdit::nigaoe_create_callback_edit, + this); + mNigaoeState = 1; + update_friendinfo(); + } + } + } + + if (getChild() == NULL && ipl::System::getReservedScene() == NULL) { + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); + mState = 0; + mNigaoeState = 0; + mpEditGui->init(); + for (u32 i = 0; i < 5; ++i) { + mPointCount[i] = 0; + } + } +} + +void ipl::scene::AddressEdit::stt_msg_add_rlt() { + ipl::scene::Button* button = static_cast(ipl::System::getScene(ipl::SCENE_BUTTON)); + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + button->reserveAnm(ipl::scene::Button::IDANIM_APPEAR_LEFT_AND_RIGHT_BUTTON); + mState = 0x30; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_msg_net() { + switch (ipl::System::getDialog()->getLastResult()) { + case 2: + mState = 0; + break; + case 1: { + SCParentalControlsInfo info; + if (SCGetParentalControl(&info) && (info.enable & SC_PARENTAL_FLAG_ENABLED)) { + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(NULL, NULL); + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); + createChildScene(ipl::SCENE_PARENTAL_DIALOG, this, NULL, reinterpret_cast(1)); + mbParentalOK = false; + mState = 0x28; + } else { + ipl::System::getFader()->fadeOut(); + reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(1)); + mState = 0x30; + } + break; + } + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_wait_parental() { + ipl::scene::ParentalDialog* parental = + static_cast(ipl::System::getScene(ipl::SCENE_PARENTAL_DIALOG)); + if (parental != NULL) { + switch (parental->getResult()) { + case 1: + mbParentalOK = true; + mState = 0x29; + break; + case 2: + case 3: + mbParentalOK = false; + mState = 0x29; + break; + default: + break; + } + } +} + +void ipl::scene::AddressEdit::stt_wait_parental_dst() { + if (getChild() == NULL) { + if (mbParentalOK) { + ipl::System::getFader()->fadeOut(); + reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(1)); + mState = 0x30; + } else { + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); + mState = 0; + } + } +} + +void ipl::scene::AddressEdit::stt_msg_wc() { + switch (ipl::System::getDialog()->getLastResult()) { + case 2: + mState = 0; + break; + case 1: { + SCParentalControlsInfo info; + if (SCGetParentalControl(&info) && (info.enable & SC_PARENTAL_FLAG_ENABLED)) { + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(NULL, NULL); + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_DISAPPEAR_LEFT_BUTTON); + createChildScene(ipl::SCENE_PARENTAL_DIALOG, this, NULL, reinterpret_cast(1)); + mbParentalOK = false; + mState = 0x2b; + } else { + ipl::System::getFader()->fadeOut(); + reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(4)); + mState = 0x30; + } + break; + } + default: + break; + } +} + +void ipl::scene::AddressEdit::stt_wait_parental_wc() { + ipl::scene::ParentalDialog* parental = + static_cast(ipl::System::getScene(ipl::SCENE_PARENTAL_DIALOG)); + if (parental != NULL) { + switch (parental->getResult()) { + case 1: + mbParentalOK = true; + mState = 0x2c; + break; + case 2: + case 3: + mbParentalOK = false; + mState = 0x2c; + break; + default: + break; + } + } +} + +void ipl::scene::AddressEdit::stt_wait_parental_dst_wc() { + if (getChild() == NULL) { + if (mbParentalOK) { + ipl::System::getFader()->fadeOut(); + reserveAllSceneDestruction(ipl::SCENE_SETTING, reinterpret_cast(4)); + mState = 0x30; + } else { + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->animation(ipl::scene::Button::IDANIM_APPEAR_LEFT_BUTTON); + static_cast(ipl::System::getScene(ipl::SCENE_BUTTON))->setEventHandler(static_cast< ::gui::EventHandler*>(this), NULL); + mState = 0; + } + } +} + +void ipl::scene::AddressEdit::stt_msg_parental() { + if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { + mState = 0; + } +} + +void ipl::scene::AddressEdit::stt_msg_nwc24_error() { + if (System::getDialog()->getLastResult() == DialogWindow::RESULT_BUTTON) { + mState = 0; + } +} + +void ipl::scene::AddressEdit::stt_msg_no_established() { + switch (ipl::System::getDialog()->getLastResult()) { + case 1: + reset_gui(); + mState = 0; + break; + default: + break; + } +} + +void ipl::scene::AddressEdit::set_textbox(nw4r::lyt::Pane* pane, const wchar_t* text) { + nw4r::lyt::TextBox* textBox = nw4r::ut::DynamicCast(pane); + textBox->SetString(text, 0); +} + +void ipl::scene::AddressEdit::nigaoe_create_callback_edit(ipl::nigaoe::Object* object, void* callbackWork) { + ipl::scene::AddressEdit* self = static_cast(callbackWork); + if (self->mpNigaoe != NULL) { + delete self->mpNigaoe; + } + self->mpNigaoe = object; + nw4r::lyt::Pane* pane = self->mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "mii_icon_00", true); + pane->GetMaterial()->SetTexture(0, object->getIconTexture()); + self->mNigaoeState = 2; + self->mpBalloon->init(object->getName(), 0xa); +} + +void ipl::scene::AddressEdit::nigaoe_create_callback_add(ipl::nigaoe::Object* object, void* callbackWork) { + ipl::scene::AddressEdit* self = static_cast(callbackWork); + if (self->mpNigaoe != NULL) { + delete self->mpNigaoe; + } + self->mpNigaoe = object; + nw4r::lyt::Pane* pane = self->mpNameLayout->getNW4RLyt()->GetRootPane()->FindPaneByName( + "mii_icon_00", true); + pane->GetMaterial()->SetTexture(0, object->getIconTexture()); + pane = self->mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("mii_icon_00", true); + pane->GetMaterial()->SetTexture(0, object->getIconTexture()); + self->mNigaoeState = 2; + self->mpBalloon->init(object->getName(), 0xa); +} void ipl::scene::AddressEdit::start_point_event( const char* paneName, ipl::controller::Interface* controller) { @@ -2457,6 +2199,15 @@ void ipl::scene::AddressEdit::start_ipt_trig_event( } } +ipl::keyboard::Manager::KeyboardSetting::KeyboardSetting( + ipl::keyboard::Manager::KeyboardType keyboardType, const wchar_t* value, u32 limit, u32 rows) { + type = keyboardType; + wcString = value; + stringLimit = limit; + rowLimit = rows; +} + +inline textinput::InputForm* textinput::Manager::getInputForm() { return mpInputForm; } void ipl::scene::AddressEdit::start_ipt_point_event( const char* paneName, int channel) { @@ -2487,6 +2238,181 @@ void ipl::scene::AddressEdit::start_ipt_point_event( } } +void ipl::scene::AddressEdit::start_ipt_left_event( + const char* paneName, int channel) { + ipl::controller::Interface* controller = ipl::System::getControllerManager()->getYoungController(); + if (controller != NULL) { + if (controller->getChannel() == channel) { + switch (mState) { + case 0x1d: { + char paneNameCopy[12] = "mii_icon_00"; + if (strcmp(paneNameCopy, paneName) == 0) { + (mpBalloon)->fadeoutForce(); + } + break; + } + } + } + } +} + +int ipl::scene::AddressEdit::get_button_no(const char* paneName) { + int result = -1; + for (int i = 0; i < 5; i++) { + if (strcmp(sButtonPaneNames[i], paneName) == 0) { + result = i; + break; + } + } + return result; +} + +void ipl::scene::AddressEdit::reset_gui() { + mpEditGui->init(); + mpInputGui->init(); + for (s32 i = 0; i < 5; ++i) { + if (mPointCount[i] > 0) { + ipl::layout::Animator* animator = mpCodeLayout->getAnim(i + 0xb); + animator->play(); + mPointCount[i] = 0; + } + } +} + +void ipl::scene::AddressEdit::add_friendinfo() { + NWC24FriendInfo info ALIGN32; + memset(&info, 0, sizeof(info)); + switch (mMode) { + case SCENE_ADD_WII: + info.attr.type = NWC24_FRIENDTYPE_WII; + { + const wchar_t* name = mString.mName; + wchar_t* storedName = reinterpret_cast(info.attr.name); + wcsncpy(storedName, name, 0xa); + } + info.addr.wiiId = ipl::scene::AddressEdit::utf16_wiiid(mString.mValue); + memcpy(&info.attr.fdId, &mCreateID, sizeof(mCreateID)); + break; + case SCENE_ADD_EMAIL: + info.attr.type = NWC24_FRIENDTYPE_EMAIL; + { + const wchar_t* name = mString.mName; + wchar_t* storedName = reinterpret_cast(info.attr.name); + wcsncpy(storedName, name, 0xa); + } + { + const wchar_t* value = mString.mValue; + u8* address = reinterpret_cast(&info.addr); + ipl::utility::CharacterCode::UTF16ToANSI(address, value, sizeof(info.addr)); + } + memcpy(&info.attr.fdId, &mCreateID, sizeof(mCreateID)); + break; + default: + break; + } + + ipl::scene::Address* address = + static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS)); + u32 index = address->getChosenFriendIndex(); + if (index >= FriendListCache::FRIEND_MAX) { + index = 0; + for (u32 remaining = FriendListCache::FRIEND_MAX; remaining != 0; --remaining) { + if (!mpFriendCache->isThere(index)) { + break; + } + ++index; + } + } + mpFriendCache->add(index, info); + if (mMode == SCENE_ADD_EMAIL) { + mpFriendCache->sendRegisterMail(index); + } +} + +#pragma push +#pragma ppc_iro_level 1 +void ipl::scene::AddressEdit::get_friendinfo() { + memcpy(&ipl::scene::sFriendInfo, &mpFriendCache->getInfo(mSelectedFriend), + sizeof(ipl::scene::sFriendInfo)); + mString.setName(reinterpret_cast(ipl::scene::sFriendInfo.attr.name)); + const wchar_t* name = mString.mName; + set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true), name); + + wchar_t wiiNo[0x100]; + wchar_t email[0x102]; + if (ipl::scene::sFriendInfo.attr.type == NWC24_FRIENDTYPE_WII) { + memset(wiiNo, 0, sizeof(wiiNo)); + ipl::scene::AddressEdit::wiiid_utf16(ipl::scene::sFriendInfo.addr.wiiId, wiiNo); + mString.setWiiNo(wiiNo); + } else { + memset(email, 0, sizeof(email)); + ipl::utility::CharacterCode::ANSIToUTF16(email, reinterpret_cast(&ipl::scene::sFriendInfo.addr), 0x102); + mString.setEMail(email); + } + const wchar_t* text = mString.mDisplayText; + set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true), text); + memcpy(&mCreateID, &ipl::scene::sFriendInfo.attr.fdId, sizeof(mCreateID)); +} +#pragma pop + +void ipl::scene::AddressEdit::delete_friendinfo() { + mpFriendCache->del(mSelectedFriend); + static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); +} + +#pragma push +#pragma ppc_iro_level 1 +void ipl::scene::AddressEdit::update_friendinfo() { + memset(ipl::scene::sFriendInfo.attr.name, 0, sizeof(ipl::scene::sFriendInfo.attr.name)); + const wchar_t* source = mString.mName; + wcsncpy(reinterpret_cast(ipl::scene::sFriendInfo.attr.name), source, 0xa); + memcpy(&ipl::scene::sFriendInfo.attr.fdId, &mCreateID, sizeof(mCreateID)); + mpFriendCache->update( + mSelectedFriend, + reinterpret_cast(ipl::scene::sFriendInfo.attr.name), + ipl::scene::sFriendInfo.attr.fdId); + static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); +} +#pragma pop + +u64 ipl::scene::AddressEdit::utf16_wiiid(const wchar_t* value) { + u64 result = 0; + u64 multiplier = 1; + for (int i = 0; i < 0x10; i++) { + result += static_cast(value[0xf - i] - L'0') * multiplier; + multiplier *= 10; + } + return result; +} + +void ipl::scene::AddressEdit::wiiid_utf16(u64 value, wchar_t* output) { + u64 multiplier = 1; + for (int i = 0; i < 0x10; ++i) { + output[0xf - i] = static_cast((value / multiplier) % 10 + L'0'); + multiplier *= 10; + } + 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)); + return; + case 0x12: + ipl::System::getKeyboard()->baseMgr()->setTitleText(ipl::System::getMessage(0x15d)); + break; + } + return; + +set_empty_title: + ipl::System::getKeyboard()->baseMgr()->setTitleText(L""); +} + void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const ipl::controller::Interface* controller) { ::gui::Manager* manager = getGuiManager(); @@ -2728,22 +2654,94 @@ void ipl::scene::AddressEdit::onEventDerived(u32 componentId, u32 event, const i } } -void ipl::scene::AddressEdit::start_ipt_left_event( - const char* paneName, int channel) { - ipl::controller::Interface* controller = ipl::System::getControllerManager()->getYoungController(); - if (controller != NULL) { - if (controller->getChannel() == channel) { - switch (mState) { - case 0x1d: { - char paneNameCopy[12] = "mii_icon_00"; - if (strcmp(paneNameCopy, paneName) == 0) { - (mpBalloon)->fadeoutForce(); - } - break; - } - } +void ipl::scene::AddressEdit::String::clear() { + memset(mValue, 0, sizeof(mValue)); + memset(mName, 0, sizeof(mName)); + memset(mDisplayText, 0, sizeof(mDisplayText)); + mbValidMail = false; + mbNameNotEmpty = false; + mbHasWiiNo = false; +} + +void ipl::scene::AddressEdit::String::setEMail(const wchar_t* value) { + mbHasWiiNo = false; + memset(mValue, 0, sizeof(mValue)); + wcsncpy(mValue, value, 0xff); + u32 length = wcslen(value); + memset(mDisplayText, 0, sizeof(mDisplayText)); + if (length > 0x10) { + wcsncpy(mDisplayText, value, 0xe); + wcscpy(mDisplayText + 0xe, L"..."); + } else { + wcscpy(mDisplayText, value); + } + u8 address[0x100]; + memset(address, 0, sizeof(address)); + ipl::utility::CharacterCode::UTF16ToANSI(address, value, sizeof(address)); + mbValidMail = !NWC24CheckPublicMailAddr_(reinterpret_cast(address)); +} + +void ipl::scene::AddressEdit::String::setWiiNo(const wchar_t* value) { + mbHasWiiNo = true; + memset(mValue, 0, sizeof(mValue)); + wcsncpy(mValue, value, 0x10); + memset(mDisplayText, 0, sizeof(mDisplayText)); + + for (s32 i = 0; i < 0x10; ++i) { + wchar_t digit = value[i]; + if (digit >= L'0' && digit <= L'9') { + mDisplayText[i + i / 4] = digit; + } else { + mDisplayText[i + i / 4] = L'?'; } } + mDisplayText[14] = L' '; + mDisplayText[9] = L' '; + mDisplayText[4] = L' '; + + bool valid = false; + if (wcslen(value) == 0x10) { + u64 userId = AddressEdit::utf16_wiiid(value); + if (mpCallbackOwner->mpFriendCache->isValidId(userId)) { + valid = true; + } + } + mbValidMail = valid; +} + +void ipl::scene::AddressEdit::String::setName(const wchar_t* value) { + wcsncpy(mName, value, 0xa); + u32 length = wcslen(value); + mbNameNotEmpty = false; + for (u32 i = 0; i < length; i++) { + if (value[i] == 0) { + break; + } + if (value[i] != L' ' && value[i] != 0x3000) { + mbNameNotEmpty = true; + break; + } + } +} + +BOOL ipl::scene::AddressEdit::String::isDupCode() const { + if (mbHasWiiNo) { + u64 userId = AddressEdit::utf16_wiiid(mValue); + return mpCallbackOwner->mpFriendCache->isDupId(userId); + } + + u8 mail[0x101]; + memset(mail, 0, sizeof(mail)); + ipl::utility::CharacterCode::UTF16ToANSI(mail, mValue, 0x100); + return mpCallbackOwner->mpFriendCache->isDupMail(reinterpret_cast(mail)); +} + +BOOL ipl::scene::AddressEdit::String::isMyCode() const { + if (mbHasWiiNo) { + NWC24UserId myUserId = mpCallbackOwner->mpFriendCache->getMyUserId(); + return AddressEdit::utf16_wiiid(mValue) == myUserId; + } + return false; } void ipl::scene::AddressEdit::set_err_msg(wchar_t* outErrMsg, u32 outErrMsgLen, NWC24Err nwc24Err) { @@ -2772,128 +2770,61 @@ void ipl::scene::AddressEdit::set_err_msg(wchar_t* outErrMsg, u32 outErrMsgLen, wcsncat(outErrMsg, ipl::System::getMessage(messageId), outErrMsgLen - wcslen(outErrMsg)); } +void ipl::scene::AddressEditEvent::onEvent(u32 componentId, u32 event, void* data) { + s32 signedEvent = static_cast(event); + ::gui::Manager* manager = mpManager; + ::gui::PaneComponent* component = + static_cast< ::gui::PaneComponent*>(manager->getComponent(componentId)); + const char* paneName = component->getPane()->GetName(); - - - - - -int ipl::scene::AddressEdit::get_button_no(const char* paneName) { - int result = -1; - for (int i = 0; i < 5; i++) { - if (strcmp(smButtonName__Q33ipl5scene6Button[i], paneName) == 0) { - result = i; - break; + switch (signedEvent) { + case 1: + if (data != NULL) { + mpParent->start_point_event(paneName, static_cast(data)); } - } - return result; -} - -void ipl::scene::AddressEdit::add_friendinfo() { - NWC24FriendInfo info ALIGN32; - memset(&info, 0, sizeof(info)); - switch (mMode) { - case SCENE_ADD_WII: - info.attr.type = NWC24_FRIENDTYPE_WII; - { - const wchar_t* name = mString.mName; - wchar_t* storedName = reinterpret_cast(info.attr.name); - wcsncpy(storedName, name, 0xa); - } - info.addr.wiiId = ipl::scene::AddressEdit::utf16_wiiid(mString.mValue); - memcpy(&info.attr.fdId, &mCreateID, sizeof(mCreateID)); break; - case SCENE_ADD_EMAIL: - info.attr.type = NWC24_FRIENDTYPE_EMAIL; - { - const wchar_t* name = mString.mName; - wchar_t* storedName = reinterpret_cast(info.attr.name); - wcsncpy(storedName, name, 0xa); + case 2: + mpParent->start_left_event(paneName); + break; + case 0: + if (data != NULL && + static_cast(data)->downTrg(ipl::controller::BTN_INTERACT)) { + mpParent->start_trig_event(paneName); } - { - const wchar_t* value = mString.mValue; - u8* address = reinterpret_cast(&info.addr); - ipl::utility::CharacterCode::UTF16ToANSI(address, value, sizeof(info.addr)); - } - memcpy(&info.attr.fdId, &mCreateID, sizeof(mCreateID)); break; default: break; } +} - ipl::scene::Address* address = - static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS)); - u32 index = address->getChosenFriendIndex(); - if (index >= FriendListCache::FRIEND_MAX) { - index = 0; - for (u32 remaining = FriendListCache::FRIEND_MAX; remaining != 0; --remaining) { - if (!mpFriendCache->isThere(index)) { - break; - } - ++index; +void ipl::scene::AddressInputEvent::onEvent(u32 componentId, u32 event, void* data) { + s32 signedEvent = static_cast(event); + ::gui::Manager* manager = mpManager; + ::gui::PaneComponent* component = + static_cast< ::gui::PaneComponent*>(manager->getComponent(componentId)); + const char* paneName = component->getPane()->GetName(); + + switch (signedEvent) { + case 0: + if (data != NULL && + static_cast(data)->downTrg(ipl::controller::BTN_INTERACT)) { + mpParent->start_ipt_trig_event( + paneName, static_cast(data)->getChannel()); } - } - mpFriendCache->add(index, info); - if (mMode == SCENE_ADD_EMAIL) { - mpFriendCache->sendRegisterMail(index); + break; + case 1: + if (data != NULL) { + mpParent->start_ipt_point_event( + paneName, static_cast(data)->getChannel()); + } + break; + case 2: + if (data != NULL) { + mpParent->start_ipt_left_event( + paneName, static_cast(data)->getChannel()); + } + break; + default: + break; } } - -#pragma push -#pragma ppc_iro_level 1 -void ipl::scene::AddressEdit::get_friendinfo() { - memcpy(&ipl::scene::sFriendInfo, &mpFriendCache->getInfo(mSelectedFriend), - sizeof(ipl::scene::sFriendInfo)); - mString.setName(reinterpret_cast(ipl::scene::sFriendInfo.attr.name)); - const wchar_t* name = mString.mName; - set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true), name); - - wchar_t wiiNo[0x100]; - wchar_t email[0x102]; - if (ipl::scene::sFriendInfo.attr.type == NWC24_FRIENDTYPE_WII) { - memset(wiiNo, 0, sizeof(wiiNo)); - ipl::scene::AddressEdit::wiiid_utf16(ipl::scene::sFriendInfo.addr.wiiId, wiiNo); - mString.setWiiNo(wiiNo); - } else { - memset(email, 0, sizeof(email)); - ipl::utility::CharacterCode::ANSIToUTF16(email, reinterpret_cast(&ipl::scene::sFriendInfo.addr), 0x102); - mString.setEMail(email); - } - const wchar_t* text = mString.mDisplayText; - set_textbox(mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true), text); - memcpy(&mCreateID, &ipl::scene::sFriendInfo.attr.fdId, sizeof(mCreateID)); -} -#pragma pop - -#pragma push -#pragma ppc_iro_level 1 -void ipl::scene::AddressEdit::update_friendinfo() { - memset(ipl::scene::sFriendInfo.attr.name, 0, sizeof(ipl::scene::sFriendInfo.attr.name)); - const wchar_t* source = mString.mName; - wcsncpy(reinterpret_cast(ipl::scene::sFriendInfo.attr.name), source, 0xa); - memcpy(&ipl::scene::sFriendInfo.attr.fdId, &mCreateID, sizeof(mCreateID)); - mpFriendCache->update( - mSelectedFriend, - reinterpret_cast(ipl::scene::sFriendInfo.attr.name), - ipl::scene::sFriendInfo.attr.fdId); - static_cast(ipl::System::getScene(ipl::SCENE_ADDRESS))->reset_friend(); -} -#pragma pop - -void ipl::scene::AddressEdit::String::setEMail(const wchar_t* value) { - mbHasWiiNo = false; - memset(mValue, 0, sizeof(mValue)); - wcsncpy(mValue, value, 0xff); - u32 length = wcslen(value); - memset(mDisplayText, 0, sizeof(mDisplayText)); - if (length > 0x10) { - wcsncpy(mDisplayText, value, 0xe); - wcscpy(mDisplayText + 0xe, L"..."); - } else { - wcscpy(mDisplayText, value); - } - u8 address[0x100]; - memset(address, 0, sizeof(address)); - ipl::utility::CharacterCode::UTF16ToANSI(address, value, sizeof(address)); - mbValidMail = !NWC24CheckPublicMailAddr_(reinterpret_cast(address)); -} diff --git a/tools/decomp-assist/sol-l1.attempts.md b/tools/decomp-assist/sol-l1.attempts.md new file mode 100644 index 00000000..a1bc2854 --- /dev/null +++ b/tools/decomp-assist/sol-l1.attempts.md @@ -0,0 +1,808 @@ +# sol-l1: link AddressEdit + +Worktree data-d10; branch agent/w1009/ae-link; baseline dc7725eb. +Baseline full 43U build passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. +Live report: functions 94/94, code 27112/27112, data 2560/2560, linked code 0. +Prior logs reviewed: lnkaddr, linkgap, sol-addr, sol-tiny, agg, scene4. AddressEdit body experiments already landed; this task changes definition placement only. lnkaddr proves delayed weak-inline definitions can restore link order. Do not repeat body or compiler-flag trials. + +Acceptance: unchanged function bodies, all 94 exact-name scores 100, all ctxdiff equal-sized with zero differences, identical pool and all data sections, Matching enabled, expected DOL hash, final gate PASS. + +## obj baseline symbols + +### .text + +```text + 0 0000 0260 STB_GLOBAL NWC24CheckPublicMailAddr_ + 1 0260 00d0 STB_GLOBAL __ct__Q33ipl5scene11AddressEditFPQ23EGG4Heapi + 2 0330 0098 STB_GLOBAL __dt__Q33ipl5scene11AddressEditFv + 3 03c8 004c STB_GLOBAL prepare__Q33ipl5scene11AddressEditFv + 4 0414 0cd0 STB_GLOBAL create__Q33ipl5scene11AddressEditFv + 5 10e4 0074 STB_GLOBAL calcFadein__Q33ipl5scene11AddressEditFv + 6 1158 0054 STB_GLOBAL initCalcNormal__Q33ipl5scene11AddressEditFv + 7 11ac 0204 STB_GLOBAL calcNormal__Q33ipl5scene11AddressEditFv + 8 13b0 0050 STB_GLOBAL initCalcFadeout__Q33ipl5scene11AddressEditFv + 9 1400 00c0 STB_GLOBAL calcFadeout__Q33ipl5scene11AddressEditFv + 10 14c0 0068 STB_GLOBAL calcCommonAfter__Q33ipl5scene11AddressEditFv + 11 1528 0068 STB_GLOBAL draw__Q33ipl5scene11AddressEditFv + 12 1590 0070 STB_GLOBAL stt_normal__Q33ipl5scene11AddressEditFv + 13 1600 05ec STB_GLOBAL stt_wait_decide_anm__Q33ipl5scene11AddressEditFv + 14 1bec 0014 STB_GLOBAL getDispCodeLong__Q43ipl5scene11AddressEdit6StringCFv + 15 1c00 00f4 STB_GLOBAL stt_wait_btn_fadein__Q33ipl5scene11AddressEditFv + 16 1cf4 0178 STB_GLOBAL stt_wait_btn_fadeout__Q33ipl5scene11AddressEditFv + 17 1e6c 004c STB_GLOBAL stt_wait_del_msg_fadein__Q33ipl5scene11AddressEditFv + 18 1eb8 00f0 STB_GLOBAL stt_wait_del_msg_fadeout__Q33ipl5scene11AddressEditFv + 19 1fa8 00c8 STB_GLOBAL stt_wait_delete__Q33ipl5scene11AddressEditFv + 20 2070 0064 STB_GLOBAL stt_wait_del_msg_fadeout_to_rlt__Q33ipl5scene11AddressEditFv + 21 20d4 009c STB_GLOBAL stt_msg_del_rlt__Q33ipl5scene11AddressEditFv + 22 2170 00a0 STB_GLOBAL stt_ipt_wait_fadein__Q33ipl5scene11AddressEditFv + 23 2210 0070 STB_GLOBAL stt_ipt_normal__Q33ipl5scene11AddressEditFv + 24 2280 020c STB_GLOBAL stt_ipt_input__Q33ipl5scene11AddressEditFv + 25 248c 00d8 STB_GLOBAL stt_ipt_wait_fadeout__Q33ipl5scene11AddressEditFv + 26 2564 00bc STB_GLOBAL stt_add_code_fadein__Q33ipl5scene11AddressEditFv + 27 2620 0070 STB_GLOBAL stt_add_code_normal__Q33ipl5scene11AddressEditFv + 28 2690 0354 STB_GLOBAL stt_add_code_input__Q33ipl5scene11AddressEditFv + 29 29e4 0060 STB_GLOBAL stt_msg_code_invalid__Q33ipl5scene11AddressEditFv + 30 2a44 0060 STB_GLOBAL stt_msg_dup_wii_no__Q33ipl5scene11AddressEditFv + 31 2aa4 0060 STB_GLOBAL stt_msg_dup_email__Q33ipl5scene11AddressEditFv + 32 2b04 0060 STB_GLOBAL stt_msg_my_wii_no__Q33ipl5scene11AddressEditFv + 33 2b64 01bc STB_GLOBAL stt_add_code_fadeout__Q33ipl5scene11AddressEditFv + 34 2d20 0084 STB_GLOBAL stt_add_name_fadein__Q33ipl5scene11AddressEditFv + 35 2da4 0070 STB_GLOBAL stt_add_name_normal__Q33ipl5scene11AddressEditFv + 36 2e14 020c STB_GLOBAL stt_add_name_input__Q33ipl5scene11AddressEditFv + 37 3020 035c STB_GLOBAL stt_add_name_fadeout__Q33ipl5scene11AddressEditFv + 38 337c 0084 STB_GLOBAL stt_add_mii_fadein__Q33ipl5scene11AddressEditFv + 39 3400 0070 STB_GLOBAL stt_add_mii_normal__Q33ipl5scene11AddressEditFv + 40 3470 0178 STB_GLOBAL stt_add_mii_input__Q33ipl5scene11AddressEditFv + 41 35e8 0060 STB_GLOBAL stt_msg_no_mii_add__Q33ipl5scene11AddressEditFv + 42 3648 02e8 STB_GLOBAL stt_add_mii_fadeout__Q33ipl5scene11AddressEditFv + 43 3930 004c STB_GLOBAL stt_add_confirm_fadein__Q33ipl5scene11AddressEditFv + 44 397c 0070 STB_GLOBAL stt_add_confirm_normal__Q33ipl5scene11AddressEditFv + 45 39ec 00f8 STB_GLOBAL stt_add_confirm_fadeout__Q33ipl5scene11AddressEditFv + 46 3ae4 00d0 STB_GLOBAL stt_wait_decide_anm_add__Q33ipl5scene11AddressEditFv + 47 3bb4 0024 STB_GLOBAL stt_msg_code_add__Q33ipl5scene11AddressEditFv + 48 3bd8 0024 STB_GLOBAL stt_msg_code_edit__Q33ipl5scene11AddressEditFv + 49 3bfc 0080 STB_GLOBAL stt_msg_no_mii__Q33ipl5scene11AddressEditFv + 50 3c7c 0190 STB_GLOBAL stt_select_mii__Q33ipl5scene11AddressEditFv + 51 3e0c 0068 STB_GLOBAL stt_msg_add_rlt__Q33ipl5scene11AddressEditFv + 52 3e74 010c STB_GLOBAL stt_msg_net__Q33ipl5scene11AddressEditFv + 53 3f80 0084 STB_GLOBAL stt_wait_parental__Q33ipl5scene11AddressEditFv + 54 4004 00e0 STB_GLOBAL stt_wait_parental_dst__Q33ipl5scene11AddressEditFv + 55 40e4 010c STB_GLOBAL stt_msg_wc__Q33ipl5scene11AddressEditFv + 56 41f0 0084 STB_GLOBAL stt_wait_parental_wc__Q33ipl5scene11AddressEditFv + 57 4274 00e0 STB_GLOBAL stt_wait_parental_dst_wc__Q33ipl5scene11AddressEditFv + 58 4354 0024 STB_GLOBAL stt_msg_parental__Q33ipl5scene11AddressEditFv + 59 4378 0024 STB_GLOBAL stt_msg_nwc24_error__Q33ipl5scene11AddressEditFv + 60 439c 0050 STB_GLOBAL stt_msg_no_established__Q33ipl5scene11AddressEditFv + 61 43ec 009c STB_GLOBAL set_textbox__Q33ipl5scene11AddressEditFPQ34nw4r3lyt4PanePCw + 62 4488 00b0 STB_GLOBAL nigaoe_create_callback_edit__Q33ipl5scene11AddressEditFPQ33ipl6nigaoe6ObjectPv + 63 4538 003c STB_GLOBAL getName__Q33ipl6nigaoe6ObjectCFv + 64 4574 00ec STB_GLOBAL nigaoe_create_callback_add__Q33ipl5scene11AddressEditFPQ33ipl6nigaoe6ObjectPv + 65 4660 02d8 STB_GLOBAL start_point_event__Q33ipl5scene11AddressEditFPCcPQ33ipl10controller9Interface + 66 4938 0180 STB_GLOBAL start_left_event__Q33ipl5scene11AddressEditFPCc + 67 4ab8 01c0 STB_GLOBAL start_trig_event__Q33ipl5scene11AddressEditFPCc + 68 4c78 04a4 STB_GLOBAL start_ipt_trig_event__Q33ipl5scene11AddressEditFPCci + 69 511c 0014 STB_GLOBAL __ct__Q43ipl8keyboard7Manager15KeyboardSettingFQ43ipl8keyboard7Manager12KeyboardTypePCwUlUl + 70 5130 0008 STB_GLOBAL getInputForm__Q29textinput7ManagerFv + 71 5138 0164 STB_GLOBAL start_ipt_point_event__Q33ipl5scene11AddressEditFPCci + 72 529c 00f8 STB_GLOBAL start_ipt_left_event__Q33ipl5scene11AddressEditFPCci + 73 5394 0074 STB_GLOBAL get_button_no__Q33ipl5scene11AddressEditFPCc + 74 5408 00ac STB_GLOBAL reset_gui__Q33ipl5scene11AddressEditFv + 75 54b4 0150 STB_GLOBAL add_friendinfo__Q33ipl5scene11AddressEditFv + 76 5604 0150 STB_GLOBAL get_friendinfo__Q33ipl5scene11AddressEditFv + 77 5754 0044 STB_GLOBAL delete_friendinfo__Q33ipl5scene11AddressEditFv + 78 5798 0098 STB_GLOBAL update_friendinfo__Q33ipl5scene11AddressEditFv + 79 5830 0084 STB_GLOBAL utf16_wiiid__Q33ipl5scene11AddressEditFPCw + 80 58b4 00a8 STB_GLOBAL wiiid_utf16__Q33ipl5scene11AddressEditFUxPw + 81 595c 00fc STB_GLOBAL setDefaultTitleText__Q33ipl5scene11AddressEditFPCwb + 82 5a58 085c STB_GLOBAL onEventDerived__Q33ipl5scene11AddressEditFUlUlPCQ33ipl10controller9Interface + 83 62b4 0064 STB_GLOBAL clear__Q43ipl5scene11AddressEdit6StringFv + 84 6318 00dc STB_GLOBAL setEMail__Q43ipl5scene11AddressEdit6StringFPCw + 85 63f4 0124 STB_GLOBAL setWiiNo__Q43ipl5scene11AddressEdit6StringFPCw + 86 6518 008c STB_GLOBAL setName__Q43ipl5scene11AddressEdit6StringFPCw + 87 65a4 0084 STB_GLOBAL isDupCode__Q43ipl5scene11AddressEdit6StringCFv + 88 6628 0068 STB_GLOBAL isMyCode__Q43ipl5scene11AddressEdit6StringCFv + 89 6690 012c STB_GLOBAL set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err + 90 67bc 00e8 STB_GLOBAL onEvent__Q33ipl5scene16AddressEditEventFUlUlPv + 91 68a4 0134 STB_GLOBAL onEvent__Q33ipl5scene17AddressInputEventFUlUlPv + 92 69d8 0008 STB_GLOBAL @20@__dt__Q33ipl5scene11AddressEditFv + 93 69e0 0008 STB_GLOBAL @88@onEventDerived__Q33ipl5scene11AddressEditFUlUlPCQ33ipl10controller9Interface +``` + +### .data + +```text + 0 0000 000d STB_GLOBAL @16959 + 1 000d 000d STB_GLOBAL @16960 + 2 001a 000d STB_GLOBAL @16961 + 3 0027 000e STB_GLOBAL @16962 + 4 0035 000c STB_GLOBAL @16963 + 5 0044 0014 STB_GLOBAL sButtonPaneNames + 6 0058 000e STB_GLOBAL @16964 + 7 0066 000c STB_GLOBAL @23886 + 8 0072 0012 STB_GLOBAL @24207 + 9 0084 001c STB_GLOBAL @24208 + 10 00a0 000f STB_GLOBAL @24209 + 11 00af 0019 STB_GLOBAL @24210 + 12 00c8 000b STB_GLOBAL @24211 + 13 00d3 000b STB_GLOBAL @24212 + 14 00de 000b STB_GLOBAL @24213 + 15 00e9 000c STB_GLOBAL @24214 + 16 00f5 000e STB_GLOBAL @24215 + 17 0103 001a STB_GLOBAL @24216 + 18 011d 001a STB_GLOBAL @24217 + 19 0137 001d STB_GLOBAL @24218 + 20 0154 001e STB_GLOBAL @24219 + 21 0172 000c STB_GLOBAL @24220 + 22 017e 0022 STB_GLOBAL @24221 + 23 01a0 0009 STB_GLOBAL @24222 + 24 01a9 0023 STB_GLOBAL @24223 + 25 01cc 001c STB_GLOBAL @24224 + 26 01e8 000d STB_GLOBAL @24225 + 27 01f5 000d STB_GLOBAL @24226 + 28 0202 000d STB_GLOBAL @24227 + 29 020f 000e STB_GLOBAL @24228 + 30 021d 000e STB_GLOBAL @24229 + 31 022b 000a STB_LOCAL @24231 + 32 0235 0012 STB_LOCAL @24804 + 33 0247 001c STB_LOCAL @24805 + 34 0263 0011 STB_LOCAL @24806 + 35 0274 0022 STB_LOCAL @24807 + 36 0296 000e STB_LOCAL @24808 + 37 02a4 001e STB_LOCAL @24809 + 38 02c2 000a STB_LOCAL @24810 + 39 02cc 001d STB_LOCAL @24811 + 40 02e9 0009 STB_LOCAL @24812 + 41 02f2 001d STB_LOCAL @24813 + 42 030f 0023 STB_LOCAL @24815 + 43 0332 001f STB_LOCAL @24816 + 44 0351 001e STB_LOCAL @24817 + 45 036f 001e STB_LOCAL @24818 + 46 038d 001c STB_LOCAL @24819 + 47 03a9 0010 STB_LOCAL @24820 + 48 03b9 0016 STB_LOCAL @24821 + 49 03cf 000b STB_LOCAL @24822 + 50 03da 0015 STB_LOCAL @24823 + 51 03ef 000e STB_LOCAL @24824 + 52 03fd 0009 STB_LOCAL @24825 + 53 0406 0019 STB_LOCAL @24829 + 54 0420 00c0 STB_LOCAL @25188 + 55 04e0 00c0 STB_LOCAL @25187 + 56 05ad 0016 STB_GLOBAL @25711 + 57 05c3 000f STB_GLOBAL @25835 + 58 05d4 0044 STB_LOCAL @25838 + 59 0628 0058 STB_LOCAL @26007 + 60 0680 008c STB_LOCAL @26006 + 61 070c 000c STB_GLOBAL @26030 + 62 0718 0018 STB_GLOBAL __vt__Q33ipl5scene17AddressInputEvent + 63 0730 0018 STB_GLOBAL __vt__Q33ipl5scene16AddressEditEvent + 64 0748 0088 STB_GLOBAL __vt__Q33ipl5scene11AddressEdit +``` + +### .rodata + +```text + 0 0000 000b STB_GLOBAL specials$18760 + 1 000b 000c STB_GLOBAL @19145 + 2 0017 000c STB_LOCAL @19550 +``` + +### .sdata + +```text + 0 0000 0004 STB_GLOBAL sInputPaneName + 1 0004 0004 STB_GLOBAL lbl_816965E4 + 2 0008 0002 STB_GLOBAL lbl_816965E8 + 3 000a 0006 STB_GLOBAL lbl_816965EA + 4 0010 0008 STB_GLOBAL lbl_816965F0 +``` + +### .sdata2 + +```text + 0 0000 0004 STB_GLOBAL lbl_816947F0 + 1 0004 0004 STB_GLOBAL lbl_816947F4 + 2 0008 0004 STB_GLOBAL lbl_816947F8 + 3 000c 0004 STB_GLOBAL lbl_816947FC + 4 0010 0004 STB_GLOBAL lbl_81694800 + 5 0014 0004 STB_GLOBAL lbl_81694804 +``` + +### .bss + +```text + 0 0000 0140 STB_GLOBAL sFriendInfo__Q23ipl5scene +``` + +## src baseline symbols + +### .text + +```text + 0 0000 0014 STB_GLOBAL __ct__Q43ipl8keyboard7Manager15KeyboardSettingFQ43ipl8keyboard7Manager12KeyboardTypePCwUlUl + 1 0014 00d0 STB_GLOBAL __ct__Q33ipl5scene11AddressEditFPQ23EGG4Heapi + 2 00e4 0058 STB_WEAK __dt__Q33ipl5scene14FaderSceneBaseFv + 3 013c 0098 STB_GLOBAL __dt__Q33ipl5scene11AddressEditFv + 4 01d4 0024 STB_GLOBAL stt_msg_code_add__Q33ipl5scene11AddressEditFv + 5 01f8 0024 STB_GLOBAL stt_msg_code_edit__Q33ipl5scene11AddressEditFv + 6 021c 0024 STB_GLOBAL stt_msg_parental__Q33ipl5scene11AddressEditFv + 7 0240 0024 STB_GLOBAL stt_msg_nwc24_error__Q33ipl5scene11AddressEditFv + 8 0264 00ac STB_GLOBAL reset_gui__Q33ipl5scene11AddressEditFv + 9 0310 0050 STB_GLOBAL stt_msg_no_established__Q33ipl5scene11AddressEditFv + 10 0360 0060 STB_GLOBAL stt_msg_code_invalid__Q33ipl5scene11AddressEditFv + 11 03c0 0060 STB_GLOBAL stt_msg_dup_wii_no__Q33ipl5scene11AddressEditFv + 12 0420 0060 STB_GLOBAL stt_msg_dup_email__Q33ipl5scene11AddressEditFv + 13 0480 0060 STB_GLOBAL stt_msg_my_wii_no__Q33ipl5scene11AddressEditFv + 14 04e0 0060 STB_GLOBAL stt_msg_no_mii_add__Q33ipl5scene11AddressEditFv + 15 0540 0068 STB_GLOBAL stt_msg_add_rlt__Q33ipl5scene11AddressEditFv + 16 05a8 0070 STB_GLOBAL stt_add_code_normal__Q33ipl5scene11AddressEditFv + 17 0618 0070 STB_GLOBAL stt_add_name_normal__Q33ipl5scene11AddressEditFv + 18 0688 0014 STB_GLOBAL getDispCodeLong__Q43ipl5scene11AddressEdit6StringCFv + 19 069c 0064 STB_GLOBAL clear__Q43ipl5scene11AddressEdit6StringFv + 20 0700 0124 STB_GLOBAL setWiiNo__Q43ipl5scene11AddressEdit6StringFPCw + 21 0824 0084 STB_GLOBAL isDupCode__Q43ipl5scene11AddressEdit6StringCFv + 22 08a8 0068 STB_GLOBAL isMyCode__Q43ipl5scene11AddressEdit6StringCFv + 23 0910 004c STB_GLOBAL prepare__Q33ipl5scene11AddressEditFv + 24 095c 0cd0 STB_GLOBAL create__Q33ipl5scene11AddressEditFv + 25 162c 00b0 STB_WEAK __ct__Q33ipl3gui11PaneManagerFPQ23gui12EventHandlerPCQ34nw4r3lyt8DrawInfoPQ23EGG4HeapPQ23EGG9Allocatorb + 26 16dc 0040 STB_WEAK __dt__Q23gui9InterfaceFv + 27 171c 0008 STB_WEAK setManager__Q23gui12EventHandlerFPQ23gui7Manager + 28 1724 05ec STB_GLOBAL stt_wait_decide_anm__Q33ipl5scene11AddressEditFv + 29 1d10 00c8 STB_GLOBAL stt_wait_delete__Q33ipl5scene11AddressEditFv + 30 1dd8 004c STB_GLOBAL stt_add_confirm_fadein__Q33ipl5scene11AddressEditFv + 31 1e24 0084 STB_GLOBAL stt_add_name_fadein__Q33ipl5scene11AddressEditFv + 32 1ea8 0084 STB_GLOBAL stt_add_mii_fadein__Q33ipl5scene11AddressEditFv + 33 1f2c 00bc STB_GLOBAL stt_add_code_fadein__Q33ipl5scene11AddressEditFv + 34 1fe8 020c STB_GLOBAL stt_add_name_input__Q33ipl5scene11AddressEditFv + 35 21f4 0070 STB_GLOBAL stt_add_mii_normal__Q33ipl5scene11AddressEditFv + 36 2264 0178 STB_GLOBAL stt_add_mii_input__Q33ipl5scene11AddressEditFv + 37 23dc 0008 STB_WEAK getChild__Q33ipl5scene4BaseFv + 38 23e4 02e8 STB_GLOBAL stt_add_mii_fadeout__Q33ipl5scene11AddressEditFv + 39 26cc 00d8 STB_GLOBAL stt_ipt_wait_fadeout__Q33ipl5scene11AddressEditFv + 40 27a4 00f0 STB_GLOBAL stt_wait_del_msg_fadeout__Q33ipl5scene11AddressEditFv + 41 2894 0080 STB_GLOBAL stt_msg_no_mii__Q33ipl5scene11AddressEditFv + 42 2914 00f8 STB_GLOBAL stt_add_confirm_fadeout__Q33ipl5scene11AddressEditFv + 43 2a0c 00d0 STB_GLOBAL stt_wait_decide_anm_add__Q33ipl5scene11AddressEditFv + 44 2adc 0070 STB_GLOBAL stt_add_confirm_normal__Q33ipl5scene11AddressEditFv + 45 2b4c 0084 STB_GLOBAL stt_wait_parental__Q33ipl5scene11AddressEditFv + 46 2bd0 0084 STB_GLOBAL stt_wait_parental_wc__Q33ipl5scene11AddressEditFv + 47 2c54 00e0 STB_GLOBAL stt_wait_parental_dst__Q33ipl5scene11AddressEditFv + 48 2d34 00e0 STB_GLOBAL stt_wait_parental_dst_wc__Q33ipl5scene11AddressEditFv + 49 2e14 010c STB_GLOBAL stt_msg_net__Q33ipl5scene11AddressEditFv + 50 2f20 010c STB_GLOBAL stt_msg_wc__Q33ipl5scene11AddressEditFv + 51 302c 0190 STB_GLOBAL stt_select_mii__Q33ipl5scene11AddressEditFv + 52 31bc 009c STB_GLOBAL set_textbox__Q33ipl5scene11AddressEditFPQ34nw4r3lyt4PanePCw + 53 3258 0008 STB_WEAK GetRuntimeTypeInfo__Q34nw4r3lyt4PaneCFv + 54 3260 00fc STB_GLOBAL setDefaultTitleText__Q33ipl5scene11AddressEditFPCwb + 55 335c 00e8 STB_GLOBAL onEvent__Q33ipl5scene16AddressEditEventFUlUlPv + 56 3444 0008 STB_WEAK getPane__Q23gui13PaneComponentFv + 57 344c 0134 STB_GLOBAL onEvent__Q33ipl5scene17AddressInputEventFUlUlPv + 58 3580 00b0 STB_GLOBAL nigaoe_create_callback_edit__Q33ipl5scene11AddressEditFPQ33ipl6nigaoe6ObjectPv + 59 3630 003c STB_WEAK getName__Q33ipl6nigaoe6ObjectCFv + 60 366c 00ec STB_GLOBAL nigaoe_create_callback_add__Q33ipl5scene11AddressEditFPQ33ipl6nigaoe6ObjectPv + 61 3758 0074 STB_GLOBAL calcFadein__Q33ipl5scene11AddressEditFv + 62 37cc 0054 STB_GLOBAL initCalcNormal__Q33ipl5scene11AddressEditFv + 63 3820 0204 STB_GLOBAL calcNormal__Q33ipl5scene11AddressEditFv + 64 3a24 035c STB_GLOBAL stt_add_name_fadeout__Q33ipl5scene11AddressEditFv + 65 3d80 0050 STB_GLOBAL initCalcFadeout__Q33ipl5scene11AddressEditFv + 66 3dd0 0068 STB_GLOBAL calcCommonAfter__Q33ipl5scene11AddressEditFv + 67 3e38 0070 STB_GLOBAL stt_normal__Q33ipl5scene11AddressEditFv + 68 3ea8 004c STB_GLOBAL stt_wait_del_msg_fadein__Q33ipl5scene11AddressEditFv + 69 3ef4 0044 STB_GLOBAL delete_friendinfo__Q33ipl5scene11AddressEditFv + 70 3f38 0084 STB_GLOBAL utf16_wiiid__Q33ipl5scene11AddressEditFPCw + 71 3fbc 00a8 STB_GLOBAL wiiid_utf16__Q33ipl5scene11AddressEditFUxPw + 72 4064 008c STB_GLOBAL setName__Q43ipl5scene11AddressEdit6StringFPCw + 73 40f0 00c0 STB_GLOBAL calcFadeout__Q33ipl5scene11AddressEditFv + 74 41b0 0068 STB_GLOBAL draw__Q33ipl5scene11AddressEditFv + 75 4218 00f4 STB_GLOBAL stt_wait_btn_fadein__Q33ipl5scene11AddressEditFv + 76 430c 0178 STB_GLOBAL stt_wait_btn_fadeout__Q33ipl5scene11AddressEditFv + 77 4484 0064 STB_GLOBAL stt_wait_del_msg_fadeout_to_rlt__Q33ipl5scene11AddressEditFv + 78 44e8 009c STB_GLOBAL stt_msg_del_rlt__Q33ipl5scene11AddressEditFv + 79 4584 00a0 STB_GLOBAL stt_ipt_wait_fadein__Q33ipl5scene11AddressEditFv + 80 4624 0070 STB_GLOBAL stt_ipt_normal__Q33ipl5scene11AddressEditFv + 81 4694 020c STB_GLOBAL stt_ipt_input__Q33ipl5scene11AddressEditFv + 82 48a0 0354 STB_GLOBAL stt_add_code_input__Q33ipl5scene11AddressEditFv + 83 4bf4 01bc STB_GLOBAL stt_add_code_fadeout__Q33ipl5scene11AddressEditFv + 84 4db0 0260 STB_GLOBAL NWC24CheckPublicMailAddr_ + 85 5010 02d8 STB_GLOBAL start_point_event__Q33ipl5scene11AddressEditFPCcPQ33ipl10controller9Interface + 86 52e8 0180 STB_GLOBAL start_left_event__Q33ipl5scene11AddressEditFPCc + 87 5468 01c0 STB_GLOBAL start_trig_event__Q33ipl5scene11AddressEditFPCc + 88 5628 04a4 STB_GLOBAL start_ipt_trig_event__Q33ipl5scene11AddressEditFPCci + 89 5acc 0008 STB_WEAK getInputForm__Q29textinput7ManagerFv + 90 5ad4 0164 STB_GLOBAL start_ipt_point_event__Q33ipl5scene11AddressEditFPCci + 91 5c38 085c STB_GLOBAL onEventDerived__Q33ipl5scene11AddressEditFUlUlPCQ33ipl10controller9Interface + 92 6494 00f8 STB_GLOBAL start_ipt_left_event__Q33ipl5scene11AddressEditFPCci + 93 658c 012c STB_GLOBAL set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err + 94 66b8 0074 STB_GLOBAL get_button_no__Q33ipl5scene11AddressEditFPCc + 95 672c 0150 STB_GLOBAL add_friendinfo__Q33ipl5scene11AddressEditFv + 96 687c 0150 STB_GLOBAL get_friendinfo__Q33ipl5scene11AddressEditFv + 97 69cc 0098 STB_GLOBAL update_friendinfo__Q33ipl5scene11AddressEditFv + 98 6a64 00dc STB_GLOBAL setEMail__Q43ipl5scene11AddressEdit6StringFPCw + 99 6b40 0008 STB_WEAK getLatestEventCtrlNo__Q23gui12EventHandlerFv +100 6b48 0008 STB_WEAK setLatestEventCtrlNo__Q23gui12EventHandlerFi +101 6b50 0008 STB_WEAK getPrev__Q33ipl5scene4BaseFv +102 6b58 0008 STB_WEAK getNext__Q33ipl5scene4BaseFv +103 6b60 0008 STB_WEAK getParent__Q33ipl5scene4BaseFv +104 6b68 0004 STB_WEAK destroy__Q33ipl5scene4BaseFv +105 6b6c 0008 STB_WEAK isResetProcessDone__Q33ipl5scene4BaseFv +106 6b74 0004 STB_WEAK startResetting__Q33ipl5scene4BaseFv +107 6b78 0008 STB_WEAK isResetAcceptable__Q33ipl5scene4BaseCFv +108 6b80 0008 STB_WEAK isReady__Q33ipl5scene4BaseCFv +109 6b88 0004 STB_WEAK calcCommon__Q33ipl5scene14FaderSceneBaseFv +110 6b8c 0004 STB_WEAK draw__Q23gui9InterfaceFRA3_A4_f +111 6b90 0004 STB_WEAK create__Q23gui9InterfaceFv +112 6b94 0054 STB_WEAK changeEventHandler__Q23gui7ManagerFPQ23gui12EventHandler +113 6be8 002c STB_WEAK setEventHandler__Q23gui7ManagerFPQ23gui12EventHandler +114 6c14 0080 STB_WEAK onEvent__Q23gui7ManagerFUlUliPv +115 6c94 0004 STB_WEAK onEvent__Q23gui12EventHandlerFUlUlPv +116 6c98 0008 STB_WEAK update__Q23gui7ManagerFiPC10KPADStatusffPv +117 6ca0 0008 STB_WEAK setDrawInfo__Q23gui11PaneManagerFPCQ34nw4r3lyt8DrawInfo +118 6ca8 0008 STB_WEAK getDrawInfo__Q23gui11PaneManagerFv +119 6cb0 0058 STB_WEAK __dt__Q33ipl3gui11PaneManagerFv +120 6d08 0004 STB_WEAK draw__Q23gui9InterfaceFv +121 6d0c 0004 STB_WEAK calc__Q23gui9InterfaceFv +122 6d10 0004 STB_WEAK init__Q23gui9InterfaceFv +123 6d14 0008 STB_WEAK @20@__dt__Q33ipl5scene11AddressEditFv +124 6d1c 0008 STB_WEAK @88@onEventDerived__Q33ipl5scene11AddressEditFUlUlPCQ33ipl10controller9Interface +``` + +### .data + +```text + 0 0000 0000 STB_LOCAL ...data.0 + 1 0000 000d STB_LOCAL @17047 + 2 000d 000d STB_LOCAL @17048 + 3 001a 000d STB_LOCAL @17049 + 4 0027 000e STB_LOCAL @17050 + 5 0035 000c STB_LOCAL @17051 + 6 0044 0014 STB_LOCAL sButtonPaneNames + 7 0058 000e STB_LOCAL @17052 + 8 0066 000c STB_LOCAL @24446 + 9 0072 0012 STB_LOCAL @24755 + 10 0084 001c STB_LOCAL @24756 + 11 00a0 000f STB_LOCAL @24757 + 12 00af 0019 STB_LOCAL @24758 + 13 00c8 000b STB_LOCAL @24759 + 14 00d3 000b STB_LOCAL @24760 + 15 00de 000b STB_LOCAL @24761 + 16 00e9 000c STB_LOCAL @24762 + 17 00f5 000e STB_LOCAL @24763 + 18 0103 001a STB_LOCAL @24764 + 19 011d 001a STB_LOCAL @24765 + 20 0137 001d STB_LOCAL @24766 + 21 0154 001e STB_LOCAL @24767 + 22 0172 000c STB_LOCAL @24768 + 23 017e 0022 STB_LOCAL @24769 + 24 01a0 0009 STB_LOCAL @24770 + 25 01a9 0023 STB_LOCAL @24771 + 26 01cc 001c STB_LOCAL @24772 + 27 01e8 000d STB_LOCAL @24773 + 28 01f5 000d STB_LOCAL @24774 + 29 0202 000d STB_LOCAL @24775 + 30 020f 000e STB_LOCAL @24776 + 31 021d 000e STB_LOCAL @24777 + 32 022b 000a STB_LOCAL @24779 + 33 0235 0012 STB_LOCAL @24780 + 34 0247 001c STB_LOCAL @24781 + 35 0263 0011 STB_LOCAL @24782 + 36 0274 0022 STB_LOCAL @24783 + 37 0296 000e STB_LOCAL @24784 + 38 02a4 001e STB_LOCAL @24785 + 39 02c2 000a STB_LOCAL @24786 + 40 02cc 001d STB_LOCAL @24787 + 41 02e9 0009 STB_LOCAL @24788 + 42 02f2 001d STB_LOCAL @24789 + 43 030f 0023 STB_LOCAL @24791 + 44 0332 001f STB_LOCAL @24792 + 45 0351 001e STB_LOCAL @24793 + 46 036f 001e STB_LOCAL @24794 + 47 038d 001c STB_LOCAL @24795 + 48 03a9 0010 STB_LOCAL @24796 + 49 03b9 0016 STB_LOCAL @24797 + 50 03cf 000b STB_LOCAL @24798 + 51 03da 0015 STB_LOCAL @24799 + 52 03ef 000e STB_LOCAL @24800 + 53 03fd 0009 STB_LOCAL @24801 + 54 0406 0019 STB_LOCAL @24804 + 55 0420 00c0 STB_LOCAL @25770 + 56 04e0 00c0 STB_LOCAL @25769 + 57 05a0 000d STB_LOCAL @25906 + 58 05ad 0016 STB_LOCAL @26437 + 59 05c3 000f STB_LOCAL @26493 + 60 05d4 0044 STB_LOCAL @26572 + 61 0618 000f STB_LOCAL @26733 + 62 0628 0058 STB_LOCAL @26737 + 63 0680 008c STB_LOCAL @26736 + 64 070c 000c STB_LOCAL @26760 + 65 0718 0018 STB_GLOBAL __vt__Q33ipl5scene17AddressInputEvent + 66 0730 0018 STB_GLOBAL __vt__Q33ipl5scene16AddressEditEvent + 67 0748 0088 STB_GLOBAL __vt__Q33ipl5scene11AddressEdit + 68 07d0 005c STB_WEAK __vt__Q33ipl3gui11PaneManager + 69 082c 0018 STB_WEAK __vt__Q23gui12EventHandler + 70 0844 0020 STB_WEAK __vt__Q23gui9Interface +``` + +### .rodata + +```text + 0 0000 000b STB_LOCAL specials$18951 + 1 000b 000c STB_LOCAL @19329 + 2 0017 000c STB_LOCAL @19521 +``` + +### .sdata + +```text + 0 0000 0004 STB_LOCAL sInputPaneName + 1 0004 0004 STB_LOCAL @24754 + 2 0008 0002 STB_LOCAL @24778 + 3 000a 0006 STB_LOCAL @24790 + 4 0010 0008 STB_LOCAL @26820 +``` + +### .sdata2 + +```text + 0 0000 0004 STB_LOCAL @24802 + 1 0004 0004 STB_LOCAL @24803 + 2 0008 0004 STB_LOCAL @24805 + 3 000c 0004 STB_LOCAL @26438 + 4 0010 0004 STB_LOCAL @26439 + 5 0014 0004 STB_LOCAL @26440 +``` + +### .bss + +```text + 0 0000 0140 STB_GLOBAL sFriendInfo__Q23ipl5scene +``` + +## Trial 1: target definition order + +Moved the 90 explicit target definitions into target order. Kept the four existing fully inlined helper bodies, the three scoped pragmas, class definitions and global declarations unchanged. Parser verifies the complete multiset of all 95 original function definitions is unchanged. First compile found a namespace global in the old inter-function declarations; retained those declarations before the ordered functions and rebuilt. + +Fresh object: 94/94 exact-name functions, code 27112/27112, data 2560/2560, every owned data section 100%. Pool IDENTICAL at 57/57 strings. Read .symtab after the move, including weak functions: retained getInputForm appears immediately before KeyboardSetting constructor, opposite the target. .data positions, string bytes, switch tables and vtable positions remain unchanged; target excludes three deduplicated weak vtables and two embedded string labels. .rodata/.sdata/.sdata2/.bss positions and sizes remain unchanged. Generated label numbers and ELF binding are metadata. + +Enabled Matching and ran full build: checksum fails with SHA1 ae060041ddf60a926d5056b589db11fbac35ac21. doldiff finds only 25 differing bytes: swapped constructor/getInputForm bodies, two caller relocations, and two getInputForm vtable slots. Raw evidence /tmp/sol-l1-trial1-doldiff.log. + +## Trial 2: delay the existing getter definition + +Extend the existing tiManager.h declaration guard to IPL_ADDRESS_EDIT_CPP. Move its unchanged body to an out-of-class inline definition immediately after KeyboardSetting, before start_ipt_point_event. This keeps weak binding, preserves the existing body, and affects only this translation unit. No caller body or instruction edits. + +Trial 2 result: target function order now identical, all 94 functions still exact, data 2560/2560, pool IDENTICAL 57/57. All 1027 other source objects retain baseline SHA256. Full link leaves exactly 3 differing bytes, all in get_button_no. The target relocations at function offsets 0x16 HA / 0x1e LO both point to sButtonPaneNames; current source points to smButtonName__Q33ipl5scene6Button. Retail instructions materialize 0x81647F24, current DOL materializes 0x8164BF5C. This predates this task and is invisible to instruction-exact scoring. Reordering cannot correct that relocation identity. Required one-line correction is in /tmp/sol-l1-table-reference.patch. Await task-scope clarification because user explicitly requires no changes inside function bodies. + +## Trial 2 symbol placement + +### .text + +```text + 0 0000 0260 STB_GLOBAL NWC24CheckPublicMailAddr_ + 1 0260 00d0 STB_GLOBAL __ct__Q33ipl5scene11AddressEditFPQ23EGG4Heapi + 2 0330 0058 STB_WEAK __dt__Q33ipl5scene14FaderSceneBaseFv + 3 0388 0098 STB_GLOBAL __dt__Q33ipl5scene11AddressEditFv + 4 0420 004c STB_GLOBAL prepare__Q33ipl5scene11AddressEditFv + 5 046c 0cd0 STB_GLOBAL create__Q33ipl5scene11AddressEditFv + 6 113c 00b0 STB_WEAK __ct__Q33ipl3gui11PaneManagerFPQ23gui12EventHandlerPCQ34nw4r3lyt8DrawInfoPQ23EGG4HeapPQ23EGG9Allocatorb + 7 11ec 0040 STB_WEAK __dt__Q23gui9InterfaceFv + 8 122c 0008 STB_WEAK setManager__Q23gui12EventHandlerFPQ23gui7Manager + 9 1234 0074 STB_GLOBAL calcFadein__Q33ipl5scene11AddressEditFv + 10 12a8 0054 STB_GLOBAL initCalcNormal__Q33ipl5scene11AddressEditFv + 11 12fc 0204 STB_GLOBAL calcNormal__Q33ipl5scene11AddressEditFv + 12 1500 0050 STB_GLOBAL initCalcFadeout__Q33ipl5scene11AddressEditFv + 13 1550 00c0 STB_GLOBAL calcFadeout__Q33ipl5scene11AddressEditFv + 14 1610 0068 STB_GLOBAL calcCommonAfter__Q33ipl5scene11AddressEditFv + 15 1678 0068 STB_GLOBAL draw__Q33ipl5scene11AddressEditFv + 16 16e0 0070 STB_GLOBAL stt_normal__Q33ipl5scene11AddressEditFv + 17 1750 05ec STB_GLOBAL stt_wait_decide_anm__Q33ipl5scene11AddressEditFv + 18 1d3c 0014 STB_GLOBAL getDispCodeLong__Q43ipl5scene11AddressEdit6StringCFv + 19 1d50 00f4 STB_GLOBAL stt_wait_btn_fadein__Q33ipl5scene11AddressEditFv + 20 1e44 0178 STB_GLOBAL stt_wait_btn_fadeout__Q33ipl5scene11AddressEditFv + 21 1fbc 004c STB_GLOBAL stt_wait_del_msg_fadein__Q33ipl5scene11AddressEditFv + 22 2008 00f0 STB_GLOBAL stt_wait_del_msg_fadeout__Q33ipl5scene11AddressEditFv + 23 20f8 00c8 STB_GLOBAL stt_wait_delete__Q33ipl5scene11AddressEditFv + 24 21c0 0064 STB_GLOBAL stt_wait_del_msg_fadeout_to_rlt__Q33ipl5scene11AddressEditFv + 25 2224 009c STB_GLOBAL stt_msg_del_rlt__Q33ipl5scene11AddressEditFv + 26 22c0 00a0 STB_GLOBAL stt_ipt_wait_fadein__Q33ipl5scene11AddressEditFv + 27 2360 0070 STB_GLOBAL stt_ipt_normal__Q33ipl5scene11AddressEditFv + 28 23d0 020c STB_GLOBAL stt_ipt_input__Q33ipl5scene11AddressEditFv + 29 25dc 00d8 STB_GLOBAL stt_ipt_wait_fadeout__Q33ipl5scene11AddressEditFv + 30 26b4 00bc STB_GLOBAL stt_add_code_fadein__Q33ipl5scene11AddressEditFv + 31 2770 0070 STB_GLOBAL stt_add_code_normal__Q33ipl5scene11AddressEditFv + 32 27e0 0354 STB_GLOBAL stt_add_code_input__Q33ipl5scene11AddressEditFv + 33 2b34 0060 STB_GLOBAL stt_msg_code_invalid__Q33ipl5scene11AddressEditFv + 34 2b94 0060 STB_GLOBAL stt_msg_dup_wii_no__Q33ipl5scene11AddressEditFv + 35 2bf4 0060 STB_GLOBAL stt_msg_dup_email__Q33ipl5scene11AddressEditFv + 36 2c54 0060 STB_GLOBAL stt_msg_my_wii_no__Q33ipl5scene11AddressEditFv + 37 2cb4 01bc STB_GLOBAL stt_add_code_fadeout__Q33ipl5scene11AddressEditFv + 38 2e70 0084 STB_GLOBAL stt_add_name_fadein__Q33ipl5scene11AddressEditFv + 39 2ef4 0070 STB_GLOBAL stt_add_name_normal__Q33ipl5scene11AddressEditFv + 40 2f64 020c STB_GLOBAL stt_add_name_input__Q33ipl5scene11AddressEditFv + 41 3170 035c STB_GLOBAL stt_add_name_fadeout__Q33ipl5scene11AddressEditFv + 42 34cc 0084 STB_GLOBAL stt_add_mii_fadein__Q33ipl5scene11AddressEditFv + 43 3550 0070 STB_GLOBAL stt_add_mii_normal__Q33ipl5scene11AddressEditFv + 44 35c0 0178 STB_GLOBAL stt_add_mii_input__Q33ipl5scene11AddressEditFv + 45 3738 0008 STB_WEAK getChild__Q33ipl5scene4BaseFv + 46 3740 0060 STB_GLOBAL stt_msg_no_mii_add__Q33ipl5scene11AddressEditFv + 47 37a0 02e8 STB_GLOBAL stt_add_mii_fadeout__Q33ipl5scene11AddressEditFv + 48 3a88 004c STB_GLOBAL stt_add_confirm_fadein__Q33ipl5scene11AddressEditFv + 49 3ad4 0070 STB_GLOBAL stt_add_confirm_normal__Q33ipl5scene11AddressEditFv + 50 3b44 00f8 STB_GLOBAL stt_add_confirm_fadeout__Q33ipl5scene11AddressEditFv + 51 3c3c 00d0 STB_GLOBAL stt_wait_decide_anm_add__Q33ipl5scene11AddressEditFv + 52 3d0c 0024 STB_GLOBAL stt_msg_code_add__Q33ipl5scene11AddressEditFv + 53 3d30 0024 STB_GLOBAL stt_msg_code_edit__Q33ipl5scene11AddressEditFv + 54 3d54 0080 STB_GLOBAL stt_msg_no_mii__Q33ipl5scene11AddressEditFv + 55 3dd4 0190 STB_GLOBAL stt_select_mii__Q33ipl5scene11AddressEditFv + 56 3f64 0068 STB_GLOBAL stt_msg_add_rlt__Q33ipl5scene11AddressEditFv + 57 3fcc 010c STB_GLOBAL stt_msg_net__Q33ipl5scene11AddressEditFv + 58 40d8 0084 STB_GLOBAL stt_wait_parental__Q33ipl5scene11AddressEditFv + 59 415c 00e0 STB_GLOBAL stt_wait_parental_dst__Q33ipl5scene11AddressEditFv + 60 423c 010c STB_GLOBAL stt_msg_wc__Q33ipl5scene11AddressEditFv + 61 4348 0084 STB_GLOBAL stt_wait_parental_wc__Q33ipl5scene11AddressEditFv + 62 43cc 00e0 STB_GLOBAL stt_wait_parental_dst_wc__Q33ipl5scene11AddressEditFv + 63 44ac 0024 STB_GLOBAL stt_msg_parental__Q33ipl5scene11AddressEditFv + 64 44d0 0024 STB_GLOBAL stt_msg_nwc24_error__Q33ipl5scene11AddressEditFv + 65 44f4 0050 STB_GLOBAL stt_msg_no_established__Q33ipl5scene11AddressEditFv + 66 4544 009c STB_GLOBAL set_textbox__Q33ipl5scene11AddressEditFPQ34nw4r3lyt4PanePCw + 67 45e0 0008 STB_WEAK GetRuntimeTypeInfo__Q34nw4r3lyt4PaneCFv + 68 45e8 00b0 STB_GLOBAL nigaoe_create_callback_edit__Q33ipl5scene11AddressEditFPQ33ipl6nigaoe6ObjectPv + 69 4698 003c STB_WEAK getName__Q33ipl6nigaoe6ObjectCFv + 70 46d4 00ec STB_GLOBAL nigaoe_create_callback_add__Q33ipl5scene11AddressEditFPQ33ipl6nigaoe6ObjectPv + 71 47c0 02d8 STB_GLOBAL start_point_event__Q33ipl5scene11AddressEditFPCcPQ33ipl10controller9Interface + 72 4a98 0180 STB_GLOBAL start_left_event__Q33ipl5scene11AddressEditFPCc + 73 4c18 01c0 STB_GLOBAL start_trig_event__Q33ipl5scene11AddressEditFPCc + 74 4dd8 04a4 STB_GLOBAL start_ipt_trig_event__Q33ipl5scene11AddressEditFPCci + 75 527c 0014 STB_GLOBAL __ct__Q43ipl8keyboard7Manager15KeyboardSettingFQ43ipl8keyboard7Manager12KeyboardTypePCwUlUl + 76 5290 0008 STB_WEAK getInputForm__Q29textinput7ManagerFv + 77 5298 0164 STB_GLOBAL start_ipt_point_event__Q33ipl5scene11AddressEditFPCci + 78 53fc 00f8 STB_GLOBAL start_ipt_left_event__Q33ipl5scene11AddressEditFPCci + 79 54f4 0074 STB_GLOBAL get_button_no__Q33ipl5scene11AddressEditFPCc + 80 5568 00ac STB_GLOBAL reset_gui__Q33ipl5scene11AddressEditFv + 81 5614 0150 STB_GLOBAL add_friendinfo__Q33ipl5scene11AddressEditFv + 82 5764 0150 STB_GLOBAL get_friendinfo__Q33ipl5scene11AddressEditFv + 83 58b4 0044 STB_GLOBAL delete_friendinfo__Q33ipl5scene11AddressEditFv + 84 58f8 0098 STB_GLOBAL update_friendinfo__Q33ipl5scene11AddressEditFv + 85 5990 0084 STB_GLOBAL utf16_wiiid__Q33ipl5scene11AddressEditFPCw + 86 5a14 00a8 STB_GLOBAL wiiid_utf16__Q33ipl5scene11AddressEditFUxPw + 87 5abc 00fc STB_GLOBAL setDefaultTitleText__Q33ipl5scene11AddressEditFPCwb + 88 5bb8 085c STB_GLOBAL onEventDerived__Q33ipl5scene11AddressEditFUlUlPCQ33ipl10controller9Interface + 89 6414 0008 STB_WEAK getPane__Q23gui13PaneComponentFv + 90 641c 0064 STB_GLOBAL clear__Q43ipl5scene11AddressEdit6StringFv + 91 6480 00dc STB_GLOBAL setEMail__Q43ipl5scene11AddressEdit6StringFPCw + 92 655c 0124 STB_GLOBAL setWiiNo__Q43ipl5scene11AddressEdit6StringFPCw + 93 6680 008c STB_GLOBAL setName__Q43ipl5scene11AddressEdit6StringFPCw + 94 670c 0084 STB_GLOBAL isDupCode__Q43ipl5scene11AddressEdit6StringCFv + 95 6790 0068 STB_GLOBAL isMyCode__Q43ipl5scene11AddressEdit6StringCFv + 96 67f8 012c STB_GLOBAL set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err + 97 6924 00e8 STB_GLOBAL onEvent__Q33ipl5scene16AddressEditEventFUlUlPv + 98 6a0c 0134 STB_GLOBAL onEvent__Q33ipl5scene17AddressInputEventFUlUlPv + 99 6b40 0008 STB_WEAK getLatestEventCtrlNo__Q23gui12EventHandlerFv +100 6b48 0008 STB_WEAK setLatestEventCtrlNo__Q23gui12EventHandlerFi +101 6b50 0008 STB_WEAK getPrev__Q33ipl5scene4BaseFv +102 6b58 0008 STB_WEAK getNext__Q33ipl5scene4BaseFv +103 6b60 0008 STB_WEAK getParent__Q33ipl5scene4BaseFv +104 6b68 0004 STB_WEAK destroy__Q33ipl5scene4BaseFv +105 6b6c 0008 STB_WEAK isResetProcessDone__Q33ipl5scene4BaseFv +106 6b74 0004 STB_WEAK startResetting__Q33ipl5scene4BaseFv +107 6b78 0008 STB_WEAK isResetAcceptable__Q33ipl5scene4BaseCFv +108 6b80 0008 STB_WEAK isReady__Q33ipl5scene4BaseCFv +109 6b88 0004 STB_WEAK calcCommon__Q33ipl5scene14FaderSceneBaseFv +110 6b8c 0004 STB_WEAK draw__Q23gui9InterfaceFRA3_A4_f +111 6b90 0004 STB_WEAK create__Q23gui9InterfaceFv +112 6b94 0054 STB_WEAK changeEventHandler__Q23gui7ManagerFPQ23gui12EventHandler +113 6be8 002c STB_WEAK setEventHandler__Q23gui7ManagerFPQ23gui12EventHandler +114 6c14 0080 STB_WEAK onEvent__Q23gui7ManagerFUlUliPv +115 6c94 0004 STB_WEAK onEvent__Q23gui12EventHandlerFUlUlPv +116 6c98 0008 STB_WEAK update__Q23gui7ManagerFiPC10KPADStatusffPv +117 6ca0 0008 STB_WEAK setDrawInfo__Q23gui11PaneManagerFPCQ34nw4r3lyt8DrawInfo +118 6ca8 0008 STB_WEAK getDrawInfo__Q23gui11PaneManagerFv +119 6cb0 0058 STB_WEAK __dt__Q33ipl3gui11PaneManagerFv +120 6d08 0004 STB_WEAK draw__Q23gui9InterfaceFv +121 6d0c 0004 STB_WEAK calc__Q23gui9InterfaceFv +122 6d10 0004 STB_WEAK init__Q23gui9InterfaceFv +123 6d14 0008 STB_WEAK @20@__dt__Q33ipl5scene11AddressEditFv +124 6d1c 0008 STB_WEAK @88@onEventDerived__Q33ipl5scene11AddressEditFUlUlPCQ33ipl10controller9Interface +``` + +### .data + +```text + 0 0000 0000 STB_LOCAL ...data.0 + 1 0000 000d STB_LOCAL @17043 + 2 000d 000d STB_LOCAL @17044 + 3 001a 000d STB_LOCAL @17045 + 4 0027 000e STB_LOCAL @17046 + 5 0035 000c STB_LOCAL @17047 + 6 0044 0014 STB_LOCAL sButtonPaneNames + 7 0058 000e STB_LOCAL @17048 + 8 0066 000c STB_LOCAL @23864 + 9 0072 0012 STB_LOCAL @24173 + 10 0084 001c STB_LOCAL @24174 + 11 00a0 000f STB_LOCAL @24175 + 12 00af 0019 STB_LOCAL @24176 + 13 00c8 000b STB_LOCAL @24177 + 14 00d3 000b STB_LOCAL @24178 + 15 00de 000b STB_LOCAL @24179 + 16 00e9 000c STB_LOCAL @24180 + 17 00f5 000e STB_LOCAL @24181 + 18 0103 001a STB_LOCAL @24182 + 19 011d 001a STB_LOCAL @24183 + 20 0137 001d STB_LOCAL @24184 + 21 0154 001e STB_LOCAL @24185 + 22 0172 000c STB_LOCAL @24186 + 23 017e 0022 STB_LOCAL @24187 + 24 01a0 0009 STB_LOCAL @24188 + 25 01a9 0023 STB_LOCAL @24189 + 26 01cc 001c STB_LOCAL @24190 + 27 01e8 000d STB_LOCAL @24191 + 28 01f5 000d STB_LOCAL @24192 + 29 0202 000d STB_LOCAL @24193 + 30 020f 000e STB_LOCAL @24194 + 31 021d 000e STB_LOCAL @24195 + 32 022b 000a STB_LOCAL @24197 + 33 0235 0012 STB_LOCAL @24198 + 34 0247 001c STB_LOCAL @24199 + 35 0263 0011 STB_LOCAL @24200 + 36 0274 0022 STB_LOCAL @24201 + 37 0296 000e STB_LOCAL @24202 + 38 02a4 001e STB_LOCAL @24203 + 39 02c2 000a STB_LOCAL @24204 + 40 02cc 001d STB_LOCAL @24205 + 41 02e9 0009 STB_LOCAL @24206 + 42 02f2 001d STB_LOCAL @24207 + 43 030f 0023 STB_LOCAL @24209 + 44 0332 001f STB_LOCAL @24210 + 45 0351 001e STB_LOCAL @24211 + 46 036f 001e STB_LOCAL @24212 + 47 038d 001c STB_LOCAL @24213 + 48 03a9 0010 STB_LOCAL @24214 + 49 03b9 0016 STB_LOCAL @24215 + 50 03cf 000b STB_LOCAL @24216 + 51 03da 0015 STB_LOCAL @24217 + 52 03ef 000e STB_LOCAL @24218 + 53 03fd 0009 STB_LOCAL @24219 + 54 0406 0019 STB_LOCAL @24222 + 55 0420 00c0 STB_LOCAL @24337 + 56 04e0 00c0 STB_LOCAL @24336 + 57 05a0 000d STB_LOCAL @25300 + 58 05ad 0016 STB_LOCAL @25856 + 59 05c3 000f STB_LOCAL @25912 + 60 05d4 0044 STB_LOCAL @25991 + 61 0618 000f STB_LOCAL @26282 + 62 0628 0058 STB_LOCAL @26286 + 63 0680 008c STB_LOCAL @26285 + 64 070c 000c STB_LOCAL @26342 + 65 0718 0018 STB_GLOBAL __vt__Q33ipl5scene17AddressInputEvent + 66 0730 0018 STB_GLOBAL __vt__Q33ipl5scene16AddressEditEvent + 67 0748 0088 STB_GLOBAL __vt__Q33ipl5scene11AddressEdit + 68 07d0 005c STB_WEAK __vt__Q33ipl3gui11PaneManager + 69 082c 0018 STB_WEAK __vt__Q23gui12EventHandler + 70 0844 0020 STB_WEAK __vt__Q23gui9Interface +``` + +### .rodata + +```text + 0 0000 000b STB_LOCAL specials$17132 + 1 000b 000c STB_LOCAL @19121 + 2 0017 000c STB_LOCAL @19153 +``` + +### .sdata + +```text + 0 0000 0004 STB_LOCAL sInputPaneName + 1 0004 0004 STB_LOCAL @24172 + 2 0008 0002 STB_LOCAL @24196 + 3 000a 0006 STB_LOCAL @24208 + 4 0010 0008 STB_LOCAL @26294 +``` + +### .sdata2 + +```text + 0 0000 0004 STB_LOCAL @24220 + 1 0004 0004 STB_LOCAL @24221 + 2 0008 0004 STB_LOCAL @24223 + 3 000c 0004 STB_LOCAL @25857 + 4 0010 0004 STB_LOCAL @25858 + 5 0014 0004 STB_LOCAL @25859 +``` + +### .bss + +```text + 0 0000 0140 STB_GLOBAL sFriendInfo__Q23ipl5scene +``` + +## Pending-scope safe state + +Retain the verified definition-order change and unchanged weak-inline relocation. Restore only the Matching flag while the single required body correction awaits authorization; current DOL must remain valid. The link task remains incomplete until that correction is allowed and the Matching/full-DOL gate passes. Run the requested quick gate on this safe state before local preservation. + +## Safe-state verification + +All 94 ctxdiff audits have identical sizes and instruction counts with diffs 0; evidence /tmp/sol-l1-ctxdiff.txt. All 95 pre-existing function definition blocks remain byte-identical. The sole added source definition is the existing getter body moved from the header. All 1027 unowned source objects are byte-identical to baseline, and all 1027 unowned live report unit entries are unchanged. Final symbol order includes every target function, including both retained weak functions and the two thunks, in original order. + +The required quick gate passes on the safe NonMatching state. This preserves code/data exactness and the original DOL while the link goal awaits the requested scope exception. Do not accept this as a completed link: complete_code remains zero. To finish, authorize/apply /tmp/sol-l1-table-reference.patch, flip only the AddressEdit Object entry to Matching, rerun the full build, pool, exact-name report, ctxdiff and final gate. Expected complete_code 27112 and complete_data 2560. No push, PR, merge, rebase, or other-worktree edit performed. + +```text +full build: ok +main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d +[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 0 +[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 +regressions vs baseline: 0 +global matched_code_percent: 98.05994 -> 98.05994 +global fuzzy_match_percent: 99.91572 -> 99.91572 +global complete_code_percent: 89.90470 -> 89.90470 +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 +``` + +## Round b: approved table correction and link + +User approved the get_button_no table correction and explicitly authorized rebase. +Fetched origin under /tmp/wii-git.lock and rebased 6a0c7424 onto ca6529e6. +Replayed definition-order commit is 52efc64f. Resolved the set_textbox conflict +by retaining its earlier definition position. Removed both file-static balloon +margin helpers and retained main's TextBalloon::getDefaultMargin16x9/4x3 calls. +The TextBalloon header is unchanged from origin/main. + +Changed get_button_no to sButtonPaneNames. Retained the external Button table +declaration needed by setDefaultTitleText. This corrects the HA/LO relocation +identity recorded in trial 2. Enabled Matching only for iplAddressEdit. +No earlier body, compiler-flag or declaration-order experiments repeated. +Required verification: full 43U build, expected DOL SHA1, identical pool, +94/94 exact-name scores and zero-diff ctxdiff, all owned sections exact, +27112 linked code bytes, 2560 linked data bytes, final requested quick gate. + +First full build rejected removal of the external Button table declaration: +setDefaultTitleText still uses index 5. Restored that declaration without +changing its caller. The approved get_button_no correction remains in place. +Build evidence: /tmp/sol-l1-round-b-build.log. + +Full build passed on the linked candidate. DOL SHA1 is +26116613f624061ba99c8d1a299aaa6efa85670d. Live report has 94/94 exact-name +functions, 27112/27112 matched and linked code bytes, 2560/2560 matched and +linked data bytes, and 100% for every owned section. Pool is identical at +57/57 strings, including byte offsets. Both object files now reference +sButtonPaneNames at get_button_no offsets 0x16 and 0x1e with zero addends. +Successful build evidence: /tmp/sol-l1-round-b-build2.log. + +All 94 target functions passed ctxdiff with equal sizes and instruction +counts and diffs 0. Evidence: /tmp/sol-l1-round-b-ctxdiff.txt. +The requested quick gate passed with zero regressions, forbidden additions +and readability warnings. Final round-b source diff from rebased HEAD is +one table reference and one Matching flag. All rebase changes retain the +previous definition order and main's TextBalloon getter calls. + +```text +full build: ok +main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d +[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 +regressions vs baseline: 0 +global matched_code_percent: 98.09787 -> 98.09787 +global fuzzy_match_percent: 99.92176 -> 99.92176 +global complete_code_percent: 90.12492 -> 91.03011 +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 +note: config touched: configure.py (orchestrator reviews every config/symbols change) +GATE PASS +``` -- 2.49.1