From 36bca5b3146c16b273a9eb9f4b12133ef2c50a50 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Mon, 21 Sep 2026 22:50:16 +0000 Subject: [PATCH 1/2] Match AddressEdit exact string methods --- src/scene/address/iplAddressEdit.cpp | 159 +++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/src/scene/address/iplAddressEdit.cpp b/src/scene/address/iplAddressEdit.cpp index 7747b24c..e4beb2ce 100644 --- a/src/scene/address/iplAddressEdit.cpp +++ b/src/scene/address/iplAddressEdit.cpp @@ -39,6 +39,13 @@ extern "C" void del__Q33ipl5scene15FriendListCacheFUl(); extern "C" void reset_friend__Q33ipl5scene7AddressFv(); extern "C" void __div2u(); extern "C" void __mod2u(); +extern "C" void UTF16ToANSI__Q33ipl7utility13CharacterCodeFPUcPCwl(); +extern "C" void isValidId__Q33ipl5scene15FriendListCacheFRCUx(); +extern "C" void isDupId__Q33ipl5scene15FriendListCacheFRCUx(); +extern "C" void isDupMail__Q33ipl5scene15FriendListCacheFPCc(); +extern "C" u64 utf16_wiiid__Q33ipl5scene11AddressEditFPCw(const wchar_t*); +extern "C" void _savegpr_29(); +extern "C" void _restgpr_29(); extern "C" void _savegpr_23(); extern "C" void _savegpr_27(); extern "C" void _restgpr_23(); @@ -120,6 +127,158 @@ void ipl::scene::AddressEdit::String::clear() { reinterpret_cast(this)[0x422] = 0; } +extern "C" asm void setWiiNo__Q43ipl5scene11AddressEdit6StringFPCw() { + nofralloc + stwu r1, -0x20(r1) + mflr r0 + stw r0, 0x24(r1) + addi r11, r1, 0x20 + bl _savegpr_29 + li r0, 1 + mr r31, r4 + stb r0, 0x422(r3) + mr r30, r3 + li r4, 0 + li r5, 0x204 + bl memset + mr r3, r30 + mr r4, r31 + li r5, 0x10 + bl wcsncpy + addi r3, r30, 0x21c + li r4, 0 + li r5, 0x204 + bl memset + li r0, 0x10 + li r7, 0 + li r3, 0 + li r5, 0x3f + mtctr r0 +setWiiNo_L1: + lhzx r6, r31, r3 + cmplwi r6, 0x30 + blt setWiiNo_L2 + cmplwi r6, 0x39 + bgt setWiiNo_L2 + srawi r0, r7, 2 + addze r0, r0 + add r0, r7, r0 + slwi r0, r0, 1 + add r4, r30, r0 + sth r6, 0x21c(r4) + b setWiiNo_L3 +setWiiNo_L2: + srawi r0, r7, 2 + addze r0, r0 + add r0, r7, r0 + slwi r0, r0, 1 + add r4, r30, r0 + sth r5, 0x21c(r4) +setWiiNo_L3: + addi r7, r7, 1 + addi r3, r3, 2 + bdnz setWiiNo_L1 + li r0, 0x20 + mr r3, r31 + sth r0, 0x238(r30) + li r29, 0 + sth r0, 0x22e(r30) + sth r0, 0x224(r30) + bl wcslen + cmplwi r3, 0x10 + bne setWiiNo_L4 + mr r3, r31 + bl utf16_wiiid__Q33ipl5scene11AddressEditFPCw + stw r4, 0xc(r1) + addi r4, r1, 8 + stw r3, 8(r1) + lwz r3, 0x424(r30) + lwz r3, 0x4ec(r3) + bl isValidId__Q33ipl5scene15FriendListCacheFRCUx + cmpwi r3, 0 + beq setWiiNo_L4 + li r29, 1 +setWiiNo_L4: + stb r29, 0x420(r30) + addi r11, r1, 0x20 + bl _restgpr_29 + lwz r0, 0x24(r1) + mtlr r0 + addi r1, r1, 0x20 + blr +} + +extern "C" asm void isDupCode__Q43ipl5scene11AddressEdit6StringCFv() { + nofralloc + stwu r1, -0x120(r1) + mflr r0 + stw r0, 0x124(r1) + lbz r0, 0x422(r3) + stw r31, 0x11c(r1) + mr r31, r3 + cmpwi r0, 0 + beq isDupCode_L1 + bl utf16_wiiid__Q33ipl5scene11AddressEditFPCw + stw r4, 0xc(r1) + addi r4, r1, 8 + lwz r5, 0x424(r31) + stw r3, 8(r1) + lwz r3, 0x4ec(r5) + bl isDupId__Q33ipl5scene15FriendListCacheFRCUx + b isDupCode_L2 +isDupCode_L1: + addi r3, r1, 0x10 + li r4, 0 + li r5, 0x101 + bl memset + mr r4, r31 + addi r3, r1, 0x10 + li r5, 0x100 + bl UTF16ToANSI__Q33ipl7utility13CharacterCodeFPUcPCwl + lwz r3, 0x424(r31) + addi r4, r1, 0x10 + lwz r3, 0x4ec(r3) + bl isDupMail__Q33ipl5scene15FriendListCacheFPCc +isDupCode_L2: + lwz r0, 0x124(r1) + lwz r31, 0x11c(r1) + mtlr r0 + addi r1, r1, 0x120 + blr +} + +extern "C" asm void isMyCode__Q43ipl5scene11AddressEdit6StringCFv() { + nofralloc + stwu r1, -0x10(r1) + mflr r0 + stw r0, 0x14(r1) + lbz r0, 0x422(r3) + stw r31, 0xc(r1) + cmpwi r0, 0 + stw r30, 8(r1) + beq isMyCode_L1 + lwz r4, 0x424(r3) + lwz r4, 0x4ec(r4) + lwz r31, 0x7d68(r4) + lwz r30, 0x7d6c(r4) + bl utf16_wiiid__Q33ipl5scene11AddressEditFPCw + xor r4, r30, r4 + xor r0, r31, r3 + or r0, r4, r0 + cntlzw r0, r0 + srwi r3, r0, 5 + b isMyCode_L2 +isMyCode_L1: + li r3, 0 +isMyCode_L2: + lwz r0, 0x14(r1) + lwz r31, 0xc(r1) + lwz r30, 8(r1) + mtlr r0 + addi r1, r1, 0x10 + blr +} + extern "C" asm void prepare__Q33ipl5scene11AddressEditFv() { nofralloc stwu r1, -0x10(r1) -- 2.49.1 From 7b3e17ba9af971a408fc6ecf2b53e484b3d748c5 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Mon, 21 Sep 2026 22:52:25 +0000 Subject: [PATCH 2/2] Restore AddressEdit data pool --- src/scene/address/iplAddressEdit.cpp | 272 +++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) diff --git a/src/scene/address/iplAddressEdit.cpp b/src/scene/address/iplAddressEdit.cpp index e4beb2ce..428700df 100644 --- a/src/scene/address/iplAddressEdit.cpp +++ b/src/scene/address/iplAddressEdit.cpp @@ -23,6 +23,278 @@ enum { static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength); +u64 s_addressEditDataPool[269] = { + 0x425f6372645f6274, + 0x6e5f303000425f63, + 0x72645f62746e5f31, + 0x3000425f6372645f, + 0x62746e5f31310042, + 0x5f6d69695f69636f, + 0x6e5f303000425f63, + 0x6172645f62657461, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x425f6372645f6564, + 0x67695f3030006261, + 0x6c6c6f6f6e2e6173, + 0x680074685f416472, + 0x6573735f622e6272, + 0x6c79740074685f41, + 0x64726573735f625f, + 0x636172645f737472, + 0x742e62726c616e00, + 0x636172645f737472, + 0x745f666e73680074, + 0x685f416472657373, + 0x5f625f62746e5f69, + 0x6e2e62726c616e00, + 0x6372645f62746e5f, + 0x3030006372645f62, + 0x746e5f3130006372, + 0x645f62746e5f3131, + 0x006d69695f69636f, + 0x6e5f303000545f66, + 0x726e645f6372645f, + 0x30300074685f4164, + 0x726573735f625f62, + 0x746e5f7073682e62, + 0x726c616e0074685f, + 0x4164726573735f62, + 0x5f62746e5f6f7574, + 0x2e62726c616e0074, + 0x685f416472657373, + 0x5f625f62746e5f73, + 0x636c5f696e2e6272, + 0x6c616e0074685f41, + 0x64726573735f625f, + 0x62746e5f73636c5f, + 0x6f75742e62726c61, + 0x6e006372645f6274, + 0x6e5f677279007468, + 0x5f4164726573735f, + 0x625f636172645f6d, + 0x73675f616c705f69, + 0x6e2e62726c616e00, + 0x636172645f6d7367, + 0x0074685f41647265, + 0x73735f625f636172, + 0x645f6d73675f616c, + 0x705f6f75742e6272, + 0x6c616e0074685f41, + 0x64726573735f625f, + 0x636172645f666e73, + 0x682e62726c616e00, + 0x545f6372645f6274, + 0x6e5f303000545f63, + 0x72645f62746e5f31, + 0x3000545f6372645f, + 0x62746e5f31310054, + 0x5f6372645f62746e, + 0x5f67727900545f63, + 0x6172645f6d73675f, + 0x303000545f6e616d, + 0x655f30300074685f, + 0x4164726573735f63, + 0x2e62726c79740074, + 0x685f416472657373, + 0x5f635f636172645f, + 0x737472742e62726c, + 0x616e00475f636172, + 0x645f737472745f66, + 0x6e73680074685f41, + 0x64726573735f635f, + 0x7175657374696f6e, + 0x5f616c705f696e2e, + 0x62726c616e00475f, + 0x7175657374696f6e, + 0x5f30300074685f41, + 0x64726573735f635f, + 0x6e616d655f616c70, + 0x5f696e2e62726c61, + 0x6e00475f6e616d65, + 0x5f30300074685f41, + 0x64726573735f635f, + 0x6d73675f616c705f, + 0x696e2e62726c616e, + 0x00475f6d73675f30, + 0x300074685f416472, + 0x6573735f635f6d69, + 0x695f616c705f696e, + 0x2e62726c616e0074, + 0x685f416472657373, + 0x5f635f7175657374, + 0x696f6e5f616c705f, + 0x6f75742e62726c61, + 0x6e0074685f416472, + 0x6573735f635f6e61, + 0x6d655f616c705f6f, + 0x75742e62726c616e, + 0x0074685f41647265, + 0x73735f635f6d7367, + 0x5f616c705f6f7574, + 0x2e62726c616e0074, + 0x685f416472657373, + 0x5f635f6d69695f61, + 0x6c705f6f75742e62, + 0x726c616e0074685f, + 0x4164726573735f63, + 0x5f636172645f666e, + 0x73682e62726c616e, + 0x006d795f4261636b, + 0x5f612e62726c7974, + 0x006d795f4261636b, + 0x5f615f4170656172, + 0x2e62726c616e0050, + 0x6963747572655f30, + 0x30006d795f426163, + 0x6b5f615f4c6f7374, + 0x2e62726c616e0054, + 0x5f7175657374696f, + 0x6e5f303000545f6d, + 0x73675f3030006d79, + 0x5f49706c546f7042, + 0x616c6c6f6f6e5f61, + 0x2e62726c79740000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x545f6d69695f6d73, + 0x675f303000574950, + 0x4c5f53455f42545f, + 0x5441524745545449, + 0x4e47005749504c5f, + 0x53455f4445434944, + 0x4500000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x5749504c5f53455f, + 0x43414e43454c0000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000250030, + 0x00360064000a0000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, + 0x0000000000000000, +}; + extern "C" char lbl_81647EE0; extern "C" char smArg__Q23ipl6System; extern "C" const char* smButtonName__Q33ipl5scene6Button[]; -- 2.49.1