Compare commits

..

17 Commits

Author SHA1 Message Date
github-actions[bot]
f0829ff810 docs: update progress [skip ci] 2026-10-01 23:06:06 +00:00
coah
ffdd7b58e0 cleanup(tiCandidateBox): name pane/string labels (#608)
Rename address placeholders for known pane names and related
sdata aliases; leave float constants for a follow-up.
2026-10-01 18:05:58 -05:00
coah
1a0f83a156 match(CDBDatabase): decompile CDBDatabaseCreateRecordAtOnceEx (#607)
Exact match (51/51, diffs 0). DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d.

Co-authored-by: asm2c <asm2c@local>
2026-10-01 18:05:17 -05:00
coah
a3d088e4d3 match(d_nhttp_private): NHTTPDeleteConnection (#606)
Rewrite ConnectionStarted's null check as if/else so the inlined
WaitConnection path matches beq/bne block order (null → -1 first).

Before: 6/7 funcs, 908/1320 code bytes
After:  7/7 funcs, 1320/1320 code bytes
DOL sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
2026-10-01 18:04:32 -05:00
coah
3b90bd66c6 cleanup(iplSound): name zero float constant (#599)
Rename lbl_816946A4 → scSoundZeroF (defined 0.0f). Leave other pitch
floats alone until they have Matching definitions.
2026-10-01 18:04:18 -05:00
coah
b395269be6 cleanup(iplChannelObj): rename leftover bVar locals (#605)
- bVar4 → foundLangGroup
- bVar3 → isNonRsoGroup
- bVar1 → shouldAdjustHeap
2026-10-01 18:04:05 -05:00
github-actions[bot]
60bc67e097 docs: update progress [skip ci] 2026-10-01 23:04:00 +00:00
coah
4e8223f3d4 cleanup(wad): sync WAD*Ex header params with .c (#592)
Match wad.h to wad.c (flags/offset/fileListOut/processCallback).
2026-10-01 18:03:49 -05:00
github-actions[bot]
3f36d5f4cc docs: update progress [skip ci] 2026-10-01 23:03:03 +00:00
coah
1f0dc64062 cleanup(kpad): sync KPADGetProjectionPos param names (#589)
Match the header to the .c (param_3/param_4 → rect/scale).
2026-10-01 18:02:56 -05:00
coah
5db0cd6086 cleanup(CDBDatabase): name error message string labels (#581)
Rename Matching lbl_* CDBReportError messages to scCdbMsg_*.
2026-10-01 18:02:31 -05:00
coah
54b44a3534 Restore keyboard unit filename and getter emission order, then link (#572) 2026-10-01 18:02:26 -05:00
coah
1493baaba0 match(pf_fat12): PFFAT12_WriteFATEntryWithBuf (#573)
Reorder locals and rewrite cross-byte stores as p_buf[offset+1].

Co-authored-by: matcher <matcher@local>
2026-10-01 18:02:05 -05:00
coah
22dd088277 match(SOBasic): SOPoll (#571)
Reorder locals (size, bytes, result, rm) for register allocation.

Co-authored-by: matcher <matcher@local>
2026-10-01 18:00:59 -05:00
coah
1bbc40cb3b cleanup(iplChannelObj): name layout/export/SE string labels (#556)
Replace Equivalent-unit lbl_* placeholders with scPaneName_/scBrlyt_/
scBrlan_/scExport_/scSE_ names; rename local_50 to langCodeBuf.
Update symbols.txt. Byte-identical; DOL sha1 unchanged.
2026-10-01 17:59:14 -05:00
coah
e6bf9cc669 cleanup(NWC24FriendList): rename friend-list path string (#533)
Rename lbl_8166E160 to scNwc24FlPath using a plain non-const char[]
declaration (no section attributes or pad objects).
2026-10-01 17:58:48 -05:00
coah
ffd9cc4a69 cleanup(iplDate): name zero float constant (#514)
String pane/brlan/SE labels already landed via #518. Rename the remaining
Matching .sdata2 zero float lbl_816948EC -> scDateZeroF.
2026-10-01 17:58:21 -05:00
24 changed files with 366 additions and 540 deletions

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.37% | 87.79% | 62.05% | 92.06% |
| 99.37% | 87.84% | 62.33% | 92.06% |
units 918/1027 complete, functions 12216/12563 matched.
units 919/1027 complete, functions 12220/12563 matched.
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
<!-- progress:end -->

View File

@@ -1054,7 +1054,7 @@ src/keyboard/tiNw4rManager.cpp:
.data start:0x8165F818 end:0x8165F8F0
.sdata2 start:0x81694E10 end:0x81694E28
src/keyboard/tiManager.cpp:
src/keyboard/tiKeyboard.cpp:
.text start:0x81437558 end:0x81439608
.ctors start:0x8160D208 end:0x8160D20C
.data start:0x8165F8F0 end:0x81660378

View File

@@ -13271,7 +13271,7 @@ __nupSetAuditState__FUc = .text:0x815F0444; // type:function size:0x7C scope:loc
__nupBase64Encode__FPUcPUcUl = .text:0x815F04C0; // type:function size:0xFC scope:local
__nupGetAuditData__FP14NUPContextInfoPPc = .text:0x815F05BC; // type:function size:0x3D0 scope:local
__nupGetTmdView__FUxPP9ESTmdView = .text:0x815F098C; // type:function size:0xB4 scope:local
__nupGetBootVersion__14NUPContextInfoFP14ESTitleVersion = .text:0x815F0A40; // type:function size:0x28C scope:local
__nupGetBootVersion__FP14ESTitleVersion = .text:0x815F0A40; // type:function size:0x28C scope:local
__nupGetTicket__FP12NUPTitleInfoPc = .text:0x815F0CCC; // type:function size:0x164 scope:local
__nupGetTmd__FP12NUPTitleInfoPc = .text:0x815F0E30; // type:function size:0x1E4 scope:local
__nupGetTitleSize__FP12NUPTitleInfo = .text:0x815F1014; // type:function size:0x22C scope:local
@@ -15968,21 +15968,21 @@ s_time_num__Q23ipl5scene = .data:0x8164E1D8; // type:object size:0x28 scope:loca
@10797 = .data:0x8164E251; // type:object size:0x1A scope:local data:string
@10804 = .data:0x8164E26B; // type:object size:0x19 scope:local data:string
@10848 = .data:0x8164E284; // type:object size:0xA scope:local data:string
lbl_8164E290 = .data:0x8164E290; // type:object size:0x9 data:string
scCursur_a = .data:0x8164E290; // type:object size:0x9 data:string
lbl_8164E299 = .data:0x8164E299; // type:object size:0x1B data:string
lbl_8164E2B4 = .data:0x8164E2B4; // type:object size:0x1A data:string
lbl_8164E2CE = .data:0x8164E2CE; // type:object size:0x19 data:string
lbl_8164E2E8 = .data:0x8164E2E8; // type:object size:0xC
lbl_8164E2F4 = .data:0x8164E2F4; // type:object size:0xA data:string
lbl_8164E300 = .data:0x8164E300; // type:object size:0x28
lbl_8164E328 = .data:0x8164E328; // type:object size:0x387
lbl_8164E6AF = .data:0x8164E6AF; // type:object size:0x20
lbl_8164E6CF = .data:0x8164E6CF; // type:object size:0x12 data:string
lbl_8164E6E1 = .data:0x8164E6E1; // type:object size:0x12 data:string
lbl_8164E6F3 = .data:0x8164E6F3; // type:object size:0x12 data:string
lbl_8164E705 = .data:0x8164E705; // type:object size:0x19 data:string
lbl_8164E71E = .data:0x8164E71E; // type:object size:0x26 data:string
lbl_8164E744 = .data:0x8164E744; // type:object size:0x1F data:string
scModuleData = .data:0x8164E328; // type:object size:0x387
scBrlan_RsoFmt = .data:0x8164E6AF; // type:object size:0x20
scBrlyt_my_IplTop_b = .data:0x8164E6CF; // type:object size:0x12 data:string
scBrlan_my_IplTop_b = .data:0x8164E6E1; // type:object size:0x12 data:string
scBrlyt_my_IplTop_d = .data:0x8164E6F3; // type:object size:0x12 data:string
scBrlyt_my_IplTopBalloon_a = .data:0x8164E705; // type:object size:0x19 data:string
scBrlan_BalloonInOut = .data:0x8164E71E; // type:object size:0x26 data:string
scSE_BALLOON = .data:0x8164E744; // type:object size:0x1F data:string
scGroup_G_FocusBtnA = .data:0x8164E768; // type:object size:0xC data:string
scGroup_G_FocusBtnB = .data:0x8164E774; // type:object size:0xC data:string
scGroup_G_SelectBtnA = .data:0x8164E780; // type:object size:0xD data:string
@@ -17491,14 +17491,14 @@ __vt__Q29textinput4Base = .data:0x8165D228; // type:object size:0x30
__vt__Q39textinput4util9Animation = .data:0x8165D258; // type:object size:0x24
lbl_8165D258 = .data:0x8165D27C; // type:object size:0xD data:string
@STRING@GetTextColor__Q34nw4r3lyt7TextBoxCFUl = .data:0x8165D28C; // type:object size:0x44
lbl_8165D2D0 = .data:0x8165D2D0; // type:object size:0xF data:string
lbl_8165D2E0 = .data:0x8165D2E0; // type:object size:0x11 data:string
lbl_8165D2F8 = .data:0x8165D2F8; // type:object size:0x68C
lbl_8165D984 = .data:0x8165D984; // type:object size:0x84
lbl_8165DA08 = .data:0x8165DA08; // type:object size:0x10 data:string
lbl_8165DA18 = .data:0x8165DA18; // type:object size:0xF data:string
lbl_8165DA28 = .data:0x8165DA28; // type:object size:0xD data:string
lbl_8165DA38 = .data:0x8165DA38; // type:object size:0xD data:string
scT_prdc_Text_00 = .data:0x8165D2D0; // type:object size:0xF data:string
scP_prdc_scrl_Left = .data:0x8165D2E0; // type:object size:0x11 data:string
scCandidatePaneData = .data:0x8165D2F8; // type:object size:0x68C
scPaneNameTable = .data:0x8165D984; // type:object size:0x84
scW_predictWindow = .data:0x8165DA08; // type:object size:0x10 data:string
scN_predictInput = .data:0x8165DA18; // type:object size:0xF data:string
scW_OnOff_Area = .data:0x8165DA28; // type:object size:0xD data:string
scN_prdc_Texts = .data:0x8165DA38; // type:object size:0xD data:string
jumptable_8165DA48 = .data:0x8165DA48; // type:object size:0x1C scope:local
lbl_8165DA64 = .data:0x8165DA64; // type:object size:0xF data:string
lbl_8165DA74 = .data:0x8165DA74; // type:object size:0xF data:string
@@ -18235,13 +18235,13 @@ jumptable_8166B3D0 = .data:0x8166B3D0; // type:object size:0x30 scope:local
@1137 = .data:0x8166B450; // type:object size:0x22 scope:local data:string
jumptable_8166B478 = .data:0x8166B478; // type:object size:0x30 scope:local
lbl_8166B4B8 = .data:0x8166B4B8; // type:object size:0x70
lbl_8166B528 = .data:0x8166B528; // type:object size:0x25 data:string
lbl_8166B550 = .data:0x8166B550; // type:object size:0x29 data:string
lbl_8166B57C = .data:0x8166B57C; // type:object size:0x2B data:string
lbl_8166B5A8 = .data:0x8166B5A8; // type:object size:0xD data:string
lbl_8166B5B8 = .data:0x8166B5B8; // type:object size:0x15 data:string
lbl_8166B5D0 = .data:0x8166B5D0; // type:object size:0x46 data:string
lbl_8166B618 = .data:0x8166B618; // type:object size:0x48 data:string
scCdbMsg_DatabaseClosed = .data:0x8166B528; // type:object size:0x25 data:string
scCdbMsg_CantCreateRecordClosed = .data:0x8166B550; // type:object size:0x29 data:string
scCdbMsg_CantCreateRecordReadonly = .data:0x8166B57C; // type:object size:0x2B data:string
scCdbMsg_InvalidKey = .data:0x8166B5A8; // type:object size:0xD data:string
scCdbMsg_FileNotFound = .data:0x8166B5B8; // type:object size:0x15 data:string
scCdbMsg_CantCleanupDirsClosed = .data:0x8166B5D0; // type:object size:0x46 data:string
scCdbMsg_CantCleanupDirsReadonly = .data:0x8166B618; // type:object size:0x48 data:string
@1360 = .data:0x8166B660; // type:object size:0x12 scope:local data:string
...data.0 = .data:0x8166B660; // type:label scope:local
@1362 = .data:0x8166B674; // type:object size:0x1C scope:local data:string
@@ -18453,7 +18453,7 @@ __FUNCTION__$1195 = .data:0x8166E0FC; // type:object size:0x1C scope:local data:
__FUNCTION__$1217 = .data:0x8166E118; // type:object size:0x1C scope:local data:string
__FUNCTION__$1255 = .data:0x8166E134; // type:object size:0x14 scope:local data:string
__FUNCTION__$1287 = .data:0x8166E148; // type:object size:0x18 scope:local data:string
lbl_8166E160 = .data:0x8166E160; // type:object size:0x1A data:string
scNwc24FlPath = .data:0x8166E160; // type:object size:0x1A data:string
@583 = .data:0x8166E180; // type:object size:0x1B scope:local data:string
__FUNCTION__$1123 = .data:0x8166E1A0; // type:object size:0x18 scope:local data:string
@1300 = .data:0x8166E1B8; // type:object size:0x11 scope:local data:string
@@ -20243,7 +20243,7 @@ lbl_81694654 = .sdata2:0x81694654; // type:object size:0x4 align:4 data:float
@10043 = .sdata2:0x81694698; // type:object size:0x4 scope:local align:4 data:float
@10044 = .sdata2:0x8169469C; // type:object size:0x4 scope:local align:4 data:float
lbl_816946A0 = .sdata2:0x816946A0; // type:object size:0x4 align:4 data:float
lbl_816946A4 = .sdata2:0x816946A4; // type:object size:0x4 align:4 data:float
scSoundZeroF = .sdata2:0x816946A4; // type:object size:0x4 align:4 data:float
lbl_816946A8 = .sdata2:0x816946A8; // type:object size:0x4 align:4 data:float
lbl_816946AC = .sdata2:0x816946AC; // type:object size:0x4 align:4 data:float
lbl_816946B0 = .sdata2:0x816946B0; // type:object size:0x4 align:4 data:float
@@ -21858,11 +21858,11 @@ lbl_816968F5 = .sdata:0x816968F5; // type:object size:0x4 data:string
@10922 = .sdata:0x81696992; // type:object size:0x3 scope:local data:string
@10923 = .sdata:0x81696995; // type:object size:0x3 scope:local data:string
lbl_81696998 = .sdata:0x81696998; // type:object size:0x4 data:4byte
lbl_8169699C = .sdata:0x8169699C; // type:object size:0x4 data:4byte
scPaneName_T_Balloon = .sdata:0x8169699C; // type:object size:0x4 data:4byte
lbl_816969A0 = .sdata:0x816969A0; // type:object size:0x7 data:string
lbl_816969A8 = .sdata:0x816969A8; // type:object size:0x4 data:4byte
scPaneName_W_Base = .sdata:0x816969A8; // type:object size:0x4 data:4byte
lbl_816969AC = .sdata:0x816969AC; // type:object size:0x8 data:string
lbl_816969B4 = .sdata:0x816969B4; // type:object size:0x4 data:4byte
scPaneName_W_Shade = .sdata:0x816969B4; // type:object size:0x4 data:4byte
lbl_816969B8 = .sdata:0x816969B8; // type:object size:0x4 data:string
lbl_816969BC = .sdata:0x816969BC; // type:object size:0x4 data:string
lbl_816969C0 = .sdata:0x816969C0; // type:object size:0x4 data:string
@@ -21872,9 +21872,9 @@ lbl_816969CC = .sdata:0x816969CC; // type:object size:0x4 data:string
lbl_816969D0 = .sdata:0x816969D0; // type:object size:0x4 data:string
lbl_816969D4 = .sdata:0x816969D4; // type:object size:0x4 data:string
lbl_816969D8 = .sdata:0x816969D8; // type:object size:0x4 data:string
lbl_816969DC = .sdata:0x816969DC; // type:object size:0x5 data:string
lbl_816969E1 = .sdata:0x816969E1; // type:object size:0x7 data:string
lbl_816969E8 = .sdata:0x816969E8; // type:object size:0x4 data:string
scExport_Calc = .sdata:0x816969DC; // type:object size:0x5 data:string
scExport_Create = .sdata:0x816969E1; // type:object size:0x7 data:string
scArc = .sdata:0x816969E8; // type:object size:0x4 data:string
lbl_816969EC = .sdata:0x816969EC; // type:object size:0x6 data:string
lbl_816969F2 = .sdata:0x816969F2; // type:object size:0x5 data:string
lbl_816969F7 = .sdata:0x816969F7; // type:object size:0x4 data:string
@@ -22281,11 +22281,11 @@ sbCompatibleFilterEnabled__Q39textinput9inputform13DeadKeyStream = .sdata:0x8169
mbHyphen__Q29textinput9inputform = .sdata:0x816973B3; // type:object size:0x1 data:byte
lbl_816973B4 = .sdata:0x816973B4; // type:object size:0x4
lbl_816973B8 = .sdata:0x816973B8; // type:object size:0x8 data:string
lbl_816973C0 = .sdata:0x816973C0; // type:object size:0x4 data:4byte
lbl_816973C4 = .sdata:0x816973C4; // type:object size:0x4 data:4byte
lbl_816973C8 = .sdata:0x816973C8; // type:object size:0x8
lbl_816973D0 = .sdata:0x816973D0; // type:object size:0x8 data:string
lbl_816973D8 = .sdata:0x816973D8; // type:object size:0x8 data:string
scCommonTextAnimName = .sdata:0x816973C0; // type:object size:0x4 data:4byte
scCommonScrollAnimName = .sdata:0x816973C4; // type:object size:0x4 data:4byte
scEmptyWChars = .sdata:0x816973C8; // type:object size:0x8
scP_OnBtn = .sdata:0x816973D0; // type:object size:0x8 data:string
scB_OnBtn = .sdata:0x816973D8; // type:object size:0x8 data:string
COMMON_BUTTON_ANIM__Q29textinput7toolbar = .sdata:0x816973E0; // type:object size:0x4 scope:local data:4byte
COMMON_CHG_ANIM__Q29textinput7toolbar = .sdata:0x816973E4; // type:object size:0x4 scope:local data:4byte
@6901 = .sdata:0x816973E8; // type:object size:0x5 scope:local data:string

View File

@@ -920,7 +920,7 @@ config.libs = [
Object(NonMatching, "keyboard/tiZiString.cpp", extra_cflags=["-O4,p"]), # for 4.3U and 4.3E
Object(Matching, "keyboard/tiTextDrawer.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiNw4rManager.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/tiManager.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiKeyboard.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiUtil.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiCpData.cpp", extra_cflags=["-O4,p"], shift_jis=False),
Object(Matching, "keyboard/tiSwData.cpp", extra_cflags=["-O4,p"], shift_jis=False),

View File

@@ -135,8 +135,13 @@ namespace textinput {
virtual keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() { return mpCellPhoneKeyboard; }
virtual const keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboard() const { return mpCellPhoneKeyboard; }
#ifdef TIMANAGER_IMPLEMENTATION
virtual void* getSignKeyboard();
virtual const void* getSignKeyboard() const;
#else
virtual void* getSignKeyboard() { return mpSignWindow; }
virtual const void* getSignKeyboard() const { return mpSignWindow; }
#endif
virtual candidatebox::LayoutByNW4R* getCandidateBox() { return mpCandidateBox; }
virtual const candidatebox::LayoutByNW4R* getCandidateBox() const { return mpCandidateBox; }
@@ -144,8 +149,13 @@ namespace textinput {
virtual toolbar::LayoutByNW4R* getToolBar() { return mpToolBar; }
virtual const toolbar::LayoutByNW4R* getToolBar() const { return mpToolBar; }
#ifdef TIMANAGER_IMPLEMENTATION
virtual void* getPredictLanguageSelectDialog();
virtual const void* getPredictLanguageSelectDialog() const;
#else
virtual void* getPredictLanguageSelectDialog() { return mpPredictLanguageDialog; }
virtual const void* getPredictLanguageSelectDialog() const { return mpPredictLanguageDialog; }
#endif
virtual inputform::EditBuffer* createEditBuffer();
virtual keyboard::hwkey::HWKeyboard* createHWKeyboard();

View File

@@ -68,7 +68,7 @@ void KPADInit();
s32 KPADRead(s32 chan, KPADStatus* status, u32 length);
void KPADSetSensorHeight(s32 chan, f32 sensorHeight);
void KPADGetProjectionPos(Vec2* dest, Vec2* src, const Rect* param_3, f32 param_4);
void KPADGetProjectionPos(Vec2* dest, Vec2* src, const Rect* rect, f32 scale);
void KPADSetPosParam(s32 chan, f32 x, f32 y);
void KPADSetBtnRepeat(s32 chan, f32, f32);

View File

@@ -80,11 +80,11 @@ typedef struct {
typedef void (*WADProcessCallback)(u32 completed, u32 total, BOOL done);
s32 WADGetTitleVersionEx(char* path, ESTitleId* titleId, u16* titleVersion, WADLocation location, u32 offset);
s32 WADBackupEx(u64 titleId, u32 param_2, MEMAllocator* allocator, char* path, u32* sizeOut, WADLocation location, u32 param_7,
WADProcessCallback processCB);
s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32* sizeOut, WADLocation location, u32 offset,
WADProcessCallback processCallback);
s32 WADImportGetBlocks(char* path, MEMAllocator* allocator, WADLocation location, u32 offset, u32 param_5, WADBlocks* blocks, u32* param_7);
s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 param_4, u32 param_5, WADProcessCallback processCB);
s32 WADImportGetBlocks(char* path, MEMAllocator* allocator, WADLocation location, u32 offset, u32 flags, WADBlocks* blocks, u32* fileListOut);
s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 offset, u32 flags, WADProcessCallback processCallback);
s32 WADGetInstalledVersion(ESTitleId titleID, u16* version);

View File

@@ -120,13 +120,13 @@ pf_s32 VFiPFFAT12_WriteFATEntry(PF_VOLUME* p_vol, pf_u16 cluster, pf_u16 value)
}
pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 value, PF_CACHE_PAGE* p_page) {
pf_s32 err;
pf_u32 next_sector;
pf_u32 offset_in_sector;
pf_u16 current_fat;
pf_s32 fat_offset;
pf_u32 fat_sector;
pf_s32 result;
pf_u32 next_sector;
pf_s32 err;
fat_offset = (pf_u16)(cluster + (cluster >> 1));
fat_sector = (pf_u16)(p_vol->bpb.active_FAT_sector + (fat_offset >> p_vol->bpb.log2_bytes_per_sector));
offset_in_sector = fat_offset & (p_vol->bpb.bytes_per_sector - 1);
@@ -153,7 +153,7 @@ pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 val
p_page->sector = next_sector;
p_page->p_buf[0] = value >> 4;
} else {
((pf_u16)offset_in_sector + p_page->p_buf)[1] = value >> 4;
*(p_page->p_buf + ((pf_u16)offset_in_sector + 1)) = value >> 4;
}
} else {
p_page->p_buf[(pf_u16)offset_in_sector] = value;
@@ -165,7 +165,7 @@ pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 val
p_page->sector = next_sector;
p_page->p_buf[0] = (p_page->p_buf[0] & 0xF0) | ((pf_u8)(value >> 8));
} else {
((pf_u16)offset_in_sector + p_page->p_buf)[1] = (((pf_u16)offset_in_sector + p_page->p_buf)[1] & 0xF0) | ((pf_u8)(value >> 8));
*(p_page->p_buf + ((pf_u16)offset_in_sector + 1)) = (*(p_page->p_buf + ((pf_u16)offset_in_sector + 1)) & 0xF0) | ((pf_u8)(value >> 8));
}
}
if (err != 0) { result = err; }

View File

@@ -122,7 +122,6 @@ struct NUPContextInfo {
OSThread thread;
OSMutex mutex;
u64 threadStack[0x400];
s32 __nupGetBootVersion(ESTitleVersion* title);
};
static const char* __nupStatusMessage[6] = {
@@ -488,7 +487,7 @@ static void __nupBase64Encode(u8* output, u8* input, unsigned long length) {
u8* end = input + length;
u32 value = 0;
u32 count = 0;
static char pad = '=';
static char fillByte = '=';
while (input != end) {
count++;
@@ -497,30 +496,39 @@ static void __nupBase64Encode(u8* output, u8* input, unsigned long length) {
if (count < 3) {
continue;
}
output[0] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
u8 encodedSecond = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
u8 encodedFirst = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[0] = encodedFirst;
u8 encodedThird = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 6 & 0x3f];
output[1] = encodedSecond;
u8 encodedFourth = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value & 0x3f];
output[2] = encodedThird;
output[3] = encodedFourth;
count = 0;
output[1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
output[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 6 & 0x3f];
output[3] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value & 0x3f];
output += 4;
}
if (count == 2) {
value <<= 8;
output[0] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
output[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 6 & 0x3f];
output[3] = pad;
u8 encodedSecond = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
u8 encodedFirst = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[0] = encodedFirst;
u8 encodedThird = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 6 & 0x3f];
output[1] = encodedSecond;
output[2] = encodedThird;
output[3] = fillByte;
return;
}
if (count != 1) {
return;
}
value <<= 16;
output[0] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
output[2] = pad;
output[3] = pad;
u8 encodedSecond = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
u8 encodedFirst = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[0] = encodedFirst;
output[1] = encodedSecond;
output[2] = fillByte;
output[3] = fillByte;
}
static s32 __nupGetAuditData(NUPContextInfo* context, char** auditData) {
@@ -717,7 +725,7 @@ static inline s32 __nupSetBootTitleVersion(ESTitleVersion* title) {
return result;
}
s32 NUPContextInfo::__nupGetBootVersion(ESTitleVersion* title) {
static s32 __nupGetBootVersion(NUPContextInfo* context, ESTitleVersion* title) {
s32 result;
ESTmdView* tmdView = 0;
@@ -728,12 +736,12 @@ s32 NUPContextInfo::__nupGetBootVersion(ESTitleVersion* title) {
result = __nupSetBootTitleVersion(title);
} else {
u32 i;
for (i = 0; i < ownedTitleCount; i++) {
if (ownedTitleIds[i] == title->titleId) {
for (i = 0; i < context->ownedTitleCount; i++) {
if (context->ownedTitleIds[i] == title->titleId) {
break;
}
}
if (i < ownedTitleCount) {
if (i < context->ownedTitleCount) {
title->hasTicket = 1;
}
@@ -1166,12 +1174,8 @@ static inline s32 __nupGetBoot2Version(u16* version) {
s32 result = ES_GetBoot2Version(&bootVersion);
if (result == 0) {
u16 checkedVersion = bootVersion;
if (checkedVersion != bootVersion) {
result = -0x1389;
}
if (checkedVersion != bootVersion) {
*version = checkedVersion;
}
*version = checkedVersion;
if (checkedVersion != bootVersion) { result = -0x1389; }
}
return result;
}
@@ -1190,7 +1194,7 @@ static inline s32 __nupGetOwnedTitles(NUPContextInfo* context) {
}
static inline s32 __nupCheckTitleVersion(NUPContextInfo* context, NUPTitleInfo* title) {
s32 result = context->__nupGetBootVersion((ESTitleVersion*)title);
s32 result = __nupGetBootVersion(context, (ESTitleVersion*)title);
if (result == 0) {
if (title->hasTicket && title->hasTmd && title->hasContent &&
title->installedVersion >= title->serverVersion) {
@@ -1221,11 +1225,11 @@ static inline void __nupSetStatus(NUPContextInfo* context, s32 status) {
extern "C" void* __nupOp(void* argument) {
u8* response = 0;
ESTmdView* tmdView = 0;
char* auditData = 0;
u32 needsAudit;
u32 currentDeviceId;
u32 needsAudit;
char* auditData = 0;
s32 result;
u16 serverBootVersion;
u16 serverBootVersion = 0;
u16 bootTitleVersion;
u16 systemMenuVersion;
ESTitleId currentTitleId;

View File

@@ -83,8 +83,8 @@ static u8* __nupNhttpBufFull(u8** buffer, unsigned long* length, unsigned long r
}
done:
if (state->error != 0) {
*length = 0;
next = NULL;
*length = 0;
}
return next;
}
@@ -101,13 +101,12 @@ static void __nupNhttpReqDone(int result, void* response, HttpState* state) {
}
static int __nupNhttpOp(char* url, NHTTPReqMethod method, char* headers, u8* body, unsigned long bodyLength, unsigned long limit, ProgressCallback progress, void* progressContext, FlushCallback flush, void* flushContext) {
int status;
u8* responseBody = NULL;
char* responseHeaders = NULL;
unsigned long transferred, expected;
int length;
unsigned long expected;
unsigned long transferred;
char* responseHeaders = NULL;
u8* responseBody = NULL;
HttpState state;
int status;
state.error = 0;
state.limit = limit;
state.received = 0;
@@ -131,15 +130,16 @@ static int __nupNhttpOp(char* url, NHTTPReqMethod method, char* headers, u8* bod
if (headerCopy == NULL) { result = -5000; goto cleanup; }
memcpy(headerCopy, headers, size);
char* field = headerCopy;
char* colon;
char* end;
char* value;
while (*field != 0 && (colon = strchr(field, ':')) != NULL && (end = strstr(colon, "\r\n")) != NULL) {
while (*field != 0) {
char* colon = strchr(field, ':');
if (colon == NULL) break;
char* end = strstr(colon, "\r\n");
if (end == NULL) break;
*colon = 0;
*end = 0;
while (*field && isspace(*field)) field++;
value = colon + 1; while (*value && isspace(*value)) value++;
if (NHTTPAddHeaderField(request, field, value) != 0) { result = -7000 - NHTTPGetError(); goto cleanup; }
do { colon++; } while (*colon && isspace(*colon));
if (NHTTPAddHeaderField(request, field, colon) != 0) { result = -7000 - NHTTPGetError(); goto cleanup; }
field = end + 2;
}
}
@@ -153,44 +153,40 @@ static int __nupNhttpOp(char* url, NHTTPReqMethod method, char* headers, u8* bod
if (method == NHTTP_POST && body != NULL && bodyLength != 0 && NHTTPAddPostDataRaw(request, body, bodyLength) != 0) { result = -7000 - NHTTPGetError(); goto cleanup; }
requestId = NHTTPSendRequestAsync(request);
if (requestId < 0) {
result = -7000 - NHTTPGetError();
int error = NHTTPGetError();
NHTTPDeleteRequest(request);
result = -7000 - error;
goto cleanup;
}
state.lastActivity = OSGetTime();
while (NHTTPGetProgress(&expected, &transferred) == 0 || state.done == 0) {
if (OSGetTime() - state.lastActivity >= OSMillisecondsToTicks((OSTime)90000)) {
if (requestId >= 0) {
NHTTPCancelRequestAsync(requestId);
NCDSleep(OSMillisecondsToTicks(100));
for (;;) {
if (NHTTPGetProgress(&expected, &transferred) != 0 && state.done != 0) {
if (state.result != 0) { result = -7000 - state.result; goto cleanup; }
if (state.response != NULL) {
length = NHTTPGetBodyAll(state.response, &responseBody);
if (length < 0) { result = -5007; goto cleanup; }
__nupNhttpBufFull(&responseBody, (unsigned long*)&length, 0, NULL, NULL, &state);
}
result = state.error;
if (result != 0 || state.response == NULL) goto cleanup;
length = NHTTPGetHeaderAll(state.response, &responseHeaders);
if (length < 0) { result = -5007; goto cleanup; }
char* protocol = strstr(responseHeaders, "HTTP/");
if (protocol != NULL && sscanf(protocol, "HTTP/%*d.%*d %d", &status) == 1) {
if (status != 200 && status != 202) result = -5000 - status;
goto cleanup;
}
result = -5009;
goto cleanup;
}
NCDSleep(OSMillisecondsToTicks(100));
}
if (state.result != 0) { result = -7000 - state.result; goto cleanup; }
if (state.response != NULL) {
length = NHTTPGetBodyAll(state.response, &responseBody);
if (length < 0) { result = -5007; goto cleanup; }
__nupNhttpBufFull(&responseBody, (unsigned long*)&length, 0, NULL, NULL, &state);
}
if (state.error != 0) {
result = state.error;
goto cleanup;
}
if (state.response == NULL) goto cleanup;
length = NHTTPGetHeaderAll(state.response, &responseHeaders);
if (length < 0) { result = -5007; goto cleanup; }
{
char* protocol = strstr(responseHeaders, "HTTP/");
if (protocol == NULL || sscanf(protocol, "HTTP/%*d.%*d %d", &status) != 1) {
result = -5007;
goto cleanup;
}
if (status != 200 && status != 202) result = -5000 - status;
goto cleanup;
if (OSGetTime() - state.lastActivity >= OSMillisecondsToTicks(90000)) break;
NCDSleep(OSMillisecondsToTicks(100));
}
if (requestId >= 0) {
NHTTPCancelRequestAsync(requestId);
NCDSleep(OSMillisecondsToTicks(100));
}
result = -5009;
cleanup:
if (state.response != NULL || result == -5009) NHTTPDestroyResponse(state.response);
if (headerCopy != NULL) nup::__nupFree(headerCopy);
@@ -204,7 +200,7 @@ static long __nupHttpStringFlush(u8* data, unsigned long length, unsigned long r
total = length + text->length;
long result = 0;
if (total > text->capacity) {
if (requested < total) {
if (requested >= total) {} else {
requested = text->growth + total;
text->growth <<= 1;
if (text->growth < text->maximumGrowth) {} else text->growth = text->maximumGrowth;

View File

@@ -79,13 +79,13 @@ typedef struct {
} CDBSearchWork;
extern CDBSearchWork* CDBDatabaseWorkBuf;
extern char lbl_8166B528[];
extern char lbl_8166B550[];
extern char lbl_8166B57C[];
extern char lbl_8166B5A8[];
extern char lbl_8166B5B8[];
extern char lbl_8166B5D0[];
extern char lbl_8166B618[];
extern char scCdbMsg_DatabaseClosed[];
extern char scCdbMsg_CantCreateRecordClosed[];
extern char scCdbMsg_CantCreateRecordReadonly[];
extern char scCdbMsg_InvalidKey[];
extern char scCdbMsg_FileNotFound[];
extern char scCdbMsg_CantCleanupDirsClosed[];
extern char scCdbMsg_CantCleanupDirsReadonly[];
extern CDBErr CDBDatabaseInit();
extern CDBErr CDBDatabaseOpen();
@@ -165,7 +165,7 @@ CDBErr CDBDatabaseClose(CDBDatabase* database) {
CDBLock();
instance = database->instance;
if (instance == NULL || instance->flags == 0) {
CDBReportError(lbl_8166B528);
CDBReportError(scCdbMsg_DatabaseClosed);
result = CDB_ERROR_27;
} else {
status = CDBDatabaseFree(database);
@@ -249,61 +249,28 @@ asm CDBErr CDBDatabaseCreateRecordAtOnce(CDBDatabase* database, CDBRecord* recor
#endif
}
asm CDBErr CDBDatabaseCreateRecordAtOnceEx(CDBDatabase* database, CDBRecord* record, const char* typeStr, const char* fileTypeStr, u8* recordData, u32 recordDataSize, int year, int month, int day, int hour, int min, int sec) {
#ifdef __MWERKS__
nofralloc
stwu r1, -0x60(r1)
mflr r0
stw r0, 0x64(r1)
addi r11, r1, 0x60
bl _savegpr_22
lwz r28, 0x68(r1)
mr r23, r4
li r0, 0x0
lwz r12, 0x6c(r1)
lwz r11, 0x70(r1)
mr r22, r3
lwz r4, 0x74(r1)
mr r24, r5
stw r9, 0x24(r1)
mr r25, r6
mr r26, r7
mr r27, r8
stw r10, 0x20(r1)
addi r3, r1, 0x10
stw r28, 0x1c(r1)
stw r12, 0x18(r1)
stw r11, 0x14(r1)
stw r4, 0x10(r1)
stw r0, 0x30(r1)
stw r0, 0x34(r1)
bl OSCalendarTimeToTicks
lhz r30, 0x0(r22)
mr r28, r4
lwz r31, 0x4(r22)
mr r29, r3
bl CDBLock
stw r26, 0x8(r1)
mr r3, r22
mr r4, r23
mr r5, r24
stw r27, 0xc(r1)
mr r6, r25
mr r8, r28
mr r7, r29
mr r9, r31
mr r10, r30
bl CDBDatabaseCreateRecordImAtOnce_
mr r30, r3
bl CDBUnlock
addi r11, r1, 0x60
mr r3, r30
bl _restgpr_22
lwz r0, 0x64(r1)
mtlr r0
addi r1, r1, 0x60
blr
#endif
CDBErr CDBDatabaseCreateRecordAtOnceEx(CDBDatabase* database, CDBRecord* record, const char* typeStr, const char* fileTypeStr, u8* recordData, u32 recordDataSize, int year, int month, int day, int hour, int min, int sec) {
u32 gameCode;
u16 makerCode;
CDBErr result;
OSTime time;
OSCalendarTime cal;
cal.year = year;
cal.mon = month;
cal.mday = day;
cal.hour = hour;
cal.min = min;
cal.sec = sec;
cal.msec = 0;
cal.usec = 0;
time = OSCalendarTimeToTicks(&cal);
makerCode = database->makerCode;
gameCode = database->gameCode;
CDBLock();
result = CDBDatabaseCreateRecordImAtOnce_(database, record, typeStr, fileTypeStr, time, gameCode, makerCode, recordData, recordDataSize);
CDBUnlock();
return result;
}
CDBErr CDBDatabasePrivateCreateRecordAtOnceEx(CDBDatabase* database, CDBRecord* record, const char* typeStr, const char* fileTypeStr, int year, int month, int day, int hour, int min, int sec, u8* recordData, u32 recordDataSize, char* makerCode, char* gameCode) {
@@ -403,17 +370,17 @@ CDBErr CDBDatabaseCreateRecordImAtOnce_(CDBDatabase* database, CDBRecord* record
instance = database->instance;
if (instance == NULL) {
CDBReportError(lbl_8166B550);
CDBReportError(scCdbMsg_CantCreateRecordClosed);
return CDB_ERROR_27;
}
flags = instance->flags;
if ((flags & 2) == 0) {
if (flags == 0) {
CDBReportError(lbl_8166B550);
CDBReportError(scCdbMsg_CantCreateRecordClosed);
return CDB_ERROR_27;
}
CDBReportError(lbl_8166B57C);
CDBReportError(scCdbMsg_CantCreateRecordReadonly);
return CDB_ERROR_26;
}
@@ -427,12 +394,12 @@ CDBErr CDBDatabaseFindByKey(CDBDatabase* database, CDBRecord* record, CDBRecordK
CDBLock();
if (!CDBRecordKeyIsValid(recordKey)) {
CDBReportError(lbl_8166B5A8);
CDBReportError(scCdbMsg_InvalidKey);
result = CDB_ERROR_5;
} else {
CDBRecordInitDescriptor(record, database, recordKey);
if (!CDBRecordIsExistFile(record)) {
CDBReportError(lbl_8166B5B8, recordKey->keyString);
CDBReportError(scCdbMsg_FileNotFound, recordKey->keyString);
result = CDB_ERROR_CANNOT_OPEN_FILE;
} else {
result = CDB_ERROR_OK;
@@ -2608,11 +2575,11 @@ CDBErr CDBDatabaseCleanUpEmptyDirectories(CDBDatabase* database, CDBRecordLocati
CDBUnlock();
if (flags == 0) {
CDBReportError(lbl_8166B5D0);
CDBReportError(scCdbMsg_CantCleanupDirsClosed);
return CDB_ERROR_27;
}
if (flags == 1) {
CDBReportError(lbl_8166B618);
CDBReportError(scCdbMsg_CantCleanupDirsReadonly);
return CDB_ERROR_26;
}
@@ -2663,16 +2630,16 @@ CDBErr CDBDatabaseCleanUpEmptyDirectories(CDBDatabase* database, CDBRecordLocati
#pragma section data_type ".data"
#pragma align 8
extern char lbl_8166B528[] = "CDBDatabaseClose database is closed\n";
extern char scCdbMsg_DatabaseClosed[] = "CDBDatabaseClose database is closed\n";
#pragma align 8
extern char lbl_8166B550[] = "can't create record; database is closed\n";
extern char scCdbMsg_CantCreateRecordClosed[] = "can't create record; database is closed\n";
#pragma align 8
extern char lbl_8166B57C[] = "can't create record; database is readonly\n";
extern char scCdbMsg_CantCreateRecordReadonly[] = "can't create record; database is readonly\n";
#pragma align 8
extern char lbl_8166B5A8[] = "invalid key\n";
extern char scCdbMsg_InvalidKey[] = "invalid key\n";
#pragma align 8
extern char lbl_8166B5B8[] = "file not found : %s\n";
extern char scCdbMsg_FileNotFound[] = "file not found : %s\n";
#pragma align 8
extern char lbl_8166B5D0[] = "can't execute CDBDatabaseCleanUpEmptyDirectories; database is closed\n";
extern char scCdbMsg_CantCleanupDirsClosed[] = "can't execute CDBDatabaseCleanUpEmptyDirectories; database is closed\n";
#pragma align 8
extern char lbl_8166B618[] = "can't execute CDBDatabaseCleanUpEmptyDirectories; database is readonly\n";
extern char scCdbMsg_CantCleanupDirsReadonly[] = "can't execute CDBDatabaseCleanUpEmptyDirectories; database is readonly\n";

View File

@@ -19,20 +19,17 @@ typedef struct HMACContext {
u8 key[64];
} HMACContext;
char hmac_file_name[] = "hmac.c";
char hmac_newline[] = "\n";
void NETHMACInit(HMACContext* context, const DigestInterface* interface, const void* key, u32 length) {
u8 innerKey[64];
u32 i;
u32 keyLength;
u8* work = context->digestContext;
void* work = context->digestContext;
const char* function = "NETHMACInit";
context->interface = *interface;
if (context->interface.contextSize > 96 || context->interface.blockSize > 64) {
OSReport("%s(%d):[warning in %s]", hmac_file_name, 100, function);
OSReport("%s(%d):[warning in %s]", "hmac.c", 100, function);
OSReport("specified interface needs too large workmemory.");
OSReport(hmac_newline);
OSReport("\n");
return;
}
if (length <= context->interface.blockSize) {
@@ -47,8 +44,8 @@ void NETHMACInit(HMACContext* context, const DigestInterface* interface, const v
keyLength = context->keyLength;
for (i=0; i<keyLength; ++i) innerKey[i] = context->key[i] ^ 0x36;
memset(innerKey + keyLength, 0x36, context->interface.blockSize - keyLength);
context->interface.init(work);
context->interface.update(work, innerKey, context->interface.blockSize);
context->interface.init(context->digestContext);
context->interface.update(context->digestContext, innerKey, context->interface.blockSize);
}
void NETHMACUpdate(HMACContext* context, const void* data, u32 length) {
@@ -60,13 +57,13 @@ void NETHMACGetDigest(HMACContext* context, void* digest) {
u8 outerKey[64];
u32 i;
u32 keyLength;
u8* work = context->digestContext;
context->interface.getDigest(context->digestContext, innerDigest);
void* work = context->digestContext;
context->interface.getDigest(work, innerDigest);
keyLength = context->keyLength;
for (i=0; i<keyLength; ++i) outerKey[i] = context->key[i] ^ 0x5c;
memset(outerKey + keyLength, 0x5c, context->interface.blockSize - keyLength);
context->interface.init(work);
context->interface.update(work, outerKey, context->interface.blockSize);
context->interface.init(context->digestContext);
context->interface.update(context->digestContext, outerKey, context->interface.blockSize);
context->interface.update(work, innerDigest, context->interface.digestSize);
context->interface.getDigest(work, digest);
}

View File

@@ -69,16 +69,7 @@ void NETMD5GetDigest(NETMD5Context* context, void* digest) {
}
#define ROTATE(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
#define STEP(a, b, c, d, f, word, n) \
do { \
u32* _p = (word); \
u32 _k = *constant; \
u32 _xw = __lwbrx(_p, 0); \
u32 _wc = __lwbrx(_p, 0) + _k; \
(a) += (f); \
(a) = (b) + ((_wc + (a)) << (n) | (_xw + (_k + (a))) >> (32 - (n))); \
++constant; \
} while (0)
#define STEP(a, b, c, d, f, word, n) ((a) += (f), (a) = (b) + ROTATE(__lwbrx(0, (int)(word)) + (*constant + (a)), n))
static void ProcessBlock(NETMD5Context* context) {
static u32 constants[64] = {0xD76AA478, 0xE8C7B756, 0x242070DB, 0xC1BDCEEE, 0xF57C0FAF, 0x4787C62A, 0xA8304613, 0xFD469501, 0x698098D8, 0x8B44F7AF, 0xFFFF5BB1, 0x895CD7BE, 0x6B901122, 0xFD987193, 0xA679438E, 0x49B40821, 0xF61E2562, 0xC040B340, 0x265E5A51, 0xE9B6C7AA, 0xD62F105D, 0x02441453, 0xD8A1E681, 0xE7D3FBC8, 0x21E1CDE6, 0xC33707D6, 0xF4D50D87, 0x455A14ED, 0xA9E3E905, 0xFCEFA3F8, 0x676F02D9, 0x8D2A4C8A, 0xFFFA3942, 0x8771F681, 0x6D9D6122, 0xFDE5380C, 0xA4BEEA44, 0x4BDECFA9, 0xF6BB4B60, 0xBEBFBC70, 0x289B7EC6, 0xEAA127FA, 0xD4EF3085, 0x04881D05, 0xD9D4D039, 0xE6DB99E5, 0x1FA27CF8, 0xC4AC5665, 0xF4292244, 0x432AFF97, 0xAB9423A7, 0xFC93A039, 0x655B59C3, 0x8F0CCC92, 0xFFEFF47D, 0x85845DD1, 0x6FA87E4F, 0xFE2CE6E0, 0xA3014314, 0x4E0811A1, 0xF7537E82, 0xBD3AF235, 0x2AD7D2BB, 0xEB86D391};
@@ -92,30 +83,30 @@ static void ProcessBlock(NETMD5Context* context) {
block = context->buffer32;
word = block;
constant = constants;
for (round = 0; round < 4; ++round) {
STEP(a,b,c,d,(b & c) | (~b & d),word++,7);
STEP(d,a,b,c,(a & b) | (~a & c),word++,12);
STEP(c,d,a,b,(d & a) | (~d & b),word++,17);
STEP(b,c,d,a,(c & d) | (~c & a),word++,22);
}
index = indices;
for (round = 0; round < 4; ++round) {
STEP(a,b,c,d,(b & d) | (c & ~d),block + *index++,5);
STEP(d,a,b,c,(a & c) | (b & ~c),block + *index++,9);
STEP(c,d,a,b,(d & b) | (a & ~b),block + *index++,14);
STEP(b,c,d,a,(c & a) | (d & ~a),block + *index++,20);
STEP(a,b,c,d,(b & c) | (~b & d),word,7); ++word; ++constant;
STEP(d,a,b,c,(a & b) | (~a & c),word,12); ++word; ++constant;
STEP(c,d,a,b,(d & a) | (~d & b),word,17); ++word; ++constant;
STEP(b,c,d,a,(c & d) | (~c & a),word,22); ++word; ++constant;
}
for (round = 0; round < 4; ++round) {
STEP(a,b,c,d,d ^ b ^ c,block + *index++,4);
STEP(d,a,b,c,c ^ a ^ b,block + *index++,11);
STEP(c,d,a,b,b ^ d ^ a,block + *index++,16);
STEP(b,c,d,a,a ^ c ^ d,block + *index++,23);
STEP(a,b,c,d,(b & d) | (c & ~d),block + *index,5); ++index; ++constant;
STEP(d,a,b,c,(a & c) | (b & ~c),block + *index,9); ++index; ++constant;
STEP(c,d,a,b,(d & b) | (a & ~b),block + *index,14); ++index; ++constant;
STEP(b,c,d,a,(c & a) | (d & ~a),block + *index,20); ++index; ++constant;
}
for (round = 0; round < 4; ++round) {
STEP(a,b,c,d,c ^ (b | ~d),block + *index++,6);
STEP(d,a,b,c,b ^ (a | ~c),block + *index++,10);
STEP(c,d,a,b,a ^ (d | ~b),block + *index++,15);
STEP(b,c,d,a,d ^ (c | ~a),block + *index++,21);
STEP(a,b,c,d,d ^ b ^ c,block + *index,4); ++index; ++constant;
STEP(d,a,b,c,c ^ a ^ b,block + *index,11); ++index; ++constant;
STEP(c,d,a,b,b ^ d ^ a,block + *index,16); ++index; ++constant;
STEP(b,c,d,a,a ^ c ^ d,block + *index,23); ++index; ++constant;
}
for (round = 0; round < 4; ++round) {
STEP(a,b,c,d,c ^ (b | ~d),block + *index,6); ++index; ++constant;
STEP(d,a,b,c,b ^ (a | ~c),block + *index,10); ++index; ++constant;
STEP(c,d,a,b,a ^ (d | ~b),block + *index,15); ++index; ++constant;
STEP(b,c,d,a,d ^ (c | ~a),block + *index,21); ++index; ++constant;
}
context->a += a;
context->b += b;

View File

@@ -55,7 +55,13 @@ static s32 ConnectionStarted(NHTTPConnectionInfo* handle) {
void* system=NHTTPi_GetSystemInfoP();
void* mutex=NHTTPi_GetMutexInfoP(system);
NHTTPConnectionInfo* connection=NHTTPi_GetConnection(mutex,handle);
return connection ? connection->started : -1;
s32 started;
if (connection == NULL) {
started = -1;
} else {
started = connection->started;
}
return started;
}
static s32 ConnectionState(NHTTPConnectionInfo* handle) {

View File

@@ -18,10 +18,8 @@ enum {
#define FRIEND_LIST_MAGIC 'WcFl'
#define FRIEND_LIST_VERSION 2
const char lbl_8166E160[26] __attribute__((section(".data"), aligned(8))) = "/shared2/wc24/nwc24fl.bin";
void* const lbl_8166E160_pad __attribute__((section(".data"))) = (void*)0;
static const char* FLFilePath = lbl_8166E160;
const u32 FLFilePath_pad __attribute__((section(".sdata"), aligned(1))) = 0;
char scNwc24FlPath[] = "/shared2/wc24/nwc24fl.bin";
static const char* FLFilePath = scNwc24FlPath;
const char g_SpecialsChars[16] = { '(', ')', '<', '>', '[', ']', ':', ';', '\\', ',', '"' };

View File

@@ -13,8 +13,8 @@ int SOiIsBufferAddrCheck(void);
void* SOiAlloc(u32, s32);
void SOiFree(u32, void*, s32);
static int soSocketRegistered[2];
const char* __SOCKETVersion ="<< RVL_SDK - SOCKET \trelease build: Dec 12 2008 03:06:17 (0x4199_60831) >>";
static int soSocketRegistered;
const char* __SOCKETVersion="<< RVL_SDK - SOCKET \trelease build: Dec 12 2008 03:06:17 (0x4199_60831) >>";
typedef struct SocketRequest { int socket; int type; int protocol; } SocketRequest;
typedef struct AddressRequest { int socket; int hasAddress; SOSockAddr address; } AddressRequest;
@@ -35,12 +35,9 @@ typedef struct RecvRequest {
union { struct { int socket; int flags; } command; u8 commandBlock[32]; };
SOSockAddr address;
} RecvRequest;
typedef struct SendCmd {
int socket; int flags; int hasAddress; SOSockAddr address;
} SendCmd;
typedef struct SendRequest {
IOSIoVector vectors[4];
SendCmd command;
struct { int socket; int flags; int hasAddress; SOSockAddr address; } command;
} SendRequest;
static int RecvFrom(const char*, int, void*, int, int, SOSockAddr*);
@@ -50,7 +47,7 @@ int SOSocket(int family, int type, int protocol) {
s32 rm;
SocketRequest* request;
int result;
if(!soSocketRegistered[0]) { OSRegisterVersion(__SOCKETVersion); soSocketRegistered[0]=1; }
if(!soSocketRegistered) { OSRegisterVersion(__SOCKETVersion); soSocketRegistered=1; }
if((result=SOiPrepare(NULL,&rm))==0) {
if(family==23) result=-5;
else {
@@ -90,7 +87,7 @@ int SOBind(int socket, void* address) {
int result;
AddressRequest* request;
if((result=SOiPrepare(NULL,&rm))==0) {
if(!address || addr->len>8 || addr->len<8) result=-28;
if(!addr || addr->len>8 || addr->len<8) result=-28;
else {
request=SOiAlloc(12,64);
if(!request) result=-49;
@@ -112,7 +109,7 @@ int SOConnect(int socket, void* address) {
int result;
AddressRequest* request;
if((result=SOiPrepare(NULL,&rm))==0) {
if(!address || addr->len>8 || addr->len<8) result=-28;
if(!addr || addr->len>8 || addr->len<8) result=-28;
else {
request=SOiAlloc(12,64);
if(!request) result=-49;
@@ -128,24 +125,26 @@ int SOConnect(int socket, void* address) {
return result;
}
int SOGetSockName(int socket, SOSockAddr* address) {
int SOGetSockName(int socket, void* address) {
int size;
int result;
s32 rm;
NameRequest* request;
SOSockAddr* addr;
SOSockAddr* reply;
NameRequest* request;
addr=address;
if((result=SOiPrepare(NULL,&rm))==0) {
if(!address || address->len>8 || address->len<8) result=-28;
if(!addr || addr->len>8 || addr->len<8) result=-28;
else {
size=(address->len+63)&~31;
size=(addr->len+63)&~31;
request=SOiAlloc(12,size);
if(!request) result=-49;
else {
request->socket=socket;
reply=&request->address;
memcpy(reply,address,address->len);
result=IOS_Ioctl(rm,7,request,4,reply,address->len);
if(result>=0) memcpy(address,reply,reply->len);
memcpy(reply,addr,addr->len);
result=IOS_Ioctl(rm,7,request,4,reply,addr->len);
if(result>=0) memcpy(addr,reply,reply->len);
SOiFree(12,request,size);
}
}
@@ -199,8 +198,10 @@ int SOShutdown(int socket, int how) {
}
int SOPoll(SOPollFD* fds, unsigned int count, s64 timeout) {
s32 size;
s32 bytes;
s32 result;
s32 rm;
s32 size,bytes,result;
PollRequest* request;
SOPollFD* reply;
if((result=SOiPrepare(NULL,&rm))==0) {
@@ -257,11 +258,11 @@ char* SOInetNtoA(SOInAddr address) {
int SOInetPtoN(int family, const char* text, void* address) {
s32 rm;
int size,temporary,result,bytes;
int temporary,result,size,bytes;
InetRequest* request;
if((result=SOiPrepareTempRm(NULL,&rm,&temporary))==0) {
bytes=0;
switch(family) { case 2: bytes=4; break; default: break; }
if(family==2) bytes=4;
if(!bytes) result=-5;
else if(!text) result=-28;
else {
@@ -306,10 +307,10 @@ static inline int DirectBuffer(const void* data, int length) {
static int RecvFrom(const char* name, int socket, void* data, int length, int flags, SOSockAddr* address) {
s32 rm;
int result,size;
BOOL direct;
RecvRequest* request;
void* buffer;
SOSockAddr* reply;
BOOL direct;
if(length>32768) length=32768;
if((result=SOiPrepare(name,&rm))==0) {
if(address && (address->len>8 || address->len<8)) result=-28;
@@ -317,7 +318,7 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
else {
direct=TRUE;
if(length && !DirectBuffer(data,length)) direct=FALSE;
size=((address==0 ? 0 : address->len)+95)&~31;
size=((address ? address->len : 0)+95)&~31;
request=SOiAlloc(12,size);
if(!direct) buffer=SOiAlloc(13,(length+31)&~31);
else buffer=data;
@@ -331,12 +332,13 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
request->vectors[2].base=NULL; request->vectors[2].length=0;
result=IOS_Ioctlv(rm,12,1,2,request->vectors);
} else {
memcpy(reply,(SOSockAddr*)address,address->len);
memcpy(reply,address,address->len);
request->vectors[2].base=(u8*)reply; request->vectors[2].length=address->len;
result=IOS_Ioctlv(rm,12,1,2,request->vectors);
if(result>=0) {
u32 bytes=address->len;
memcpy(address,reply,bytes>reply->len?reply->len:bytes);
if(bytes>reply->len) bytes=reply->len;
memcpy(address,reply,bytes);
}
}
if(result>=0 && !direct) memcpy(data,buffer,length);
@@ -362,20 +364,19 @@ static int SendTo(const char* name, int socket, const void* data, int length, in
direct=TRUE;
if(length && !DirectBuffer(data,length)) direct=FALSE;
request=SOiAlloc(12,96);
if(direct==0) buffer=SOiAlloc(14,(length+31)&~31);
if(!direct) buffer=SOiAlloc(14,(length+31)&~31);
else buffer=(void*)data;
if(!request || !buffer) result=-49;
else {
SendCmd* cmd=&request->command;
cmd->socket=socket; cmd->flags=flags;
if(!address) cmd->hasAddress=0;
request->command.socket=socket; request->command.flags=flags;
if(!address) request->command.hasAddress=0;
else {
cmd->hasAddress=1;
memcpy(&cmd->address,address,address->len);
request->command.hasAddress=1;
memcpy(&request->command.address,address,address->len);
}
if(!direct) memcpy(buffer,data,length);
request->vectors[0].base=buffer; request->vectors[0].length=length;
request->vectors[1].base=(u8*)cmd; request->vectors[1].length=40;
request->vectors[1].base=(u8*)&request->command; request->vectors[1].length=40;
result=IOS_Ioctlv(rm,13,2,0,request->vectors);
}
if(!direct) SOiFree(14,buffer,(length+31)&~31);

View File

@@ -94,12 +94,8 @@ int SOGetAddrInfo(const char* nodeName, const char* servName, const SOAddrInfo*
char* node;
char* service;
SOAddrInfo* requestHints;
int nodeSize,servSize;
if((result=SOiPrepare(NULL,&rm))==0) {
servSize = servName==0 ? 0 : strlen(nodeName)+1;
nodeSize = nodeName==0 ? 0 : strlen(nodeName)+1;
size=((nodeSize+31)&~31)+((servSize+31)&~31)+95;
size&=~31;
size=(((NameSize(nodeName)+31)&~31)+((servName ? strlen(nodeName)+32 : 31)&~31)+95)&~31;
request=SOiAlloc(12,size);
if(!request) result=-49;
else {
@@ -107,14 +103,14 @@ int SOGetAddrInfo(const char* nodeName, const char* servName, const SOAddrInfo*
if(!reply) { SOiFree(12,request,size); result=-49; }
else {
node=(char*)request->storage;
service=node+(((nodeName==0 ? 0 : strlen(nodeName)+1)+31)&~31);
requestHints=(SOAddrInfo*)(service+(((servName==0 ? 0 : strlen(nodeName)+1)+31)&~31));
service=node+((NameSize(nodeName)+31)&~31);
requestHints=(SOAddrInfo*)(service+((servName ? strlen(nodeName)+32 : 31)&~31));
if(nodeName) strcpy(node,nodeName);
request->vectors[0].base=nodeName ? (u8*)node : NULL;
request->vectors[0].length=nodeName==0 ? 0 : strlen(nodeName);
request->vectors[0].length=nodeName ? strlen(nodeName) : 0;
if(servName) strcpy(service,servName);
request->vectors[1].base=servName ? (u8*)service : NULL;
request->vectors[1].length=servName==0 ? 0 : strlen(servName);
request->vectors[1].length=servName ? strlen(servName) : 0;
if(hints) memcpy(requestHints,hints,32);
else memset(requestHints,0,32);
if(requestHints->family==0) requestHints->family=2;
@@ -125,7 +121,7 @@ int SOGetAddrInfo(const char* nodeName, const char* servName, const SOAddrInfo*
request->vectors[3].base=(u8*)reply; request->vectors[3].length=0x834;
result=IOS_Ioctlv(rm,24,3,1,request->vectors);
if(result>=0) {
SOAddrInfo* entry=(SOAddrInfo*)reply;
SOAddrInfo* entry=reply->entries;
u8* address=reply->addresses;
*resultInfo=entry;
while(entry) {

View File

@@ -111,8 +111,8 @@ int SOGetInterfaceOpt(void* interface, int level, int option, void* value, int*
else {
command=&request->command;
command->level=level; command->option=option;
returnedLength=(int*)((u8*)command+0x20);
reply=(u8*)returnedLength+0x20;
returnedLength=&request->length;
reply=request->value;
*returnedLength=OptionLength(length);
request->vectors[0].base=(u8*)command;
request->vectors[0].length=8;
@@ -152,7 +152,7 @@ int SOSetInterfaceOpt(void* interface, int level, int option, const void* value,
else {
command=&request->command;
command->level=level; command->option=option;
reply=(u8*)command+0x20;
reply=request->value;
if(value) memcpy(reply,value,length);
else memset(reply,0,length);
request->vectors[0].base=(u8*)command; request->vectors[0].length=8;

View File

@@ -21,22 +21,22 @@ namespace textinput {
#pragma push
#pragma section const_type ".data"
extern "C" const char lbl_8165D2D0[15] = "T_prdc_Text_00";
extern "C" const char lbl_8165D2E0[17] = "P_prdc_scrl_Left";
extern "C" const char scT_prdc_Text_00[15] = "T_prdc_Text_00";
extern "C" const char scP_prdc_scrl_Left[17] = "P_prdc_scrl_Left";
#pragma pop
#pragma push
#pragma section sconst_type ".sdata"
extern "C" const char* lbl_816973C0 = lbl_8165D2D0;
extern "C" const char* lbl_816973C4 = lbl_8165D2E0;
extern "C" const wchar_t lbl_816973C8[4] = {0, 0, 0, 1};
extern "C" const char lbl_816973D0[8] = "P_OnBtn";
extern "C" const char lbl_816973D8[8] = "B_OnBtn";
extern "C" const char* scCommonTextAnimName = scT_prdc_Text_00;
extern "C" const char* scCommonScrollAnimName = scP_prdc_scrl_Left;
extern "C" const wchar_t scEmptyWChars[4] = {0, 0, 0, 1};
extern "C" const char scP_OnBtn[8] = "P_OnBtn";
extern "C" const char scB_OnBtn[8] = "B_OnBtn";
#pragma pop
#define COMMON_TEXT_ANIM lbl_816973C0
#define COMMON_SCROLL_ANIM lbl_816973C4
#define COMMON_TEXT_ANIM scCommonTextAnimName
#define COMMON_SCROLL_ANIM scCommonScrollAnimName
// name made up, no dwarf (?)
struct AnimationFile {
@@ -77,7 +77,7 @@ namespace textinput {
char tail[12];
};
extern "C" const CandidatePaneData lbl_8165D2F8 __attribute__((aligned(8))) = {{
extern "C" const CandidatePaneData scCandidatePaneData __attribute__((aligned(8))) = {{
{KT_CandidateText, "N_predictInput", 1, NULL, {&csAninationFile[0]}},
{KT_ScrollButton,
"P_prdc_scrl_Left",
@@ -212,7 +212,7 @@ namespace textinput {
#pragma push
#pragma section const_type ".data"
extern "C" const char lbl_8165D984[132] =
extern "C" const char scPaneNameTable[132] =
"B_OffBtn\0\0\0"
"P_JPOffBtn\0"
"P_CNOffBtn\0"
@@ -222,10 +222,10 @@ namespace textinput {
"B_prdc_scrl_Rght\0\0\0"
"P_prdc_scrl_Rght\0\0\0"
"\0\0\0";
extern "C" char lbl_8165DA08[16] = "W_predictWindow";
extern "C" const char lbl_8165DA18[15] = "N_predictInput";
extern "C" const char lbl_8165DA28[13] = "W_OnOff_Area";
extern "C" const char lbl_8165DA38[13] = "N_prdc_Texts";
extern "C" char scW_predictWindow[16] = "W_predictWindow";
extern "C" const char scN_predictInput[15] = "N_predictInput";
extern "C" const char scW_OnOff_Area[13] = "W_OnOff_Area";
extern "C" const char scN_prdc_Texts[13] = "N_prdc_Texts";
#pragma pop
void CandidateBoxCaller::Candidates::addCandidate(const wchar_t* wcString) {
@@ -398,20 +398,20 @@ namespace textinput {
mTextArea.Init();
mOnOffButton.Create(this);
mOnOffButton.Init();
const char* paneNames = lbl_8165D984;
const char* paneNames = scPaneNameTable;
mLeftScroll.Create(this, paneNames + 68, paneNames + 48);
mRightScroll.Create(this, paneNames + 108, paneNames + 88);
mLeftScroll.Init();
mRightScroll.Init();
mTextWindow.Create(this, lbl_8165DA08);
mTextWindow.Create(this, scW_predictWindow);
init();
}
void LayoutByNW4R::createAnmPane_(MEMAllocator* allocator) {
CandidateTextAnmPane* pane;
for (u16 i = 0; i < ARRAY_LENGTH(lbl_8165D2F8.panes); i++) {
for (u16 i = 0; i < ARRAY_LENGTH(scCandidatePaneData.panes); i++) {
pane = NULL;
const PaneToAnimation& p = lbl_8165D2F8.panes[i];
const PaneToAnimation& p = scCandidatePaneData.panes[i];
switch (p.type) {
case KT_ScrollButton: {
void* pBtnBuf = MEMAllocFromAllocator(allocator, sizeof(CandidateScrollAnmPane));
@@ -454,7 +454,7 @@ namespace textinput {
}
void LayoutByNW4R::init() {
searchAnmPane(lbl_8165DA18)->changeAnimation(ANM_Normal);
searchAnmPane(scN_predictInput)->changeAnimation(ANM_Normal);
Base::setInvalid(false);
setActive(true);
setOnOff(false);
@@ -467,7 +467,7 @@ namespace textinput {
mpLayout->CalculateMtx(mDrawInfo);
if (meLanguage == KR) {
mTextWindow.SetVisible(false);
getPane(lbl_8165DA28)->SetVisible(false);
getPane(scW_OnOff_Area)->SetVisible(false);
} else if (meLanguage == CN) {
setOnOff(true);
mTextWindow.SetVisible(true);
@@ -477,16 +477,16 @@ namespace textinput {
} else {
mTextWindow.ChangeAnimation(ANM_Normal);
}
getPane(lbl_8165DA28)->SetVisible(false);
getPane(scW_OnOff_Area)->SetVisible(false);
} else {
getPane(lbl_8165DA28)->SetVisible(true);
getPane(scW_OnOff_Area)->SetVisible(true);
}
}
void LayoutByNW4R::draw() {
getPane(lbl_8165DA38)->SetVisible(false);
getPane(scN_prdc_Texts)->SetVisible(false);
nw4rmanager::Layout::draw();
getPane(lbl_8165DA38)->SetVisible(true);
getPane(scN_prdc_Texts)->SetVisible(true);
if (!isInvalid()) {
mTextArea.Draw(mDrawInfo);
}
@@ -496,8 +496,8 @@ namespace textinput {
nw4rmanager::Layout::calc();
mTextArea.Calc();
if (mbAnimOn) {
getPane(lbl_8165DA38)->Animate(0);
getPane(lbl_8165DA38)->CalculateMtx(mDrawInfo);
getPane(scN_prdc_Texts)->Animate(0);
getPane(scN_prdc_Texts)->CalculateMtx(mDrawInfo);
}
}
@@ -505,7 +505,7 @@ namespace textinput {
Base::setLanguage(language);
init();
// Maybe inlines, maybe not
nw4r::math::VEC3 pos = searchAnmPane(lbl_8165DA08)->getPane()->GetTranslate();
nw4r::math::VEC3 pos = searchAnmPane(scW_predictWindow)->getPane()->GetTranslate();
if (meLanguage == CN || meLanguage == KR) {
Base::checkValidation();
// Potentially an inline
@@ -520,7 +520,7 @@ namespace textinput {
pos.x = 202.0f;
}
searchAnmPane(lbl_8165DA08)->getPane()->SetTranslate(pos);
searchAnmPane(scW_predictWindow)->getPane()->SetTranslate(pos);
if (meLanguage == CN) {
mTextArea.ApplyFontScale(1.2f);
} else if (meLanguage == KR) {
@@ -531,10 +531,10 @@ namespace textinput {
}
void LayoutByNW4R::onOnOffButton(bool arg) {
const char* base = lbl_8165D2D0;
const char* base = scT_prdc_Text_00;
mTextWindow.TurnOnOff(!isOn());
if (isOn()) {
searchAnmPane(lbl_816973D0)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
searchAnmPane(scP_OnBtn)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
if (arg) {
mpEventObserver->onSE(sound::SE_PREDICT_OFF);
}
@@ -588,7 +588,7 @@ namespace textinput {
}
void LayoutByNW4R::startTurnOn(bool on) {
const char* base = lbl_8165D2D0;
const char* base = scT_prdc_Text_00;
if (isInScroll()) {
return;
}
@@ -596,7 +596,7 @@ namespace textinput {
mTextWindow.TurnOnOff(on);
if (!on) {
searchAnmPane(lbl_816973D0)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
searchAnmPane(scP_OnBtn)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
mpEventObserver->onSE(sound::SE_PREDICT_OFF);
} else {
searchAnmPane(base + 0x6a8)->onAnmEvent(nw4rmanager::AnmPane::PE_0);
@@ -637,7 +637,7 @@ namespace textinput {
current = reinterpret_cast<CandidateBoxCaller::Candidates*>(reinterpret_cast<u8*>(current) + sizeof(current->szwcPredicted[0]));
}
}
gui::PaneComponent* p = mpPaneManager->searchPaneComponent(isOn() ? lbl_816973D8 : lbl_8165D984);
gui::PaneComponent* p = mpPaneManager->searchPaneComponent(isOn() ? scB_OnBtn : scPaneNameTable);
if (p != NULL) {
p->lockInitialize(true);
}
@@ -706,8 +706,8 @@ namespace textinput {
}
void LayoutByNW4R::cancelStateFocusIn() {
const PaneToAnimation* pane = lbl_8165D2F8.panes;
for (int i = 0; i < ARRAY_LENGTH(lbl_8165D2F8.panes); i++) {
const PaneToAnimation* pane = scCandidatePaneData.panes;
for (int i = 0; i < ARRAY_LENGTH(scCandidatePaneData.panes); i++) {
CandidateTextAnmPane* p = static_cast<CandidateTextAnmPane*>(searchAnmPane(pane->paneName));
if (p != NULL) {
switch (p->getKeyType()) {
@@ -765,7 +765,7 @@ namespace textinput {
}
void LayoutByNW4R::onEvent(UIObj* obj, u32 id, void* data) {
const char* base = lbl_8165D2D0;
const char* base = scT_prdc_Text_00;
int tmp;
switch (id) {
@@ -996,7 +996,7 @@ namespace textinput {
void UITextArea::Create(nw4rmanager::Layout* layout) {
// These could have been static...
const char* textPanes[NUM_PANES] = {
lbl_8165D2D0, "T_prdc_Text_01", "T_prdc_Text_02", "T_prdc_Text_03", "T_prdc_Text_04", "T_prdc_Text_05", "T_prdc_Text_06",
scT_prdc_Text_00, "T_prdc_Text_01", "T_prdc_Text_02", "T_prdc_Text_03", "T_prdc_Text_04", "T_prdc_Text_05", "T_prdc_Text_06",
"T_prdc_Text_07", "T_prdc_Text_08", "T_prdc_Text_09", "T_prdc_Text_10", "T_prdc_Text_11", "T_prdc_Text_12", "T_prdc_Text_13",
"T_prdc_Text_14", "T_prdc_Text_15", "T_prdc_Text_16", "T_prdc_Text_17", "T_prdc_Text_18", "T_prdc_Text_19",
};
@@ -1015,7 +1015,7 @@ namespace textinput {
mpBoundingPane[i]->setListener(this);
}
mpTextAreaPane = mgr->searchPaneComponent("N_prdcTextArea");
mpTextsPane = mgr->searchPaneComponent(lbl_8165DA38);
mpTextsPane = mgr->searchPaneComponent(scN_prdc_Texts);
mSize = mpTextBoxPane[0]->getTextPane()->GetFontSize();
mpTextAreaPane->setListener(this);
}
@@ -1023,7 +1023,7 @@ namespace textinput {
void UITextArea::Init() {
for (u32 i = 0; i < NUM_PANES; i++) {
mpTextBoxPane[i]->getTextPane()->SetString(const_cast<const wchar_t*>(lbl_816973C8), 0);
mpTextBoxPane[i]->getTextPane()->SetString(const_cast<const wchar_t*>(scEmptyWChars), 0);
mpBoundingPane[i]->setTriggerTarget(true);
}
mfTextWidth = 0.0f;
@@ -1210,7 +1210,7 @@ namespace textinput {
void UITextArea::Clear() {
for (u32 i = 0; i < NUM_PANES; i++) {
mpTextBoxPane[i]->getTextPane()->SetString(const_cast<const wchar_t*>(lbl_816973C8), 0);
mpTextBoxPane[i]->getTextPane()->SetString(const_cast<const wchar_t*>(scEmptyWChars), 0);
}
}
@@ -1493,7 +1493,7 @@ namespace textinput {
if (mgr()->isInScroll() && event != 1 && event != 0) {
return;
}
if (!mgr()->searchAnmPane(lbl_8165DA08)->isInAnimation() || event == 1) {
if (!mgr()->searchAnmPane(scW_predictWindow)->isInAnimation() || event == 1) {
if (!mgr()->isInvalid()) {
switch (event) {
case 4:
@@ -1645,7 +1645,7 @@ namespace textinput {
if (mgr()->isInScroll() && event != 1 && event != 0) {
return;
}
if (!mgr()->searchAnmPane(lbl_8165DA08)->isInAnimation() || event == 1) {
if (!mgr()->searchAnmPane(scW_predictWindow)->isInAnimation() || event == 1) {
if (!mgr()->isInvalid()) {
switch (event) {
case 4:
@@ -1691,15 +1691,15 @@ namespace textinput {
mpOnPictPane = mgr->searchPaneComponent("P_OnBtn");
mpOnBoundPane = mgr->searchPaneComponent("B_OnBtn");
mpOnAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane("P_OnBtn"));
mpOffPictPane = mgr->searchPaneComponent(lbl_8165D2F8.tail);
mpOffBoundPane = mgr->searchPaneComponent(lbl_8165D984);
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(lbl_8165D2F8.tail));
mpOffPictPane = mgr->searchPaneComponent(scCandidatePaneData.tail);
mpOffBoundPane = mgr->searchPaneComponent(scPaneNameTable);
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(scCandidatePaneData.tail));
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D2F8.tail)->GetMaterial()->GetTexture(&mOffTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D984 + 12)->GetMaterial()->GetTexture(&mOffTexJP, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D984 + 24)->GetMaterial()->GetTexture(&mOffTexCN, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_816973D0)->GetMaterial()->GetTexture(&mOnTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(lbl_8165D984 + 36)->GetMaterial()->GetTexture(&mOnTexCN, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(scCandidatePaneData.tail)->GetMaterial()->GetTexture(&mOffTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(scPaneNameTable + 12)->GetMaterial()->GetTexture(&mOffTexJP, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(scPaneNameTable + 24)->GetMaterial()->GetTexture(&mOffTexCN, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(scP_OnBtn)->GetMaterial()->GetTexture(&mOnTexDefault, 0);
layout->getLayout()->GetRootPane()->FindPaneByName(scPaneNameTable + 36)->GetMaterial()->GetTexture(&mOnTexCN, 0);
mpOffBoundPane->setListener(this);
mpOnBoundPane->setListener(this);
@@ -1756,7 +1756,7 @@ namespace textinput {
if (mgr()->isInScroll() && event != 1 && event != 0) {
return;
}
if (!mgr()->searchAnmPane(lbl_8165DA08)->isInAnimation() || event == 1) {
if (!mgr()->searchAnmPane(scW_predictWindow)->isInAnimation() || event == 1) {
OnOffAnmPane* p;
if (&component == mpOnBoundPane) {
p = mpOnAnmPane;

View File

@@ -312,6 +312,10 @@ void Manager::SetFont(nw4r::lyt::FontRefLink* link) {
if (mpInputForm) mpInputForm->nw4r::ut::CharWriter::SetFont(*font);
if (mpCellPhoneKeyboard) static_cast<nw4rmanager::Layout&>(*mpCellPhoneKeyboard).SetFontForce(font);
}
void* Manager::getPredictLanguageSelectDialog() { return mpPredictLanguageDialog; }
const void* Manager::getPredictLanguageSelectDialog() const { return mpPredictLanguageDialog; }
void* Manager::getSignKeyboard() { return mpSignWindow; }
const void* Manager::getSignKeyboard() const { return mpSignWindow; }
void Manager::setDefaultPredictionJP(int count, const char** predictions) {
static_cast<tistring::WithAtok*>(getInputForm()->getAtokString())->setDefaultPrediction(count, predictions);
}

View File

@@ -312,7 +312,7 @@ namespace ipl {
#pragma push
#pragma section sconst_type ".sdata2"
extern "C" const f32 lbl_816948EC = 0.0f;
extern "C" const f32 scDateZeroF = 0.0f;
extern "C" const f32 lbl_816948F0;
#pragma pop
} // namespace scene

View File

@@ -10,9 +10,9 @@
namespace ipl {
namespace scene {
// clang-format off
extern "C" char lbl_8164E290[] = "Cursur_a";
extern "C" char scCursur_a[] = "Cursur_a";
static const char* scCursur = lbl_8164E290;
static const char* scCursur = scCursur_a;
static const char* scCursorAnims[] = {
"my_IplTop_d_FocusOff.brlan",
@@ -20,10 +20,10 @@ namespace ipl {
"my_IplTop_d_Select.brlan",
};
extern "C" const char* lbl_8169699C = "T_Balloon";
extern "C" const char* scPaneName_T_Balloon = "T_Balloon";
extern "C" const char* lbl_816969A8 = "W_Base";
extern "C" const char* lbl_816969B4 = "W_Shade";
extern "C" const char* scPaneName_W_Base = "W_Base";
extern "C" const char* scPaneName_W_Shade = "W_Shade";
static const char* scLangGroups[] = {
"JPN",
@@ -38,8 +38,8 @@ namespace ipl {
"KOR",
};
extern "C" char lbl_816969DC[] = "Calc";
extern "C" char lbl_816969E1[] = "Create";
extern "C" char scExport_Calc[] = "Calc";
extern "C" char scExport_Create[] = "Create";
#pragma pack(1)
struct ModuleData {
@@ -53,7 +53,7 @@ namespace ipl {
};
#pragma pack()
extern "C" ModuleData lbl_8164E328 = {
extern "C" ModuleData scModuleData = {
{
{
"JPN",
@@ -112,9 +112,9 @@ namespace ipl {
"icon_Whole.brlan",
};
extern "C" char lbl_8164E6AF[] = "%s_Rso%d.brlan";
extern "C" char lbl_8164E6C0[] = "icon_Start.brlan";
extern "C" char lbl_816969E8[] = "arc";
extern "C" char scBrlan_RsoFmt[] = "%s_Rso%d.brlan";
extern "C" char scBrlan_icon_Start[] = "icon_Start.brlan";
extern "C" char scArc[] = "arc";
static const u32 scLangLookup[SC_PRODUCT_AREA_MAX][16] = {
// Japan
@@ -296,7 +296,7 @@ namespace ipl {
int ChannelObj::calcExtModule(EGG::ExpHeap* expHeap, bool unk0, bool onSceneChange) {
int result = EXT_MODULE_RESULT_WAIT;
const char* dataBase = lbl_8164E290;
const char* dataBase = scCursur_a;
if (mExtModuleState == EXT_MODULE_STATE_UNAVAILABLE) {
return EXT_MODULE_RESULT_UNAVAILABLE;
@@ -354,7 +354,7 @@ namespace ipl {
// Import `int Calc(int)`
// This is during ChannelObj's loop.
mpRSOCalc = (channel::CalcFunc)RSOFindExportSymbolAddr(mpRSOHeader, lbl_816969DC);
mpRSOCalc = (channel::CalcFunc)RSOFindExportSymbolAddr(mpRSOHeader, scExport_Calc);
// Import `void ThreadCalc()`
// This is executed on a seperate thread.
@@ -364,7 +364,7 @@ namespace ipl {
// Import `void Create(nw4r::lyt::Layout*)`
// This is the initialization of the module.
channel::CreateFunc createFunc = (channel::CreateFunc)RSOFindExportSymbolAddr(mpRSOHeader, lbl_816969E1);
channel::CreateFunc createFunc = (channel::CreateFunc)RSOFindExportSymbolAddr(mpRSOHeader, scExport_Create);
if (createFunc != NULL) {
createFunc(mpThumbLayout->getNW4RLyt());
}
@@ -501,8 +501,8 @@ namespace ipl {
}
void ChannelObj::createDiskLayout(void* data) {
const ModuleData* moduleData = reinterpret_cast<const ModuleData*>(lbl_8164E290 + 0x98);
mpDiskLayout = layout::Object::create(mpDiskHeap, 0x19000, data, lbl_816969E8, moduleData->iconBrlyt);
const ModuleData* moduleData = reinterpret_cast<const ModuleData*>(scCursur_a + 0x98);
mpDiskLayout = layout::Object::create(mpDiskHeap, 0x19000, data, scArc, moduleData->iconBrlyt);
setLangPane(mpDiskLayout);
if (mpDiskLayout->searchFile(moduleData->iconBrlan)) {
@@ -638,33 +638,33 @@ namespace ipl {
void ChannelObj::setLangPane(const layout::Object* layout) {
int lang = System::getLanguage();
const char* langGroup = scLangGroups[lang];
char local_50[40] = "";
char langCodeBuf[40] = "";
bool bVar4 = false;
bool foundLangGroup = false;
for (nw4r::lyt::GroupList::Iterator it = layout->GetGroupList().GetBeginIter(); it != layout->GetGroupList().GetEndIter(); it++) {
if (strcmp(it->GetName(), langGroup) == 0) {
bVar4 = true;
foundLangGroup = true;
} else {
bool bVar3 = true;
bool isNonRsoGroup = true;
for (int i = 0; i < channel::MAX_ANIMS; i++) {
char name[6];
sprintf(name, "Rso%d", i);
if (strncmp(it->GetName(), name, 5) == 0) {
bVar3 = false;
isNonRsoGroup = false;
break;
}
}
if (bVar3) {
if (isNonRsoGroup) {
for (nw4r::lyt::PaneLinkList::Iterator it2 = it->GetPaneList().GetBeginIter(); it2 != it->GetPaneList().GetEndIter(); it2++) {
it2->mTarget->SetVisible(false);
}
for (int i = 0; i < 10; i++) {
if (strncmp(it->GetName(), scLangGroups[i], 3) == 0) {
memcpy(&local_50[i], it->GetName(), 3);
local_50[i + 3] = 0;
memcpy(&langCodeBuf[i], it->GetName(), 3);
langCodeBuf[i + 3] = 0;
break;
}
}
@@ -672,7 +672,7 @@ namespace ipl {
}
}
if (bVar4) {
if (foundLangGroup) {
nw4r::lyt::Group* group = layout->FindGroupByName(langGroup);
for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++) {
it->mTarget->SetVisible(true);
@@ -680,10 +680,10 @@ namespace ipl {
} else {
s32 region = System::getRegion();
for (int i = 0; i < channel::MAX_ANIMS; i++) {
char* groupName = (char*)lbl_8164E328.langGroupLookup[region][i];
char* groupName = (char*)scModuleData.langGroupLookup[region][i];
if (groupName != NULL) {
if (strcmp(groupName, &local_50[scLangLookup[region][i]]) == 0) {
if (strcmp(groupName, &langCodeBuf[scLangLookup[region][i]]) == 0) {
nw4r::lyt::Group* group = layout->FindGroupByName(groupName);
for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter();
it++) {
@@ -698,7 +698,7 @@ namespace ipl {
void ChannelObj::bindRsoAnm(layout::Object* layout, layout::Animator** anims, const char* layoutFile) {
for (int i = 0; i < channel::MAX_ANIMS; i++) {
char fileName[20];
sprintf(fileName, lbl_8164E6AF, layoutFile, i);
sprintf(fileName, scBrlan_RsoFmt, layoutFile, i);
if (layout->searchFile(fileName)) {
char groupName[8];
@@ -730,7 +730,7 @@ namespace ipl {
}
void ChannelObj::createThumbnail() {
bool bVar1 = false;
bool shouldAdjustHeap = false;
if (mpBalloonLayout == NULL && System::getChannelManager()->isLoaded(mChanPage, mChanIndex)) {
initBalloon();
@@ -746,12 +746,12 @@ namespace ipl {
frame = createWadThumbnail();
} else {
frame = createWrongThumbnail();
bVar1 = true;
shouldAdjustHeap = true;
}
}
} else {
frame = createEmptyThumbnail();
bVar1 = true;
shouldAdjustHeap = true;
}
calcNormal();
@@ -764,7 +764,7 @@ namespace ipl {
mpThumbAnim->setCurrentFrame(frame);
}
if (bVar1) {
if (shouldAdjustHeap) {
mpThumbLayout->adjustHeap();
}
}
@@ -772,10 +772,10 @@ namespace ipl {
f32 ChannelObj::createWadThumbnail() {
f32 frame = 0.0f;
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpThumbFile->getBuffer(), lbl_816969E8, lbl_8164E290 + 0x3F8);
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpThumbFile->getBuffer(), scArc, scCursur_a + 0x3F8);
setLangPane(mpThumbLayout);
const char* dataBase = lbl_8164E290;
const char* dataBase = scCursur_a;
u32 rsoIdx = System::getChannelManager()->getIconRSOIdx(mChanPage, mChanIndex);
u32 csIdx = System::getChannelManager()->getIconCSIdx(mChanPage, mChanIndex);
@@ -826,11 +826,11 @@ namespace ipl {
return frame;
}
extern "C" char lbl_8164E6CF[] = "my_IplTop_b.brlyt";
extern "C" char lbl_8164E6E1[] = "my_IplTop_b.brlan";
extern "C" char scBrlyt_my_IplTop_b[] = "my_IplTop_b.brlyt";
extern "C" char scBrlan_my_IplTop_b[] = "my_IplTop_b.brlan";
f32 ChannelObj::createWrongThumbnail() {
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpSysLayoutFile, lbl_816969E8, lbl_8164E6CF);
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpSysLayoutFile, scArc, scBrlyt_my_IplTop_b);
mpThumbLayout->FindPaneByName("Ch0")->SetVisible(false);
mpThumbLayout->FindPaneByName("Ch1")->GetMaterial()->SetTevColor(0, (GXColorS10){0, 0, 0, 255});
@@ -841,8 +841,8 @@ namespace ipl {
}
f32 ChannelObj::createEmptyThumbnail() {
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpSysLayoutFile, lbl_816969E8, lbl_8164E6CF);
mpThumbAnim = mpThumbLayout->bind(lbl_8164E6E1);
mpThumbLayout = layout::Object::create(mpMainHeap, 0x8000, mpSysLayoutFile, scArc, scBrlyt_my_IplTop_b);
mpThumbAnim = mpThumbLayout->bind(scBrlan_my_IplTop_b);
return System::getRndm()->get_u16() % 2000;
}
@@ -871,12 +871,12 @@ namespace ipl {
calcBalloon(pos);
}
extern "C" char lbl_8164E6F3[] = "my_IplTop_d.brlyt";
extern "C" char lbl_8164E705[] = "my_IplTopBalloon_a.brlyt";
extern "C" char lbl_8164E71E[] = "my_IplTopBalloon_a_BalloonInOut.brlan";
extern "C" char scBrlyt_my_IplTop_d[] = "my_IplTop_d.brlyt";
extern "C" char scBrlyt_my_IplTopBalloon_a[] = "my_IplTopBalloon_a.brlyt";
extern "C" char scBrlan_BalloonInOut[] = "my_IplTopBalloon_a_BalloonInOut.brlan";
void ChannelObj::initCursor() {
mpCursorLayout = new (mpCursorHeap, 4) layout::Object(mpCursorHeap, mpSysLayoutFile, lbl_816969E8, lbl_8164E6F3);
mpCursorLayout = new (mpCursorHeap, 4) layout::Object(mpCursorHeap, mpSysLayoutFile, scArc, scBrlyt_my_IplTop_d);
for (int i = 0; i < ANIM_CURSOR_MAX; i++) {
mpCursorAnims[i] = mpCursorLayout->bind(scCursorAnims[i], scCursur, false);
@@ -1001,19 +1001,19 @@ namespace ipl {
mpBalloonLayout = NULL;
return;
}
mpBalloonLayout = new (mpBalloonHeap, 4) layout::Object(mpBalloonHeap, mpSysLayoutFile, lbl_816969E8, lbl_8164E705);
mpBalloonLayout = new (mpBalloonHeap, 4) layout::Object(mpBalloonHeap, mpSysLayoutFile, scArc, scBrlyt_my_IplTopBalloon_a);
setBalloonText((wchar_t*)System::getChannelManager()->getTitleName(mChanPage, mChanIndex, 0));
mpBalloonAnim = mpBalloonLayout->bind(lbl_8164E71E);
mpBalloonAnim = mpBalloonLayout->bind(scBrlan_BalloonInOut);
setBalloonAnim(0);
mpBalloonLayout->finishBinding();
}
extern "C" char lbl_8164E744[] = "WIPL_SE_BALLOON";
extern "C" char scSE_BALLOON[] = "WIPL_SE_BALLOON";
void ChannelObj::setBalloonText(const wchar_t* text) {
nw4r::lyt::TextBox* textPane = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpBalloonLayout->FindPaneByName(lbl_8169699C));
nw4r::lyt::TextBox* textPane = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpBalloonLayout->FindPaneByName(scPaneName_T_Balloon));
wchar_t fullStr[channel::META_CHANNEL_NAME_LENGTH + 3] = L"";
u32 strLen;
@@ -1052,22 +1052,22 @@ namespace ipl {
nw4r::ut::Rect textRect = textPane->GetTextDrawRect(*mpBalloonLayout->getDrawInfo());
nw4r::lyt::Size newSize(mpBalloonLayout->FindPaneByName(lbl_816969A8)->GetSize());
nw4r::lyt::Size newSize(mpBalloonLayout->FindPaneByName(scPaneName_W_Base)->GetSize());
newSize.width = textRect.right - textRect.left + 40.0f;
if (newSize.width < mLocationAdjust * 160.0f) {
newSize.width = mLocationAdjust * 160.0f;
}
mpBalloonLayout->FindPaneByName(lbl_816969B4)->SetSize(newSize);
mpBalloonLayout->FindPaneByName(lbl_816969A8)->SetSize(newSize);
mpBalloonLayout->FindPaneByName(scPaneName_W_Shade)->SetSize(newSize);
mpBalloonLayout->FindPaneByName(scPaneName_W_Base)->SetSize(newSize);
}
void ChannelObj::calcBalloon(const nw4r::math::VEC3& vec) {
if (mpBalloonLayout != NULL) {
nw4r::lyt::Size size;
size = mpBalloonLayout->FindPaneByName(lbl_816969A8)->GetSize();
size = mpBalloonLayout->FindPaneByName(scPaneName_W_Base)->GetSize();
f32 val = -2.0f + ((size.height / 2) + mThumbHeight);
val *= -1.0f;
@@ -1117,7 +1117,7 @@ namespace ipl {
mpBalloonLayout->GetRootPane()->SetVisible(true);
mpBalloonLayout->setAnmType(ANIM_TYPE_FORWARD);
mpBalloonLayout->start();
snd::getSystem()->startSE(lbl_8164E744);
snd::getSystem()->startSE(scSE_BALLOON);
} else if (unk == 4) {
unk_0x68 = 0;
}
@@ -1229,7 +1229,7 @@ namespace ipl {
if (group != NULL) {
mpNwc24NewGroup = group;
} else {
lookup = (char**)lbl_8164E328.langGroupLookup[System::getRegion()];
lookup = (char**)scModuleData.langGroupLookup[System::getRegion()];
for (int i = 0; lookup[i] != NULL; i++) {
sprintf(grpName, "New_%s", lookup[i]);

View File

@@ -19,7 +19,7 @@ extern "C" {
}
extern "C" void _seBlk__Q23ipl3snd();
extern "C" nw4r::snd::SoundHandle* _mainBGMHandle__Q23ipl3snd;
extern "C" const f32 lbl_816946A4;
extern "C" const f32 scSoundZeroF;
extern "C" const f32 lbl_816946AC;
extern "C" const f32 lbl_816946A8;
extern "C" const f32 lbl_816946B0;
@@ -265,10 +265,10 @@ namespace ipl {
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
lfs f1, lbl_816946A4
lfs f1, scSoundZeroF
li r4, 0
bl SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi
lfs f1, lbl_816946A4
lfs f1, scSoundZeroF
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl setMasterVolume__17BannerSoundPlayerFf
addi r11, r1, 0x20
@@ -315,7 +315,7 @@ namespace ipl {
sBannerSoundPlayer.setMasterVolume(0.9f);
}
extern "C" const f32 lbl_816946A4 = 0.0f;
extern "C" const f32 scSoundZeroF = 0.0f;
void System::stopBannerSound(int unk) {
sBannerSoundPlayer.stop(unk);

View File

@@ -1,144 +0,0 @@
## Pass 3 (w0929 worker session)
### Member-function symbol-name dialect (new lever)
Orig .o symbol names come from symbols.txt metadata, not ground truth. Orig's
`__nupGetBootVersion__FP14ESTitleVersion` used an old no-class-scope `__F`
member dialect; the fn is actually `s32 NUPContextInfo::__nupGetBootVersion(ESTitleVersion*)`.
Writing it as a member fn + fixing symbols.txt to the `__14NUPContextInfoF` name
made objdiff pair it (None → 99.36, insn-identical, 17 regname diffs remain).
Correcting WRONG names in symbols.txt is legitimate (extracted objects never link).
### Re-tested-condition decode (new lever)
`if (x != y) { result = ERR; } if (x != y) { *out = x; }` — re-testing the same
comparison emits a dead second `cmplw`. Took `__nupGetBoot2Version`/`__nupOp`
from 437 to 438=438 structural match.
### MD5 dual-lwbrx STEP
Orig emits TWO `__lwbrx(word,0)` loads per step: first feeds the `>>` (rotate-low)
chain `word + (const + (a+f))`, second feeds `word + const` → `(a+f) + wc` (`<<` side).
Capture order matters: `_xw = __lwbrx(w)` (X side) then `_wc = __lwbrx(w) + *const`
(Y side), `a += f` between decl and use, `(a) = b + (((a)+_wc) << n | (_xw + (const + a)) >> (32-n))`.
Reversed `|` operands pick srwi-base + rlwimi (orig) over slwi+rlwimi. 57.1 → 70.8.
Residual: orig's `word` walks in-place (`addi r4,r4,4`) vs MWCC strength-reduced
`base + 4k` recomputes; post-inc/_wp capture forms don't defeat it. Documented tie.
### `!direct` arm-order (SOBasic RecvFrom/SendTo)
Orig: `if (!direct) buffer = SOiAlloc(...); else buffer = data;` — alloc in-line,
data out-of-line via `bne`. `if(direct) data else alloc` emits opposite layout.
SendTo: `if (direct == 0)` form (not `switch(direct){default/case 1}` which emits
`cmpwi 1; beq`, nor `!direct` ternary which flips arms back). RecvFrom: `!direct`.
Both now instruction-identical (regname-only residual).
### Interface fn-pointer marshal order (hmac — partial)
`context->interface.init(work)` vs `init(context->digestContext)`: reusing the
`work` local matches orig's `mr r3,rX`; recomputing emits `addi r3,ctx,0x20`.
NETHMACGetDigest orig keeps `context->digestContext` in a callee web for calls
1/4/5 and materializes `work` via `mr r31,r30` at first use (web-split copy);
my build rematerializes the addi — 3-insn gap, allocator-internal.
### Cold-block out-of-line (HttpStringFlush — parked)
Orig emits `blt → growth-block` + `b → malloc` (growth block detached, cold).
`if/else`, positive `if`, `!cond` ternary, `goto` forms all normalize to
in-line growth. Same family as the documented select/cold-block walls.
### Base64Encode / ParseServerInfo / nupOp / GetTitleSize / GetBootVersion
All verified: instruction-identical streams (452=452 ParseServerInfo) or tiny
scheduling swaps — pure web-rotation / marshal-order ties, no source lever found.
### AESiEncryptBlock / AESiDecryptBlock / NETAESCreateEx
158=158 / structurally complete — remaining diff is the interleave ORDER of the
16 table-index `rlwinm` extracts vs `lwzx` loads across the 4 ENCRYPT terms
(pure list-scheduler shape); ENCRYPT operand-assoc/order variants don't move it.
## Pass 4 (orchestrator resume — decode walls)
### MD5 base-materialization + increment placement (70.8 -> 79.2)
Orig materializes `&indices` at the round-2 boundary (`lis/addi` mid-function), not in
the prologue — `u32* index` declared at top but `index = indices` assigned BETWEEN
loop 1 and loop 2. Orig also schedules `++constant` inside the step body (each step's
end), not as a separate statement after STEP — `++constant` moved inside the STEP
macro tail. Combined: 70.8 -> 79.2, 307=307 insns. `*++constant`/`*constant++` forms
score higher (75.7) but read constants[1..64] — semantically wrong (OOB on last step),
rejected. Residual: software-pipelining — orig prefetches next-step `lwz 4(rc)` /
`lwz idx` / `lwbrx` into the current step's tail; MWCC won't pipeline with this web
set. Tried: block-scoped round webs (C89 — no for-init decls; block-wrap BUILDFAIL
fixup attempt regressed), `*index++`/`word++` in expr/macro (74.1), block/wptr
elimination via context->buffer32 (70.0), const-1 init (73.1).
### AES extract/load interleave — all forms regress (60.35 stays)
nextA-D temps confirmed (fused per-statement key-xor -> 44). Tried: key+=4 early
(57.4), xor order rev (56.0), next-decl rev (58.7), xor operand swap key^next (56.4),
for(rounds>1) (53.8), *key++ (57.4), reversed xor chain (52.8), right-assoc (56.0).
Orig's interleave mixes extract/lwzx/rotlwi/xor across all 4 terms — MWCC list-
scheduler shape, no source lever found. Documented wall.
### ParseServerInfo — instruction-identical, pure reg rotation (98.11)
Normalized diff = 5 symbol-name artifacts only; raw diff = whole-fn callee-web
rotation (orig binds &locals to r25/r22/r23 webs, mine r24/r25/r27 + one web escapes
to r18). Decl-order rotation inert (all 4 orders = 98.11); per-block start/valueLength
locals regressed (94.09) — shared decls confirmed. Documented wall.
## Pass 5 (orchestrator resume — nup_nhttp gaps)
### NhttpOp/BufFull/HttpStringFlush structure check
All 9 nup_nhttp fns implemented — complete_code 22.6% reflects 3 sub-100 fns' whole
sizes, not missing code. Same for nup (53.4%).
### BufFull 96.44 -> 97.58
done-block store order: `*length = 0; next = NULL;` (orig emits `li r0,0; li r30,0;
stw r0` — separate zero materializations per use). Residual (3 blocks): cmplw
operand order on `received + *length < received` (sum-temp/operand-swap inert),
next==NULL alloc cold-block (`beq→alloc;b→merge` vs `bne` — goto/else forms inert),
req>=0x8000 set-block same cold-block family. Documented wall.
### HttpStringFlush 96.88 — cold-block, all forms inert
Orig `blt→growth;b→merge` out-of-line growth block. Tried: double-goto
(`if(req<total) goto grow; goto alloc;`), single-goto-skip, empty-else — all
normalize to in-line `bge`. Same wall as BufFull alloc block.
### NhttpOp 98.79 — single `li r29,0` placement
Orig rematerializes the `*colon=0`/`*end=0` store-zero fresh after memcpy
(web-split); mine shares headerCopy's NULL web. `'\0'` literal + late-init
headerCopy inert — allocator-internal. Documented tie.
## Pass 6 — md5 ProcessBlock 74.14 -> 81.68/81.71
Two decodes landed:
- `_k = *constant` as a separate temp BEFORE the lwbrx pair (orig emits `lwz const`
first, then the two word loads — a distinct constant web vs folding `*constant`
into the _wc expression). 74.14 -> 80.86.
- `_p` pointer capture inside STEP + post-increment args at call sites
(`STEP(..., word++, 7)` and `STEP(..., block + *index++, 5)`). The `word++`
evaluates once into `_p`, so both lwbrx see the same address while the pointer
walks in place — reproduces orig's `addi r4,r4,4` per-step in-place walk
(vs MWCC's `base+offset` temps from `++word` statements). `wptr` local deleted.
index++ likewise folds to orig's stride-16/offset form. -> 81.68.
- `(_wc + (a))` operand order -> 81.71.
Rejected: `++(word)` inside shared macro tail (no-op; semantically wrong for
rounds 2-4 anyway), `word[i]` args (type error), xw-before-k decl order (74.13),
(a)+=(f) before loads (buildfix attempt broke), shift-assoc `((_xw + _k) + a)` (79.5).
Residual (32 diff blocks): pure scheduler micro-order — orig prefetches
next-step `lwz const`/`lwz idx`/`lwbrx` into the current step's tail; insn count
306 = 306. Documented pipelining wall.
## Pass 6b — hmac globals + remaining wall checks
### hmac .sdata STB_GLOBAL decode
Orig emits `lbl_81697AB0` (7B "hmac.c") + `lbl_81697AB8` (2B "\n") as STB_GLOBAL
.sdata objects — real file-scope non-static char arrays in the original source.
Decoded as `char hmac_file_name[]` + `char hmac_newline[]`; call sites updated.
Codegen unchanged (93.36) — remaining Init diffs are (a) pool/work callee-web
swap (r29/r31 rotation family), (b) `i` counter binding r4-vs-r3 in the unrolled
xor loop. Levers tried: ptr-idx/ptr-walk loop forms (84-87, regress), int-i
(77, regress — wrong cmp type), decl-swap (no-op).
### Base64Encode 86.54 — parked
count→r7-vs-r10 binding + `li` placement among stores + `lbzx` scheduling.
declswap/reset-late/count-=3/!=3 all no-op or regress. 63=63 insns otherwise.
### SOGetSockName 96.67 — parked
Single `mr r3,r28` marshal-order placement diff (r3 arg last vs first).
63=63 insns, reply-web identical. Scheduler-internal.