Compare commits

..

159 Commits

Author SHA1 Message Date
coah
c6fbcbe532 Refresh completion code total after removing overlapping extent 2026-10-02 02:55:15 -05:00
github-actions[bot]
b84b3c0d57 docs: update progress [skip ci] 2026-10-02 07:45:02 +00:00
coah
950bb0dda6 match(NHTTP_socket_RVL 8/10) (fz2c) (worker d651d6ad) (#770) 2026-10-02 02:43:25 -05:00
github-actions[bot]
de05797e19 docs: update progress [skip ci] 2026-10-02 07:43:17 +00:00
coah
c70816c7e1 match(PFPATH_MatchFileNameWithPattern: fix overlapping symbol extent) (orchestrator) (worker 5f027758) (#769) 2026-10-02 02:40:46 -05:00
github-actions[bot]
1d290fa12a docs: update progress [skip ci] 2026-10-02 07:33:40 +00:00
coah
6547b1fa10 Link memo input form natively after exact data restoration (#768) 2026-10-02 02:32:54 -05:00
github-actions[bot]
3bdb663f09 docs: update progress [skip ci] 2026-10-02 07:28:48 +00:00
coah
8120309670 Link matched SDK FAT12 and file units natively (#767) 2026-10-02 02:27:48 -05:00
github-actions[bot]
a4c84cbf53 docs: update progress [skip ci] 2026-10-02 07:25:52 +00:00
coah
6ebe56bc04 Emit GCWindow interpolation constructor in native order and link (#765) 2026-10-02 02:24:55 -05:00
github-actions[bot]
69c235ffc2 docs: update progress [skip ci] 2026-10-02 07:23:27 +00:00
coah
767f393bf9 data(iplESMisc data 100%), match(NHTTP_stdlib_RVL 11/14, data 100%) (near8g) (worker 2fc43755) (#766) 2026-10-02 02:22:15 -05:00
github-actions[bot]
6368cc44e9 docs: update progress [skip ci] 2026-10-02 07:20:46 +00:00
coah
7deffd048c data(MyTiInputForm data 100%, tiInputForm/MyTiManager data up) (data-d4b) (worker 4e1959af) (#764) 2026-10-02 02:19:33 -05:00
github-actions[bot]
4aaa362c5e docs: update progress [skip ci] 2026-10-02 07:14:34 +00:00
coah
5fe0a61af7 Initialize KPR callbacks explicitly and enable native linking (#762) 2026-10-02 02:13:46 -05:00
github-actions[bot]
dbf6a1256e docs: update progress [skip ci] 2026-10-02 07:13:27 +00:00
coah
c6c0b145f8 match(pf_fat12 4/4) (fz3b) (worker 18afdc56) (#763) 2026-10-02 02:12:31 -05:00
github-actions[bot]
b38c5653df docs: update progress [skip ci] 2026-10-02 07:11:00 +00:00
coah
d9cf3598fc match(iplMemoryCardManager 18/26) (near9f) (worker 05f3938f) (#761) 2026-10-02 02:09:55 -05:00
coah
c44fbd7209 match(pf_file 45/45) (fz2b) (worker 26c4b368) (#760) 2026-10-02 02:07:43 -05:00
coah
f78a686e32 Correct AOSS allocation callback symbol signatures (#759) 2026-10-02 02:05:41 -05:00
coah
c9fb0697ca tools: audit literal values at corresponding PPC calls (#758) 2026-10-02 01:59:04 -05:00
github-actions[bot]
11df09974b docs: update progress [skip ci] 2026-10-02 06:57:45 +00:00
coah
a3b27c9ed0 match(puh_msc_blk 10/11; pf_fat12, iqdec fuzzy up) (fz3) (worker 6651d7cf) (#757) 2026-10-02 01:56:45 -05:00
github-actions[bot]
91fd1dcb69 docs: update progress [skip ci] 2026-10-02 06:55:24 +00:00
coah
b02273897c fuzzy(zidawg1, zi8pud2, ziswordw structure; ziswordw data) (data-d11b) (worker 9a700863) (#756) 2026-10-02 01:54:31 -05:00
github-actions[bot]
249c129e67 docs: update progress [skip ci] 2026-10-02 06:53:24 +00:00
coah
9ef60d674d match(iplGCWindow 48/48, NWC24MBoxCtrl data 100%) (fz4) (worker 715d7be2) (#755) 2026-10-02 01:52:29 -05:00
github-actions[bot]
aa677ad520 docs: update progress [skip ci] 2026-10-02 06:47:56 +00:00
coah
cbf6363d0f match(kpr_lib 9/9, zconvert 3/4) (fz2) (worker 7208e236) (#754) 2026-10-02 01:46:58 -05:00
github-actions[bot]
c4857800df docs: update progress [skip ci] 2026-10-02 06:33:14 +00:00
coah
0dd0a6941a data(iplSDChannelSelect, iplChannelSelect, wad, NHTTP_thread data 100%) (data-d5c) (worker a2bc7e81) (#753) 2026-10-02 01:32:21 -05:00
github-actions[bot]
422a344b28 docs: update progress [skip ci] 2026-10-02 06:29:37 +00:00
coah
5543b7b720 data(tiTextDrawer data 100%) (data-d14) (worker 6757043c) (#752) 2026-10-02 01:28:42 -05:00
github-actions[bot]
5d63d15248 docs: update progress [skip ci] 2026-10-02 06:27:05 +00:00
coah
2f0f5a44c7 data(zi8alpha data 180->516) (data-d13) (worker 5c2aec13) (#751) 2026-10-02 01:26:05 -05:00
github-actions[bot]
08923eda6c docs: update progress [skip ci] 2026-10-02 06:17:06 +00:00
coah
0c94076d99 data(NHTTP_thread data 88->304) (data-d5b) (worker b909c94b) (#750) 2026-10-02 01:16:02 -05:00
github-actions[bot]
0695760312 docs: update progress [skip ci] 2026-10-02 06:15:45 +00:00
coah
b3c23834a7 data(iplAddressEdit, iplAddress, WPADHIDParser, iplBoardObject data 100%) (data-d7b) (worker 364037a2) (#749) 2026-10-02 01:14:46 -05:00
coah
b145a74db1 data(tiHwKeyboard, sha1, nettime data 100%) (data-d12) (worker b6f9650f) (#748) 2026-10-02 01:13:29 -05:00
github-actions[bot]
b941fc6268 docs: update progress [skip ci] 2026-10-02 06:11:34 +00:00
coah
d5cd4ca777 data(RFL MiddleDatabase/MakeTex/DataUtility/NWC24 data 100%) (data-d10b) (worker 65d1c6de) (#747) 2026-10-02 01:10:19 -05:00
github-actions[bot]
5b7fb6f968 docs: update progress [skip ci] 2026-10-02 06:07:04 +00:00
coah
6fa90e5574 Link the verified native AXFXChorusExp unit (#746) 2026-10-02 01:06:03 -05:00
github-actions[bot]
9702056bda docs: update progress [skip ci] 2026-10-02 06:04:52 +00:00
coah
dc40dd44bb data(RFL Database/HiddenDatabase/NANDLoader/Model data 100%) (data-d9) (worker ba614360) (#745) 2026-10-02 01:03:37 -05:00
github-actions[bot]
32f358cd65 docs: update progress [skip ci] 2026-10-02 06:01:45 +00:00
coah
0cc4c57ecd data(NHTTP_os_RVL, iplDate data 100%, ATERM +80) (data-d3b) (worker 385ef001) (#744) 2026-10-02 01:00:51 -05:00
coah
a1d6b7d930 Correct fixed-width candidate pane-name record boundaries (#742) 2026-10-02 00:57:56 -05:00
github-actions[bot]
18e8dd2d07 docs: update progress [skip ci] 2026-10-02 05:56:49 +00:00
coah
09d3f9beef data(iplController, d_nhttp, iplKeyboard data 100%) (data-d1c) (worker 154fb6cd) (#743) 2026-10-02 00:55:55 -05:00
github-actions[bot]
41adc87d89 docs: update progress [skip ci] 2026-10-02 05:54:16 +00:00
coah
d2ef39c441 data(sd_drv, www_surface, iplFocusObject data 100%) (data-d6b) (worker 85303ada) (#741) 2026-10-02 00:52:57 -05:00
github-actions[bot]
1296031075 docs: update progress [skip ci] 2026-10-02 05:46:15 +00:00
coah
775167f4a5 Link the verified native NUP HTTP unit (#740) 2026-10-02 00:45:17 -05:00
github-actions[bot]
547637bf79 docs: update progress [skip ci] 2026-10-02 05:43:38 +00:00
coah
2b1e29a746 data(iplKeyboard data 1176/1184) (data-d1b) (worker 9e9e6cc1) (#739) 2026-10-02 00:42:44 -05:00
github-actions[bot]
394f6c2444 docs: update progress [skip ci] 2026-10-02 05:41:38 +00:00
coah
35e7147b97 data(iplUSBAP, AOSS data 100%, iplSetting +640, ATERM sbss) (data-d3) (worker ef0da9b3) (#738) 2026-10-02 00:40:50 -05:00
github-actions[bot]
ed3fad1bff docs: update progress [skip ci] 2026-10-02 05:38:15 +00:00
coah
f72e4281a8 match(AXFXChorusExp 7/7) (near7f) (worker f241c3a9) (#737) 2026-10-02 00:37:19 -05:00
github-actions[bot]
f6fd278076 docs: update progress [skip ci] 2026-10-02 05:34:04 +00:00
coah
4b25950eeb data(iplGCWindow, iplSDMemory data 100%) (data-d5) (worker a506aca5) (#736) 2026-10-02 00:32:51 -05:00
coah
dc5d3cf81b Use the implicit HKBManager destructor and link native C++ (#734) 2026-10-02 00:32:38 -05:00
github-actions[bot]
d54e4ba47a docs: update progress [skip ci] 2026-10-02 05:31:35 +00:00
coah
3f330a39ea data(sd_drv data 408->1016) (data-d6) (worker 7268acb9) (#735) 2026-10-02 00:30:26 -05:00
github-actions[bot]
85701c828f docs: update progress [skip ci] 2026-10-02 05:27:56 +00:00
coah
f37268de4f data(BS2Update, iplSound, AOSSLink, iplRakuRakuThread data 100%) (data-d2) (worker 1146ea35) (#733) 2026-10-02 00:26:43 -05:00
github-actions[bot]
26afef0d00 docs: update progress [skip ci] 2026-10-02 05:25:02 +00:00
coah
ecd5e498b5 match(iplMemoryCardManager 17/26) (near9d) (worker ef0188be) (#732) 2026-10-02 00:24:04 -05:00
coah
68e1ee3a35 Restore two original CDB record diagnostic messages (#731) 2026-10-02 00:22:41 -05:00
github-actions[bot]
bcb2ac0e37 docs: update progress [skip ci] 2026-10-02 05:21:18 +00:00
coah
00ff6ea6a0 data(OSUtf 48704/48704 data, iplKeyboard 31/32) (data-d1) (worker c9656d2b) (#730) 2026-10-02 00:20:11 -05:00
github-actions[bot]
eadb516be8 docs: update progress [skip ci] 2026-10-02 05:18:56 +00:00
coah
e3be21cd6c match(nup_nhttp 9/9) (near8e) (worker 6e28d64b) (#729) 2026-10-02 00:18:07 -05:00
coah
9eb08c48a7 Restore the original decide sound in address-book click handling (#727) 2026-10-02 00:16:06 -05:00
github-actions[bot]
456e9dbd2e docs: update progress [skip ci] 2026-10-02 05:15:36 +00:00
coah
4d08c3005b match(tiHKBManager 29/29) (near6i) (worker ba6dfd2a) (#728) 2026-10-02 00:14:31 -05:00
coah
a16c5191f0 Fix the waiting pane references in settings visibility calls (#726) 2026-10-02 00:13:43 -05:00
coah
eecf16f01e Extend memo Manager vtable through its proven final virtual slot (#725) 2026-10-02 00:02:01 -05:00
github-actions[bot]
73f5b332e2 docs: update progress [skip ci] 2026-10-02 04:55:57 +00:00
coah
3d97a4040f Prevent false pointer relocation in the SDK CP932 scalar table (#724) 2026-10-01 23:55:19 -05:00
coah
0b623f581b Restore memo destructor definitions; defer unresolved data linking (#714) 2026-10-01 23:47:34 -05:00
github-actions[bot]
f4e539191d docs: update progress [skip ci] 2026-10-02 04:46:16 +00:00
coah
cb0716f7a5 match(pf_path 26/27) (near6g) (worker 8270df04) (#723) 2026-10-01 23:45:27 -05:00
github-actions[bot]
d47d308721 docs: update progress [skip ci] 2026-10-02 04:45:10 +00:00
coah
1bf9ae4569 match(tiPcKeyboard 140/141, AXFXChorusExp 6/7, aes 7/9) (near7d) (worker 348bb89e) (#722) 2026-10-01 23:44:15 -05:00
github-actions[bot]
bab82c12dd docs: update progress [skip ci] 2026-10-02 04:40:19 +00:00
coah
ccca706770 Match and link USBAP registration; correct thread sbss ownership (#721) 2026-10-01 23:39:26 -05:00
github-actions[bot]
a9833b51a2 docs: update progress [skip ci] 2026-10-02 04:26:00 +00:00
coah
76d8500dcf Repair two reconstructed function symbol names (#720) 2026-10-01 23:25:16 -05:00
github-actions[bot]
184bee0173 docs: update progress [skip ci] 2026-10-02 03:54:08 +00:00
coah
368a86cc6c match(nup_nhttp): 6 -> 8 exact (near8c) (worker 9dbfc514) (#719) 2026-10-01 22:53:23 -05:00
github-actions[bot]
9a7da62d3a docs: update progress [skip ci] 2026-10-02 03:47:25 +00:00
coah
b3c1300392 match(iplSDChannelTitle 64/69, NHTTP_recvbuf 6/7) (worker c82a056b) (#718) 2026-10-01 22:46:49 -05:00
coah
bd762fd162 docs(agents): add orchestrator handoff section (tools, state, pickup steps) (#717) 2026-10-01 22:44:50 -05:00
github-actions[bot]
f18d945894 docs: update progress [skip ci] 2026-10-02 03:02:34 +00:00
coah
bc505c3b8a Restore sensitivity projection constant pool and link source (#716) 2026-10-01 21:49:43 -05:00
coah
a5f79b81fa Correct memo Manager title setter vtable target (#715) 2026-10-01 21:35:19 -05:00
github-actions[bot]
137edaff42 docs: update progress [skip ci] 2026-10-02 01:58:17 +00:00
coah
4a7353ec73 Restore sound globals and link iplSound (#713) 2026-10-01 20:57:25 -05:00
coah
618e713b53 docs(agents): describe the Claude orchestrator / Codex worker loop (#711)
Effort scale, silent mode for workers, gate and landing rules, the PR
review daemon and auto-merge conditions, single-orchestrator rule, and
the policy additions (no retail .s linking, definition-level volatile).
2026-10-01 20:56:59 -05:00
github-actions[bot]
3dcd723459 docs: update progress [skip ci] 2026-10-02 01:55:54 +00:00
coah
4ed63ff786 match(tiHKBManager): key validity (worker 4e3e9738) (#712) 2026-10-01 20:54:55 -05:00
coah
eb8b9b978d Discover compiler-named and custom jump tables (#710) 2026-10-01 20:29:36 -05:00
github-actions[bot]
10e3f47e64 docs: update progress [skip ci] 2026-10-02 01:19:23 +00:00
coah
006457008c match(pf_fat): fsinfo byte order and sector rounding, 34/35 (worker 4129772d) (#709) 2026-10-01 20:18:35 -05:00
github-actions[bot]
75677c746b docs: update progress [skip ci] 2026-10-02 01:16:28 +00:00
coah
ccbc04a997 match(NHTTP_stdlib_RVL): hex/decimal parsing, 10/14 (worker 8531a6bf) (#708) 2026-10-01 20:15:19 -05:00
coah
da35a476bf Decompile sound effect stopping with a void return (#707) 2026-10-01 20:12:48 -05:00
coah
589bee2b0d Decompile system sound initialization (#706) 2026-10-01 20:07:38 -05:00
github-actions[bot]
f36411d483 docs: update progress [skip ci] 2026-10-02 01:03:37 +00:00
coah
9a897b043b match(pdm_partition): partition sector conversion, 18/20 (worker a5353c91) (#705) 2026-10-01 20:02:35 -05:00
coah
4d828ed557 Generate hardware keyboard vtable from C++ declarations (#704) 2026-10-01 19:59:33 -05:00
coah
f479546211 Decompile hardware keyboard character conversion (#703) 2026-10-01 19:54:11 -05:00
github-actions[bot]
a6c7690eb0 docs: update progress [skip ci] 2026-10-02 00:52:09 +00:00
coah
54b82eb747 Decompile hardware keyboard input dispatch (#701) 2026-10-01 19:51:53 -05:00
coah
326273b619 match(NHTTP_recvbuf): NHTTPi_RecvBufN (#559)
* match(NHTTP_recvbuf): NHTTPi_RecvBufN

Declare available before response and reload recvBufLen via
volatile so MWCC places response in r10 and reloads length
before the offset subtract.

* match(NHTTP_recvbuf): declare recvBufLen volatile instead of a use-site cast

The target re-reads recvBufLen back to back with no intervening store,
so the field itself is volatile. Field-level volatile leaves every other
function in the six NHTTP units that touch it unchanged.
2026-10-01 19:51:25 -05:00
github-actions[bot]
31d0f12981 docs: update progress [skip ci] 2026-10-02 00:50:35 +00:00
coah
01fb2284c6 match(tiHKBManager 26/29, pf_fat 32/35, SOBasic 21/22) (worker 536586f5) (#702) 2026-10-01 19:49:48 -05:00
coah
426555a34f match(SaveDataManager): decompile isEqualChannel (#677)
* match(SaveDataManager): decompile isEqualChannel

* cleanup(SaveDataManager): drop register keyword from isEqualChannel
2026-10-01 19:47:51 -05:00
coah
9acff80781 cleanup(CXStreamingUncompression): name remaining RL/LZ/Huffman fields (#680)
Follows #678 (outData/outDataLen). Renames length/flags/hdrLen and
Huffman wordBuffer/wordBits.
2026-10-01 19:45:41 -05:00
coah
3c9af06f34 Decompile hardware keyboard language selection (#700) 2026-10-01 19:43:23 -05:00
github-actions[bot]
824fe9fc0a docs: update progress [skip ci] 2026-10-02 00:38:30 +00:00
coah
34d6a62df3 match(tiPcKeyboard 138/141, AXFXChorusExp 5/7) (worker 1aeb77af) (#699) 2026-10-01 19:37:15 -05:00
github-actions[bot]
f97f091472 docs: update progress [skip ci] 2026-10-02 00:36:30 +00:00
coah
6c042d2a06 Correct memory-card conversion constant ownership (#697) 2026-10-01 19:35:48 -05:00
coah
53f70c85ce Correct L2CAP diagnostic string ownership (#696) 2026-10-01 19:35:42 -05:00
github-actions[bot]
7a24a5c17e docs: update progress [skip ci] 2026-10-02 00:30:05 +00:00
coah
37c7c21953 Restore hardware-keyboard function order and link unit (#698) 2026-10-01 19:29:25 -05:00
github-actions[bot]
a81b7c36fe docs: update progress [skip ci] 2026-10-02 00:16:19 +00:00
coah
d17ab22bf0 match(SOBasic): SOInetPtoN address family selection, 19/22 (worker 1e3ff7dd) (#695) 2026-10-01 19:15:29 -05:00
coah
17407ed1cb cleanup(iplButton): name anim-wait and new-mail anm flags (#694)
Rename Button calc busy flag and new-mail animation controls; update
ChannelTitle setter call sites.
2026-10-01 19:14:24 -05:00
coah
199883f758 cleanup(eZiText): rename work unk_0x16 to cangjieEnabled (#693)
Same Zi8GetFormatVersion(... ) & 2 pattern as ZiInfoWork.cangjieEnabled.
2026-10-01 19:14:18 -05:00
coah
edfb253724 cleanup(eZiText): rename work unk_0x538 to language (#692)
Assigned from parameters->language in zi8getc2; Matching zi8initd clears it.
2026-10-01 19:13:52 -05:00
coah
c8bb9f44da cleanup(iplDate): name focus state, pending cmd, point count (#691)
Rename Date focus SM fields used by onCmdRecv / pointer enter-leave.
2026-10-01 19:13:46 -05:00
coah
0d75b24a96 cleanup(CXStreamingUncompression): rename unk_0x0C to length (#690)
RL/LZ run and match length field (countdown while writing).
2026-10-01 19:11:21 -05:00
coah
262996a0de cleanup(NWC24MsgObj): rename unk_0x28/2C to date/receivedDate (#688)
Evidence from NWC24MBoxCtrl entry->date / entry->receivedDate copies.
2026-10-01 19:10:55 -05:00
coah
f095c9ea12 cleanup(iplCalendar): name draw list and search-task flag (#687)
Rename the secondary date list used for draw order and the vBOOL that
tracks the jam search task.
2026-10-01 19:10:27 -05:00
coah
f410332140 cleanup(iplNandSDWorker): rename unk_0x04 to mbCancel (#686)
requestCancel() sets this flag; work loops check it to abort.
2026-10-01 19:10:21 -05:00
coah
fed31b69b6 cleanup(iplBoardObject): name StandData step and angle index (#685)
Rename StandData lerp counter and angle index used by stt_stand.
2026-10-01 19:09:54 -05:00
coah
5ac1f65c4a cleanup(tiInputForm): name unused N_KOR/N_CHN sdata strings (#684)
lbl_816973A4 → scN_KOR, lbl_816973AC → scN_CHN.
2026-10-01 19:09:49 -05:00
coah
d9fbf88fb8 cleanup(eZiText): rename work unk_0x18 to subLanguage (#683)
Assigned from parameters->subLanguage in zi8getc2; Matching users
zi8is/zi8misc/zaddress updated.
2026-10-01 19:09:22 -05:00
github-actions[bot]
a77ce293ce docs: update progress [skip ci] 2026-10-02 00:09:13 +00:00
coah
e5f4e0e1f4 match(pf_cluster): InsertCluster and capacity check, 7/8 (worker a218bc12) (#689) 2026-10-01 19:08:17 -05:00
coah
c1cccf1c2c cleanup(iplTextWriter): rename unk_0x7D to mbResetAcceptable (#682)
Field is exactly what isResetAcceptable() returns; also update LetterWriter
uses of the inherited member.
2026-10-01 19:07:17 -05:00
coah
ded159048f cleanup(CDBAttr): name dirty / wiiIdDirty / wiiIdValid flags (#681)
Runtime flags after the attr buffer: lead dirty, wiiId-region dirty
(full write), and wiiId/attr loaded-valid.
2026-10-01 19:07:12 -05:00
coah
0ec86e7985 cleanup(jdec): name frame remX/remY remainder fields (#679)
Width/height leftover pixels after MCU tiling, set from remX/remY locals.
2026-10-01 19:06:45 -05:00
coah
30e1ef0938 cleanup(CXStreamingUncompression): name RL/LZ outData and outDataLen (#678)
Match Huffman context naming for the destination pointer and remaining
byte count on CXUncompContextRL/LZ.
2026-10-01 19:04:36 -05:00
coah
9ff511afd7 cleanup(RakuRakuThread): name BSS globals, alloc wrappers, syncProgress (#665)
- RakuRakuThread_810BDDD0 → sRakuAllocator
- RakuRakuThread_810BDDE0 → sRakuStatus
- RakuRakuThread_810BDED4 → sRakuMsgQueue
- RakuRakuThread_813FDEF0/FC → RakuSocketAlloc/Free
- RakuRakuThread_813FDF08/18 → RakuAtermAlloc/Free
- RakuRakuThread_813FDA04 → syncRakuProgress

DOL sha1 unchanged.
2026-10-01 19:00:34 -05:00
coah
2f206d7fe8 Add relocation-aware jump-table comparison and tests (#676) 2026-10-01 18:58:24 -05:00
coah
d6b044ff32 cleanup(BS2Mach): promote lbl_* aliases to real names (#675)
Replace address labels with the existing #define names (DvdReadPending,
TicketViews, CoverBlock, etc.) and drop the macros.

DOL sha1 unchanged.
2026-10-01 18:57:57 -05:00
coah
0e73a554de cleanup(AOSS): name protocol/state handlers (#671)
Rename remaining address-suffixed AOSS_* dispatch, reply, parse, and
send helpers. Pairs with crypto/connect helper rename PR.

DOL sha1 unchanged.
2026-10-01 18:57:52 -05:00
coah
d4cdae2177 cleanup(usb_kbd): name USBKBDCmdLED device and ledBits (#674)
Rename unk_0x00/unk_0x04 to match USBKBDSetLED parameters.
2026-10-01 18:55:13 -05:00
coah
4b831f9ec0 cleanup(ATERM): name protocol and crypto helpers (#673)
Rename remaining ATERM_814* address symbols to descriptive names for
network/stack, scan, association, AES key wrap, and MD5 helpers.

DOL sha1 unchanged.
2026-10-01 18:55:06 -05:00
coah
fbecedd948 cleanup(sdi_api): rename __sdCbArg.unk_0x0C to cmd (#672)
Field is assigned the SD command and switched on in __sdCb.
2026-10-01 18:52:58 -05:00
149 changed files with 14836 additions and 2633 deletions

170
AGENTS.md
View File

@@ -78,6 +78,12 @@ Helper tools live in `tools/decomp-assist/`:
between your object and the original. This is the main iteration loop.
- `disasm_fn.py <object> <symbol>` — disassembly with relocation-resolved call
names, so you can see which real functions are being called.
- `literal_reference_diff.py [unit ...]` — advisory check of actual narrow-string
bytes passed at corresponding calls, including addresses derived from a shared
data base. Defaults to functions scored 100% in the live report; use
`--all-functions` to include other equal-sized functions. Inspect every
candidate against the assembly. This does not follow mutable pointer globals,
infer compiler aliases, or prove complete data matching; skips are reported.
- `pool_diff.py` — diffs the string pool in `.data` between your object and the
original, string by string. See below; this is the highest-signal tool.
- `export_pyghidra.py` — regenerates `ghidra_decomp.txt`, decompiled C for the
@@ -164,9 +170,8 @@ This repository targets only Wii Menu 4.3U. Do not configure or build 43E,
43J, or 43K while doing matching work.
Most workers should pursue exact matching or safe linking; assign the remainder
to decompilation. Keep up to 75 live workers when the runtime allows it, while
reserving capacity for fixer and validation workers. Fill completed slots with
disjoint tasks. Never duplicate a source file or function
to decompilation. Keep every worker slot busy (currently four Codex slots; see
"Orchestrator loop" below). Fill completed slots with disjoint tasks. Never duplicate a source file or function
range. Workers return changed paths, exact objdiff measurements, and validation
results. Fuzzy-only results are not accepted.
@@ -246,6 +251,12 @@ and merge the PR, fast-forward `origin/main`, and publish progress. If a
candidate fails validation, return it to its worker; do not fix the candidate
inline in the orchestrator.
Two exceptions, both set by the human: once a leaf has failed at `max` effort
(see the effort scale below) the orchestrator itself takes a crack at it, and
the orchestrator may finish PRs whose authors are gone (rebase, drop a
forbidden pattern, close with evidence). Record every such attempt in the
policy log, including the ones that fail.
A new thread must begin by reading this file, checking the live 43U report and
remote branch, and dispatching the worker pool. The parent must not claim a
match without fresh independent verification.
@@ -320,6 +331,159 @@ Linked: <percent> | Fuzzy: <percent> | Data: <percent>
Do not report stale values, unmerged PR results, or add other text to that
update. Continue all required verification and coordination silently.
## Orchestrator loop (Claude orchestrator, Codex workers)
This is the loop currently in use. One Claude session is the orchestrator.
It does not spawn Claude subagents. All decompilation work goes to Codex CLI
workers running `gpt-6.1-sol`. The orchestrator assigns leaves, verifies,
lands, reviews outside PRs, and only decompiles by hand in the cases listed
under the ownership boundary above.
Only one orchestrator session may run at a time. If a second session resumes
the same thread (for example, the same session opened in two windows), close
one of them. Two orchestrators double-merge PRs and fight over the shared
build tree.
### Worker slots and the effort scale
Run four worker slots, each in its own worktree on a fresh branch from
`origin/main`. Every slot gets a disjoint set of three or four leaves (units),
closest-to-matching first. A slot starts at `medium` (or `low`) reasoning
effort and escalates only when a round produces no new exact function:
```
low/medium -> high -> xhigh -> max -> orchestrator attempt -> parked
```
A round that gains at least one exact function is landed, and the remaining
functions go out again at the same effort or one step up. A set that fails at
`max` goes to the orchestrator. If the orchestrator also fails, the function
is parked as a compiler tie-break with its evidence. Fill freed slots from the
live checklist right away; never leave a slot idle.
Before starting a function, a worker fetches `origin/main` and checks it is
not already matched. Outside contributors land work in parallel, and
duplicated matches waste a round.
### Silent mode for workers
Workers run unattended and must not talk. Every turn is tool calls only: no
plans, no progress notes, no summaries. Progress goes into an attempts log
file in `tools/decomp-assist/`. The only text message in a run is the final
report, at most 8-15 short lines:
- exact functions per unit, before and after;
- the final `GATE` line;
- commit hashes;
- a link to the attempts log.
Runs are audited for text messages, and any chatter is a contract
violation. Workers also must not push, open PRs, merge, rebase, touch other
worktrees, or spawn subagents.
Each worker prompt has this layout:
1. the `<task>` block (leaves, current exact counts, method, report format);
2. the shared `common.md` block with `<silent_mode>`, `<forbidden>`,
`<method>` and `<definition_of_done>`.
Resume a stalled worker on the same session with the failure evidence. Don't
replace it with a fresh one.
### Gate, landing and review
- `gate.py <unit...>` is the acceptance check for workers and for outside
PRs. It covers:
- a full 4.3U build and the DOL SHA1;
- per-unit objdiff and instruction-exact counts;
- regressions against a baseline report of `origin/main`;
- a net forbidden-pattern scan and a readability scan (auto-named
identifiers, raw `*(T*)(p + N)` offset casts).
- A function that disappears because it was renamed is not a regression,
unless the unit's exact count, code or data also drops.
- Landing a worker result builds a branch from `origin/main` with the
worker's diff, gates it, pushes it, then opens and squash-merges a PR on
the fork. After that it regenerates the checklist.
- Never run two full builds in the same build tree at once.
- Never land while the review queue is building. Both use the same
verification worktree.
Outside PRs are reviewed by a daemon. It re-runs the gate on any open PR
whose head commit changed since its last review. A PR is merged
automatically only when all of these hold:
- the PR rebases cleanly;
- the full build passes;
- the DOL hash matches;
- the gate passes, or its only failures are renamed-away functions;
- the diff adds no forbidden pattern and no `.s` file.
Everything else is reviewed by hand:
- **Conflicts:** comment asking for a rebase.
- **Forbidden patterns:** request changes with a concrete honest
alternative.
- **"Linking" by swapping in retail assembly or pinned labels:** close and
explain.
- **Proven split/ownership corrections** (relocation evidence, total data
unchanged): merge even if one unit's numbers move to its neighbour.
Policy additions learned in this loop:
- Linking a unit by building the retail `.s` instead of its C/C++ is
forbidden. "Linked" means the C/C++ itself compiles to the exact bytes.
- Definition-level `volatile` (on the field or object declaration) is allowed
when the target proves it, e.g. back-to-back reloads with no store in
between. Check that it changes no other function in the units that use it.
Use-site volatile casts and the `register` keyword stay forbidden.
### Handoff: where the loop lives
The loop's tools and state live outside the repository, in the author's
workers directory `/mnt/drive2/projects/wii-ipl-workers` (`$W` below). A new
orchestrator thread picks up from there.
Tools in `$W/_restore0928-tools/`:
| File | Purpose |
|------|---------|
| `gate.py <unit...> [--base origin/main] [--quick]` | the acceptance gate; `--quick` only skips the clean `rm -rf build/43U` |
| `land.sh <name> <worktree> merge-base <unit...> <title>` | gate a worker's diff on a fresh branch, push, open and squash-merge the PR |
| `luna.sh <worktree> <name> <prompt> <effort> [session]` | start (or resume) one Codex worker; run with `MODEL=gpt-6.1-sol CODEX_BIN=$W/_codex159/bin/codex` |
| `reviewd.sh` | review daemon: queues every open PR whose head changed |
| `revq.sh`, `automerge.py` | the daemon's gate runner and merge decision |
| `checklist.py` | regenerates `$W/CHECKLIST.md` from a report |
| `chatter.py <run-prefix>` | counts worker text messages for the silent-mode audit |
| `baseline-<sha8>.json` | objdiff reports of past `origin/main` commits, used for regressions |
State:
- `$W/_luna-runs/prompts/`: worker prompts. `common.md` is shared; each
task is `<name>.task.md`, and the launched prompt is `<name>.md` = task +
common.
- `$W/_luna-runs/<name>.<time>.jsonl` and `.last.md`: worker transcript and
final report.
- `$W/_luna-runs/effort-policy.txt`: the policy log. Records escalations,
parked functions, and every orchestrator attempt with what was tried.
- `$W/CHECKLIST.md`: units with non-exact code, worst first.
- Worktrees: `verify-fix` is the only verification and landing tree;
`sol-low`, `sol-med`, `sol-high` and `w0929-fix-board` are the four worker
slots; `orch` is orchestrator scratch.
- Logs: `/tmp/reviewd.log`, `/tmp/vfq.log` (current review batch) and
`/tmp/automerge.log` (merge decisions). These are lost on reboot, which
only means open PRs get reviewed again.
- `/tmp/wii-git.lock`: every `git fetch` or checkout in a shared worktree
runs under `flock` on this file, because worktrees share refs.
To pick up the loop:
1. Make sure no other orchestrator session is running.
2. Check `pgrep -af "reviewd.sh|luna.sh|land.sh"` and restart the review
daemon if it isn't running.
3. Read the newest `.last.md` for each slot. Land gains, then relaunch the
slot per the effort scale.
4. Handle every `NEEDS REVIEW` line in `/tmp/automerge.log`.
## Goal completion contract
The decompilation loop does not stop after a successful wave, a convenient

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.38% | 88.00% | 62.37% | 92.07% |
| 99.48% | 88.74% | 64.70% | 98.77% |
units 920/1027 complete, functions 12226/12563 matched.
units 932/1027 complete, functions 12274/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

@@ -688,13 +688,13 @@ src/scene/memoryCard/iplMemoryCard.cpp:
.text start:0x813C9DCC end:0x813CC1FC
.rodata start:0x81610368 end:0x81610480
.data start:0x81651D30 end:0x81652640
.sdata2 start:0x81694A68 end:0x81694A80
.sdata2 start:0x81694A68 end:0x81694A78
.sdata start:0x81696C78 end:0x81696CA0
src/scene/memoryCard/iplMemoryCardBase.cpp:
.text start:0x813CC1FC end:0x813CD034
.data start:0x81652640 end:0x816526D0
.sdata2 start:0x81694A80 end:0x81694A88
.sdata2 start:0x81694A78 end:0x81694A88
src/scene/memoryCard/iplMemoryCardManager.cpp:
.text start:0x813CD034 end:0x813CE548
@@ -869,11 +869,12 @@ src/scene/setting/iplUSBAP.cpp:
.bss start:0x810BC148 end:0x810BD498
.text start:0x813FC520 end:0x813FC8FC
.data start:0x81657B08 end:0x81657B18
.sbss start:0x81698C08 end:0x81698C28
.sbss start:0x81698C08 end:0x81698C20
src/scene/setting/iplUSBAPThread.cpp:
.text start:0x813FC8FC end:0x813FCA0C
.data start:0x81657B18 end:0x81657B60
.sbss start:0x81698C20 end:0x81698C28
src/scene/setting/iplAOSSThread.cpp:
.bss start:0x810BD498 end:0x810BD4A8
@@ -3551,12 +3552,12 @@ libs/RVL_SDK/src/bte/l2c_csm.c:
libs/RVL_SDK/src/bte/l2c_link.c:
.text start:0x815AC630 end:0x815AD7BC
.data start:0x8168E930 end:0x8168EB68
.data start:0x8168E930 end:0x8168EBA0
libs/RVL_SDK/src/bte/l2c_main.c:
.bss start:0x811725E0 end:0x81172DC8
.text start:0x815AD7BC end:0x815AE7EC
.data start:0x8168EB68 end:0x8168EEA0
.data start:0x8168EBA0 end:0x8168EEA0
libs/RVL_SDK/src/bte/l2c_utils.c:
.text start:0x815AE7EC end:0x815B06B0

File diff suppressed because it is too large Load Diff

View File

@@ -689,7 +689,7 @@ config.libs = [
]
),
IPLSection("sound", [
Object(NonMatching, "sound/iplSound.cpp"),
Object(Matching, "sound/iplSound.cpp"),
]
),
IPLSection("iplwww", [
@@ -816,7 +816,7 @@ config.libs = [
Object(Matching, "scene/memoryCard/iplMemoryCardBase.cpp"),
Object(NonMatching, "scene/memoryCard/iplMemoryCardManager.cpp"),
Object(Matching, "scene/memoryCard/iplGCSaveData.cpp"),
Object(NonMatching, "scene/memoryCard/iplGCWindow.cpp"),
Object(Matching, "scene/memoryCard/iplGCWindow.cpp"),
]
),
IPLSection("textBalloon", [
@@ -869,11 +869,11 @@ config.libs = [
),
IPLSection("setting", [
Object(NonMatching, "scene/setting/iplSetting.cpp"),
Object(NonMatching, "scene/setting/iplSensitivity.cpp"),
Object(Matching, "scene/setting/iplSensitivity.cpp"),
Object(Matching, "scene/setting/iplNCDSetting.cpp"),
Object(Matching, "scene/setting/iplParental.cpp"),
Object(Matching, "scene/setting/iplAPScanThread.cpp"),
Object(NonMatching, "scene/setting/iplUSBAP.cpp"),
Object(Matching, "scene/setting/iplUSBAP.cpp"),
Object(NonMatching, "scene/setting/iplUSBAPThread.cpp"),
Object(Matching, "scene/setting/iplAOSSThread.cpp"),
Object(NonMatching, "scene/setting/AOSSLink.c"),
@@ -928,13 +928,13 @@ config.libs = [
Object(Matching, "keyboard/tiLanguageIndependentData.cpp", extra_cflags=["-O4,p"], shift_jis=False),
Object(Matching, "keyboard/tiTextInputBase.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/MyTiManager.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/MyTiInputForm.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/MyTiInputForm.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/MyTiLetterForm.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/MyTiBg.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiDebug.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiGUIManager.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/tiHKBManager.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/tiHwKeyboard.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiHKBManager.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiHwKeyboard.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiLayout.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiLayoutGather.cpp", extra_cflags=["-O4,p"]),
Object(NonMatching, "keyboard/tiKoreanInput.cpp", extra_cflags=["-O4,p"]), # for 4.3K
@@ -1453,7 +1453,7 @@ config.libs = [
Object(Matching, "axfx/AXFXReverbStd.c"),
Object(Matching, "axfx/AXFXReverbStdExp.c"),
Object(Matching, "axfx/AXFXChorus.c"),
Object(NonMatching, "axfx/AXFXChorusExp.c"),
Object(Matching, "axfx/AXFXChorusExp.c"),
Object(Matching, "axfx/AXFXLfoTable.c"),
Object(Matching, "axfx/AXFXSrcCoef.c"),
Object(Matching, "axfx/AXFXHooks.c"),
@@ -1697,11 +1697,11 @@ config.libs = [
Object(Matching, "fa/pf_entry.c"),
Object(NonMatching, "fa/pf_entry_iterator.c"),
Object(NonMatching, "fa/pf_fat.c"),
Object(NonMatching, "fa/pf_fat12.c"),
Object(Matching, "fa/pf_fat12.c"),
Object(Matching, "fa/pf_fat16.c"),
Object(Matching, "fa/pf_fat32.c"),
Object(Matching, "fa/pf_fatfs.c"),
Object(NonMatching, "fa/pf_file.c"),
Object(Matching, "fa/pf_file.c"),
Object(NonMatching, "fa/pf_path.c"),
Object(Matching, "fa/pf_sector.c"),
Object(NonMatching, "fa/pf_volume.c"),
@@ -1869,7 +1869,7 @@ config.libs = [
),
RVLSDKLib("nup", [
Object(NonMatching, "nup/nup.cpp"),
Object(NonMatching, "nup/nup_nhttp.cpp"),
Object(Matching, "nup/nup_nhttp.cpp"),
Object(Matching, "nup/nup_mem.cpp"),
]
),
@@ -1892,7 +1892,7 @@ config.libs = [
]
),
RVLSDKLib("kpr", [
Object(NonMatching, "kpr/kpr_lib.c"),
Object(Matching, "kpr/kpr_lib.c"),
]
),
RVLSDKLib("usbkbd", [

View File

@@ -37,8 +37,16 @@ namespace ipl {
u8 unk_0x06; // 0x06
u8 unk_0x07; // 0x07
u8 iconFmt[8]; // 0x08
u16 anmFrameBits; // 0x10
#ifdef IPL_MEMORY_CARD_MANAGER_CPP
volatile u16 anmFrameBits;
#else
u16 anmFrameBits;
#endif
#ifdef IPL_MEMORY_CARD_MANAGER_CPP
volatile s16 anmMax;
#else
s16 anmMax; // 0x12
#endif
u32 bannerOffset; // 0x14
u32 bannerTlutOffset; // 0x18
u32 iconOffset[8]; // 0x1C

View File

@@ -92,7 +92,11 @@ namespace textinput {
virtual void setSaveData(savedata::MemoSetting memoSetting) {
mMemoSetting = memoSetting;
}
#ifdef IPL_KEYBOARD_MEMO_GET_SAVE_DATA
virtual savedata::MemoSetting getSaveData();
#else
virtual savedata::MemoSetting getSaveData() { return mMemoSetting; }
#endif
virtual void changeState(StateTimeLine stateTimeLine);
virtual State* getState() { return mpCurrentState; }

View File

@@ -20,6 +20,8 @@ namespace textinput {
public:
void NotifyEvent(u8 down, u8 code);
void Update();
bool HasCurrentKey(u32 slot) const { return (current & (1 << slot)) != 0; }
bool HadPreviousKey(u32 slot) const { return (previous & (1 << slot)) != 0; }
void UpdateModState_();
void Clear() {
held = 0;
@@ -107,10 +109,23 @@ namespace textinput {
HKBManager* manager;
};
HKBManager() __attribute__((never_inline));
~HKBManager();
static HKBManager& getInstance() { return sInstance; }
void Initialize();
void ClearState();
u32 FilterCharacter(u32 code) const {
if (allowedCharacters == 0) return code;
u32 count = allowedCharacterCount;
if (count == 0) return code;
for (u32 index = 0; index < count; index++) {
if (static_cast<u16>(code) == allowedCharacters[index]) return code;
}
return 0;
}
void DetachDevice(KBDDevEvent* event) {
u8 device = event->device;
attached[device] = 0;
states[device].Clear();
}
u32 GetModifierState() const;
void SetCountry(u8 country);
void SetModifierState(u32 state, u32 mask);
@@ -149,6 +164,7 @@ namespace textinput {
void Update();
u32 GetModifierState() const;
void SetCountry(u8 country);
void SetModifierState(u32, u32);
#if defined(TI_CELLPHONE_HKB_KEYSET)

View File

@@ -15,12 +15,12 @@ namespace textinput {
#endif
public:
HWKeyboard(Manager *);
#ifdef TIMANAGER_IMPLEMENTATION
#if defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
inline ~HWKeyboard();
#else
~HWKeyboard();
#endif
#ifdef TIMANAGER_IMPLEMENTATION
#if defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
void setLanguage(Destination destination, Language language);
#endif
@@ -29,7 +29,7 @@ namespace textinput {
wchar_t convertWCCode(wchar_t code) const;
#endif
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
#else
virtual void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
@@ -46,9 +46,10 @@ namespace textinput {
bool updateTappingShift_(input::HKBManager&);
#endif
void updateShift(input::HKBManager& hkbManager);
void controlKeyTriggeredHandler(input::HKBManager);
bool controlKeyTriggeredHandler(input::HKBManager&);
Manager *mgr() { return mpManager; }
const Manager *mgr() const { return mpManager; }
Manager* mpManager; // 0x10
u8 field_0x14; // 0x14

View File

@@ -113,6 +113,8 @@ namespace textinput {
#ifdef TIMANAGER_IMPLEMENTATION
virtual void setTitleText(wchar_t* titleText);
void initAspect();
#elif defined(MYTIMANAGER_IMPLEMENTATION)
virtual void setTitleText(wchar_t* titleText);
#else
virtual void setTitleText(const wchar_t* titleText);
#endif

View File

@@ -197,6 +197,7 @@ namespace textinput {
bool mbMaintainCursorCache;
#elif defined(MYTIINPUTFORM_IMPLEMENTATION)
protected:
void setDrawScrollY(const f32& scroll) { mfDrawScrollY = scroll; }
u8 mDrawState[0x27];
f32 mfDrawScrollY;
u8 mDrawCacheState[0x14];

View File

@@ -7,6 +7,10 @@
#include "utility/iplFrameController.h"
#ifdef IPL_GC_WINDOW_CPP
#include "math/iplMathTypes.h"
#endif
#ifdef IPL_GCW_INTP_CTOR_OUT_OF_LINE
#include "global/decomp/utils.h"
#endif
@@ -38,6 +42,33 @@ namespace ipl {
T mEnd;
};
#ifdef IPL_GC_WINDOW_CPP
template <>
class Interporation<VEC3> : public utility::FrameController {
public:
virtual ~Interporation();
void init(int playback, f32 maxFrame, f32 minFrame, const VEC3& start,
const VEC3& end, f32 speed = 1.0f) {
mStart = start;
mEnd = end;
utility::FrameController::init(playback, maxFrame, minFrame, speed);
}
const VEC3& getStart() { return mStart; }
const VEC3& getEnd() { return mEnd; }
void playBackwards() {
mAnmType = ANIM_TYPE_BACKWARD;
mState = ANIM_STATE_PLAY;
}
protected:
VEC3 mStart;
VEC3 mEnd;
};
#endif
template <typename T>
class LinearIntp : public Interporation<T> {
public:
@@ -61,6 +92,16 @@ namespace ipl {
T get2() const { return (((mStart * (mMaxFrame - mFrame)) + (mEnd * mFrame)) / mMaxFrame); }
};
#ifdef IPL_GC_WINDOW_CPP
template <>
class LinearIntp<VEC3> : public Interporation<VEC3> {
public:
LinearIntp();
virtual ~LinearIntp();
VEC3 get() const;
};
#endif
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
template <typename T>

View File

@@ -162,14 +162,14 @@ namespace ipl {
class {
public:
void init() {
unk_0x0C = -1;
mAngleIdx = -1;
pos.x = 0.0f;
pos.y = 0.0f;
}
math::VEC2 pos; // pos
int unk_0x08;
int unk_0x0C;
int mStep;
int mAngleIdx;
} mStandData; // 0xE4
picture mPicture; // 0xF4

View File

@@ -309,8 +309,8 @@ namespace ipl {
return mbArrowVisible[i];
}
void setUnk_0x105(bool flag) {
unk_0x105 = flag;
void setSuppressNewMailAnm(bool flag) {
mbSuppressNewMailAnm = flag;
}
protected:
@@ -354,7 +354,7 @@ namespace ipl {
ANIM_MAX,
};
int unk_0x54;
int mAnimWait;
layout::Object* mpLayout; // 0x58
nand::LayoutFile* mpLayoutFile; // 0x5C
@@ -373,8 +373,8 @@ namespace ipl {
BOOL mbHovered[BTN_MAX]; // 0xD8
bool unk_0x104;
bool unk_0x105;
bool mbNewMailAnm;
bool mbSuppressNewMailAnm;
utility::timer mTimer; // 0x108
bool mbEnabled; // 0x110

View File

@@ -95,9 +95,9 @@ namespace ipl {
public:
nw4r::ut::List mDateList; // 0x84
nw4r::ut::List unk_0x90;
nw4r::ut::List mDrawList;
bool mbScrolling; // 0x9C
vBOOL unk_0xA0;
vBOOL mbSearchTaskRunning;
BOOL mbTaskCanceled; // 0xA4
vBOOL mbBackToBoardAlt; // 0xA8
bool mbAsian; // 0xAC

View File

@@ -68,8 +68,8 @@ namespace ipl {
vBOOL mbAppearMsg; // 0x0C
private:
u32 unk_0x10;
int unk_0x14;
u32 mFocusState;
int mPendingFocusCmd;
layout::Object* mpLayout; // 0x18
gui::PaneManager* mpGui; // 0x1C
layout::PaneAnimator* mpCurrentPaneAnim; // 0x20
@@ -77,7 +77,7 @@ namespace ipl {
public:
utility::Date* mpDate; // 0x38
u32 unk_0x3C;
u32 mPointCount;
static const char* mscAnimPanes[ANIM_PANE_MAX];

View File

@@ -42,7 +42,7 @@ namespace ipl {
};
virtual BOOL isResetAcceptable() const {
return unk_0x7D;
return mbResetAcceptable;
}
virtual void prepare();
@@ -108,7 +108,7 @@ namespace ipl {
static const int mToFace_Duration = 20;
bool mbClosing; // 0x7C
bool unk_0x7D;
bool mbResetAcceptable;
wchar_t* mWCString; // 0x80

View File

@@ -44,7 +44,7 @@ namespace ipl {
int stopBGM(int unk = 0);
#endif
int stopBGM(nw4r::snd::SoundHandle* handle, int unk = 0);
int stopSE(nw4r::snd::SoundHandle* handle, int unk = 0);
void stopSE(nw4r::snd::SoundHandle* handle, int unk = 0);
void stopAllSound(int unk = 0);
int resetAllSound();
@@ -99,7 +99,7 @@ namespace ipl {
long clipGELT_S32(long value, long lo, long hi);
private:
u32 unk_0x620[0x18];
u32 unk_0x620[3];
};
// use getSystem() and getBannerPlayer() instead

View File

@@ -152,7 +152,7 @@ namespace ipl {
BOOL is_working();
#ifdef IPL_SD_CHANNEL_SELECT_CPP
void requestCancel() { unk_0x04 = true; }
void requestCancel() { mbCancel = true; }
#endif
WIISaveBannerFile* get_cached_nand_save_banner(ESTitleId titleId);
@@ -531,7 +531,7 @@ namespace ipl {
static void wad_backup_progress_callback(u32 completed, u32 total, BOOL done);
Work* myWork; // 0x00
bool unk_0x04; // 0x04
bool mbCancel; // 0x04
static const char* c_banner_file_name;
static const char* c_nocopy_folder_name;

View File

@@ -64,8 +64,8 @@ typedef struct {
u16 mcuYCount; // 0x10
u16 mcuXCount2; // 0x12
u32 unk_0x14;
u8 unk_0x18;
u8 unk_0x19;
u8 remX; // 0x18
u8 remY; // 0x19
u8 compCount; // 0x1A
u8 scanCompCount; // 0x1B
u8 blockCount[4]; // 0x1C
@@ -143,8 +143,8 @@ struct TMCCJPEGDecWork_t {
u16 mcuYCount; // 0x1800
u16 mcuXCount2; // 0x1802
u32 unk_0x1804;
u8 unk_0x1808;
u8 unk_0x1809;
u8 remX; // 0x1808
u8 remY; // 0x1809
u8 compCount; // 0x180A
u8 scanCompCount; // 0x180B
u8 blockCount[4]; // 0x180C

View File

@@ -106,21 +106,21 @@ static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, co
s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_ptr, TMCCJPEGDecWork* work) {
TMCHuffmanEntry dcEntry;
TMCHuffmanEntry acEntry;
const TMCHuffmanEntry* ac_fast;
u8* huff_sym;
const TMCHuffmanEntry* ac_fast;
s32 idx;
u32* huff_tbl;
s32 bit_pos;
u32 bit_data;
const TMCHuffmanEntry* dc_fast;
u32 tmp;
s32 r;
s32 blk0;
s32 idx;
TMCHuffmanEntry acEntry;
s32 extra;
s32 t;
s32 zz;
s32 q;
u32 tmp;
const TMCHuffmanEntry* dc_fast;
const u8* zztbl;
bit_pos = work->bitCount;
@@ -135,17 +135,14 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
bit_pos = work->bitCount;
bit_data = work->bitBuf;
tmp = bit_pos - 8;
tmp = ((bit_data >> tmp) & 0xFF) << 2;
{
dcEntry = readHuffmanEntry(dc_fast, tmp >> 2);
dcEntry = readHuffmanEntry(dc_fast, (bit_data >> (bit_pos - 8)) & 0xFF);
r = dcEntry.bitLength;
extra = dcEntry.symbol;
}
if (r != 0) {
bit_pos -= r;
work->bitCount = bit_pos;
work->bitCount = bit_pos - r;
r = extra;
} else {
huff_sym = work->pDCHuffSym;

View File

@@ -59,8 +59,8 @@ s32 TMCJPEGDEC_Setsize(TMCCJPEGDecWork* work) {
state->stepY = (state->scaleFactor + work->mcuXRem - 1) / state->scaleFactor;
state->jpegWidth = ((s32)(work->frameWidth + state->scaleFactor) - 1) / state->scaleFactor;
state->jpegHeight = (state->scaleFactor + work->frameHeight - 1) / state->scaleFactor;
state->stepXExt = (state->scaleFactor + work->unk_0x1808 - 1) / state->scaleFactor;
state->stepYExt = (state->scaleFactor + work->unk_0x1809 - 1) / state->scaleFactor;
state->stepXExt = (state->scaleFactor + work->remX - 1) / state->scaleFactor;
state->stepYExt = (state->scaleFactor + work->remY - 1) / state->scaleFactor;
state->dataSizeX = (state->stepXExt != 0) ? (state->maxX - 1) * state->stepX : (state->maxX + 1) * state->stepX;
state->dataSizeY = (state->stepYExt != 0) ? (state->maxY - 1) * state->stepY : (state->maxY + 1) * state->stepY;

View File

@@ -562,8 +562,8 @@ s32 TMCJPEGDEC_scan_varinit(TMCCJPEGDecWork* work) {
remX = p->frameWidth % p->mcuXCount;
remY = p->frameHeight % p->mcuXRem;
p->unk_0x18 = remX;
p->unk_0x19 = remY;
p->remX = remX;
p->remY = remY;
p->mcuYCount = p->mcuYCount + ((u8)remX != 0 ? 1 : 0);
p->mcuXCount2 = p->mcuXCount2 + ((u8)remY != 0 ? 1 : 0);
@@ -1919,8 +1919,8 @@ static s32 TMCJPEGDEC_parse_sof(TMCCJPEGDecWork* work) {
remX = fw - mcuCountX * mcuX;
remY = fh - mcuCountY * mcuY;
work->unk_0x1808 = remX;
work->unk_0x1809 = remY;
work->remX = remX;
work->remY = remY;
{
u16 xr = (remX != 0) ? 1 : 0;

View File

@@ -215,9 +215,9 @@ struct __zi8_work_data_s {
ziU32 unk_0x0C;
ziU32 unk_0x10;
ziU16 unk_0x14;
ziU8 unk_0x16;
ziU8 cangjieEnabled; // 0x16
ziU8 unk_0x17;
ziU8 unk_0x18;
ziU8 subLanguage; // 0x18
ziU8 unk_0x19;
ziU16 unk_0x1A;
ziU8 unk_0x1C[3];
@@ -258,7 +258,7 @@ struct __zi8_work_data_s {
ziU8 unk_0x330[8];
ziU32 unk_0x338;
ziU8 unk_0x33C[0x1FC];
ziU8 unk_0x538;
ziU8 language; // 0x538
ziU8 unk_0x539;
ziU8 unk_0x53A[0x40];
ziWChar unk_0x57A[0x641];

View File

@@ -55,7 +55,7 @@ ziU32 Zi8GetTableData(ziU8 lang, ziU8 tableIdx, ziU8 memberId ZI_NEED_WORK) {
if (langIdx-- != 0) {
tableData = ZI_WORK->langEntries[langIdx].tableData;
if ((lang == ZI8_LANG_ZH) && (tableData[3] >= 4) &&
((ZI_WORK->unk_0x18 == 1) || (ZI_WORK->unk_0x18 == 0x80) || (ZI_WORK->unk_0x18 == 0x40))) {
((ZI_WORK->subLanguage == 1) || (ZI_WORK->subLanguage == 0x80) || (ZI_WORK->subLanguage == 0x40))) {
offset = ((tableData[0x8B] << 0x10) + (tableData[0x8C] << 8) + tableData[0x8D]);
if (offset != 0) {
tableData += offset;

View File

@@ -27,11 +27,11 @@ ziPtr Zi8GetTableAddress(ziU8, ziU8 ZI_NEED_WORK);
ziWChar Zi8ConvertUC2UserKey(ziChar, ziU8 ZI_NEED_WORK);
ziWChar Zi8ConvertUC2WC(ziChar character, ziU8 language ZI_NEED_WORK) {
ziU8* table;
const ziConversionTables* defaults;
ziWChar* mapped;
ziU8* cursor;
ziU16 first, last;
const ziConversionTables* defaults;
ziU8* table;
if (character == 0) {
Zi8LogError(0x133, __zi8_work_data);
return 0;

View File

@@ -430,7 +430,7 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (getMode != 7 && getMode != 10 && getMode != 8 && getMode != 9) {
Zi8PrepareMatch(request, &match, 0, work);
} else {
if (!((struct __zi8_work_data_s*)work)->unk_0x16 || request->elementCount > 6) {
if (!((struct __zi8_work_data_s*)work)->cangjieEnabled || request->elementCount > 6) {
resultFallback = 0;
goto engine_finish;
}
@@ -1151,7 +1151,7 @@ context_word_lookup:
if (ordinalIndex == 0xFFFF) goto context_results_done;
record = records + ordinalIndex * 12;
phoneticGroups = phraseTable + ((record[9] & 15) << 16 | (record[11] | record[10] << 8));
if (((struct __zi8_work_data_s*)work)->unk_0x16) {
if (((struct __zi8_work_data_s*)work)->cangjieEnabled) {
switch (phoneticGroups[0] & 7) {
case 2: phoneticGroups += 2; break;
case 3: case 4: phoneticGroups += 3; break;
@@ -1965,7 +1965,7 @@ component_retry:
((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = ordinalIndex;
relatedRecord = records + ordinalIndex * 12;
phoneticGroups = phraseTable + ((relatedRecord[9] & 15) << 16 | (relatedRecord[11] | relatedRecord[10] << 8));
if (((struct __zi8_work_data_s*)work)->unk_0x16) {
if (((struct __zi8_work_data_s*)work)->cangjieEnabled) {
switch (phoneticGroups[0] & 7) {
case 2: phoneticGroups += 2; break;
case 3: case 4: phoneticGroups += 3; break;

View File

@@ -164,7 +164,7 @@ static ziBool Zi8AlphaSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED
if (parameters->maxCandidates < length) length = parameters->maxCandidates;
parameters->letters = length;
if ((parameters->getOptions & 0x80) == 0) {
ZI_WORK->unk_0x538 = parameters->language;
ZI_WORK->language = parameters->language;
parameters->candidates[0] = 0xfff0;
output = (ziWChar*)&ZI_WORK->unk_0x338;
}
@@ -490,8 +490,8 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
ZI_WORK->unk_0x00 = '\0';
}
}
ZI_WORK->unk_0x18 = parameters->subLanguage;
ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1,ZI_WORK) & 2;
ZI_WORK->subLanguage = parameters->subLanguage;
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1,ZI_WORK) & 2;
options->maxCount = ZI_WORK->unk_0x10;
options->maxWordLength = ZI_WORK->unk_0x0A;
ZI_WORK->unk_0x0A = -1;
@@ -558,7 +558,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
}
else if ((parameters->language == 1) &&
((((parameters->getMode == 7 || (parameters->getMode == 8)) || (parameters->getMode == 10)) || (parameters->getMode == 9)))) {
if (ZI_WORK->unk_0x16 != '\0') {
if (ZI_WORK->cangjieEnabled != '\0') {
candidateCount = Zi8GetChineseCandidates(parameters,options,ZI_WORK);
} else {
error = 0x708;
@@ -582,7 +582,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
}
}
else {
ZI_WORK->unk_0x538 = parameters->language;
ZI_WORK->language = parameters->language;
if ((parameters->getOptions & 0x80) == 0) {
saved.restoreCandidates = 1;
saved.savedOptions = parameters->getOptions;

View File

@@ -42,13 +42,13 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
return 0;
}
ZI_WORK->unk_0x1874 = 0x2D;
ZI_WORK->unk_0x538 = 0;
ZI_WORK->language = 0;
ZI_WORK->unk_0x1C[3] = 0;
ZI_WORK->unk_0x141A = 0x100;
Zi8SetLatinSearchOrder(0, 0, ZI_WORK);
ZADP_Zi8SetPDremoveOpt(1, ZI_WORK);
ZI_WORK->unk_0x17 = 5;
ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1, ZI_WORK) & 2;
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, ZI_WORK) & 2;
ZI_WORK->unk_0x1B28.bits.msb = 1;
ZI_WORK->unk_0x1B2C.bits.msb = 1;
zyFuzzy = ZI_WORK->unk_0x1B2C.word;

View File

@@ -24,17 +24,17 @@ ziU8 Zi8GetZHCharSet(ziPtr workData) {
return 0;
}
if (Zi8GetTableCount(1, 10, workData) != 0) {
bak = ((struct __zi8_work_data_s*)workData)->unk_0x18;
((struct __zi8_work_data_s*)workData)->unk_0x18 = 1;
bak = ((struct __zi8_work_data_s*)workData)->subLanguage;
((struct __zi8_work_data_s*)workData)->subLanguage = 1;
addr = Zi8GetTableAddress(1, 10, workData);
p = (ziU8*)addr;
v0 = (ziU16)((ziU16)p[0] | ((ziU16)p[1] << 8));
((struct __zi8_work_data_s*)workData)->unk_0x18 = 0;
((struct __zi8_work_data_s*)workData)->subLanguage = 0;
addr = Zi8GetTableAddress(1, 10, workData);
p = (ziU8*)addr;
v1 = (ziU16)((ziU16)p[2] | ((ziU16)p[3] << 8));
v2 = (ziU16)((ziU16)p[4] | ((ziU16)p[5] << 8));
((struct __zi8_work_data_s*)workData)->unk_0x18 = bak;
((struct __zi8_work_data_s*)workData)->subLanguage = bak;
if (v0 != 0) {
if (v0 > 0x4E20) {
charSet |= 8;

View File

@@ -139,7 +139,7 @@ ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam*
data = (ziU8*)Zi8GetTableAddress(1, 1, ZI_WORK);
data += ((ziU8*)nodeAddress)[0xB] + (((ziU8*)nodeAddress)[0xA] << 8) + ((((ziU8*)nodeAddress)[9] & 0xF) << 16);
if (ZI_WORK->unk_0x16 != 0) {
if (ZI_WORK->cangjieEnabled != 0) {
switch (data[0] & 7) {
case 2:
data += 2;
@@ -346,7 +346,7 @@ match_code:
traversal.soundIndex = initialCode;
}
sound = (ziU8*)(tableAddress + ((node[9] & 0xF) * 0x10000 + (node[0xB] + node[0xA] * 0x100)));
if (ZI_WORK->unk_0x16 != 0) {
if (ZI_WORK->cangjieEnabled != 0) {
switch (sound[0] & 7) {
case 2:
sound += 2;

View File

@@ -37,7 +37,7 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) {
p = (ziU8*)(table2 +
(((e[9] & 0xF) << 16) |
(e[0xB] | (e[0xA] << 8))));
if (WORKP->unk_0x16 != 0) {
if (WORKP->cangjieEnabled != 0) {
switch (p[0] & 7) {
case 2:
p += 2;
@@ -65,7 +65,7 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) {
}
}
e = (ziU8*)table;
if (WORKP->unk_0x1B18 != ZI8_NULL && WORKP->unk_0x1B24 == WORKP->unk_0x18) {
if (WORKP->unk_0x1B18 != ZI8_NULL && WORKP->unk_0x1B24 == WORKP->subLanguage) {
if ((ziU16)ch >= WORKP->unk_0x1B1C && (ziU16)ch <= WORKP->unk_0x1B1E) {
i = (ziU16)(ch - WORKP->unk_0x1B1C);
goto map;

View File

@@ -58,8 +58,8 @@ ziU8 ZADP_Zi8SetPDremoveOpt(ziU8 option ZI_NEED_WORK) {
}
ziU32 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziWChar* spelling, ziU16 spellingCapacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {
ziWChar folded;
ziU32 entrySize, wordSize, copied;
ziU8* entry;
ziU32 entrySize;
int wordSize, copied;
ziU8* word;
int index;
int fallback = 0;
@@ -70,18 +70,18 @@ ziU32 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar*
return 0;
}
if (language == 1) {
length &= 0x7F;
length *= 2;
}
if (continuation == 0) {
table = (ziPudHeader*)ZI_WORK->pudTable[ZI_WORK->pudCount - 1];
index = 0;
section = table->sections;
while (index < table->languageCount && section->language != language) {
index = 0;
while (index < table->languageCount) {
if (section->language == language) break;
index++;
section++;
}
if (table->languageCount <= index) {
if (index >= table->languageCount) {
Zi8LogError(0x4F6, __zi8_work_data);
return 0;
}
@@ -90,78 +90,82 @@ ziU32 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar*
ZI_WORK->unk_0x318 = 0;
}
for (;;) {
entry = (ziU8*)ZI_WORK->unk_0x310;
if (entry == 0) {
word = (ziU8*)ZI_WORK->unk_0x310;
if (word == 0) {
Zi8LogError(0x4B3, __zi8_work_data);
return 0;
}
while ((ziS32)ZI_WORK->unk_0x318 < (ziS32)ZI_WORK->unk_0x314) {
word = entry + 1;
wordSize = *entry;
wordSize = *word++;
entrySize = wordSize;
if (language == 1) {
if (*word < ZI_WORK->unk_0x17) goto next;
if (ZI_WORK->unk_0x17 > *word) goto next;
entrySize = wordSize - 1;
word = entry + 2;
word++;
wordSize = ZiGetZHWordSize((ziWChar*)word, entrySize);
} else if (ZI_WORK->unk_0x31E != 0 && complete != 0 && wordSize > length && word[length] == 0x20) goto matchText;
if ((ziS32)length > (ziS32)wordSize || (complete != 0 && wordSize != length) || (complete == 0 && wordSize == length)) goto next;
if (language == 1) {
for (index = 0; index < length; index++) {
if (word[index] != ((ziU8*)pattern)[index]) goto next;
}
goto matched;
}
matchText:
for (index = 0; index < length; index++) {
if (pattern[index] < 0xEFF1 || pattern[index] > 0xF37F) {
folded = Zi8ConvertUC2WC(word[index], language, __zi8_work_data);
if (folded != pattern[index] && (!ZI_WORK->unk_0x1F || !Zi8ChangeCharCase(0, &folded, language, __zi8_work_data) || folded != pattern[index])) goto next;
} else if (pattern[index] != Zi8ConvertUC2Key(word[index], language, __zi8_work_data)) goto next;
}
matched:
if (fallback) {
ZI_WORK->unk_0x310 = 0;
ZI_WORK->unk_0x318 = 0;
ZI_WORK->unk_0x314 = 0;
if (*pattern < 0xEFF1) *output = Zi8ConvertWC2Key(*pattern, language, __zi8_work_data);
else *output = *pattern;
return 1;
}
if (language == 1) {
index = 0;
for (copied = 0; index < (ziS32)wordSize && copied < capacity; copied++) {
((ziU8*)output)[index] = word[index];
((ziU8*)output)[index + 1] = word[index + 1];
index += 2;
}
Zi8CopyZHSpelling(word, spelling, spellingCapacity, entrySize, wordSize);
if ((ziS32)length > (ziS32)wordSize || (complete != 0 && wordSize != length) || (complete == 0 && wordSize == length)) {
next:
ZI_WORK->unk_0x318++;
word += entrySize;
} else {
for (copied = 0; copied < wordSize && copied < capacity; copied++) {
output[copied] = Zi8ConvertUC2WC(word[copied], language, __zi8_work_data);
if (ZI_WORK->unk_0x31E != 0 && copied >= length && output[copied] == 0x20) {
if (complete != 0 || copied >= length) break;
goto next;
if (language == 1) {
for (index = 0; index < length; index++) {
if (word[index] != ((ziU8*)pattern)[index]) goto next;
}
goto matched;
}
matchText:
for (index = 0; index < length; index++) {
if (pattern[index] >= 0xEFF1 && pattern[index] <= 0xF37F) {
if (pattern[index] != Zi8ConvertUC2Key(word[index], language, __zi8_work_data)) goto next;
} else {
folded = Zi8ConvertUC2WC(word[index], language, __zi8_work_data);
if (folded != pattern[index] && (!ZI_WORK->unk_0x1F || !Zi8ChangeCharCase(0, &folded, language, __zi8_work_data) || folded != pattern[index])) goto next;
}
}
matched:
if (fallback) {
ZI_WORK->unk_0x310 = 0;
ZI_WORK->unk_0x318 = 0;
ZI_WORK->unk_0x314 = 0;
if (*pattern >= 0xEFF1) *output = *pattern;
else *output = Zi8ConvertWC2Key(*pattern, language, __zi8_work_data);
return 1;
}
if (language == 1) {
index = 0;
for (copied = 0; index < (ziS32)wordSize && copied < capacity; copied++) {
((ziU8*)output)[index] = word[index];
((ziU8*)output)[index + 1] = word[index + 1];
index += 2;
}
Zi8CopyZHSpelling(word, spelling, spellingCapacity, entrySize, wordSize);
} else {
for (copied = 0; copied < wordSize && copied < capacity; copied++) {
output[copied] = Zi8ConvertUC2WC(word[copied], language, __zi8_work_data);
if (ZI_WORK->unk_0x31E != 0 && copied >= length && output[copied] == 0x20) {
if (complete != 0 || copied >= length) break;
goto next;
}
}
}
ZI_WORK->unk_0x318++;
ZI_WORK->unk_0x310 = (ziU32)(word + entrySize);
Zi8LogError(100, __zi8_work_data);
return (ziU8)copied;
}
ZI_WORK->unk_0x318++;
ZI_WORK->unk_0x310 = (ziU32)(word + entrySize);
Zi8LogError(100, __zi8_work_data);
return (ziU8)copied;
next:
ZI_WORK->unk_0x318++;
entry = word + entrySize;
}
if (length != 1 || complete == 0 || continuation != 0) {
if (length == 1 && complete != 0 && continuation == 0) {
complete = 0;
fallback = 1;
ZI_WORK->unk_0x318 = 0;
} else {
ZI_WORK->unk_0x310 = 0;
ZI_WORK->unk_0x318 = 0;
ZI_WORK->unk_0x314 = 0;
return 0;
}
complete = 0;
fallback = 1;
ZI_WORK->unk_0x318 = 0;
}
}
ziU32 Zi8MatchPUDdata(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {

View File

@@ -42,39 +42,41 @@ ziU32 ZiDAWGGetChild(ziU32 node) {
return node;
}
ziU8* ZiDAWGGetSibling(ziU8* node) {
ziU8* ZiDAWGGetSibling(ziU8* cursor) {
ziU16 header;
ziU8* cursor = node;
ziU8* node;
ziS32 depth;
ziS32 offset;
depth = 0;
node = cursor;
offset = 0;
header = nodeHeaderTable[node[0] >> 4];
header = nodeHeaderTable[cursor[0] >> 4];
if ((header & 4) == 0) {
node = 0;
return 0;
} else {
if ((header & 8) != 0) {
if ((node[0] & 0xf) == 0xf) {
node += 2;
if ((cursor[0] & 0xf) == 0xf) {
cursor += 2;
} else {
node += 1;
cursor += 1;
}
if ((header & 2) != 0) {
if ((*node & 0x80) == 0) {
node += 2;
if ((*cursor & 0x80) != 0) {
cursor += 3;
} else {
node += 3;
cursor += 2;
}
}
if ((*node & 0x80) != 0) {
node += (*node & 0x7f) * 0x10000 + (ziU32)node[1] * 0x100 +
(ziU32)node[2] + 0x8000;
if ((*cursor & 0x80) != 0) {
node += (*cursor & 0x7f) * 0x10000 + (ziU32)cursor[1] * 0x100 +
(ziU32)cursor[2] + 0x8000;
} else {
node += (ziU16)*node * 0x100 + (ziU32)node[1];
node = cursor[1] + (node + (ziU16)*cursor * 0x100);
}
return node;
} else {
cursor = node;
do {
@@ -88,14 +90,16 @@ ziU8* ZiDAWGGetSibling(ziU8* node) {
}
if ((header & 1) != 0) {
if ((header & 2) == 0) {
depth++;
} else if ((*cursor & 0x80) != 0) {
cursor += 3;
offset += 3;
if ((header & 2) != 0) {
if ((*cursor & 0x80) != 0) {
cursor += 3;
offset += 3;
} else {
cursor += 2;
offset += 2;
}
} else {
cursor += 2;
offset += 2;
depth++;
}
}
@@ -113,11 +117,10 @@ ziU8* ZiDAWGGetSibling(ziU8* node) {
}
} while (0 < depth);
node += offset;
return node + offset;
}
}
return node;
}
ziU8 ZiDAWGgetEOWattribute(ziU32 node) {
@@ -158,57 +161,52 @@ ziU32 ZiDAWGGetGraphInfo(zi8DawgCtx* context, ziU8* entry, ziU16* keys) {
ziS32 result;
ziU32 end;
ziU8 depth;
ziU32 pair;
graph = ZiDAWGGetGraph(context);
result = 0;
pair = (((ziU16)entry[0] << 8) + entry[1]);
if (pair != 0) {
if ((((ziU16)entry[0] << 8) + entry[1]) != 0 || (((ziU16)entry[2] << 8) + entry[3]) != 0) {
return 0;
}
pair = (((ziU16)entry[2] << 8) + entry[3]);
if (pair == 0) {
end = (ziU32)(entry + (((ziU16)entry[4] << 8) + entry[5] + 1) * 10);
entry += 10;
depth = 0;
while ((depth < 2) && (*keys != 0)) {
if ((*keys < 0xeff1) || (0xf010 < *keys)) {
break;
}
end = (ziU32)(entry + (((ziU16)entry[4] << 8) + entry[5] + 1) * 10);
entry += 10;
depth = 0;
while ((depth < 2) && (*keys != 0)) {
if (*keys >= 0xeff1 && *keys <= 0xf010) {
goto checkEntry;
while (1) {
if (*keys == (ziS32)(entry[3] + ((ziU16)entry[2] << 8))) {
if (*keys == (ziS32)(((ziU16)entry[2] << 8) + entry[3])) {
break;
}
entry += (entry[1] + ((ziU16)entry[0] << 8)) * 10 + 10;
entry += (((ziU16)entry[0] << 8) + entry[1]) * 10 + 10;
checkEntry:
if (((ziU32)entry >= end) ||
(*keys == (ziS32)(entry[3] + ((ziU16)entry[2] << 8)))) {
(*keys == (ziS32)(((ziU16)entry[2] << 8) + entry[3]))) {
break;
}
}
if ((ziU32)entry >= end) {
return 0;
}
result = graph + (ziU32)entry[4] * 0x10000 + ((ziU16)entry[5] << 8) +
entry[6];
((zi8DawgCtx*)context)->unk_0x338 =
graph + (ziU32)entry[7] * 0x10000 + ((ziU16)entry[8] << 8) +
entry[9];
if (((zi8DawgCtx*)context)->unk_0x338 == graph) {
((zi8DawgCtx*)context)->unk_0x338 = 0;
}
if ((entry[1] + ((ziU16)entry[0] << 8)) == 0) {
break;
}
end = (ziU32)(entry + (entry[1] + ((ziU16)entry[0] << 8)) * 10 + 10);
entry += 10;
depth++;
keys++;
} else {
return 0;
}
if ((ziU32)entry >= end) {
return 0;
}
result = graph + (ziU32)entry[4] * 0x10000 + (((ziU16)entry[5] << 8) + entry[6]);
((zi8DawgCtx*)context)->unk_0x338 =
graph + (ziU32)entry[7] * 0x10000 + (((ziU16)entry[8] << 8) + entry[9]);
if (((zi8DawgCtx*)context)->unk_0x338 == graph) {
((zi8DawgCtx*)context)->unk_0x338 = 0;
}
if ((((ziU16)entry[0] << 8) + entry[1]) == 0) {
break;
}
end = (ziU32)(entry + (((ziU16)entry[0] << 8) + entry[1]) * 10 + 10);
entry += 10;
depth++;
keys++;
}
return result;

View File

@@ -20,13 +20,12 @@ typedef struct ziChineseEntry {
ziU8 offsetLow[2];
} ziChineseEntry;
ziU8 Zi8GetCandidatesOrCount(ziGetParam*, ziSearchState* ZI_NEED_WORK);
ziU32 Zi8GetCandidatesOrCount(ziGetParam*, ziSearchState* ZI_NEED_WORK);
ziU8 Zi8GetFormatVersion(ziU8 ZI_NEED_WORK);
ziPtr Zi8GetTableAddress(ziU8, ziU8 ZI_NEED_WORK);
ziU16 Zi8Uni2Ord(ziWChar ZI_NEED_WORK);
ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
int count;
int offset;
ziU8 group;
ziU8 remaining;
@@ -35,9 +34,10 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
ziSearchState search;
ziGetParam request;
ziWChar ordinals[65];
int length;
int count;
int unmatched;
ziChineseEntry* entry;
ziChineseEntry* table;
ziU8* data;
ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0};
ziU32 savedFormats = ZI_WORK->unk_0x1410;
@@ -54,10 +54,10 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
return 0;
}
if (language != 1) {
for (length = 0; word[length] != 0; length++) {
if (word[length] >= 0xEFF1 || length == 64) return 0;
for (count = 0; word[count] != 0; count++) {
if (word[count] >= 0xEFF1 || count == 64) return 0;
}
((ziU8*)&search.length)[0] = length;
((ziU8*)&search.length)[0] = count;
((ziU8*)&search.flags)[2] = 1;
((ziU16*)&search.capacity)[0] = 64;
search.word = word;
@@ -67,7 +67,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
request.context = 1;
request.getOptions = 0x81;
request.elements = word;
request.elementCount = length;
request.elementCount = count;
request.currentWord = 0;
request.wordCharCount = 0;
request.candidates = ordinals;
@@ -92,21 +92,23 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
if (count != 0) return 1;
}
if (language == 1) {
length = 0;
count = 0;
do {
ordinals[length] = Zi8Uni2Ord(word[length], __zi8_work_data);
if (ordinals[length] == 0xFFFF) return 0;
length++;
if (length == 64) return 0;
} while (word[length] != 0);
ordinals[count] = Zi8Uni2Ord(word[count], __zi8_work_data);
if (ordinals[count] == 0xFFFF) return 0;
count++;
if (count == 64) return 0;
} while (word[count] != 0);
{
if (length == 1) return 1;
count = --length;
if (count == 1) return 1;
count--;
ordinals[count] |= 0x8000;
ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1, __zi8_work_data) & 2;
entry = (ziChineseEntry*)Zi8GetTableAddress(1, 0, __zi8_work_data) + ordinals[0];
data = (ziU8*)Zi8GetTableAddress(1, 1, __zi8_work_data) + ((entry->offsetHigh & 15) << 16 | ((entry->offsetLow[0] << 8) | entry->offsetLow[1]));
if (ZI_WORK->unk_0x16 != 0) {
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, __zi8_work_data) & 2;
table = (ziChineseEntry*)Zi8GetTableAddress(1, 0, __zi8_work_data);
entry = table + ordinals[0];
data = (ziU8*)Zi8GetTableAddress(1, 1, __zi8_work_data);
data += ((entry->offsetHigh & 15) << 16 | ((entry->offsetLow[0] << 8) | entry->offsetLow[1]));
if (ZI_WORK->cangjieEnabled != 0) {
switch (*data & 7) {
case 2:
offset = 2;

View File

@@ -16,24 +16,24 @@ typedef s32 CXStreamingResult;
#define CX_STREAMING_ERR_BAD_FILE_TABLE -5
typedef struct CXUncompContextRL {
u8* unk_0x00; // 0x00
int unk_0x04; // 0x04
u8* outData; // 0x00
int outDataLen; // 0x04
u32 size; // 0x08
u16 unk_0x0C; // 0x0C
u8 unk_0x0e; // 0x0E
u8 unk_0x0f; // 0x0F
u16 length; // 0x0C
u8 flags; // 0x0E
u8 hdrLen; // 0x0F
} CXUncompContextRL;
typedef struct CXUncompContextLZ {
u8* unk_0x00; // 0x00
int unk_0x04; // 0x04
u8* outData; // 0x00
int outDataLen; // 0x04
u32 size; // 0x08
int unk_0x0C; // 0x0C
u8 unk_0x10; // 0x10
u8 unk_0x11; // 0x11
u8 unk_0x12; // 0x12
u8 unk_0x13; // 0x13
u8 unk_0x14; // 0x14
int length; // 0x0C
u8 lengthBytesLeft; // 0x10
u8 flags; // 0x11
u8 flagsLeft; // 0x12
u8 hdrLen; // 0x13
u8 lzType; // 0x14
u8 padding[3];
} CXUncompContextLZ;
@@ -52,10 +52,10 @@ typedef struct CXUncompContextHuffman {
u32 size; // 0x08
CXHuffmanDecodeTableEntry* decodeTable; // 0x0C
u32 bits; // 0x10
u32 unk_0x14; // 0x14
u32 wordBuffer; // 0x14
s16 decodeTableSize; // 0x18
u8 bitsLeft; // 0x1A
u8 unk_0x1b; // 0x1B
u8 wordBits; // 0x1B
u8 depth; // 0x1C
u8 hdrLen; // 0x1D
u8 padding[2]; // 0x1E

View File

@@ -67,14 +67,17 @@ BOOL AXFXChorusExpSettings(AXFX_CHORUS_EXP* fx) {
OSRestoreInterrupts(enabled);
return result;
}
void AXFXChorusExpShutdown(AXFX_CHORUS_EXP* fx) {
BOOL enabled = OSDisableInterrupts();
static void __FreeDelayLine(AXFX_CHORUS_EXP* fx) {
u32 channel;
fx->active |= 1;
for (channel = 0; channel < 3; channel++) {
if (fx->delay.line[channel] != NULL) __AXFXFree(fx->delay.line[channel]);
fx->delay.line[channel] = NULL;
}
}
void AXFXChorusExpShutdown(AXFX_CHORUS_EXP* fx) {
BOOL enabled = OSDisableInterrupts();
fx->active |= 1;
__FreeDelayLine(fx);
OSRestoreInterrupts(enabled);
}
void AXFXChorusExpCallback(AXFX_BUFFERUPDATE* update, AXFX_CHORUS_EXP* fx) {
@@ -118,10 +121,11 @@ void AXFXChorusExpCallback(AXFX_BUFFERUPDATE* update, AXFX_CHORUS_EXP* fx) {
fx->history[0][history] = fx->delay.line[0][source];
fx->history[1][history] = fx->delay.line[1][source];
fx->history[2][history] = fx->delay.line[2][source];
history = (history + 1) & 3;
history++;
history &= 3;
source++;
if (source >= fx->delay.size) source = 0;
whole--;
if (source >= fx->delay.size) source = 0;
}
fx->delay.lastPos = position & 0xFFFF0000;
coefficients = __AXFXGetSrcCoef((fraction >> 9) & 0x7F);
@@ -129,14 +133,18 @@ void AXFXChorusExpCallback(AXFX_BUFFERUPDATE* update, AXFX_CHORUS_EXP* fx) {
f32 filtered = 0.0f;
f32 dry;
filtered += coefficients[0] * fx->history[channel][history];
history = (history + 1) & 3;
history++;
history &= 3;
filtered += coefficients[1] * fx->history[channel][history];
history = (history + 1) & 3;
history++;
history &= 3;
filtered += coefficients[2] * fx->history[channel][history];
history = (history + 1) & 3;
history++;
history &= 3;
filtered += coefficients[3] * fx->history[channel][history];
history = (history + 1) & 3;
if (fx->busIn != NULL) dry = *input[channel]++ + *output[channel];
history++;
history &= 3;
if (fx->busIn != NULL) dry = *output[channel] + *input[channel]++;
else dry = *output[channel];
fx->delay.line[channel][fx->delay.inPos] = dry + filtered * fx->feedback;
*output[channel]++ = filtered * fx->outGain;
@@ -149,8 +157,20 @@ void AXFXChorusExpCallback(AXFX_BUFFERUPDATE* update, AXFX_CHORUS_EXP* fx) {
if (fx->delay.outPos >= fx->delay.sizeFP) fx->delay.outPos = 0;
}
}
static inline void chorus_gradient(AXFX_CHORUS_EXP_LFO* lfo, f32 depth, f32 step) {
depth /= step;
lfo->gradFactor = 65536.0f * depth;
}
static BOOL __InitParams(AXFX_CHORUS_EXP* fx) {
f32 delay, depth, step;
f32 delay;
f32 depth;
f32 step;
u32 channel;
u32 sample;
s32 stepSamp;
s32 phaseAdd;
s32 depthSamp;
if (fx->delayTime < 0.1f || fx->delayTime > 50.0f) return FALSE;
if (fx->depth < 0.0f || fx->depth > 1.0f) return FALSE;
if (fx->rate < 0.1f || fx->rate > 2.0f) return FALSE;
@@ -160,61 +180,60 @@ static BOOL __InitParams(AXFX_CHORUS_EXP* fx) {
fx->lfo.table = __AXFXGetLfoSinTable();
delay = 32.0f * fx->delayTime;
depth = delay * fx->depth;
if (delay <= depth) {
if (depth >= delay) {
depth -= 1.0f;
if (depth < 0.0f) depth = 0.0f;
}
fx->lfo.depthSamp = 65536.0f * depth;
fx->lfo.phaseAdd = 65536.0f * (256.0f * fx->rate / 32000.0f);
step = (32000.0f / fx->rate) * (1.0f / 256.0f);
fx->lfo.stepSamp = 65536.0f * step;
fx->lfo.gradFactor = 65536.0f * (depth / step);
fx->lfo.lastNum = -1;
fx->lfo.phase = 0;
fx->lfo.sign = 0;
fx->lfo.lastValue = 0;
fx->lfo.grad = 0;
fx->history[0][0] = 0.0f;
fx->history[0][1] = 0.0f;
fx->history[0][2] = 0.0f;
fx->history[0][3] = 0.0f;
fx->history[1][0] = 0.0f;
fx->history[1][1] = 0.0f;
fx->history[1][2] = 0.0f;
fx->history[1][3] = 0.0f;
fx->history[2][0] = 0.0f;
fx->history[2][1] = 0.0f;
fx->history[2][2] = 0.0f;
fx->history[2][3] = 0.0f;
depthSamp = 65536.0f * depth;
phaseAdd = 65536.0f * (256.0f * fx->rate / 32000.0f);
step = (32000.0f / fx->rate) / 256.0f;
stepSamp = 65536.0f * step;
fx->lfo.depthSamp = depthSamp;
fx->lfo.phaseAdd = phaseAdd;
fx->lfo.stepSamp = stepSamp;
chorus_gradient(&fx->lfo, depth, step);
for (channel = 0; channel < 3; channel++) {
for (sample = 0; sample < 4; sample++) {
fx->history[channel][sample] = 0.0f;
}
}
fx->histIndex = 0;
return TRUE;
}
static void __CalcLFO(s32* output, AXFX_CHORUS_EXP_LFO* lfo) {
u32 remaining = 96;
do {
s32 value;
u32 phase = lfo->phase & 0xFFFF0000;
s32 start;
s64 value;
s32 difference;
s64 gradient;
u32 phase;
u32 sample;
for (sample = 0; sample < 96; sample++) {
phase = lfo->phase & 0xFFFF0000;
if (phase != lfo->lastNum) {
s32 start, difference;
s64 product;
lfo->lastNum = phase;
phase >>= 16;
start = lfo->table[phase];
difference = lfo->table[(phase + 1) & 0x7F] - start;
product = (s64)start * lfo->depthSamp;
value = ((u32)(product >> 32) << 8) | ((u32)product >> 24);
product = (s64)difference * lfo->gradFactor;
lfo->grad = ((u32)(product >> 32) << 8) | ((u32)product >> 24);
gradient = difference;
gradient *= lfo->gradFactor;
lfo->grad = gradient >> 24;
value = (s64)start * lfo->depthSamp;
value >>= 24;
} else {
value = lfo->lastValue + lfo->grad;
}
else value = lfo->lastValue + lfo->grad;
lfo->lastValue = value;
if (lfo->sign != 0) value = -value;
if (lfo->sign >= 1) value = -value;
lfo->phase += lfo->phaseAdd;
if (lfo->phase & 0xFF800000) {
lfo->phase &= 0x7FFFFF;
lfo->sign ^= 1;
}
*output++ = value;
remaining--;
} while (remaining != 0);
}
}

View File

@@ -5,23 +5,23 @@ static inline int CXiReadHeader(u8*, int*, const u8*, int, int);
static inline CXHuffmanDecodeTableEntry* GetNextNode(CXHuffmanDecodeTableEntry*, int);
void CXInitUncompContextRL(CXUncompContextRL* context, u8* data) {
context->unk_0x00 = data;
context->unk_0x04 = 0;
context->unk_0x0e = 0;
context->unk_0x0C = 0;
context->unk_0x0f = 8;
context->outData = data;
context->outDataLen = 0;
context->flags = 0;
context->length = 0;
context->hdrLen = 8;
context->size = 0;
}
void CXInitUncompContextLZ(CXUncompContextLZ* context, u8* data) {
context->unk_0x00 = data;
context->unk_0x04 = 0;
context->unk_0x11 = 0;
context->unk_0x12 = 0;
context->unk_0x0C = 0;
context->unk_0x10 = 3;
context->unk_0x13 = 8;
context->unk_0x14 = 0;
context->outData = data;
context->outDataLen = 0;
context->flags = 0;
context->flagsLeft = 0;
context->length = 0;
context->lengthBytesLeft = 3;
context->hdrLen = 8;
context->lzType = 0;
context->size = 0;
}
@@ -31,8 +31,8 @@ void CXInitUncompContextHuffman(CXUncompContextHuffman* context, u8* data) {
context->depth = 0;
context->decodeTableSize = -1;
context->decodeTable = context->decodeTableData;
context->unk_0x14 = 0;
context->unk_0x1b = 0;
context->wordBuffer = 0;
context->wordBits = 0;
context->bits = 0;
context->bitsLeft = 0;
context->hdrLen = 8;
@@ -42,9 +42,9 @@ void CXInitUncompContextHuffman(CXUncompContextHuffman* context, u8* data) {
CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u32 size) {
const u8* pSrc = src;
if (context->unk_0x0f) {
if (context->hdrLen) {
int a;
if (context->unk_0x0f == 8) {
if (context->hdrLen == 8) {
if ((*pSrc & CX_COMPRESSION_TYPE_MASK) != CX_COMPRESSION_TYPE_RUN_LENGTH) {
return CX_STREAMING_ERR_BAD_FILE_TYPE;
}
@@ -54,68 +54,68 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
}
}
a = CXiReadHeader(&context->unk_0x0f, &context->unk_0x04, pSrc, size, context->size);
a = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
pSrc += a;
size -= a;
if (!size) {
return !context->unk_0x0f ? context->unk_0x04 : CX_STREAMING_ERR_BAD_FILE_TYPE;
return !context->hdrLen ? context->outDataLen : CX_STREAMING_ERR_BAD_FILE_TYPE;
}
}
while (context->unk_0x04 > 0) {
if (!(context->unk_0x0e & 0x80)) {
while (context->unk_0x0C) {
*context->unk_0x00++ = *pSrc++;
while (context->outDataLen > 0) {
if (!(context->flags & 0x80)) {
while (context->length) {
*context->outData++ = *pSrc++;
context->unk_0x0C--;
context->unk_0x04--;
context->length--;
context->outDataLen--;
size--;
if (!size) {
return context->unk_0x04;
return context->outDataLen;
}
}
} else if (context->unk_0x0C) {
} else if (context->length) {
u8 b = *pSrc++;
size--;
while (context->unk_0x0C) {
*context->unk_0x00++ = b;
while (context->length) {
*context->outData++ = b;
context->unk_0x0C--;
context->unk_0x04--;
context->length--;
context->outDataLen--;
}
if (!size) {
return context->unk_0x04;
return context->outDataLen;
}
}
context->unk_0x0e = *pSrc++;
context->flags = *pSrc++;
size--;
context->unk_0x0C = context->unk_0x0e & 0x7f;
context->length = context->flags & 0x7f;
if (context->unk_0x0e & 0x80) {
context->unk_0x0C += 3;
if (context->flags & 0x80) {
context->length += 3;
} else {
context->unk_0x0C += 1;
context->length += 1;
}
if (context->unk_0x0C > context->unk_0x04) {
if (context->length > context->outDataLen) {
if (!context->size) {
return CX_STREAMING_ERR_BAD_FILE_SIZE;
}
context->unk_0x0C = context->unk_0x04;
context->length = context->outDataLen;
}
if (size) {
continue;
}
return context->unk_0x04;
return context->outDataLen;
}
if (!context->size && size > 32) {
@@ -160,79 +160,79 @@ static int CXiReadHeader(u8* pHdrLen, int* pOutLen, const u8* pSrc, int srcSize,
CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u32 size) {
const u8* pSrc = src;
if (context->unk_0x13) {
if (context->hdrLen) {
int a;
if (context->unk_0x13 == 8) {
if (context->hdrLen == 8) {
if ((*pSrc & CX_COMPRESSION_TYPE_MASK) != CX_COMPRESSION_TYPE_LZ) {
return CX_STREAMING_ERR_BAD_FILE_TYPE;
}
context->unk_0x14 = *pSrc & 0x0F;
context->lzType = *pSrc & 0x0F;
if (context->unk_0x14 != 0 && context->unk_0x14 != 1) {
if (context->lzType != 0 && context->lzType != 1) {
return CX_STREAMING_ERR_BAD_FILE_TYPE;
}
}
a = CXiReadHeader(&context->unk_0x13, &context->unk_0x04, pSrc, size, context->size);
a = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
pSrc += a;
size -= a;
if (!size) {
return !context->unk_0x13 ? context->unk_0x04 : CX_STREAMING_ERR_BAD_FILE_TYPE;
return !context->hdrLen ? context->outDataLen : CX_STREAMING_ERR_BAD_FILE_TYPE;
}
}
while (context->unk_0x04 > 0) {
while (context->unk_0x12) {
while (context->outDataLen > 0) {
while (context->flagsLeft) {
s32 a;
if (!size) {
return context->unk_0x04;
return context->outDataLen;
}
if (!(context->unk_0x11 & 0x80)) {
*context->unk_0x00++ = *pSrc++;
context->unk_0x04--;
if (!(context->flags & 0x80)) {
*context->outData++ = *pSrc++;
context->outDataLen--;
size--;
goto there;
}
while (context->unk_0x10) {
context->unk_0x10--;
while (context->lengthBytesLeft) {
context->lengthBytesLeft--;
if (!context->unk_0x14) {
context->unk_0x0C = *pSrc++;
context->unk_0x0C += 0x30;
context->unk_0x10 = 0;
if (!context->lzType) {
context->length = *pSrc++;
context->length += 0x30;
context->lengthBytesLeft = 0;
} else {
switch (context->unk_0x10) {
switch (context->lengthBytesLeft) {
case 2: {
context->unk_0x0C = *pSrc++;
context->length = *pSrc++;
if (context->unk_0x0C >> 4 == 1) {
context->unk_0x0C = (context->unk_0x0C & 0x0F) << 16;
context->unk_0x0C += 0x1110;
} else if (context->unk_0x0C >> 4 == 0) {
context->unk_0x0C = (context->unk_0x0C & 0x0F) << 8;
context->unk_0x0C += 0x110;
context->unk_0x10 = 1;
if (context->length >> 4 == 1) {
context->length = (context->length & 0x0F) << 16;
context->length += 0x1110;
} else if (context->length >> 4 == 0) {
context->length = (context->length & 0x0F) << 8;
context->length += 0x110;
context->lengthBytesLeft = 1;
} else {
context->unk_0x0C += 0x10;
context->unk_0x10 = 0;
context->length += 0x10;
context->lengthBytesLeft = 0;
}
break;
}
case 1: {
context->unk_0x0C += *pSrc++ << 8;
context->length += *pSrc++ << 8;
break;
}
case 0: {
context->unk_0x0C += *pSrc++;
context->length += *pSrc++;
break;
}
}
@@ -240,47 +240,47 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
size--;
if (!size) {
return context->unk_0x04;
return context->outDataLen;
}
}
a = (context->unk_0x0C & 0x0F) << 8;
context->unk_0x0C >>= 4;
a = (context->length & 0x0F) << 8;
context->length >>= 4;
a = (a | *pSrc++) + 1;
size--;
context->unk_0x10 = 3;
context->lengthBytesLeft = 3;
if (context->unk_0x0C > context->unk_0x04) {
if (context->length > context->outDataLen) {
if (!context->size) {
return CX_STREAMING_ERR_BAD_FILE_SIZE;
}
context->unk_0x0C = context->unk_0x04;
context->length = context->outDataLen;
}
while (context->unk_0x0C > 0) {
*context->unk_0x00 = context->unk_0x00[-a];
context->unk_0x00++;
context->unk_0x04--;
context->unk_0x0C--;
while (context->length > 0) {
*context->outData = context->outData[-a];
context->outData++;
context->outDataLen--;
context->length--;
}
there:
if (!context->unk_0x04) {
if (!context->outDataLen) {
goto out;
}
context->unk_0x11 <<= 1;
context->unk_0x12--;
context->flags <<= 1;
context->flagsLeft--;
}
if (!size) {
return context->unk_0x04;
return context->outDataLen;
}
context->unk_0x11 = *pSrc++;
context->unk_0x12 = 8;
context->flags = *pSrc++;
context->flagsLeft = 8;
size--;
}
@@ -369,16 +369,16 @@ CXStreamingResult CXReadUncompHuffman(CXUncompContextHuffman* context, const voi
continue;
}
context->unk_0x14 >>= context->depth;
context->unk_0x14 |= context->decodeTable->raw << (32 - context->depth);
context->wordBuffer >>= context->depth;
context->wordBuffer |= context->decodeTable->raw << (32 - context->depth);
context->decodeTable = context->decodeTableData + 1;
context->unk_0x1b += context->depth;
context->wordBits += context->depth;
if (context->unk_0x1b == 32) {
*context->outData = CXiConvertEndian32_(context->unk_0x14);
if (context->wordBits == 32) {
*context->outData = CXiConvertEndian32_(context->wordBuffer);
context->outData++;
context->outDataLen -= 4;
context->unk_0x1b = 0;
context->wordBits = 0;
if (context->outDataLen <= 0) {
goto out;

View File

@@ -11,7 +11,7 @@ typedef struct PFD_SDDRV_INFO {
u32 media_inserted;
u32 media_ejected;
s8 drive;
} PFD_SDDRV_INFO;
} ATTRIBUTE_ALIGN(8) PFD_SDDRV_INFO;
typedef union PFD_SDDEV_STORAGE {
SDDev device;

View File

@@ -87,8 +87,9 @@ s32 uhf_msc_blk_mount(FADisk* disk) {
}
s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* completed) {
s32 error;
UHF_MSC_DEVICE* device;
u16 transfer_blocks;
s32 error;
u32 block_size;
u8* transfer_buffer;
u32 transfer_limit;
@@ -102,7 +103,17 @@ s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* com
if (blocks == 0) {
return 0;
}
device = uhf_msc_blk_find_device(disk);
device = NULL;
{
u32 index;
UHF_MSC_DEVICE* candidate;
for (candidate = uhg_msc_blk_device_tbl, index = 0; index < 8; candidate++, index++) {
if (candidate->disk == disk) {
device = &uhg_msc_blk_device_tbl[index];
break;
}
}
}
if (device == NULL) {
return -1;
}
@@ -127,7 +138,7 @@ s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* com
transfer_buffer = buffer;
}
do {
u16 transfer_blocks = transfer_limit;
transfer_blocks = transfer_limit;
if (blocks <= transfer_limit) {
transfer_blocks = blocks;
}
@@ -186,7 +197,17 @@ s32 uhf_msc_blk_pwrite(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* co
if (blocks == 0) {
return 0;
}
device = uhf_msc_blk_find_device(disk);
device = NULL;
{
u32 index;
UHF_MSC_DEVICE* candidate;
for (candidate = uhg_msc_blk_device_tbl, index = 0; index < 8; candidate++, index++) {
if (candidate->disk == disk) {
device = &uhg_msc_blk_device_tbl[index];
break;
}
}
}
if (device == NULL) {
return -1;
}

View File

@@ -141,7 +141,7 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
}
return 0;
}
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u16 media_bps;
pf_u32 ratio;
pf_u32 start;
@@ -158,6 +158,9 @@ pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
else if (ratio == 8) { start >>= 3; }
return sector + start;
}
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) NO_INLINE {
return partition_physical_sector(p_part, sector, bps);
}
pf_s32 pdm_part_get_partition(PDM_DISK* p_disk, pf_u32 id, PDM_PARTITION** pp_part) {
pf_s32 err;
pf_u16 index;

View File

@@ -322,6 +322,8 @@ pf_s32 PFCLUSTER_CombineFiles(PFCLUSTER_ENT_ITER* p_first_iter, PFCLUSTER_ENT_IT
pf_u32 first_spare_clusters;
pf_u32 second_spare_clusters;
pf_u32 excess_clusters;
pf_s32 second_allocated_clusters;
pf_u32 capacity_clusters;
pf_u32 first_end_cluster;
pf_u32 first_spare_cluster;
pf_u32 second_spare_cluster;
@@ -370,8 +372,10 @@ pf_s32 PFCLUSTER_CombineFiles(PFCLUSTER_ENT_ITER* p_first_iter, PFCLUSTER_ENT_IT
if (*p_second_iter->ffd.p_start_cluster != 0) {
second_spare_clusters = p_second_iter->ffd.last_cluster.max_chain_index + 1 - second_used_clusters;
}
if (-1U / cluster_size + 1 < (second_used_clusters + second_spare_clusters) + first_used_clusters) {
excess_clusters = (second_used_clusters + second_spare_clusters) + first_used_clusters - (-1U / cluster_size + 1);
second_allocated_clusters = second_used_clusters + second_spare_clusters;
capacity_clusters = -1U / cluster_size + 1;
if (capacity_clusters < first_used_clusters + second_allocated_clusters) {
excess_clusters = first_used_clusters + second_allocated_clusters - capacity_clusters;
err = PFFAT_TraceClustersChain(&p_second_iter->ffd, second_spare_cluster,
cluster_size * ((p_second_iter->ffd.last_cluster.max_chain_index + 1 - excess_clusters) - second_used_clusters),
&end_cluster, &spare_cluster);
@@ -534,7 +538,7 @@ pf_s32 PFCLUSTER_DivideFile(PFCLUSTER_ENT_ITER* p_source_iter, PFCLUSTER_ENT_ITE
pf_s32 PFCLUSTER_InsertCluster(PFCLUSTER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent,
pf_u32 cluster_index, pf_u32 num_clusters, pf_u32* p_inserted_clusters) {
pf_s32 err;
pf_u32 requested_size;
pf_u32 previous_cluster;
pf_u32 next_cluster;
pf_u32 success_size;
@@ -544,7 +548,7 @@ pf_s32 PFCLUSTER_InsertCluster(PFCLUSTER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent,
pf_u32 allocated_size;
pf_u32 first_cluster;
pf_u32 last_cluster;
pf_u32 requested_size;
pf_s32 err;
pf_u32 file_clusters;
pf_u32 remainder;
pf_u32 extra_size;

View File

@@ -784,6 +784,21 @@ s32 PFFAT_WriteClusterWithBuf(PFFAT_FFD* file, u32 cluster, u32 chainIndex,
return 0;
}
static s32 PFFAT_WriteFATCopies(PF_VOLUME* volume, PF_CACHE_PAGE* page) {
u16 fatIndex;
u32 sector;
s32 firstError;
sector = page->sector;
firstError = 0;
for (fatIndex = 0; fatIndex < volume->bpb.num_active_FATs; fatIndex++) {
s32 error = PFSEC_WriteFAT(volume, page->p_buf, sector, 0, volume->bpb.bytes_per_sector);
if (error != 0 && firstError == 0) firstError = error;
sector += volume->bpb.sectors_per_FAT;
}
return firstError;
}
s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
u32* firstAllocatedCluster,
u32* lastAllocatedCluster, s32 resetClusters)
@@ -793,13 +808,10 @@ s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
u32 firstFreeCluster;
u32 lastFreeCluster;
u32 cluster;
u32 currentSector;
PF_CACHE_PAGE* flushPage;
u32 firstFlushError;
s32 alreadyAllocated;
s32 error;
PF_CACHE_PAGE* page;
u16 completedFATs;
volume = file->p_vol;
eoc2 = fat_special_values[volume->bpb.fat_type].eoc2;
@@ -873,18 +885,7 @@ s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
file->last_cluster.max_chain_index = chainIndex;
*lastAllocatedCluster = lastFreeCluster;
firstFlushError = 0;
currentSector = page->sector;
flushPage = page;
for (completedFATs = 0; completedFATs < volume->bpb.num_active_FATs;
completedFATs++) {
error = PFSEC_WriteFAT(volume, flushPage->p_buf, currentSector, 0,
volume->bpb.bytes_per_sector);
if (error != 0 && firstFlushError == 0) {
firstFlushError = error;
}
currentSector += volume->bpb.sectors_per_FAT;
}
firstFlushError = PFFAT_WriteFATCopies(volume, page);
if (firstFlushError != 0) {
PFCACHE_FreeDataPage(volume, page);
return firstFlushError;
@@ -1231,8 +1232,6 @@ s32 PFFAT_GetSector(PFFAT_FFD* file, u32 fileSectorIndex, u32 mode,
u32 fatType;
u32 chainIndex;
u32 cluster;
u32 numRemainder;
u32 numDivide;
u32 numClusters;
u32 numSectors;
s32 error;
@@ -1248,12 +1247,10 @@ s32 PFFAT_GetSector(PFFAT_FFD* file, u32 fileSectorIndex, u32 mode,
}
chainIndex = fileSectorIndex >> volume->bpb.log2_sectors_per_cluster;
if (mode == 2) {
numSectors = (size / volume->bpb.bytes_per_sector) +
((size % volume->bpb.bytes_per_sector) != 0);
numDivide = numSectors / volume->bpb.sectors_per_cluster;
numRemainder =
(numSectors % volume->bpb.sectors_per_cluster) != 0;
numClusters = numRemainder + numDivide;
numClusters = size / volume->bpb.bytes_per_sector;
numSectors = numClusters + (size % volume->bpb.bytes_per_sector != 0);
numClusters = numSectors / volume->bpb.sectors_per_cluster;
numClusters = numClusters + (numSectors % volume->bpb.sectors_per_cluster != 0);
error = PFFAT_GetClusterAllocated(file, chainIndex, numClusters,
&cluster);
if (error != 0) {
@@ -1875,11 +1872,12 @@ s32 PFFAT_RefreshFSINFO(PF_VOLUME* volume)
error = 17;
}
if (error == 0) {
if (((u32)&((PFFAT_FSINFO*)page->p_buf)
->num_free_clusters.word &
3) != 0) {
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.bytes[0] =
(u8)volume->num_free_clusters;
PFFAT_FSINFO* info;
u8* freeClusterBytes;
info = (PFFAT_FSINFO*)page->p_buf;
freeClusterBytes = info->num_free_clusters.bytes;
if (((u32)freeClusterBytes & 3) != 0) {
freeClusterBytes[0] = (u8)volume->num_free_clusters;
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.bytes[1] =
(u8)(volume->num_free_clusters >> 8);
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.bytes[2] =
@@ -1888,11 +1886,9 @@ s32 PFFAT_RefreshFSINFO(PF_VOLUME* volume)
(u8)(volume->num_free_clusters >> 24);
} else {
u32 freeClusters = volume->num_free_clusters;
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.word =
(freeClusters << 24) |
((freeClusters & 0xFF00) << 8) |
((freeClusters >> 8) & 0xFF00) | (freeClusters >> 24);
u32 upperBytes = (freeClusters << 24) | ((freeClusters << 8) & 0x00FF0000);
u32 lowerBytes = (freeClusters >> 24) | ((freeClusters >> 8) & 0xFF00);
info->num_free_clusters.word = upperBytes | lowerBytes;
}
error = PFSEC_WriteData(
volume, page->p_buf, volume->bpb.fs_info_sector, 0,

View File

@@ -175,68 +175,70 @@ pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 val
pf_s32 PFFAT12_ReadFATEntryWithBuf(PF_VOLUME* p_vol , pf_u16 cluster , pf_u32* p_value ,
PF_CACHE_PAGE* p_page ) {
pf_s32 err;
pf_u32 current_fat;
pf_u32 sector;
pf_u32 offset;
struct {
pf_u32 sector;
pf_u32 current_fat;
pf_s32 err;
pf_u32 offset;
} state;
pf_s32 result;
#define LOAD_FAT_SECTOR(next_sector) \
if (p_page->sector != sector + (next_sector)) { \
if (p_page->sector != state.sector + (next_sector)) { \
if (p_page->option == 1) { \
for (err = 0; (pf_u16)err < p_vol->bpb.num_active_FATs; err++) { \
VFiPFSEC_WriteFAT(p_vol, p_page->p_buf, p_page->sector + (pf_u16)err * p_vol->bpb.sectors_per_FAT, 0, p_vol->bpb.bytes_per_sector); \
for (state.err = 0; (pf_u16)state.err < p_vol->bpb.num_active_FATs; state.err++) { \
VFiPFSEC_WriteFAT(p_vol, p_page->p_buf, p_page->sector + (pf_u16)state.err * p_vol->bpb.sectors_per_FAT, 0, p_vol->bpb.bytes_per_sector); \
} \
} \
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, sector + (next_sector), 0, p_vol->bpb.bytes_per_sector); \
if (err != 0) { continue; } \
p_page->sector = sector + (next_sector); \
state.err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, state.sector + (next_sector), 0, p_vol->bpb.bytes_per_sector); \
if (state.err != 0) { continue; } \
p_page->sector = state.sector + (next_sector); \
}
offset = (pf_u16)(cluster + (cluster >> 1));
sector = p_vol->bpb.active_FAT_sector + (offset >> p_vol->bpb.log2_bytes_per_sector) & 0xFFFF;
state.offset = (pf_u16)(cluster + (cluster >> 1));
state.sector = p_vol->bpb.active_FAT_sector + (state.offset >> p_vol->bpb.log2_bytes_per_sector) & 0xFFFF;
if ((p_vol->bpb.ext_flags & 0x80) != 0) {
current_fat = p_vol->bpb.ext_flags & (0x01 | 0x02 | 0x04);
state.current_fat = p_vol->bpb.ext_flags & (0x01 | 0x02 | 0x04);
} else {
current_fat = 1;
state.current_fat = 1;
}
err = 0;
state.err = 0;
while (PF_TRUE) {
if (err == 0x1000 && p_vol->p_callback != PF_NULL) {
if (state.err == 0x1000 && p_vol->p_callback != PF_NULL) {
result = ((PF_VOLUME_CB)p_vol->p_callback)(p_vol->last_driver_error);
if (result == 0) {
err = 0;
state.err = 0;
continue;
}
if (result == 1 && p_vol->bpb.num_active_FATs >= 2 && current_fat < p_vol->bpb.num_active_FATs) {
current_fat++;
sector += p_vol->bpb.sectors_per_FAT;
err = 0;
if (result == 1 && p_vol->bpb.num_active_FATs >= 2 && state.current_fat < p_vol->bpb.num_active_FATs) {
state.current_fat++;
state.sector += p_vol->bpb.sectors_per_FAT;
state.err = 0;
continue;
}
} else {
LOAD_FAT_SECTOR(0);
offset &= p_vol->bpb.bytes_per_sector - 1;
if (offset == (p_vol->bpb.bytes_per_sector - 1)) {
*p_value = *(p_page->p_buf + offset);
state.offset &= p_vol->bpb.bytes_per_sector - 1;
if (state.offset == (p_vol->bpb.bytes_per_sector - 1)) {
*p_value = *(p_page->p_buf + state.offset);
if (p_page->option == 1) {
for (err = 0; (pf_u16)err < p_vol->bpb.num_active_FATs; err++) {
VFiPFSEC_WriteFAT(p_vol, p_page->p_buf, p_page->sector + (pf_u16)err * p_vol->bpb.sectors_per_FAT, 0, p_vol->bpb.bytes_per_sector);
for (state.err = 0; (pf_u16)state.err < p_vol->bpb.num_active_FATs; state.err++) {
VFiPFSEC_WriteFAT(p_vol, p_page->p_buf, p_page->sector + (pf_u16)state.err * p_vol->bpb.sectors_per_FAT, 0, p_vol->bpb.bytes_per_sector);
}
}
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, sector + 1, 0, p_vol->bpb.bytes_per_sector);
if (err != 0) { continue; }
p_page->sector = sector + 1;
state.err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, state.sector + 1, 0, p_vol->bpb.bytes_per_sector);
if (state.err != 0) { continue; }
p_page->sector = state.sector + 1;
*p_value += (pf_u16)(*p_page->p_buf) << 8;
} else {
*p_value = ((pf_u16)p_page->p_buf[offset + 1] << 8) + *(p_page->p_buf + offset);
*p_value = ((pf_u16)p_page->p_buf[state.offset + 1] << 8) + *(p_page->p_buf + state.offset);
}
}
break;
}
if (err != 0) {
if (state.err != 0) {
*p_value = -1;
return err;
return state.err;
}
if ((cluster & 0x01) != 0) {
*p_value = *p_value >> 4;

View File

@@ -647,18 +647,16 @@ void PFFILE_Cursor_MoveToClusterEnd(PFFILE_FILE* file, pf_u32 size) {
}
}
PFFILE_SFD* PFFILE_GetSFD(PF_VOLUME* volume, PF_DIR_ENT* entry) {
PFFILE_VOLUME_DIRS* volume_dirs = (PFFILE_VOLUME_DIRS*)volume;
PFFILE_SFD* first_free_sfd = PF_NULL;
PFFILE_SFD* sfd = volume_dirs->sfds;
PFFILE_SFD* PFFILE_GetSFD(PFFILE_VOLUME_DIRS* volume_dirs, PF_DIR_ENT* entry) {
pf_u32 first_free_index = 0;
pf_u32 index = 0;
PFFILE_SFD* first_free_sfd = PF_NULL;
pf_u32 index;
for (; index < 5; index++, sfd++) {
for (index = 0; index < 5; index++) {
if ((volume_dirs->sfds[index].stat & 1) == 0 ||
((volume_dirs->sfds[index].stat & 1) != 0 && (!volume_dirs->sfds[index].stat & 2) != 0)) {
if (first_free_sfd == PF_NULL) {
first_free_sfd = sfd;
first_free_sfd = &volume_dirs->sfds[index];
first_free_index = index;
}
} else if (entry->p_vol == volume_dirs->sfds[index].dir_entry.p_vol &&
@@ -922,7 +920,7 @@ pf_s32 PFFILE_p_fopen(PF_VOLUME* volume, PF_STR* path, pf_u32 open_mode,
}
}
volume = entry.p_vol;
sfd = PFFILE_GetSFD(volume, &entry);
sfd = PFFILE_GetSFD((PFFILE_VOLUME_DIRS*)volume, &entry);
if (sfd == PF_NULL) {
return 0x15;
}
@@ -1409,7 +1407,7 @@ pf_s32 PFFILE_FsexecOpenFile(PF_DIR_ENT* entry, PFFILE_ENT_ITER* iter,
} else {
PFENT_getcurrentDateTimeForEnt(&entry->access_date, &access_time);
}
sfd = PFFILE_GetSFD(volume, entry);
sfd = PFFILE_GetSFD((PFFILE_VOLUME_DIRS*)volume, entry);
if (sfd == PF_NULL) {
return 0x15;
}

View File

@@ -360,17 +360,16 @@ pf_bool PFPATH_MatchFileNameWithPattern(const pf_s8* file_name, PF_STR* p_patter
pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* matched_end) {
pf_u32 read_char;
pf_s32 recursive_error;
pf_u16 name_char;
pf_s32 name_width;
pf_u16 pattern_char;
pf_u16 converted_pattern;
pf_u16 converted_name;
pf_s32 name_width;
pf_u16 name_char;
pf_s32 pattern_width;
PF_PATH_VOLUME_SET* volume = &pf_vol_set;
while (*pattern != 0) {
pattern_width = volume->codeset.oem_char_width(pattern);
name_width = volume->codeset.oem_char_width(name);
pattern_width = pf_vol_set.codeset.oem_char_width(pattern);
name_width = pf_vol_set.codeset.oem_char_width(name);
if (pattern_width == 1) {
read_char = pf_toupper(*pattern);
} else {
@@ -399,18 +398,18 @@ pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* match
}
case '*': {
do {
pattern_width = volume->codeset.oem_char_width(pattern);
if (pattern_width != 1) {
read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)pattern);
} else {
pattern_width = pf_vol_set.codeset.oem_char_width(pattern);
if (pattern_width == 1) {
read_char = pf_toupper(*pattern);
} else {
read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)pattern);
}
pattern_char = (pf_u16)read_char;
pattern += pattern_width;
if (pattern_char == '?') {
if (name_char == 0) { return 1; }
name += name_width;
name_width = volume->codeset.oem_char_width(name);
name_width = pf_vol_set.codeset.oem_char_width(name);
if (name_width == 1) { read_char = pf_toupper(*name); }
else { read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)name); }
name_char = (pf_u16)read_char;
@@ -428,7 +427,7 @@ pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* match
}
if (*matched_end != 0) { return recursive_error; }
}
name_width = volume->codeset.oem_char_width(name);
name_width = pf_vol_set.codeset.oem_char_width(name);
if (name_width == 1) {
read_char = pf_toupper(*name);
} else {

View File

@@ -144,8 +144,8 @@ const u16 kprLookupTable437[] = {
0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0,
};
static void (*kprProcDeadKeysFP)(KPRQueue* queue);
static void (*kprProcRomajiFP)(KPRQueue* queue);
static void (*kprProcDeadKeysFP)(KPRQueue* queue) = NULL;
static void (*kprProcRomajiFP)(KPRQueue* queue) = NULL;
const char* __KPRVersion = "<< RVL_SDK - KPR \trelease build: Apr 20 2010 11:21:44 (0x4199_60831) >>";
void KPRProcessDeadKeys(KPRQueue* queue);
@@ -242,6 +242,25 @@ u8 KPRLookAhead(KPRQueue* queue, u16* destination, u32 capacity) {
return queue->iCount + queue->oCount;
}
static inline u32 KPRConvertAltValue(u32 value, u32 leadingZero) {
if (value >= 128 && value <= 255) {
if (leadingZero) {
if (value < 160) {
value = kprLookupTable1252[value - 128];
}
} else {
value = kprLookupTable437[value - 128];
}
} else if (value > 255) {
u32 converted = 32;
if (value <= 0x6666666) {
converted = (u8)value;
}
value = converted;
}
return value;
}
BOOL KPRProcessAltKeypad(KPRQueue* queue, u16 character) {
if (queue->altVal != 0) {
u32 accumulator = queue->altVal & 0x7FFFFFFF;
@@ -256,21 +275,7 @@ BOOL KPRProcessAltKeypad(KPRQueue* queue, u16 character) {
return TRUE;
}
value = queue->altVal;
if (value >= 128 && value <= 255) {
if (leadingZero) {
if (value < 160) {
value = kprLookupTable1252[value - 128];
}
} else {
value = kprLookupTable437[value - 128];
}
} else if (value > 255) {
u32 converted = 32;
if (value <= 0x6666666) {
converted = (u8)value;
}
value = converted;
}
value = KPRConvertAltValue(value, leadingZero);
{
u16* destination;
int index = queue->oCount + queue->iCount;

View File

@@ -50,12 +50,16 @@ int NHTTPGetHeaderAll(void*, char**);
void NHTTPCancelRequestAsync(int);
void NHTTPDestroyResponse(void*);
static inline unsigned long NhttpBufferSize(unsigned long requested) {
if (requested != 0 && requested < 0x8000) return requested;
return 0x8000;
}
static u8* __nupNhttpBufFull(u8** buffer, unsigned long* length, unsigned long requested, void*, void*, HttpState* state) {
u8* next = NULL;
if (state->progress != NULL && *length != 0) {
state->progress(state->progressContext, *length);
}
if ((state->received + *length) < state->received) {
if ((u32)(state->received + *length) < (u32)state->received) {
if (state->error == 0) state->error = -5012;
}
state->received += *length;
@@ -69,22 +73,26 @@ static u8* __nupNhttpBufFull(u8** buffer, unsigned long* length, unsigned long r
if (state->error != 0) goto done;
}
next = *buffer;
if (next == NULL) {
if (requested != 0 && requested < 0x8000) {} else requested = 0x8000;
switch ((u32)next) {
case 0: {
requested = NhttpBufferSize(requested);
next = (u8*)nup::__nupMalloc(requested);
if (next == NULL) {
state->error = -5000;
goto done;
}
*length = requested;
break;
}
default: break;
}
if (*length != 0) state->lastActivity = OSGetTime();
}
}
done:
if (state->error != 0) {
next = NULL;
*length = 0;
next = NULL;
}
return next;
}
@@ -101,12 +109,17 @@ 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) {
unsigned long transferred, expected;
int length;
char* responseHeaders = NULL;
u8* responseBody = NULL;
HttpState state;
int result = 0;
char* headerCopy = NULL;
void* request;
int requestId;
int status;
u8* responseBody = NULL;
char* responseHeaders = NULL;
int length;
unsigned long expected;
unsigned long transferred;
HttpState state;
state.error = 0;
state.limit = limit;
state.received = 0;
@@ -118,10 +131,7 @@ static int __nupNhttpOp(char* url, NHTTPReqMethod method, char* headers, u8* bod
state.done = 0;
state.result = 0;
state.lastActivity = 0;
int result = 0;
int requestId = 0;
char* headerCopy = NULL;
void* request = NHTTPCreateRequestEx(url, method, NULL, 0, __nupNhttpReqDone, &state, __nupNhttpBufFull, __nupNhttpBufFree);
request = NHTTPCreateRequestEx(url, method, NULL, 0, __nupNhttpReqDone, &state, __nupNhttpBufFull, __nupNhttpBufFree);
if (request == NULL) { result = -7000 - NHTTPGetError(); goto cleanup; }
if (NHTTPSetSocketBufferSize(request, 0x8000) != 0) { result = -7000 - NHTTPGetError(); goto cleanup; }
if (headers != NULL) {
@@ -130,16 +140,15 @@ 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;
while (*field != 0) {
char* colon = strchr(field, ':');
if (colon == NULL) break;
char* end = strstr(colon, "\r\n");
if (end == NULL) break;
char* colon;
char* end;
while (*field != 0 && (colon = strchr(field, ':')) != NULL && (end = strstr(colon, "\r\n")) != NULL) {
*colon = 0;
*end = 0;
while (*field && isspace(*field)) field++;
do { colon++; } while (*colon && isspace(*colon));
if (NHTTPAddHeaderField(request, field, colon) != 0) { result = -7000 - NHTTPGetError(); goto cleanup; }
char* value = colon + 1;
while (*value && isspace(*value)) ++value;
if (NHTTPAddHeaderField(request, field, value) != 0) { result = -7000 - NHTTPGetError(); goto cleanup; }
field = end + 2;
}
}
@@ -153,40 +162,39 @@ 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) {
int error = NHTTPGetError();
result = -7000 - NHTTPGetError();
NHTTPDeleteRequest(request);
result = -7000 - error;
goto cleanup;
}
state.lastActivity = OSGetTime();
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);
while (NHTTPGetProgress(&expected, &transferred) == 0 || state.done == 0) {
if (OSGetTime() - state.lastActivity >= OSMillisecondsToTicks((OSTime)90000)) {
if (requestId >= 0) {
NHTTPCancelRequestAsync(requestId);
NCDSleep(OSMillisecondsToTicks(100));
}
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 = -5007;
result = -5009;
goto cleanup;
}
if (OSGetTime() - state.lastActivity >= OSMillisecondsToTicks(90000)) break;
NCDSleep(OSMillisecondsToTicks(100));
}
if (requestId >= 0) {
NHTTPCancelRequestAsync(requestId);
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);
}
result = -5009;
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;
cleanup:
if (state.response != NULL || result == -5009) NHTTPDestroyResponse(state.response);
if (headerCopy != NULL) nup::__nupFree(headerCopy);
@@ -194,18 +202,21 @@ cleanup:
}
extern "C" {
static long __nupHttpStringFlush(u8* data, unsigned long length, unsigned long requested, void* context) {
HttpString* text = (HttpString*)context;
static inline unsigned long HttpStringGrowthSize(HttpString* text, unsigned long total, unsigned long requested) {
if (requested >= total) return requested;
requested = text->growth + total;
text->growth <<= 1;
if (text->growth >= text->maximumGrowth) text->growth = text->maximumGrowth;
return requested;
}
static inline long AppendHttpString(unsigned long length, u8* data, unsigned long requested, HttpString* text) {
u8* next;
unsigned long total;
total = length + text->length;
total = text->length + length;
long result = 0;
if (total > text->capacity) {
if (requested >= total) {} else {
requested = text->growth + total;
text->growth <<= 1;
if (text->growth < text->maximumGrowth) {} else text->growth = text->maximumGrowth;
}
u8* next = (u8*)nup::__nupMalloc(requested);
requested = HttpStringGrowthSize(text, total, requested);
next = (u8*)nup::__nupMalloc(requested);
if (next == NULL) { result = -5000; goto done; }
if (text->buffer != NULL) {
memcpy(next, text->buffer, text->length);
@@ -218,6 +229,9 @@ static long __nupHttpStringFlush(u8* data, unsigned long length, unsigned long r
done:
return result;
}
static long __nupHttpStringFlush(u8* data, unsigned long length, unsigned long requested, void* context) {
return AppendHttpString(length, data, requested, (HttpString*)context);
}
}
static int __nupNhttpOpString(u8** output, unsigned long* outputLength, char* url, NHTTPReqMethod method, char* headers, u8* body, unsigned long bodyLength, unsigned long limit, ProgressCallback progress, void* context) NO_INLINE;
static int __nupNhttpOpString(u8** output, unsigned long* outputLength, char* url, NHTTPReqMethod method, char* headers, u8* body, unsigned long bodyLength, unsigned long limit, ProgressCallback progress, void* context) {

View File

@@ -43,7 +43,7 @@ typedef struct __sdCbArg {
SDCallbackFunc cb; // 0x00
void* cbArg; // 0x04
SDDev* dev; // 0x08
u32 unk_0x0C;
u32 cmd; // 0x0C
u32 SDDevRca;
u32* resp; // 0x14
u8* SDSectorSize;
@@ -70,7 +70,7 @@ ISD_Error ISD_GetCardSize(SDDev* dev, u32* outSize, u32* outSize2, u32* outSecto
IOSError __sdCb(s32 result, void* arg) {
__sdCbArg* data = (__sdCbArg*)arg;
switch (data->unk_0x0C) {
switch (data->cmd) {
case 4: {
if (result != 0) {
OSReport(__sdPathData, result);
@@ -196,7 +196,7 @@ static IOSError sduCommandv(s32 fd, u32 cmd, u32 cmdType, u32 respType, u32 arg,
data->cb = cb;
data->cbArg = cbArg;
data->resp = resp;
data->unk_0x0C = cmd;
data->cmd = cmd;
data->SDSectorSize = (u8*)sdCmd;
ret = IOS_IoctlvAsync(fd, 7, readCount, writeCount, __sdVect, __sdCb, data);
@@ -243,7 +243,7 @@ static ISD_Error sduCommand(s32 fd, u32 cmd, u32 cmdType, u32 respType, u32 arg,
data->cb = cb;
data->cbArg = cbArg;
data->resp = resp;
data->unk_0x0C = cmd;
data->cmd = cmd;
data->SDDevRca = 1;
data->SDSectorSize = (u8*)sdCmd;

View File

@@ -54,9 +54,9 @@ typedef struct _CDBAttrBuf {
typedef struct _CDBAttr {
CDBAttrBuf buf; // 0x00
BOOL unk_0x400; // 0x400
BOOL unk_0x404; // 0x404
BOOL unk_0x408; // 0x408
BOOL dirty; // 0x400
BOOL wiiIdDirty; // 0x404
BOOL wiiIdValid; // 0x408
} CDBAttr;
#pragma pack(pop)

View File

@@ -97,7 +97,7 @@ typedef struct NHTTPResponseInfo
s32 isSuccess;
s32 isHeaderParse;
s32 httpStatus;
u32 recvBufLen;
volatile u32 recvBufLen;
char* allHeader_p;
char* foundHeader_p;
char* recvBuf_p;

View File

@@ -44,8 +44,8 @@ typedef struct NWC24MsgObjPrivate {
#else
NWC24UserId fromId; // 0x20
#endif
u32 unk_0x28;
u32 unk_0x2C;
u32 date; // 0x28
u32 receivedDate; // 0x2C
NWC24Data unk_0x30;
NWC24Data unk_0x38;
NWC24Data subject; // 0x40

View File

@@ -87,6 +87,10 @@ typedef struct WD_Info_ {
u8 unk_0x60[0x30]; // 0x60 (is it padding???)
} PACKED WD_Info;
#ifdef __cplusplus
extern "C" {
#endif
s32 WDCheckEnableChannel(u16* enableChannel);
s32 WDScanOnce(u8* scanBuffer, u32 scanBufferLen, WDScanParam* param);
s32 WDGetPrivacyMode(WDBssDesc* bssDesc);
@@ -94,4 +98,8 @@ s32 WDGetPrivacyMode(WDBssDesc* bssDesc);
BOOL WDFindInformationElement(WDInfoElement** outIE, u32* outIELength, WDBssDesc* bssDesc, int id);
BOOL WDiFindVendorSpecificIE(WDVendorInfoElement** outIE, u32* outIELength, WDBssDesc* bssDesc, int id, u8* data, u8 mode);
#ifdef __cplusplus
}
#endif
#endif // REVOLUTION_WD_H

View File

@@ -55,9 +55,9 @@ CDBErr CDBAttrCheckAttrBuf(CDBAttr* attr) {
void CDBAttrInit(CDBAttr* attr) {
memset(&attr->buf, 0, sizeof(CDBAttrBuf));
attr->unk_0x408 = FALSE;
attr->unk_0x400 = FALSE;
attr->unk_0x404 = FALSE;
attr->wiiIdValid = FALSE;
attr->dirty = FALSE;
attr->wiiIdDirty = FALSE;
}
CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate) {
@@ -89,7 +89,7 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
err = CDB_ERROR_OK;
attr->unk_0x400 = TRUE;
attr->dirty = TRUE;
}
if (err != CDB_ERROR_OK) {
@@ -98,11 +98,11 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
attrLastModifiedDate = lastModifiedDate;
memcpy(&attr->buf.lastModifiedDate, &attrLastModifiedDate, sizeof(u32));
attr->unk_0x400 = TRUE;
attr->dirty = TRUE;
attrModifiedCount = 0;
memcpy(&attr->buf.cdbID.modifiedCount, &attrModifiedCount, sizeof(u32));
attr->unk_0x400 = TRUE;
attr->dirty = TRUE;
GenCDBIdNumber(&cdbNum);
attrCdbIDNum = cdbNum;
@@ -110,12 +110,12 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
attrWiiID = CDBGetWiiId();
memcpy(&attr->buf.wiiId, &attrWiiID, sizeof(u64));
attr->unk_0x408 = TRUE;
attr->wiiIdValid = TRUE;
err = CDB_ERROR_OK;
attr->unk_0x400 = TRUE;
attr->unk_0x404 = TRUE;
attr->dirty = TRUE;
attr->wiiIdDirty = TRUE;
return err;
}
@@ -123,7 +123,7 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
CDBErr CDBAttrSetModifiedDate(CDBAttr* attr, u32 modifiedDate) {
u32 value = modifiedDate;
memcpy(&attr->buf.lastModifiedDate, &value, sizeof(u32));
attr->unk_0x400 = TRUE;
attr->dirty = TRUE;
return CDB_ERROR_OK;
}
@@ -131,7 +131,7 @@ CDBErr CDBAttrSetModifiedDate(CDBAttr* attr, u32 modifiedDate) {
CDBErr CDBAttrSetModifiedCount(CDBAttr* attr, u32 modifiedCount) {
u32 value = modifiedCount;
memcpy(&attr->buf.cdbID.modifiedCount, &value, sizeof(u32));
attr->unk_0x400 = TRUE;
attr->dirty = TRUE;
return CDB_ERROR_OK;
}
@@ -151,7 +151,7 @@ CDBErr CDBAttrGetIDNumber(CDBAttr* attr, CDBId* cdbID) {
CDBErr CDBAttrSetWiiId(CDBAttr* attr, u64 wiiId) {
u64 value = wiiId;
memcpy(&attr->buf.wiiId, &value, sizeof(u64));
attr->unk_0x404 = TRUE;
attr->wiiIdDirty = TRUE;
return CDB_ERROR_OK;
}

View File

@@ -367,6 +367,19 @@ CDBErr CDBRecordSeek(CDBRecord* record, s32 offset, CDBSeek seek) {
return err;
}
CDBErr CDBRecordGetFileSize(CDBRecord* record, u32* size) {
CDBErr err;
CDBLock();
if ((s32)record->file == 0) {
CDBReportError("can't get file size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDBRecordFileGetFileSize(record, size);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetDataSize(CDBRecord* record, u32* size) {
CDBErr err;
CDBLock();
@@ -455,7 +468,7 @@ CDBErr CDBRecordGetId(CDBRecord* record, CDBId* id) {
} else {
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get CDBId of the record ; the record is closed\n");
CDBReportError("can't get maker code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBLock();
@@ -723,14 +736,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
return CDB_ERROR_OK;
}
}
CDBLock();
if ((s32)record->file == 0) {
CDBReportError("can't get file size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDBRecordFileGetFileSize(record, &fileSize);
}
CDBUnlock();
err = CDBRecordGetFileSize(record, &fileSize);
CDBAttrSetFileSize(&recordFile->attr, fileSize);
if (err != CDB_ERROR_OK) {
return CDB_ERROR_OK;
@@ -933,7 +939,7 @@ CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize
if (CDBRecordKeyCompareByDate(&comparisonKey, &record->key) != 0) {
if (CDBIsPrintDebugMessage(3)) {
CDBReport_(3);
OSReport("CDBRecordPrivateChangeOwner\n");
OSReport("ファイル名の改竄を検出\n");
}
return CDB_ERROR_32;
}

View File

@@ -21,7 +21,7 @@ CDBErr CDBRecordFileReadAttrBuf(CDBRecord* record) {
return err;
}
recordFile->attr.unk_0x408 = TRUE;
recordFile->attr.wiiIdValid = TRUE;
return CDB_ERROR_OK;
}
@@ -34,12 +34,12 @@ CDBErr CDBRecordFileWriteAttrBuf(CDBRecord* record) {
return CDB_ERROR_27;
}
if (recordFile->attr.unk_0x400 && !recordFile->attr.unk_0x404) {
if (recordFile->attr.dirty && !recordFile->attr.wiiIdDirty) {
err = CDBFWriteAttrOnlyLeadChunk(&recordFile->bridgeFile, &recordFile->attr, record->key.location);
if (err != CDB_ERROR_OK) {
return err;
}
} else if (recordFile->attr.unk_0x400 || recordFile->attr.unk_0x404) {
} else if (recordFile->attr.dirty || recordFile->attr.wiiIdDirty) {
err = CDBFWriteAttr(&recordFile->bridgeFile, &recordFile->attr, record->key.location);
if (err != CDB_ERROR_OK) {
return err;

View File

@@ -234,30 +234,39 @@ void AESiDecryptBlock(AESContext* context, u32* output, const u32* input) {
}
BOOL NETAESCreateEx(AESContext* context, const void* key, u32 keyLength, const void* iv, const AESBlockMode* mode) {
BOOL result=FALSE;
u32 words,index,value;
u32* schedule;
u32 words;
u32 index;
u32 value;
BOOL result = FALSE;
if (keyLength != 16 && keyLength != 24 && keyLength != 32) {
OSReport("NETAESCreateEx() failed! (key-length is allowed only 16, 20, 24 BYTEs)");
} else {
context->rounds=keyLength/4+6;
context->needsTransform=1;
context->mode=mode;
context->needsTransform = 1;
context->rounds = (keyLength * 8) / 32 + 6;
context->mode = mode;
memcpy(context->chain, iv, 16);
schedule=context->keys;
words=keyLength/4;
memcpy(schedule,key,keyLength);
value=schedule[words-1];
for(index=words; index<(context->rounds+1)*4; ++index) {
if (index%words == 0) {
value=SUBSTITUTE_XOR(AESiSubShiftTable,value<<8,value<<8,value<<8,value>>24) ^ ((u32)AESiRoundKeyRcon0[index/words-1]<<24);
} else if(words>6 && index%words==4) {
value=SUBSTITUTE_XOR(AESiSubShiftTable,value,value,value,value);
schedule = context->keys;
words = keyLength / 4;
memcpy(schedule, key, keyLength);
value = schedule[words - 1];
for (index = words; index < (context->rounds + 1) * 4; ++index) {
if (index % words == 0) {
u32 high = (u32)AESiSubShiftTable[(value >> 16) & 255] << 24;
u32 low = AESiSubShiftTable[value >> 24];
u32 lower = (u32)AESiSubShiftTable[value & 255] << 8;
u32 upper = (u32)AESiSubShiftTable[(value >> 8) & 255] << 16;
value = (low ^ high) ^ (lower ^ upper);
value ^= (u32)AESiRoundKeyRcon0[index / words - 1] << 24;
} else if (words > 6 && index % words == 4) {
value = ((u32)AESiSubShiftTable[value >> 24] << 24) ^
(((u32)AESiSubShiftTable[(value >> 16) & 255] << 16) ^
(AESiSubShiftTable[value & 255] ^ ((u32)AESiSubShiftTable[(value >> 8) & 255] << 8)));
}
value ^= schedule[index-words];
schedule[index]=value;
value ^= schedule[index - words];
schedule[index] = value;
}
result=TRUE;
result = TRUE;
}
return result;
}

View File

@@ -13,7 +13,7 @@ static void FindHeaderBlock(const NHTTPResponseInfo* response, s32 position, NHT
}
}
static s8 ReadHeaderChar(const NHTTPResponseInfo* response, NHTTPi_HDRBUFLIST** block, s32* offset) {
static int ReadHeaderChar(const NHTTPResponseInfo* response, NHTTPi_HDRBUFLIST** block, s32* offset) {
if(!*block) {
if(*offset<1024) return (s8)response->hdrBufFirst[(*offset)++];
*block=response->hdrBufBlock_p;
@@ -30,30 +30,31 @@ static int LowerCase(int character) {
s32 NHTTPi_findNextLineHdrRecvBuf(const NHTTPResponseInfo* response, s32 position, s32 limit, s32* colon, s32* newlineLength) {
NHTTPi_HDRBUFLIST* block;
s32 offset;
s32 next=-1;
BOOL carriage=FALSE;
if(colon) *colon=-1;
if(position>=limit) return -1;
FindHeaderBlock(response,position,&block,&offset);
for(; position<limit; ++position) {
s8 character=ReadHeaderChar(response,&block,&offset);
if(character==':' && colon && *colon<0) *colon=position;
if(carriage) {
if(character=='\n') {
next=position==limit-1 ? 0 : position+1;
if(newlineLength) *newlineLength=2;
if (position < limit) {
s32 next=-1;
BOOL carriage=FALSE;
FindHeaderBlock(response,position,&block,&offset);
for(; position<limit; ++position) {
int character=ReadHeaderChar(response,&block,&offset);
if((s8)character==':' && colon && *colon<0) *colon=position;
if(carriage) {
if((s8)character=='\n') {
next=position==limit-1 ? 0 : position+1;
if(newlineLength) *newlineLength=2;
}
return next;
}
if((s8)character=='\r') {
next=position==limit-1 ? 0 : position+1;
carriage=TRUE;
if(newlineLength) *newlineLength=1;
}
if((s8)character=='\n') {
next=position==limit-1 ? 0 : position+1;
if(newlineLength) *newlineLength=1;
return next;
}
return next;
}
if(character=='\r') {
next=position==limit-1 ? 0 : position+1;
carriage=TRUE;
if(newlineLength) *newlineLength=1;
}
if(character=='\n') {
next=position==limit-1 ? 0 : position+1;
if(newlineLength) *newlineLength=1;
return next;
}
}
return -1;
@@ -62,11 +63,12 @@ s32 NHTTPi_findNextLineHdrRecvBuf(const NHTTPResponseInfo* response, s32 positio
s32 NHTTPi_skipSpaceHdrRecvBuf(const NHTTPResponseInfo* response, s32 position, s32 limit) {
NHTTPi_HDRBUFLIST* block;
s32 offset;
if(position>=limit) return -1;
FindHeaderBlock(response,position,&block,&offset);
for(; position<limit; ++position) {
s8 character=ReadHeaderChar(response,&block,&offset);
if(character!=' ') return position;
if (position < limit) {
FindHeaderBlock(response,position,&block,&offset);
for(; position<limit; ++position) {
s8 character=ReadHeaderChar(response,&block,&offset);
if(character!=' ') return position;
}
}
return -1;
}
@@ -91,32 +93,35 @@ s32 NHTTPi_loadFromHdrRecvBuf(NHTTPResponseInfo* response, char* destination, s3
s32 amount;
NHTTPi_HDRBUFLIST* block;
if(position+length>response->headerLen) return FALSE;
if(length) {
if(position<1024) {
amount=length;
if(length>1024-position) amount=1024-position;
NHTTPi_memcpy(destination,response->hdrBufFirst+position,amount);
position+=amount; length-=amount; destination+=amount;
}
if (position + length <= response->headerLen) {
if(length) {
s32 blocks;
position-=1024;
block=response->hdrBufBlock_p;
blocks=position>>9;
position&=511;
while(blocks--) block=block->next_p;
while(length) {
if(position<1024) {
amount=length;
if(length>512-position) amount=512-position;
NHTTPi_memcpy(destination,block->block+position,amount);
position=(position+amount)&511;
block=block->next_p;
length-=amount; destination+=amount;
if(length>1024-position) amount=1024-position;
NHTTPi_memcpy(destination,response->hdrBufFirst+position,amount);
position+=amount; length-=amount; destination+=amount;
}
if(length) {
s32 blocks;
position-=1024;
block=response->hdrBufBlock_p;
blocks=position>>9;
position&=511;
while(blocks--) block=block->next_p;
while(length) {
amount=length;
if(length>512-position) amount=512-position;
NHTTPi_memcpy(destination,block->block+position,amount);
position+=amount;
position&=511;
block=block->next_p;
length-=amount; destination+=amount;
}
}
}
return TRUE;
}
return TRUE;
return FALSE;
}
BOOL NHTTPi_isRecvBufFull(NHTTPResponseInfo* response, u32 length) { return length>=response->recvBufLen; }
@@ -127,10 +132,14 @@ s32 NHTTPi_RecvBuf(void* mutex, NHTTPRequestInfo* request, s32 socket, u32 offse
}
s32 NHTTPi_RecvBufN(void* mutex, NHTTPRequestInfo* request, s32 socket, u32 offset, s32 length, s32 flags) {
NHTTPResponseInfo* response=request->response;
s32 available;
NHTTPResponseInfo* response=request->response;
void* buf;
if(response->recvBufLen<=offset) return -1003;
available=response->recvBufLen-offset;
available=response->recvBufLen;
buf=response->recvBuf_p;
available=available-offset;
buf=(u8*)buf+offset;
if(length>available) length=available;
return NHTTPi_SocRecv(mutex,request,socket,response->recvBuf_p+offset,length,flags);
return NHTTPi_SocRecv(mutex,request,socket,buf,length,flags);
}

View File

@@ -135,10 +135,14 @@ s32 NHTTPi_SocSend_sub(s32 socket, const char* data, u32 length, s32 flags) {
if(head>length) head=length;
NHTTPi_memcpy(buffer,data,head);
result=SOSend(socket,buffer,head,flags);
if(result<=0) return result;
sent=result;
if((u32)result<head) return result;
data+=result; length-=result;
if (result > 0) {
sent = result;
if ((u32)result < head) return result;
data += result;
length -= result;
} else {
return result;
}
}
if((s32)length>0) {
head=length&~31;

View File

@@ -67,10 +67,11 @@ s32 NHTTPi_strToHex(const char* string, s32 length) {
s32 value;
BOOL started;
if(length>8) return -1;
if((length==8) & (*string>='7')) return -1;
if((length==8) & (*string>'7')) return -1;
value=0; started=FALSE;
for(; length>0; --length,++string) {
s8 character=LowerCase(*string);
u8 rawCharacter = *(const u8*)string;
s8 character = LowerCase((s8)rawCharacter);
if(character>='0' && character<='9') { value=(value<<4)+character-'0'; started=TRUE; }
else if(character>='a' && character<='f') { value=(value<<4)+character-'a'+10; started=TRUE; }
else {
@@ -101,23 +102,25 @@ s32 NHTTPi_strToInt(const char* string, s32 length) {
return value;
}
static inline u32 TakeDecimalDigit(u32* remaining, u32 scale) {
u32 digit = *remaining / scale;
*remaining -= digit * scale;
return digit;
}
s32 NHTTPi_intToStr(char* destination, u32 value) {
u32 scales[9]={1000000000,100000000,10000000,1000000,100000,10000,1000,100,10};
BOOL started;
int digit;
char* output;
BOOL started;
s32 length;
output = destination;
length = 0;
started = FALSE;
for(digit=0; digit<9; ++digit) {
if(value>=scales[digit]) {
u32 quotient=value/scales[digit];
u32 quotient=TakeDecimalDigit(&value, scales[digit]);
started=TRUE;
++length;
*output++=quotient+'0';
value-=quotient*scales[digit];
} else if(started) { *output++='0'; ++length; }
destination[length++]=quotient+'0';
} else if(started) { destination[length++]='0'; }
}
destination[length]=value+'0';
return length+1;
@@ -135,18 +138,22 @@ s32 NHTTPi_compareToken(const char* left, const char* right) {
}
s32 NHTTPi_strtonum(const char* string, u32 length) {
int digits=0;
s32 value=0;
while(length--) {
int character=*string++;
if(character==' ') continue;
if((character>='0') & (character<='9')) {
value=value*10+character-'0';
int character;
s32 value;
int digits;
digits = 0;
value = 0;
for (; length != 0; --length, ++string) {
u8 rawCharacter = *(const u8*)string;
character = (s8)rawCharacter;
if (character == ' ') continue;
if ((character >= '0') & (character <= '9')) {
value = value * 10 + character - '0';
++digits;
if(digits>9) return -1;
if (digits > 9) return -1;
}
}
if(digits==0) return -1;
if (digits == 0) return -1;
return value;
}

View File

@@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
continue;
}
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->unk_0x28) {
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->date) {
duplicateId = entry->msgId;
duplicateOffset = offset;
continue;
@@ -962,8 +962,8 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
entry->crc = msg->unk_0x1C;
entry->fromIdHigh = msg->fromIdHigh;
entry->fromIdLow = msg->fromIdLow;
entry->date = msg->unk_0x28;
entry->receivedDate = msg->unk_0x2C;
entry->date = msg->date;
entry->receivedDate = msg->receivedDate;
entry->numTo = msg->numTo;
entry->numAttached = msg->numAttached;
entry->groupId = msg->groupId;
@@ -1009,8 +1009,8 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->unk_0x1C = entry->crc;
msg->fromIdHigh = entry->fromIdHigh;
msg->fromIdLow = entry->fromIdLow;
msg->unk_0x28 = entry->date;
msg->unk_0x2C = entry->receivedDate;
msg->date = entry->date;
msg->receivedDate = entry->receivedDate;
msg->numTo = entry->numTo;
msg->numAttached = entry->numAttached;
msg->groupId = entry->groupId;

View File

@@ -158,7 +158,7 @@ static inline NWC24Err WriteMessageIdField(NWC24MsgObjPrivate* msg) {
Mail_memset(buffer, 0, 1024);
Mail_strcpy(buffer, "Message-Id: <");
Mail_memset(idText, 0, 32);
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->unk_0x28);
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->date);
Mail_strcat(buffer, idText);
Mail_strcat(buffer, domain);
Mail_strcat(buffer, ">\r\n");
@@ -312,7 +312,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
}
CHECK_WRITE(WriteExtraFields(msg));
Mail_memset(MultiPartDivider, 0, 40);
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->unk_0x28, msg->msgId);
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->date, msg->msgId);
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_strcpy(buffer, "MIME-Version: 1.0\r\n");
@@ -654,9 +654,9 @@ static NWC24Err WriteDateField(NWC24MsgObjPrivate* msg) {
date.sec = calendar.sec;
if (date.month > 12)
return NWC24_ERR_FORMAT;
NWC24iDateToMinutes(&msg->unk_0x28, &date);
NWC24iDateToMinutes(&msg->date, &date);
if (msg->type & 0x1000000)
NWC24iMinutesToDate(&date, msg->unk_0x2C);
NWC24iMinutesToDate(&date, msg->receivedDate);
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_sprintf(buffer, "Date: %02d %s %d %02d:%02d:%02d -0000\r\n", date.day, months[date.month - 1], date.year, date.hour, date.min, date.sec);

View File

@@ -46,9 +46,9 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
return NWC24_ERR_INVALID_VALUE;
}
msgObj->unk_0x28 = 0;
msgObj->date = 0;
msgObj->type |= 0x200000;
msgObj->unk_0x2C = 0;
msgObj->receivedDate = 0;
NWC24GetMyUserId(&msgObj->fromId);
msgObj->numTo = 0;
@@ -477,7 +477,7 @@ NWC24Err NWC24GetMsgFromId(const NWC24MsgObj* msg, NWC24UserId* fromId) {
NWC24Err NWC24GetMsgDate(const NWC24MsgObj* msg, OSCalendarTime* msgDate) {
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->unk_0x28);
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->date);
return NWC24_OK;
}

View File

@@ -30,14 +30,23 @@ typedef struct InetRequest {
union { struct { int family; u8 address[16]; } reply; u8 replyBlock[32]; };
char text[1];
} InetRequest;
typedef struct RecvRequest {
IOSIoVector vectors[4];
typedef struct RecvPayload {
union { struct { int socket; int flags; } command; u8 commandBlock[32]; };
SOSockAddr address;
} RecvPayload;
typedef struct RecvRequest {
IOSIoVector vectors[4];
RecvPayload payload;
} RecvRequest;
typedef struct SendCommand {
int socket;
int flags;
int hasAddress;
SOSockAddr address;
} SendCommand;
typedef struct SendRequest {
IOSIoVector vectors[4];
struct { int socket; int flags; int hasAddress; SOSockAddr address; } command;
SendCommand command;
} SendRequest;
static int RecvFrom(const char*, int, void*, int, int, SOSockAddr*);
@@ -258,11 +267,17 @@ char* SOInetNtoA(SOInAddr address) {
int SOInetPtoN(int family, const char* text, void* address) {
s32 rm;
int temporary,result,size,bytes;
int temporary;
int size;
int result;
int bytes;
InetRequest* request;
if((result=SOiPrepareTempRm(NULL,&rm,&temporary))==0) {
bytes=0;
if(family==2) bytes=4;
switch (family) {
case 2: bytes=4; break;
default: break;
}
if(!bytes) result=-5;
else if(!text) result=-28;
else {
@@ -289,11 +304,14 @@ u32 SOHtoNl(u32 value) { return value; }
u16 SOHtoNs(u16 value) { return value; }
static inline int DirectBuffer(const void* data, int length) {
BOOL direct=FALSE;
BOOL aligned=FALSE;
BOOL accessible;
BOOL direct;
BOOL aligned;
direct=FALSE;
aligned=FALSE;
if(((u32)data&31)==0 && length%32==0) aligned=TRUE;
if(aligned) {
BOOL accessible=TRUE;
accessible=TRUE;
if(SOiIsBufferAddrCheck()) {
BOOL inMemory=FALSE;
if(((u32)data&0x1fffffff)>=0x10000000 && ((u32)data&0x1fffffff)<0x18000000) inMemory=TRUE;
@@ -306,10 +324,12 @@ 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;
void* buffer;
int size;
BOOL direct;
RecvRequest* request;
void* buffer;
RecvPayload* payload;
int result;
SOSockAddr* reply;
if(length>32768) length=32768;
if((result=SOiPrepare(name,&rm))==0) {
@@ -318,15 +338,16 @@ 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 ? address->len : 0)+95)&~31;
size=((address == NULL ? 0 : address->len)+95)&~31;
request=SOiAlloc(12,size);
if(!direct) buffer=SOiAlloc(13,(length+31)&~31);
if(direct == FALSE) buffer=SOiAlloc(13,(length+31)&~31);
else buffer=data;
if(!request || !buffer) result=-49;
else {
request->command.socket=socket; request->command.flags=flags;
reply=&request->address;
request->vectors[0].base=(u8*)&request->command; request->vectors[0].length=8;
payload=&request->payload;
payload->command.socket=socket; payload->command.flags=flags;
reply=&payload->address;
request->vectors[0].base=(u8*)payload; request->vectors[0].length=8;
request->vectors[1].base=buffer; request->vectors[1].length=length;
if(!address) {
request->vectors[2].base=NULL; request->vectors[2].length=0;
@@ -336,14 +357,12 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
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;
if(bytes>reply->len) bytes=reply->len;
memcpy(address,reply,bytes);
memcpy(address,reply,address->len > reply->len ? reply->len : address->len);
}
}
if(result>=0 && !direct) memcpy(data,buffer,length);
if(result>=0 && direct == FALSE) memcpy(data,buffer,length);
}
if(!direct) SOiFree(13,buffer,(length+31)&~31);
if(direct == FALSE) SOiFree(13,buffer,(length+31)&~31);
SOiFree(12,request,size);
}
result=SOiConclude(name,result);
@@ -352,11 +371,12 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
}
static int SendTo(const char* name, int socket, const void* data, int length, int flags, const SOSockAddr* address) {
BOOL direct;
void* buffer;
int result;
s32 rm;
void* buffer;
BOOL direct;
SendRequest* request;
SendCommand* command;
if((result=SOiPrepare(name,&rm))==0) {
if(address && (address->len>8 || address->len<8)) result=-28;
else if(length<0 || (length>0 && !data)) result=-28;
@@ -364,22 +384,23 @@ 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) buffer=SOiAlloc(14,(length+31)&~31);
if(direct == FALSE) buffer=SOiAlloc(14,(length+31)&~31);
else buffer=(void*)data;
if(!request || !buffer) result=-49;
else {
request->command.socket=socket; request->command.flags=flags;
if(!address) request->command.hasAddress=0;
command = &request->command;
command->socket=socket; command->flags=flags;
if(!address) command->hasAddress=0;
else {
request->command.hasAddress=1;
memcpy(&request->command.address,address,address->len);
command->hasAddress=1;
memcpy(&command->address,address,address->len);
}
if(!direct) memcpy(buffer,data,length);
if(direct == FALSE) memcpy(buffer,data,length);
request->vectors[0].base=buffer; request->vectors[0].length=length;
request->vectors[1].base=(u8*)&request->command; request->vectors[1].length=40;
request->vectors[1].base=(u8*)command; request->vectors[1].length=40;
result=IOS_Ioctlv(rm,13,2,0,request->vectors);
}
if(!direct) SOiFree(14,buffer,(length+31)&~31);
if(direct == FALSE) SOiFree(14,buffer,(length+31)&~31);
SOiFree(12,request,96);
}
result=SOiConclude(name,result);

View File

@@ -30,8 +30,8 @@ typedef struct AppLoaderHeader {
} AppLoaderHeader;
u8 TicketViewsBuf[OSRoundUp32B(sizeof(ESTicketView) * 64)] ALIGN32;
ESTicketView *lbl_81696578 = (ESTicketView *)TicketViewsBuf;
DVDDiskID lbl_810ADF60 ALIGN32;
ESTicketView *TicketViews = (ESTicketView *)TicketViewsBuf;
DVDDiskID UpdateDiskID ALIGN32;
OSBootInfo2 bi2 ALIGN32;
AppLoaderHeader AppLoaderHdr ALIGN32;
OSBootInfo3 bi3 ALIGN32;
@@ -41,118 +41,66 @@ DVDDiskID DiskID ALIGN32;
DVDPartitionParams PartitionParams ALIGN32;
NANDCommandBlock BS2NandBlock;
NANDFileInfo BS2CacheFileInfo;
DVDCommandBlock lbl_8108BF60;
DVDCommandBlock CoverBlock;
u8 PartitionInfoBuf[OSRoundUp32B(sizeof(DVDPartitionInfo) * 256)] ALIGN32;
DVDCommandBlock Block;
BS2State State = BS2_STT_BEGIN;
vu32 lbl_81698A0C = 0;
u32 lbl_81698A10 = 0;
u32 lbl_81698A14 = 0;
u32 lbl_81698A18 = 0;
u32 lbl_81698A1C = 0;
vu32 DvdReadPending = 0;
u32 BannerAllocation = 0;
u32 BannerBuffer = 0;
u32 BannerAvailable = 0;
u32 Allocator = 0;
BOOL StartingGame = FALSE;
u32 lbl_81698A24 = 0;
u32 lbl_81698A28 = 0;
u32 lbl_81698A2C = 0;
u32 lbl_81698A30 = 0;
u32 RestartRequested = 0;
u32 PartitionOpen = 0;
u32 CacheSeekComplete = 0;
u32 LoadingTitle = 0;
BOOL FatalErrorFlag = FALSE;
BOOL RetryErrorFlag = FALSE;
BOOL UpdateErrorFlag = FALSE;
BOOL AbortFlag = FALSE;
volatile int lbl_81698A44 = 0;
volatile int lbl_81698A48 = 0;
volatile int lbl_81698A4C = 0;
vu32 lbl_81698A50 = 0;
u32 lbl_81698A54 = 0;
u32 lbl_81698A58 = 0;
u32 lbl_81698A5C = 0;
u64 lbl_81698A60 = 0;
u64 lbl_81698A68 = 0;
u64 lbl_81698A70 = 0;
u32 lbl_81698A78 = 0;
u32 lbl_81698A7C = 0;
u32 lbl_81698A80 = 0;
u32 lbl_81698A84 = 0;
u32 lbl_81698A88 = 0;
u32 lbl_81698A8C = 0;
u32 lbl_81698A90 = 0;
u32 lbl_81698A94 = 0;
u32 lbl_81698A98 = 0;
u32 lbl_81698A9C = 0;
u64 lbl_81698AA0 = 0;
u32 lbl_81698AA8 = 0;
u32 lbl_81698AAC = 0;
vu32 lbl_81698AB0 = 0;
vu32 lbl_81698AB4 = 0;
u8 *lbl_81698AB8 = NULL;
NANDFileInfo *lbl_81698ABC = NULL;
vu32 lbl_81698AC0 = 0;
volatile NANDCallback lbl_81698AC4 = NULL;
u32 lbl_81698AC8 = 0;
vu32 lbl_81698ACC = 0;
u32 lbl_81698AD0 = 0;
vu32 lbl_81698AD4 = 0;
vu32 lbl_81698AD8 = 0;
vu32 lbl_81698ADC = 0;
vu32 lbl_81698AE0 = 0;
u32 *lbl_81698AE4 = 0;
u32 lbl_81698AE8 = 0;
u32 lbl_81698AEC = 0;
u32 lbl_81698AF0 = 0;
volatile int CacheFailed = 0;
volatile int RegionValid = 0;
volatile int NandPending = 0;
vu32 CancelNand = 0;
u32 LowReadResult = 0;
u32 CacheCommandComplete = 0;
u32 AudioBufferUnconfigured = 0;
u64 ResetTime = 0;
u64 SpinupDeadline = 0;
u64 CoverPollTime = 0;
u32 DriveWasReset = 0;
u32 TitleTicketView = 0;
u32 CurrentTmd = 0;
u32 TitleCode = 0;
u32 RequiredIosHigh = 0;
u32 RequiredIosLow = 0;
u32 GamePartition = 0;
u32 UpdatePartition = 0;
u32 PartitionCursor = 0;
u32 DataToc = 0;
u64 GameToc = 0;
u32 CoverOpenTimeHigh = 0;
u32 CoverOpenTimeLow = 0;
vu32 NandTransferred = 0;
vu32 NandLength = 0;
u8 *NandBuffer = NULL;
NANDFileInfo *NandFile = NULL;
vu32 NandOperation = 0;
volatile NANDCallback NandCompletion = NULL;
u32 LoaderOffset = 0;
vu32 LoaderLength = 0;
u32 LoaderAddress = 0;
vu32 CacheLength = 0;
vu32 BannerLength = 0;
vu32 DvdTransferLength = 0;
vu32 DvdTransferred = 0;
u32 *DvdProgress = 0;
u32 LoaderClose = 0;
u32 LoaderMain = 0;
u32 LoaderInit = 0;
#define DvdReadPending lbl_81698A0C
#define BannerAllocation lbl_81698A10
#define BannerBuffer lbl_81698A14
#define BannerAvailable lbl_81698A18
#define Allocator lbl_81698A1C
#define RestartRequested lbl_81698A24
#define PartitionOpen lbl_81698A28
#define CacheSeekComplete lbl_81698A2C
#define LoadingTitle lbl_81698A30
#define CacheFailed lbl_81698A44
#define RegionValid lbl_81698A48
#define NandPending lbl_81698A4C
#define CancelNand lbl_81698A50
#define LowReadResult lbl_81698A54
#define CacheCommandComplete lbl_81698A58
#define AudioBufferUnconfigured lbl_81698A5C
#define ResetTime lbl_81698A60
#define SpinupDeadline lbl_81698A68
#define CoverPollTime lbl_81698A70
#define DriveWasReset lbl_81698A78
#define TitleTicketView lbl_81698A7C
#define CurrentTmd lbl_81698A80
#define TitleCode lbl_81698A84
#define RequiredIosHigh lbl_81698A88
#define RequiredIosLow lbl_81698A8C
#define GamePartition lbl_81698A90
#define UpdatePartition lbl_81698A94
#define PartitionCursor lbl_81698A98
#define DataToc lbl_81698A9C
#define GameToc lbl_81698AA0
#define CoverOpenTimeHigh lbl_81698AA8
#define CoverOpenTimeLow lbl_81698AAC
#define NandTransferred lbl_81698AB0
#define NandLength lbl_81698AB4
#define NandBuffer lbl_81698AB8
#define NandFile lbl_81698ABC
#define NandOperation lbl_81698AC0
#define NandCompletion lbl_81698AC4
#define LoaderOffset lbl_81698AC8
#define LoaderLength lbl_81698ACC
#define LoaderAddress lbl_81698AD0
#define CacheLength lbl_81698AD4
#define BannerLength lbl_81698AD8
#define DvdTransferLength lbl_81698ADC
#define DvdTransferred lbl_81698AE0
#define DvdProgress lbl_81698AE4
#define LoaderClose lbl_81698AE8
#define LoaderMain lbl_81698AEC
#define LoaderInit lbl_81698AF0
#define CoverBlock lbl_8108BF60
#define UpdateDiskID lbl_810ADF60
#define TicketViews lbl_81696578
void BS2Report(const char *msg, ...) {
#ifdef ENABLE_BS2_REPORT

View File

@@ -14,11 +14,11 @@ typedef struct UpdateThreadData {
u8 stack[4096];
} UpdateThreadData;
static u32 Flags0[BS2_UPDATE_ENTRY_COUNT];
static u32 Flags1[BS2_UPDATE_ENTRY_COUNT];
static UpdateThreadData Thread;
static BS2UpdateHeader UpdateHeader0 ALIGN32;
static BS2UpdateHeader UpdateHeader1 ALIGN32;
static u32 Flags0[BS2_UPDATE_ENTRY_COUNT] = {0};
static u32 Flags1[BS2_UPDATE_ENTRY_COUNT] = {0};
static UpdateThreadData Thread = {0};
static BS2UpdateHeader UpdateHeader0 ALIGN32 = {0};
static BS2UpdateHeader UpdateHeader1 ALIGN32 = {0};
#define UPDATE_DISC_ENTRIES ((BS2UpdateEntry*)0x80480000)
@@ -26,25 +26,25 @@ s32 WADCheckImport(u64 titleId, u16 titleVersion);
s32 WADImportDVDForBS(const char* path, void* buffer, u32 length);
s32 WADImportDVDExForBS(const char* path, void* buffer, u32 length);
static BS2UpdateEntry* pEntries;
static u32 EntriesCount;
static u32* pFlags;
static void* MemAllocator;
int State;
BS2UpdateEntry* CurrentEntry;
static u32 RebootRequired;
static BOOL ContainsSeatTitles;
static u32 UpdateImportState;
static u32 UpdateImportResult;
u32 StartUpdate;
u32 CancelUpdate;
static u32 UpdateProgress;
static s32 rc;
static u64 VersionIOS;
static u32 VersionMEM2;
static u32 VersionES;
static u32 ConsoleType;
static void* FatalFunc;
static BS2UpdateEntry* pEntries = NULL;
static u32 EntriesCount = 0;
static u32* pFlags = NULL;
static void* MemAllocator = NULL;
int State = 0;
BS2UpdateEntry* CurrentEntry = 0;
static u32 RebootRequired = 0;
static BOOL ContainsSeatTitles = 0;
static u32 UpdateImportState = 0;
static u32 UpdateImportResult = 0;
u32 StartUpdate = 0;
u32 CancelUpdate = 0;
static u32 UpdateProgress = 0;
static s32 rc = 0;
static u64 VersionIOS = 0;
static u32 VersionMEM2 = 0;
static u32 VersionES = 0;
static u32 ConsoleType = 0;
static void* FatalFunc = NULL;
#pragma force_active on
char* getSuffix(const char* path) {
@@ -174,7 +174,7 @@ product_region_checked:
goto selection_done;
}
strcpy(scratch.updatePath, "__update.inf");
strcat(scratch.updatePath, "-");
strcat(scratch.updatePath, ".");
strcat(scratch.updatePath, scratch.productArea);
if (DVDConvertPathToEntrynum(scratch.updatePath) < 0) {
switch (SCGetProductArea()) {
@@ -271,7 +271,7 @@ product_region_checked:
}
}
strcpy(scratch.seatPath, "__seatholder.inf");
strcat(scratch.seatPath, "-");
strcat(scratch.seatPath, ".");
strcat(scratch.seatPath, scratch.productArea);
if (DVDConvertPathToEntrynum(scratch.seatPath) < 0) {
switch (SCGetProductArea()) {

View File

@@ -23,7 +23,7 @@ namespace memo {
class EventHandler : public inputform::EventHandler {
public:
EventHandler(InputForm* form) : inputform::EventHandler(form), mpMemoForm(form) {}
virtual ~EventHandler() {}
virtual ~EventHandler();
virtual void onTiEvent(gui::PaneComponent*, u32, Input*);
private:
InputForm* mpMemoForm;
@@ -48,14 +48,14 @@ protected:
class WholePane : public AnmPane {
public:
WholePane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = 0; }
virtual ~WholePane() {}
virtual ~WholePane();
virtual void onAnmEvent(AnmPaneEvent event);
};
class NigaoePane : public AnmPane {
public:
NigaoePane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = 1; }
virtual ~NigaoePane() {}
virtual ~NigaoePane();
virtual void onAnmEvent(AnmPaneEvent event);
};
@@ -81,7 +81,7 @@ private:
class SimpleAnmPane : public nw4rmanager::AnmPane {
public:
SimpleAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : nw4rmanager::AnmPane(pane, observer) {}
virtual ~SimpleAnmPane() {}
virtual ~SimpleAnmPane();
virtual void init();
virtual void changeAnimation(u32 id);
};
@@ -523,7 +523,7 @@ void InputForm::calc() {
if (meEditMode == EM_Edit) {
height = 2.0f * getLineHeight();
boundY = (mDefaultBoundTrans.y - (height - mDefaultBoundSize.height) / 2.0f) - mfScroll;
} else mfDrawScrollY = 0.0f;
} else setDrawScrollY(0.0f);
mpBoundPane->SetSize(nw4r::lyt::Size(mpBoundPane->GetSize().width, height));
mpBoundPane->SetTranslate(nw4r::math::VEC2(mDefaultBoundTrans.x, boundY));
mpBoundPane->CalculateMtx(mDrawInfo);
@@ -792,8 +792,12 @@ void AnmPane::changeAnimation(u32 id) {
}
u32 AnmPane::getKeyType() const { return meKeyType; }
void AnmPane::init() { meState = 0; }
NigaoePane::~NigaoePane() {}
void NigaoePane::onAnmEvent(AnmPaneEvent) {}
WholePane::~WholePane() {}
bool InputForm::isInScroll() { return mExScrollAnm.isActive(); }
EventHandler::~EventHandler() {}
SimpleAnmPane::~SimpleAnmPane() {}
}
}

View File

@@ -206,14 +206,14 @@ namespace textinput {
#pragma push
#pragma section const_type ".data"
extern "C" const char scPaneNameTable[132] =
"B_OffBtn\0\0\0"
"P_JPOffBtn\0"
"P_CNOffBtn\0"
"P_CNOnBtn\0\0"
"B_prdc_scrl_Left\0\0\0"
"P_prdc_scrl_Left\0\0\0"
"B_prdc_scrl_Rght\0\0\0"
"P_prdc_scrl_Rght\0\0\0"
"B_OffBtn\0\0\0\0"
"P_JPOffBtn\0\0"
"P_CNOffBtn\0\0"
"P_CNOnBtn\0\0\0"
"B_prdc_scrl_Left\0\0\0\0"
"P_prdc_scrl_Left\0\0\0\0"
"B_prdc_scrl_Rght\0\0\0\0"
"P_prdc_scrl_Rght\0\0\0\0"
"\0\0\0";
extern "C" char scW_predictWindow[16] = "W_predictWindow";
extern "C" const char scN_predictInput[15] = "N_predictInput";

View File

@@ -78,9 +78,7 @@ void HKBManager::KBDListenerOwn::OnAttach(KBDDevEvent* event) {
void HKBManager::KBDListenerOwn::OnDetach(KBDDevEvent* event) {
u8 device = event->device;
if (device >= 2) return;
HKBManager* owner = manager;
owner->attached[device] = 0;
owner->states[device].Clear();
manager->DetachDevice(event);
}
void HKBManager::KBDListenerOwn::OnKeyEvent(KBDKeyEvent* event) {
@@ -338,8 +336,8 @@ void HKBManager::KeyState_::Update() {
held = heldKeys;
for (index = 0; index < 8; index++) {
bit = 1 << index;
if ((current & bit) != 0) {
if ((previous & bit) == 0 || previousKeys[index] != currentKeys[index]) {
if (HasCurrentKey(index)) {
if (!HadPreviousKey(index) || previousKeys[index] != currentKeys[index]) {
triggered |= bit;
}
}
@@ -347,8 +345,8 @@ void HKBManager::KeyState_::Update() {
released = 0;
for (index = 0; index < 8; index++) {
bit = 1 << index;
if ((previous & bit) != 0) {
if ((current & bit) == 0 || previousKeys[index] != currentKeys[index]) {
if (HadPreviousKey(index)) {
if (!HasCurrentKey(index) || previousKeys[index] != currentKeys[index]) {
released |= bit;
}
}
@@ -356,7 +354,7 @@ void HKBManager::KeyState_::Update() {
repeated = 0;
for (index = 0; index < 8; index++) {
bit = 1 << index;
if ((current & bit) != 0) {
if (HasCurrentKey(index)) {
if ((triggered & bit) != 0) {
repeatDelay[index] = 30;
repeated |= bit;
@@ -371,17 +369,14 @@ void HKBManager::KeyState_::Update() {
}
void HKBManager::KeyState_::UpdateModState_() {
u32 oldModifiers;
u32 index;
u32 oldModifiers = modifiers;
oldModifiers = modifiers;
modifiers = oldModifiers & 0xffffffd0;
index = 0;
for (; index < 8; index++) {
u32 keySet;
u8 slot;
keySet = current;
slot = index;
if ((keySet & (1 << slot)) != 0) {
u8 code = currentKeys[slot];
if (HasCurrentKey(static_cast<u8>(index))) {
u8 code = currentKeys[static_cast<u8>(index)];
if (code == 0xe5 || code == 0xe1) {
modifiers |= 2;
} else if (code == 0xe4 || code == 0xe0) {
@@ -453,15 +448,7 @@ u32 HKBManager::KeySet::GetWChar() const {
} else if ((static_cast<u32>(code) & 0xffff) < 0x20) {
code = 0;
}
u32 index = 0;
const HKBManager* owner = manager;
if (owner->allowedCharacters == 0) return code;
u32 count = owner->allowedCharacterCount;
if (count == 0) return code;
for (; index < count; index++) {
if ((static_cast<u32>(code) & 0xffff) == owner->allowedCharacters[index]) return code;
}
return 0;
return manager->FilterCharacter(code);
}
u32 HKBManager::KeySet::GetVCode() const {
@@ -500,7 +487,23 @@ u32 HKBManager::KeySet::GetVCode() const {
}
u32 HKBManager::KeySet::IsValid() const {
return CheckValidity();
s8 keyIndex;
u32 keyDevice;
const HKBManager* owner;
owner = manager;
if (!owner) return false;
keyIndex = index;
if (keyIndex < 0 || keyIndex >= 8) return false;
keyDevice = device;
if (keyDevice >= 2) return false;
switch (type) {
case 0: return (owner->states[keyDevice].held & (1 << keyIndex)) != 0;
case 1: return (owner->states[keyDevice].triggered & (1 << keyIndex)) != 0;
case 2: return (owner->states[keyDevice].released & (1 << keyIndex)) != 0;
case 3: return (owner->states[keyDevice].repeated & (1 << keyIndex)) != 0;
}
return false;
}
HKBManager::KeySet HKBManager::KeySet::GetNext() const {
@@ -528,7 +531,6 @@ HKBManager::KeySet HKBManager::KeySet::GetNext() const {
}
HKBManager::~HKBManager() {}
}
}

View File

@@ -5,245 +5,14 @@
#include "keyboard/tiHKBManager.h"
#include "keyboard/tiLayoutGather.h"
extern "C" void SetCountry__Q39textinput5input10HKBManagerFUc();
extern "C" textinput::input::HKBManager sInstance__Q39textinput5input10HKBManager;
extern "C" void convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw();
extern "C" bool updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" void __dt__Q49textinput8keyboard5hwkey10HWKeyboardFv();
extern "C" void create__Q29textinput4BaseFP12MEMAllocator();
extern "C" void init__Q49textinput8keyboard5hwkey10HWKeyboardFv();
extern "C" void setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver();
extern "C" void sendCommand__Q29textinput13CommandSenderFUlPv();
extern "C" void updateFromReceiver__Q29textinput13CommandSenderFUlPv();
#pragma push
#pragma section const_type ".data"
typedef void (*KeyboardDataFunction)();
extern "C" KeyboardDataFunction const scHwKeyboardConvertWCCodeJumpTable[0x3f] = {
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000158),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001d8),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001c0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000170),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x0000017c),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000134),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001a0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000140),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000188),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000194),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000148),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000150),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000164),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001b8),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001ac)
};
extern "C" KeyboardDataFunction const __vt__Q49textinput8keyboard5hwkey10HWKeyboard[9] = {
NULL,
NULL,
__dt__Q49textinput8keyboard5hwkey10HWKeyboardFv,
create__Q29textinput4BaseFP12MEMAllocator,
init__Q49textinput8keyboard5hwkey10HWKeyboardFv,
setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver,
sendCommand__Q29textinput13CommandSenderFUlPv,
updateFromReceiver__Q29textinput13CommandSenderFUlPv,
reinterpret_cast<KeyboardDataFunction>(updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager)
};
#pragma pop
namespace textinput {
namespace keyboard {
namespace hwkey {
extern "C" void GetTriggeredKeySet__Q39textinput5input10HKBManagerCFv();
extern "C" void IsValid__Q49textinput5input10HKBManager6KeySetCFv();
extern "C" void GetKey__Q49textinput5input10HKBManager6KeySetCFv();
extern "C" void GetNext__Q49textinput5input10HKBManager6KeySetCFv();
extern "C" void GetModifierState__Q39textinput5input10HKBManagerCFv();
extern "C" bool updateRepeatKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" bool updateTriggerKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" bool updateTappingShift___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" void updateShift__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" asm bool updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager() {
nofralloc
stwu r1, -0x40(r1)
mflr r0
stw r0, 0x44(r1)
stw r31, 0x3c(r1)
mr r31, r4
stw r30, 0x38(r1)
mr r30, r3
lwz r3, 0x10(r3)
lwz r12, 0(r3)
lwz r12, 0x84(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0xdc(r12)
mtctr r12
bctrl
cmpwi r3, 0
bne updateInput_HWKeyboard_L1
mr r3, r31
bl GetModifierState__Q39textinput5input10HKBManagerCFv
rlwinm. r0, r3, 0, 0x1d, 0x1d
bne updateInput_HWKeyboard_L2
li r0, 0
b updateInput_HWKeyboard_L3
updateInput_HWKeyboard_L2:
li r5, 0
li r0, -1
stw r5, 8(r1)
mr r4, r31
addi r3, r1, 0x14
stb r5, 0xc(r1)
stb r0, 0xd(r1)
stb r5, 0xe(r1)
sth r5, 0x10(r1)
bl GetTriggeredKeySet__Q39textinput5input10HKBManagerCFv
lwz r6, 0x14(r1)
lbz r5, 0x18(r1)
lbz r4, 0x19(r1)
lbz r3, 0x1a(r1)
lhz r0, 0x1c(r1)
stw r6, 8(r1)
stb r5, 0xc(r1)
stb r4, 0xd(r1)
stb r3, 0xe(r1)
sth r0, 0x10(r1)
b updateInput_HWKeyboard_L4
updateInput_HWKeyboard_L5:
addi r3, r1, 8
bl GetKey__Q49textinput5input10HKBManager6KeySetCFv
clrlwi r0, r3, 0x18
cmpwi r0, 0x2b
bge updateInput_HWKeyboard_L6
cmpwi r0, 0x28
beq updateInput_HWKeyboard_L7
bge updateInput_HWKeyboard_L8
b updateInput_HWKeyboard_L9
updateInput_HWKeyboard_L6:
cmpwi r0, 0x58
beq updateInput_HWKeyboard_L7
b updateInput_HWKeyboard_L9
updateInput_HWKeyboard_L7:
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x94(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0xa0(r12)
mtctr r12
bctrl
li r0, 1
b updateInput_HWKeyboard_L3
updateInput_HWKeyboard_L8:
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x94(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0xa4(r12)
mtctr r12
bctrl
li r0, 1
b updateInput_HWKeyboard_L3
updateInput_HWKeyboard_L9:
addi r3, r1, 0x20
addi r4, r1, 8
bl GetNext__Q49textinput5input10HKBManager6KeySetCFv
lwz r6, 0x20(r1)
lbz r5, 0x24(r1)
lbz r4, 0x25(r1)
lbz r3, 0x26(r1)
lhz r0, 0x28(r1)
stw r6, 8(r1)
stb r5, 0xc(r1)
stb r4, 0xd(r1)
stb r3, 0xe(r1)
sth r0, 0x10(r1)
updateInput_HWKeyboard_L4:
addi r3, r1, 8
bl IsValid__Q49textinput5input10HKBManager6KeySetCFv
cmpwi r3, 0
bne updateInput_HWKeyboard_L5
li r0, 0
updateInput_HWKeyboard_L3:
cmpwi r0, 0
bne updateInput_HWKeyboard_L1
mr r3, r30
mr r4, r31
bl updateRepeatKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
cmpwi r3, 0
bne updateInput_HWKeyboard_L1
mr r3, r30
mr r4, r31
bl updateTriggerKey___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
cmpwi r3, 0
bne updateInput_HWKeyboard_L1
mr r3, r30
mr r4, r31
bl updateTappingShift___Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
updateInput_HWKeyboard_L1:
mr r3, r30
mr r4, r31
bl updateShift__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager
lwz r31, 0x3c(r1)
li r3, 0
lwz r30, 0x38(r1)
lwz r0, 0x44(r1)
mtlr r0
addi r1, r1, 0x40
blr
HWKeyboard::HWKeyboard(Manager* manager) : mpManager(manager), field_0x14(0), field_0x15(0), field_0x16(0) {
}
struct NavigationCommand { u32 command; u32 modifiers; };
@@ -257,6 +26,78 @@ struct KeyInputData {
u32 data;
};
extern const u8 controlKeys[];
void HWKeyboard::init() {
LayoutGather::Singleton::getInstance().setHWPressedShift(false);
u32 state = input::HKBManager::getInstance().GetModifierState();
input::HKBManager::getInstance().SetModifierState(state | 0x100, 0x700);
field_0x15 = 0;
field_0x16 = 0;
}
void HWKeyboard::updateShift(input::HKBManager& hkbManager) {
LayoutGather &gather = LayoutGather::Singleton::getInstance();
u32 state = hkbManager.GetModifierState();
if (!mgr()->getToolBar()->isQwerty() && !mgr()->getToolBar()->isEnableKeytopChange()) {
return;
}
bool previousShift = gather.isHoldingShift();
if (state & 0x2) {
gather.setHWPressedShift(true);
if (!previousShift) {
mgr()->getPCKeyboard()->onPressedShift(true);
}
} else {
gather.setHWPressedShift(false);
if (previousShift) {
if (!gather.isHoldingShift()) {
mgr()->getPCKeyboard()->onReleasedShift();
}
}
}
}
inline bool HWKeyboard::controlKeyTriggeredHandler(input::HKBManager& hkbManager) {
if ((hkbManager.GetModifierState() & 4) == 0) {
return false;
}
input::HKBManager::KeySet currentKeySet;
currentKeySet = hkbManager.GetTriggeredKeySet();
while (currentKeySet.IsValid()) {
switch (currentKeySet.GetKey()) {
case 0x28:
case 0x58: {
mgr()->getToolBar()->onOK();
return true;
}
case 0x29:
case 0x2A: {
mgr()->getToolBar()->onCancel();
return true;
}
default: {
currentKeySet = currentKeySet.GetNext();
break;
}
}
}
return false;
}
bool HWKeyboard::updateInput(input::HKBManager& hkbManager) {
if (!static_cast<signwindow::LayoutByNW4R*>(mgr()->getSignKeyboard())->isActive() &&
!controlKeyTriggeredHandler(hkbManager) &&
!updateRepeatKey_(hkbManager) && !updateTriggerKey_(hkbManager)) {
updateTappingShift_(hkbManager);
}
updateShift(hkbManager);
return false;
}
bool HWKeyboard::updateRepeatKey_(input::HKBManager& hkbManager) {
u32 modifierState = hkbManager.GetModifierState();
input::HKBManager::KeySet currentKeySet;
@@ -575,50 +416,12 @@ extern const u8 controlKeys[];
return false;
}
HWKeyboard::HWKeyboard(Manager* manager) : mpManager(manager), field_0x14(0), field_0x15(0), field_0x16(0) {
}
void HWKeyboard::init() {
LayoutGather::Singleton::getInstance().setHWPressedShift(false);
u32 state = input::HKBManager::getInstance().GetModifierState();
input::HKBManager::getInstance().SetModifierState(state | 0x100, 0x700);
field_0x15 = 0;
field_0x16 = 0;
}
void HWKeyboard::updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data) {
if (trig != 0) {
field_0x14 = 0;
}
}
void HWKeyboard::updateShift(input::HKBManager& hkbManager) {
LayoutGather &gather = LayoutGather::Singleton::getInstance();
u32 state = hkbManager.GetModifierState();
if (!mgr()->getToolBar()->isQwerty() && !mgr()->getToolBar()->isEnableKeytopChange()) {
return;
}
bool previousShift = gather.isHoldingShift();
if (state & 0x2) {
gather.setHWPressedShift(true);
if (!previousShift) {
mgr()->getPCKeyboard()->onPressedShift(true);
}
} else {
gather.setHWPressedShift(false);
if (previousShift) {
if (!gather.isHoldingShift()) {
mgr()->getPCKeyboard()->onReleasedShift();
}
}
}
}
extern "C" const u8 scCountryMap_EU[] = {0x0f, 0x21, 0x20, 0x08, 0x09, 0x0e, 0x19, 0x00, 0x21, 0x21, 0x00, 0x00};
extern "C" const u8 scCountryMap_NonEU[] = {0x0f, 0x21, 0x20, 0x04, 0x09, 0x0e, 0x11, 0x00, 0x21, 0x21, 0x00, 0x00};
@@ -637,183 +440,47 @@ const u8 controlKeys[] = {
0x06, 0x05, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
extern "C" asm void setLanguage__Q49textinput8keyboard5hwkey10HWKeyboardFQ29textinput11DestinationQ29textinput8Language() {
nofralloc
cmpwi r4, 2
bne setLanguage_L1
lis r4, scCountryMap_EU@ha
lis r3, sInstance__Q39textinput5input10HKBManager@ha
addi r4, r4, scCountryMap_EU@l
lbzx r4, r4, r5
addi r3, r3, sInstance__Q39textinput5input10HKBManager@l
b SetCountry__Q39textinput5input10HKBManagerFUc
setLanguage_L1:
lis r4, scCountryMap_NonEU@ha
lis r3, sInstance__Q39textinput5input10HKBManager@ha
addi r4, r4, scCountryMap_NonEU@l
lbzx r4, r4, r5
addi r3, r3, sInstance__Q39textinput5input10HKBManager@l
b SetCountry__Q39textinput5input10HKBManagerFUc
wchar_t HWKeyboard::convertWCCode(wchar_t code) const {
if (mgr()->getToolBar()->isQwerty() && mgr()->getPCKeyboard()->getTranslateMode()) {
if (mgr()->getLanguage() == JP) {
switch (code) {
case 0x2C: { return 0x3001; }
case 0x2E: { return 0x3002; }
case 0x2D: { return 0x30FC; }
case 0x5B: { return 0x300C; }
case 0x5D: { return 0x300D; }
}
} else if (mgr()->getLanguage() == CN) {
switch (code) {
case 0x2C: { return 0xFF0C; }
case 0x2E: { return 0x3002; }
case 0x3C: { return 0x300A; }
case 0x3E: { return 0x300B; }
case 0x21: { return 0xFF01; }
case 0x3F: { return 0xFF1F; }
case 0x28: { return 0xFF08; }
case 0x29: { return 0xFF09; }
case 0x3A: { return 0xFF1A; }
case 0x3B: { return 0xFF1B; }
case 0x2D: { return 0xFF0D; }
case 0x5F: { return 0xFF3F; }
case 0x5C: { return 0x3001; }
case 0x27: { if (field_0x15) { return 0x2019; } return 0x2018; }
case 0x22: { if (field_0x16) { return 0x201D; } return 0x201C; }
}
}
}
return code;
}
extern "C" asm void convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw() {
nofralloc
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xc(r1)
mr r31, r4
stw r30, 8(r1)
mr r30, r3
lwz r3, 0x10(r3)
lwz r12, 0(r3)
lwz r12, 0x98(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0x10(r12)
mtctr r12
bctrl
cmpwi r3, 0
beq convertWCCode_HWKeyboard_L1
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x78(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0x58(r12)
mtctr r12
bctrl
cmpwi r3, 0
beq convertWCCode_HWKeyboard_L1
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x34(r12)
mtctr r12
bctrl
cmpwi r3, 0
bne convertWCCode_HWKeyboard_L2
cmpwi r31, 0x5b
beq convertWCCode_HWKeyboard_L3
bge convertWCCode_HWKeyboard_L4
cmpwi r31, 0x2d
beq convertWCCode_HWKeyboard_L5
bge convertWCCode_HWKeyboard_L6
cmpwi r31, 0x2c
bge convertWCCode_HWKeyboard_L7
b convertWCCode_HWKeyboard_L1
convertWCCode_HWKeyboard_L6:
cmpwi r31, 0x2f
bge convertWCCode_HWKeyboard_L1
b convertWCCode_HWKeyboard_L8
convertWCCode_HWKeyboard_L4:
cmpwi r31, 0x5d
beq convertWCCode_HWKeyboard_L9
b convertWCCode_HWKeyboard_L1
convertWCCode_HWKeyboard_L7:
li r3, 0x3001
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L8:
li r3, 0x3002
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L5:
li r3, 0x30fc
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L3:
li r3, 0x300c
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L9:
li r3, 0x300d
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L2:
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x34(r12)
mtctr r12
bctrl
cmpwi r3, 8
bne convertWCCode_HWKeyboard_L1
addi r0, r31, -0x21
cmplwi r0, 0x3e
bgt convertWCCode_HWKeyboard_L1
lis r3, scHwKeyboardConvertWCCodeJumpTable@ha
slwi r0, r0, 2
addi r3, r3, scHwKeyboardConvertWCCodeJumpTable@l
lwzx r3, r3, r0
mtctr r3
bctr
convertWCCode_HWKeyboard_L11:
lis r3, 1
addi r3, r3, -0xf4
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L12:
li r3, 0x3002
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L13:
li r3, 0x300a
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L14:
li r3, 0x300b
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L15:
lis r3, 1
addi r3, r3, -0xff
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L16:
lis r3, 1
addi r3, r3, -0xe1
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L17:
lis r3, 1
addi r3, r3, -0xf8
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L18:
lis r3, 1
addi r3, r3, -0xf7
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L19:
lis r3, 1
addi r3, r3, -0xe6
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L20:
lis r3, 1
addi r3, r3, -0xe5
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L21:
lis r3, 1
addi r3, r3, -0xf3
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L22:
lis r3, 1
addi r3, r3, -0xc1
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L23:
li r3, 0x3001
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L24:
lbz r3, 0x15(r30)
neg r0, r3
or r0, r0, r3
srwi r3, r0, 0x1f
addi r3, r3, 0x2018
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L25:
lbz r3, 0x16(r30)
neg r0, r3
or r0, r0, r3
srwi r3, r0, 0x1f
addi r3, r3, 0x201c
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L1:
mr r3, r31
convertWCCode_HWKeyboard_L10:
lwz r0, 0x14(r1)
lwz r31, 0xc(r1)
lwz r30, 8(r1)
mtlr r0
addi r1, r1, 0x10
blr
void HWKeyboard::setLanguage(Destination destination, Language language) {
if (destination == DST_EU) {
input::HKBManager::getInstance().SetCountry(scCountryMap_EU[language]);
} else {
input::HKBManager::getInstance().SetCountry(scCountryMap_NonEU[language]);
}
}
} // namespace hwkey

View File

@@ -151,8 +151,8 @@ extern "C" const char scT_title_textKOR[];
extern "C" const char scN_separateBarCHN[];
extern "C" const char scT_2l_TextBoxCHN[];
extern "C" const char scT_title_textCHN[];
extern "C" const char lbl_816973A4[];
extern "C" const char lbl_816973AC[];
extern "C" const char scN_KOR[];
extern "C" const char scN_CHN[];
#pragma pop
extern "C" const f32 scInputFormZeroF;
extern "C" void _savegpr_20();

View File

@@ -1499,14 +1499,18 @@ namespace textinput {
return mKeyState.getWCCode(paneName);
}
u32 Base::getControlKey(char* paneName) {
inline u32 FindControlKey(const Base::KeyState& state, char* paneName) {
for (u16 i = 0; i < 23; i++) {
if (util::strcmp(mKeyState.data->controls[i].paneName, paneName))
return mKeyState.data->controls[i].key;
if (util::strcmp(state.data->controls[i].paneName, paneName))
return state.data->controls[i].key;
}
return 27;
}
u32 Base::getControlKey(char* paneName) {
return FindControlKey(mKeyState, paneName);
}
void Base::changeABCInputMode(InputMode mode) {
switch (mode) {
case IM_Direct:
@@ -2110,7 +2114,12 @@ namespace textinput {
void LayoutByNW4R::onPressedShift(bool sound) {
u32 flags = mKeyState.getABCFlag();
flags |= 128;
mKeyState.setABCFlag(flags);
if ((mKeyState.abcFlags & ~15) != flags) {
Base* keyboard = mKeyState.owner;
mKeyState.abcFlags = (mKeyState.abcFlags & 15) | (flags & ~15);
if (keyboard != NULL)
keyboard->refreshState();
}
mShiftButton.SetState(true, 5);
if (sound)
mpEventObserver->onSE(static_cast<sound::SE>(13));
@@ -2119,7 +2128,13 @@ namespace textinput {
void LayoutByNW4R::onReleasedShift() {
u32 flags = mKeyState.getABCFlag();
flags &= ~128;
mKeyState.setABCFlag(flags);
u32 currentFlags = mKeyState.abcFlags;
if ((currentFlags & ~15) != flags) {
Base* keyboard = mKeyState.owner;
mKeyState.abcFlags = (currentFlags & 15) | (flags & ~15);
if (keyboard != NULL)
keyboard->refreshState();
}
if (mShiftButton.mbOn) {
mShiftButton.mbOn = false;
mShiftButton.mpAnimation->onAnmEvent(static_cast<AnmPane::AnmPaneEvent>(5));
@@ -2509,8 +2524,24 @@ namespace textinput {
} else {
gather.setPressedShiftB(false);
input::HKBManager::getInstance().SetForceModifierState(0, 0);
if (wasShift && !gather.isHoldingShift())
onReleasedShift();
if (wasShift && !gather.isHoldingShift()) {
u32 flags;
u32 currentFlags;
Base* keyboard;
flags = mKeyState.getABCFlag();
flags &= ~128;
currentFlags = mKeyState.abcFlags;
if ((currentFlags & ~15) != flags) {
keyboard = mKeyState.owner;
mKeyState.abcFlags = (currentFlags & 15) | (flags & ~15);
if (keyboard != NULL)
keyboard->refreshState();
}
if (mShiftButton.mbOn) {
mShiftButton.mbOn = false;
mShiftButton.mpAnimation->onAnmEvent(static_cast<AnmPane::AnmPaneEvent>(5));
}
}
}
return handled;
}

View File

@@ -2298,7 +2298,7 @@ void ipl::scene::AddressEdit::start_trig_event(
pane->initFrame();
pane->restart();
mSelectedButton = buttonNo;
ipl::snd::getSystem()->startSE("WIPL_SE_BT_TARGETTING");
ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE");
mState = 1;
break;
}
@@ -2317,7 +2317,7 @@ void ipl::scene::AddressEdit::start_trig_event(
pane->initFrame();
pane->restart();
mSelectedButton = buttonNo;
ipl::snd::getSystem()->startSE("WIPL_SE_BT_TARGETTING");
ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE");
mState = 1;
break;
}
@@ -2343,7 +2343,7 @@ void ipl::scene::AddressEdit::start_trig_event(
pane->initFrame();
pane->restart();
mSelectedButton = buttonNo;
ipl::snd::getSystem()->startSE("WIPL_SE_BT_TARGETTING");
ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE");
mState = 0x24;
break;
}

View File

@@ -485,16 +485,16 @@ namespace ipl {
}
void BoardObject::stt_stand() {
f32 degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
f32 degrees = mStandData.mAngleIdx * 30.0f + 30.0f;
f32 cosF = nw4r::math::CosFIdx(degrees * 0.7111111f);
degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
degrees = mStandData.mAngleIdx * 30.0f + 30.0f;
f32 sinF = nw4r::math::SinFIdx(degrees * 0.7111111f);
math::VEC2 standPos;
__ct__Q33ipl4math4VEC2Fff(&standPos, sinF * 160.0f, cosF * 160.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.unk_0x08)) + (standPos * mStandData.unk_0x08)) / 10.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.mStep)) + (standPos * mStandData.mStep)) / 10.0f);
if ((mStandData.unk_0x08 += 1) > 10) {
if ((mStandData.mStep += 1) > 10) {
mStandData.init();
mState = STATE_NORMAL;
}

View File

@@ -185,7 +185,7 @@ namespace ipl {
};
// clang-format on
Button::Button(EGG::Heap* heap) : Base(heap), unk_0x54(0), mOptOutBtn(), mSdMenuBtn(), unk_0x104(false), unk_0x105(false), mReservedCmd() {
Button::Button(EGG::Heap* heap) : Base(heap), mAnimWait(0), mOptOutBtn(), mSdMenuBtn(), mbNewMailAnm(false), mbSuppressNewMailAnm(false), mReservedCmd() {
for (int i = 0; i < ARROW_BTN_MAX; i++) {
mbArrowVisible[i] = true;
}
@@ -293,7 +293,7 @@ namespace ipl {
}
void Button::calc() {
switch (unk_0x54) {
switch (mAnimWait) {
case 0: {
if (mReservedCmd.get_current_index() != 0) {
Command popped = mReservedCmd.get_popped_item();
@@ -312,7 +312,7 @@ namespace ipl {
if (!mpButtonAnim[ANIM_SCENE_CHANGE]->isPlaying() && !mpButtonAnim[ANIM_CALENDAR_EXIT]->isPlaying() &&
!mpButtonAnim[ANIM_COMMON_BUTTON]->isPlaying() && !mpButtonAnim[ANIM_TRASH_DELETE]->isPlaying() &&
!mOptOutBtn.mpLayout->isPlaying()) {
unk_0x54 = 0;
mAnimWait = 0;
}
break;
}
@@ -335,7 +335,7 @@ namespace ipl {
mpBalloons[i]->calc();
}
if (unk_0x104 && !unk_0x105 && mTimer()) {
if (mbNewMailAnm && !mbSuppressNewMailAnm && mTimer()) {
startNewMailAnm_();
}
}
@@ -457,7 +457,7 @@ namespace ipl {
bool Button::isActive() const {
bool result = false;
if (isSceneCreated() && unk_0x54 != 1) {
if (isSceneCreated() && mAnimWait != 1) {
result = true;
}
return result;
@@ -668,7 +668,7 @@ namespace ipl {
}
}
unk_0x54 = 1;
mAnimWait = 1;
}
void Button::initArrowAppearance(int arrowType, bool bAppear) {
@@ -752,8 +752,8 @@ namespace ipl {
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMinFrame(scLoopAnmFrame.start);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(scLoopAnmFrame.end);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(1.0f);
unk_0x104 = true;
if (!unk_0x105) {
mbNewMailAnm = true;
if (!mbSuppressNewMailAnm) {
startNewMailAnm_();
}
}
@@ -773,7 +773,7 @@ namespace ipl {
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(1.0f);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(0.0f);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->play();
unk_0x104 = false;
mbNewMailAnm = false;
}
void Button::enableBtn() {

View File

@@ -236,10 +236,10 @@ namespace ipl {
Calendar::Calendar(EGG::Heap* heap)
: FaderSceneBase(heap), ButtonEventHandlerBase(), mState(STATE_NORMAL), mPrevState(STATE_NORMAL), mpLayout(NULL), mpLayoutFile(NULL),
mpGroupAnim(NULL), mpInitAnim(NULL), mpBoardDate(NULL), mpSelectDate(NULL), mbScrolling(false), unk_0xA0(FALSE), mbTaskCanceled(FALSE),
mpGroupAnim(NULL), mpInitAnim(NULL), mpBoardDate(NULL), mpSelectDate(NULL), mbScrolling(false), mbSearchTaskRunning(FALSE), mbTaskCanceled(FALSE),
mbBackToBoardAlt(FALSE) {
nw4r::ut::List_Init(&mDateList, offsetof(Date, mNode1));
nw4r::ut::List_Init(&unk_0x90, offsetof(Date, mNode2));
nw4r::ut::List_Init(&mDrawList, offsetof(Date, mNode2));
mbAsian = System::getRegion() == SC_PRODUCT_AREA_JPN || (u32)System::getRegion() == SC_PRODUCT_AREA_KOR ||
(u32)System::getRegion() == SC_PRODUCT_AREA_CHN;
@@ -262,7 +262,7 @@ namespace ipl {
for (int i = 0; i < (DATE_COUNT * 2); i++) {
Date* date = new Date(getSceneHeap(), mpLayoutFile, "arc", "my_IplTop_f.brlyt");
if (i < DATE_COUNT) {
nw4r::ut::List_Append(&unk_0x90, date);
nw4r::ut::List_Append(&mDrawList, date);
}
nw4r::ut::List_Append(&mDateList, date);
}
@@ -382,10 +382,10 @@ namespace ipl {
}
} else {
for (u32 i = 0; i < DATE_COUNT; i++) {
((Date*)nw4r::ut::List_GetNth(&unk_0x90, i))->draw(false);
((Date*)nw4r::ut::List_GetNth(&mDrawList, i))->draw(false);
}
for (u32 i = 0; i < DATE_COUNT; i++) {
((Date*)nw4r::ut::List_GetNth(&unk_0x90, i))->draw(true);
((Date*)nw4r::ut::List_GetNth(&mDrawList, i))->draw(true);
}
}
}
@@ -425,8 +425,8 @@ namespace ipl {
}
void Calendar::onPointDate(Date* date) {
nw4r::ut::List_Remove(&unk_0x90, date);
nw4r::ut::List_Append(&unk_0x90, date);
nw4r::ut::List_Remove(&mDrawList, date);
nw4r::ut::List_Append(&mDrawList, date);
}
void Calendar::onTrigDate(Date* date) {
@@ -503,7 +503,7 @@ namespace ipl {
}
void Calendar::on_wait_task() {
if (unk_0xA0 == FALSE) {
if (mbSearchTaskRunning == FALSE) {
switch (mPrevState) {
case STATE_SCROLL_RIGHT: {
do_scroll_r();
@@ -535,7 +535,7 @@ namespace ipl {
mPrevState = mState;
mState = STATE_SCROLL_RIGHT;
if (unk_0xA0 == TRUE) {
if (mbSearchTaskRunning == TRUE) {
mbTaskCanceled = TRUE;
mPrevState = STATE_SCROLL_RIGHT;
mState = STATE_WAIT_TASK;
@@ -577,7 +577,7 @@ namespace ipl {
mPrevState = mState;
mState = STATE_SCROLL_LEFT;
if (unk_0xA0) {
if (mbSearchTaskRunning) {
mbTaskCanceled = TRUE;
mPrevState = STATE_SCROLL_LEFT;
mState = STATE_WAIT_TASK;
@@ -616,7 +616,7 @@ namespace ipl {
mPrevState = mState;
mState = STATE_DONE;
if (unk_0xA0 == TRUE) {
if (mbSearchTaskRunning == TRUE) {
OSReport("検索タスク終了要求\n"); // "Search task termination requested"
mbTaskCanceled = TRUE;
mPrevState = mState;
@@ -863,14 +863,14 @@ namespace ipl {
OSReport("タスク終了\n"); // Task end
calendar->unk_0xA0 = FALSE;
calendar->mbSearchTaskRunning = FALSE;
calendar->mbTaskCanceled = FALSE;
}
}
void Calendar::exec_search_task() {
OSReport("検索開始\n"); // Start search
unk_0xA0 = TRUE;
mbSearchTaskRunning = TRUE;
System::getTask1()->requestJam(search_task_, this, NULL);
}

View File

@@ -67,7 +67,7 @@ namespace ipl {
DECOMP_FORCE_ACTIVE(iplDate_cpp, padding);
Date::Date(EGG::Heap* heap, nand::LayoutFile* file, const char* layoutFolder, const char* layoutFileName)
: ::gui::EventHandler(), mbAppearMsg(0), unk_0x10(0), unk_0x14(0), mpLayout(NULL), mpCurrentPaneAnim(0), unk_0x3C(0) {
: ::gui::EventHandler(), mbAppearMsg(0), mFocusState(0), mPendingFocusCmd(0), mpLayout(NULL), mpCurrentPaneAnim(0), mPointCount(0) {
// Layout
mpLayout = new layout::Object(heap, file, layoutFolder, layoutFileName);
@@ -103,16 +103,16 @@ namespace ipl {
onCmdRecv(3);
}
onCmdRecv(unk_0x14);
onCmdRecv(mPendingFocusCmd);
}
void Date::draw(bool unk) {
if (unk) {
if (unk_0x3C != 0) {
if (mPointCount != 0) {
mpLayout->draw();
}
} else {
if (unk_0x3C == 0) {
if (mPointCount == 0) {
mpLayout->draw();
}
}
@@ -210,7 +210,7 @@ namespace ipl {
void Date::start_point_event(const char* paneName, controller::Interface* con) {
if (strcmp(paneName, scB_Cal) == 0) {
if (unk_0x3C == 0) {
if (mPointCount == 0) {
static_cast<Calendar*>(System::getScene(SCENE_CALENDAR))->onPointDate(this);
onCmdRecv(1);
@@ -221,16 +221,16 @@ namespace ipl {
}
}
}
unk_0x3C++;
mPointCount++;
}
}
void Date::start_left_event(const char* paneName) {
if (strcmp(paneName, scB_Cal) == 0) {
if (unk_0x3C == 1) {
if (mPointCount == 1) {
onCmdRecv(2);
}
unk_0x3C--;
mPointCount--;
}
}
@@ -268,35 +268,35 @@ namespace ipl {
void Date::onCmdRecv(int cmd) {
if (cmd == 1 || cmd == 2) {
unk_0x14 = cmd;
mPendingFocusCmd = cmd;
}
switch (unk_0x10) {
switch (mFocusState) {
case 0: {
if (cmd == 1) {
mpCurrentPaneAnim = doAnim(IDANIM_FOCUS_IN);
unk_0x10 = 1;
mFocusState = 1;
} else if (cmd == 2) {
mpCurrentPaneAnim = doAnim(IDANIM_FOCUS_OUT);
unk_0x10 = 2;
mFocusState = 2;
}
break;
}
case 1: {
if (cmd == 3) {
if (unk_0x14 == 1) {
unk_0x14 = 0;
if (mPendingFocusCmd == 1) {
mPendingFocusCmd = 0;
}
unk_0x10 = 0;
mFocusState = 0;
}
break;
}
case 2: {
if (cmd == 3) {
if (unk_0x14 == 2) {
unk_0x14 = 0;
if (mPendingFocusCmd == 2) {
mPendingFocusCmd = 0;
}
unk_0x10 = 0;
mFocusState = 0;
}
break;
}
@@ -306,7 +306,7 @@ namespace ipl {
void Date::initEvent() {
mpGui->init();
mpPaneAnims[ANIM_PANE_BTN_HOVER]->initAnmFrame(0.0f);
unk_0x3C = 0;
mPointCount = 0;
onCmdRecv(3);
}

View File

@@ -1734,11 +1734,13 @@ namespace ipl {
}
}
extern "C" char scSE_WSD_SELECT[] = "WSD_SELECT";
void ChannelSelect::preparePageScrolling(int nextState) {
mbModuleSceneChange = true;
mState = nextState;
unk_0x185 = false;
snd::getSystem()->startSE("WSD_SELECT");
snd::getSystem()->startSE(scSE_WSD_SELECT);
}
void ChannelSelect::startPageScroll(int nextState) {
@@ -2087,7 +2089,6 @@ namespace ipl {
mpMoveLytDrop->getAnim()->initAnmFrame();
}
extern "C" char scSE_WSD_SELECT[] = "WSD_SELECT";
extern "C" char scSE_WIPL_SE_CH_TARGETTING[] = "WIPL_SE_CH_TARGETTING";
extern "C" char scSE_WIPL_SE_CH_HOLD[] = "WIPL_SE_CH_HOLD";
extern "C" char scSE_WIPL_SE_CH_SET[] = "WIPL_SE_CH_SET";

View File

@@ -449,7 +449,7 @@ namespace ipl {
mpRsoExpHeaps[0] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL);
mpRsoExpHeaps[1] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL);
getButton()->setUnk_0x105(true);
getButton()->setSuppressNewMailAnm(true);
}
void ChannelTitle::calcCommon() {
@@ -931,7 +931,7 @@ namespace ipl {
System::getChannelManager()->resetChJumpLoad();
getButton()->setUnk_0x105(false);
getButton()->setSuppressNewMailAnm(false);
}
BOOL ChannelTitle::isResetAcceptable() const {

View File

@@ -71,7 +71,7 @@ namespace ipl {
mSelectedFaceId = -1;
mpNigaoe = NULL;
mbClosing = false;
unk_0x7D = true;
mbResetAcceptable = true;
mNwc24ErrCountdown = 0;
mbToFriend = false;
@@ -385,7 +385,7 @@ namespace ipl {
snd::getSystem()->startSE("WIPL_SE_DECIDE");
unk_0x7D = false;
mbResetAcceptable = false;
// Copy letter contents
wmemcpy(mWCString, getMemoInputForm()->getSendString()->getWCString(), WC_STRING_LENGTH);
@@ -409,7 +409,7 @@ namespace ipl {
closeNWC24();
}
unk_0x7D = true;
mbResetAcceptable = true;
// Button animation
button->animation(Button::IDANIM_SELECT_CREATE_R);

View File

@@ -90,6 +90,12 @@ MemCardEventHandler::~MemCardEventHandler() {}
MemoryBaseEvent::MemoryBaseEvent(MemoryBase* memoryBase) : mpBase(memoryBase) {}
} // namespace scene
namespace math {
inline LinearIntp<VEC3>::LinearIntp() {}
}
namespace scene {
void GCWindow::init(const math::VEC3& translate, MemoryCardManager* manager, u8 cardState, short cardIndex) {
mActive = true;
mFlags1[cardState] = 0;
@@ -106,8 +112,8 @@ void GCWindow::init(const math::VEC3& translate, MemoryCardManager* manager, u8
}
int blocks = mpMemoryCardManager->getBlocks(cardState, cardIndex);
DigitTable digitTable = scNumber;
int blockCount = static_cast<u16>(blocks);
wchar_t decimal[5] = {0};
int blockCount = static_cast<u16>(blocks);
int skipCount = 0;
wchar_t blockText[5] = {0};
decimal[0] = digitTable.w[blockCount / 1000];
@@ -123,8 +129,7 @@ void GCWindow::init(const math::VEC3& translate, MemoryCardManager* manager, u8
wcscpy(blockText, decimal + skipCount);
set_textbox("T_Block_00", blockText);
mTranslate = translate;
math::VEC3 zero(0.0f, 0.0f, 0.0f);
mLinearInterp.init(ANIM_TYPE_FORWARD, 12.0f, 0.0f, mTranslate, zero, 1.0f);
mLinearInterp.init(ANIM_TYPE_FORWARD, 12.0f, 0.0f, mTranslate, math::VEC3(0.0f, 0.0f, 0.0f), 1.0f);
mLinearInterp.initFrame();
mLinearInterp.restart();
math::VEC3 position = mLinearInterp.get();

View File

@@ -1,3 +1,4 @@
#define IPL_MEMORY_CARD_MANAGER_CPP
#include "scene/memoryCard/iplMemoryCardManager.h"
#include "utility/iplCharacterCode.h"
#include <revolution/sc.h>
@@ -252,7 +253,9 @@ void MemoryCardManager::update_icon_anm() {
u32 file = mFile[slot][index].fileNo;
if (file < 0x7f && dirs[slot][file].fileNo != 0) {
memorycard::IconState* icon = icons[slot] + file;
s32 frame = mFileCell[slot][file].iconAnmCounter + icon->anmDelta;
s8 delta = icon->anmDelta;
s16 currentFrame = mFileCell[slot][file].iconAnmCounter;
s32 frame = currentFrame + delta;
mFileCell[slot][file].iconAnmCounter = frame;
if ((s16)frame >= icons[slot][file].anmMax) {
if (icon->anmType == 4) {
@@ -342,12 +345,10 @@ void MemoryCardManager::update_change_cardstate(u8 slot) {
GXTexObj* MemoryCardManager::create_icon(u8 slot, s16 index) {
memorycard::IconState (*icons)[0x7f] = reinterpret_cast<memorycard::IconState(*)[0x7f]>(memorycard::getIconStateArray());
int total = 0;
u32 file = mFile[slot][index].fileNo;
s16 frame = 0;
u32 file = mFile[slot][index].fileNo;
do {
u32 shift = frame << 1;
frame++;
total += ((icons[slot][file].anmFrameBits >> shift) & 3) * 4;
total += ((icons[slot][file].anmFrameBits >> (frame++ << 1)) & 3) * 4;
if (mFileCell[slot][file].iconAnmCounter <= total) {
break;
}

View File

@@ -60,7 +60,7 @@ namespace ipl {
"A", "B", "B_BtnA",
};
static const char* sTitlePaneNames[] = {"A", "B", "B_BtnA", "C", "D"};
static const char* sTitlePaneNames[] = {"A", "B", "C", "D", "B_BtnA"};
static const char* sAdditionalTitlePaneNames[] = {"B_00", "C_00", "D_00", "B_BtnA"};
static const char* sDialogPaneNames[] = {"B_ArwR", "B_ArwL", "B_CalExit", "B_CalExit_00"};

View File

@@ -225,8 +225,7 @@ void SDChannelTitle::create() {
comment->SetString(System::getMessage(0xad));
iplSDChannelTitle_rebuildBannerLayout(this);
mpFade = new math::HermiteIntp<f32>();
static f32 fadeRange[2] = {0.0f, 255.0f};
mpFade->init(fadeRange[0], fadeRange[1], 28.0f, 0.0f, 0.0f);
mpFade->init(0.0f, 255.0f, 28.0f, 0.0f, 0.0f);
mpFade->setAnmType(ANIM_TYPE_FORWARD);
mpScreenCapture = new (System::getTreasureHeap(), 32) utility::Capture(System::getTreasureHeap(), 0, 0,
System::getRenderModeObj()->fbWidth, System::getRenderModeObj()->efbHeight, GX_TF_RGB565);
@@ -1016,8 +1015,7 @@ extern "C" void iplSDChannelTitle_preparePageRestart(SDChannelTitle* scene) {
if (!scene->mScriptEnabled || scene->mScriptState == 4) {
if (scene->mpChannelSelect->prepareRestarting(scene->mPage)) {
scene->mpChannelSelect->startPageTransition(scene->mPage, scene->mIndex);
static f32 fadeRange[2] = {0.0f, 255.0f};
scene->mpFade->init(fadeRange[0], fadeRange[1], 28.0f, 0.0f, 0.0f);
scene->mpFade->init(0.0f, 255.0f, 28.0f, 0.0f, 0.0f);
scene->mpFade->setAnmType(ANIM_TYPE_BACKWARD);
scene->mpFade->play();
scene->mState = 6;

View File

@@ -290,25 +290,25 @@ extern int SORecvFrom(int socket, void* buffer, int length, int flags, void* add
extern int SOSendTo(int socket, const void* buffer, int length, int flags, const void* address);
extern int SOBind(int socket, const void* address);
int AOSS_813FFD68(AOSSInitInput* input);
int AOSSValidateInitConfig(AOSSInitInput* input);
int AOSS_CheckAP(AOSSAccessPointRecord* list);
int AOSS_814001B4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request, int socket);
int AOSS_814002F0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request);
int AOSS_814004D0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request);
int AOSS_814006A4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request);
int AOSSDispatchReceiveState(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request, int socket);
int AOSSHandleDiscoverReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request);
int AOSSHandleAuthReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request);
int AOSSHandleFinalReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request);
int AOSSDecryptMessage(AOSSDecryptionMessage* message);
int AOSS_81400D34(u16 command, const u8* manufacturerAddress);
int AOSS_81401104(const AOSSOptionRecord* packet, AOSSStoredConfig* config);
int AOSS_81401284(const AOSSOptionRecord* packet, AOSSStoredConfig* config);
int AOSSCheckAccessPointName(u16 command, const u8* manufacturerAddress);
int AOSSParseWepConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config);
int AOSSParsePskConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config);
void AOSSInitKeySchedule(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32 stateLength);
void AOSSInitCrc32Table(u32 seed, u32* table);
s16 AOSSBuildInterfaceOption(void* buffer);
int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket);
int AOSS_81401778(void* packet, void* request, int socket);
int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int socket);
int AOSSSendHelloRequest(void* packet, void* request, int socket);
int AOSSXorBufferWithKey(void* packet, s32 length, char* key, int keyLength);
int AOSSConnectAndAwaitHost(void* settings, void* config);
int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings);
int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength, void* config, void* networkData);
int AOSSParseNetworkSettings(const AOSSOptionRecord* packet, u8* settings);
int AOSSApplyAuthOptions(int state, const AOSSReplyOption* response, int responseLength, void* config, void* networkData);
int AOSSi_Init(AOSSInitInput* input) {
int result;
@@ -950,14 +950,14 @@ request_socket_cleanup_complete:
s_operationState = 2;
AOSSi_Status(2);
}
requestResult = AOSS_81401574(networkAddresses,&requestRecords,requestResult);
requestResult = AOSSSendDiscoveryRequest(networkAddresses,&requestRecords,requestResult);
break;
case 1:
if (s_operationState != 3) {
s_operationState = 3;
AOSSi_Status(3);
}
requestResult = AOSS_81401778(networkAddresses,&requestRecords,requestResult);
requestResult = AOSSSendHelloRequest(networkAddresses,&requestRecords,requestResult);
break;
case 2:
@@ -1089,7 +1089,7 @@ process_received_packet:
packetBuffer->socket = s_socket;
retryWait = SONtoHs(receivedLength);
packetBuffer->length = retryWait & 0xffff;
requestResult = AOSS_814001B4(protocolState,packetBuffer,&receivedPackets,&requestRecords,s_socket);
requestResult = AOSSDispatchReceiveState(protocolState,packetBuffer,&receivedPackets,&requestRecords,s_socket);
if (requestResult == 100) {
protocolResult = 0;
}
@@ -1391,7 +1391,7 @@ protocol_socket_cleanup_complete:
resultCode = 0xffffffff;
goto finish_initialization;
} else {
protocolResult = AOSS_813FFD68(input);
protocolResult = AOSSValidateInitConfig(input);
if (protocolResult == 0) goto configuration_success;
{
input->status = 6;
@@ -1414,7 +1414,7 @@ finish_initialization:
return (int)resultCode;
}
int AOSS_813FFD68(AOSSInitInput* input) {
int AOSSValidateInitConfig(AOSSInitInput* input) {
AOSSConfigRecord* config;
u8* output;
u8* cursor;
@@ -1599,7 +1599,7 @@ int AOSS_CheckAP(AOSSAccessPointRecord* list) {
return result;
}
int AOSS_814001B4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request, int socket) {
int AOSSDispatchReceiveState(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request, int socket) {
u16 messageLength = SONtoHs(packet->message.messageLength);
u16 opcode;
@@ -1618,19 +1618,19 @@ int AOSS_814001B4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
opcode = SONtoHs(packet->message.opcode);
switch (opcode) {
case 0x1010:
state = AOSS_814002F0(state, packet, count, request);
state = AOSSHandleDiscoverReply(state, packet, count, request);
break;
case 0x2010:
state = AOSS_814004D0(state, packet, count, request);
state = AOSSHandleAuthReply(state, packet, count, request);
break;
case 0x3010:
state = AOSS_814006A4(state, packet, count, request);
state = AOSSHandleFinalReply(state, packet, count, request);
break;
}
return state;
}
int AOSS_814002F0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int AOSSHandleDiscoverReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
AOSSReplyPayload* reply;
AOSSRequestRecord* requestRecord;
size_t manufacturerLength;
@@ -1686,7 +1686,7 @@ int AOSS_814002F0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
(*count)++;
return state;
}
parserResult = AOSS_81400E0C(&reply->data.optionRecord, s_networkBuffer);
parserResult = AOSSParseNetworkSettings(&reply->data.optionRecord, s_networkBuffer);
if (parserResult < 0) {
if (parserResult == -2) {
s_errorCode = 0x16;
@@ -1705,7 +1705,7 @@ int AOSS_814002F0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
return 1;
}
int AOSS_814004D0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int AOSSHandleAuthReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
size_t manufacturerLength;
int compareResult;
u16 packetSequence;
@@ -1756,7 +1756,7 @@ int AOSS_814004D0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
} else {
memset(&s_configData, 0, sizeof(s_configData));
authType = SONtoHs(packet->message.authType);
operationResult = AOSS_814013AC(0, (const AOSSReplyOption*)reply, authType, &s_configData,
operationResult = AOSSApplyAuthOptions(0, (const AOSSReplyOption*)reply, authType, &s_configData,
s_networkBuffer);
if (operationResult < 0) {
*count = *count + 1;
@@ -1772,7 +1772,7 @@ int AOSS_814004D0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
return state;
}
int AOSS_814006A4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int AOSSHandleFinalReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int result = state;
size_t manufacturerLength;
int compareResult;
@@ -1857,7 +1857,7 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
return -100;
}
result = AOSS_81400D34(SONtoHs(message->command), manufacturerAddress);
result = AOSSCheckAccessPointName(SONtoHs(message->command), manufacturerAddress);
if (result != 0) {
return result;
}
@@ -1931,7 +1931,7 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
return 0;
}
int AOSS_81400D34(u16 command, const u8* manufacturerAddress) {
int AOSSCheckAccessPointName(u16 command, const u8* manufacturerAddress) {
u8* storedAddress = s_accessPointName;
int result = 0;
int hasAddress = 0;
@@ -1961,7 +1961,7 @@ int AOSS_81400D34(u16 command, const u8* manufacturerAddress) {
return result;
}
int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings) {
int AOSSParseNetworkSettings(const AOSSOptionRecord* packet, u8* settings) {
const u8* packetBytes = (const u8*)packet;
const AOSSOptionRecord* record;
s32 length;
@@ -2027,7 +2027,7 @@ int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings) {
return 0;
}
int AOSS_81401104(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
int AOSSParseWepConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
const u8* packetBytes = (const u8*)packet;
const AOSSOptionRecord* record = (const AOSSOptionRecord*)(packetBytes + 6);
u32 length;
@@ -2099,7 +2099,7 @@ int AOSS_81401104(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
return 0;
}
int AOSS_81401284(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
int AOSSParsePskConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
const u8* packetBytes = (const u8*)packet;
const AOSSOptionRecord* record = (const AOSSOptionRecord*)(packetBytes + 6);
u32 length;
@@ -2146,7 +2146,7 @@ int AOSS_81401284(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
return 0;
}
int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength, void* config, void* networkData) {
int AOSSApplyAuthOptions(int state, const AOSSReplyOption* response, int responseLength, void* config, void* networkData) {
u32 flags = 0;
const AOSSReplyOption* responseRecord;
AOSSConfigRecord* configRecord;
@@ -2190,19 +2190,19 @@ int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength
do {
switch (option->fields.type) {
case 3:
result = AOSS_81401104((const AOSSOptionRecord*)option, wep40Config);
result = AOSSParseWepConfig((const AOSSOptionRecord*)option, wep40Config);
flags |= 1;
break;
case 4:
result = AOSS_81401104((const AOSSOptionRecord*)option, wep104Config);
result = AOSSParseWepConfig((const AOSSOptionRecord*)option, wep104Config);
flags |= 2;
break;
case 5:
result = AOSS_81401284((const AOSSOptionRecord*)option, tkipConfig);
result = AOSSParsePskConfig((const AOSSOptionRecord*)option, tkipConfig);
flags |= 4;
break;
case 6:
result = AOSS_81401284((const AOSSOptionRecord*)option, aesConfig);
result = AOSSParsePskConfig((const AOSSOptionRecord*)option, aesConfig);
flags |= 8;
break;
case 10:
@@ -2234,7 +2234,7 @@ int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength
return 0;
}
int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket) {
int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int socket) {
u8* responsePayload;
u8 accessPointName[8];
AOSSSocketAddress destination;
@@ -2302,7 +2302,7 @@ int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket) {
return result;
}
int AOSS_81401778(void* packet, void* request, int socket) {
int AOSSSendHelloRequest(void* packet, void* request, int socket) {
AOSSHelloPacket* response = (AOSSHelloPacket*)s_responseBuffer;
AOSSHelloPayload* payload;
AOSSRequestRecords* requestRecords = (AOSSRequestRecords*)request;

View File

@@ -3,15 +3,15 @@
#include <private/wd.h>
#include <string.h>
s32 AOSSi_cancel_flag;
static u8 ipAddress[4];
static u8 ipNetmask[4];
static u8 ipGateway[4];
static u8 primaryDns[4];
static u8 secondaryDns[4];
static void* (*allocateMemory)(u32, s32);
static void (*releaseMemory)(u32, void*, s32);
static void (*statusCallback)(void);
s32 AOSSi_cancel_flag = 0;
static u8 ipAddress[4] = {0};
static u8 ipNetmask[4] = {0};
static u8 ipGateway[4] = {0};
static u8 primaryDns[4] = {0};
static u8 secondaryDns[4] = {0};
static void* (*allocateMemory)(u32, s32) = NULL;
static void (*releaseMemory)(u32, void*, s32) = NULL;
static void (*statusCallback)(void) = NULL;
static NCDIfConfig AOSSi_NcdIfConfig;
static NCDIpConfig AOSSi_NcdIpConfig;

View File

@@ -540,20 +540,20 @@ AtermProgressCallback gAtermProgressCallback;
u32 gAtermResult;
s32 gAtermState;
void ATERM_8140684C(OSAlarm* alarm, OSContext* context);
s32 ATERM_814038C8(void);
void ATERM_81405ACC(AtermMd5Context* context, void* input, u32 length);
void ATERMAlarmWakeQueue(OSAlarm* alarm, OSContext* context);
s32 ATERMRunConfigProtocol(void);
void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length);
extern u8 gAtermDigestFill[64];
extern u8* gAtermRequestOptions;
int ATERM_81404844(u16* destination, u16* source, u32 length, void* key, u32 keyLength);
int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 keyLength);
int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits);
int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits);
void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* output);
void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* output);
int ATERM_814033F0(u16* response);
int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength);
int ATERMAesKeyUnwrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength);
int ATERMAesExpandEncryptKey(u32* expandedKey, const void* key, u32 keyBits);
int ATERMAesExpandDecryptKey(u32* expandedKey, const void* key, u32 keyBits);
void ATERMAesEncryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u8* output);
void ATERMAesDecryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u8* output);
int ATERMParseAssociationResponse(u16* response);
int ATERM_814021BC(void) {
int ATERMStartNetworkStack(void) {
int status;
int waitCount = 0;
u32 convertedHost;
@@ -605,7 +605,7 @@ int ATERM_814021BC(void) {
OSCreateAlarm(&interfaceAlarm);
OSSetAlarmTag(&interfaceAlarm, (u32)&interfaceQueue);
timeoutTicks = (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10;
OSSetAlarm(&interfaceAlarm, timeoutTicks, ATERM_8140684C);
OSSetAlarm(&interfaceAlarm, timeoutTicks, ATERMAlarmWakeQueue);
OSReceiveMessage(&interfaceQueue, &interfaceMessage, 1);
}
@@ -621,7 +621,7 @@ int ATERM_814021BC(void) {
OSCreateAlarm(&hostAlarm);
OSSetAlarmTag(&hostAlarm, (u32)&hostQueue);
timeoutTicks = (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10;
OSSetAlarm(&hostAlarm, timeoutTicks, ATERM_8140684C);
OSSetAlarm(&hostAlarm, timeoutTicks, ATERMAlarmWakeQueue);
OSReceiveMessage(&hostQueue, &hostMessage, 1);
}
} else {
@@ -631,7 +631,7 @@ int ATERM_814021BC(void) {
return waitCount;
}
int ATERM_81402424(u16* resultBuffer, u32 resultBufferLength) {
int ATERMScanAccessPoints(u16* resultBuffer, u32 resultBufferLength) {
int lockId;
int result = -2;
u16* scanBuffer = resultBuffer;
@@ -678,7 +678,7 @@ int ATERM_81402424(u16* resultBuffer, u32 resultBufferLength) {
OSCreateAlarm(&startupAlarm);
OSSetAlarmTag(&startupAlarm, (u32)&startupQueue);
OSSetAlarm(&startupAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&startupQueue, &startupMessage, 1);
} while (1);
@@ -719,7 +719,7 @@ int ATERM_81402424(u16* resultBuffer, u32 resultBufferLength) {
OSCreateAlarm(&scanAlarm);
OSSetAlarmTag(&scanAlarm, (u32)&scanQueue);
OSSetAlarm(&scanAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&scanQueue, &scanMessage, 1);
}
@@ -737,7 +737,7 @@ cleanup_driver:
OSCreateAlarm(&cleanupAlarm);
OSSetAlarmTag(&cleanupAlarm, (u32)&cleanupQueue);
OSSetAlarm(&cleanupAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&cleanupQueue, &cleanupMessage, 1);
}
@@ -752,7 +752,7 @@ unlock_driver:
OSCreateAlarm(&unlockAlarm);
OSSetAlarmTag(&unlockAlarm, (u32)&unlockQueue);
OSSetAlarm(&unlockAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&unlockQueue, &unlockMessage, 1);
}
}
@@ -760,7 +760,7 @@ unlock_driver:
return result;
}
int ATERM_8140276C(AtermApRecordSet* currentRecords, AtermApRecordSet* previousRecords,
int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet* previousRecords,
u32* changedIndex) {
u32 previousIndex;
u32 currentIndex = 0;
@@ -869,7 +869,7 @@ int ATERM_8140276C(AtermApRecordSet* currentRecords, AtermApRecordSet* previousR
return result;
}
int ATERM_81402A24(void) {
int ATERMDiscoverAccessPoints(void) {
s32 result = -1;
u32 scanBufferBytes;
u32 recordIndex;
@@ -912,7 +912,7 @@ int ATERM_81402A24(void) {
break;
}
result = ATERM_81402424((u16*)scanBuffer, scanBufferBytes);
result = ATERMScanAccessPoints((u16*)scanBuffer, scanBufferBytes);
if (result < 0) {
goto cleanup;
}
@@ -954,7 +954,7 @@ int ATERM_81402A24(void) {
currentRecords->count = result;
if (gAtermState != 1 &&
ATERM_8140276C(currentRecords, previousRecords, (u32*)&progressInfo[0])) {
ATERMFindChangedApRecord(currentRecords, previousRecords, (u32*)&progressInfo[0])) {
AtermApRecord* selectedRecord;
gAtermSelectedRecordIndex = progressInfo[0];
selectedRecord = &currentRecords->entries[progressInfo[0]];
@@ -1036,7 +1036,7 @@ cleanup:
return result;
}
int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloadLength,
int ATERMBuildEncryptedMessage(u16* messageBuffer, u32 sequence, u16* payload, size_t payloadLength,
void* encryptionKey) {
u8* end;
u8* cursor;
@@ -1045,7 +1045,7 @@ int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloa
memset(payload, 0, 8);
payload[0] = SOHtoNs((payloadLength - 8) & 0xFFFF);
if (encryptionKey != NULL) {
ATERM_81404844(messageBuffer + 3, payload, payloadLength, encryptionKey, 0x10);
ATERMAesKeyWrap(messageBuffer + 3, payload, payloadLength, encryptionKey, 0x10);
payloadLength += 8;
} else {
memcpy(messageBuffer + 3, payload, payloadLength);
@@ -1064,7 +1064,7 @@ int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloa
return (int)(end + sizeof(u16) - (u8*)messageBuffer);
}
int ATERM_81402FC0(AtermPacket* packet, u32* setupType) {
int ATERMParsePacket(AtermPacket* packet, u32* setupType) {
u8* cursor;
u8* end;
u8* payload;
@@ -1142,7 +1142,7 @@ int ATERM_81402FC0(AtermPacket* packet, u32* setupType) {
return 0;
}
int ATERM_814031DC(AtermAssociationRequest* request) {
int ATERMBuildAssociationRequest(AtermAssociationRequest* request) {
u8 scanAddress[8];
u8 interfaceMacAddress[8];
char interfaceMacText[32];
@@ -1227,7 +1227,7 @@ int ATERM_814031DC(AtermAssociationRequest* request) {
return 1;
}
int ATERM_814033F0(u16* response) {
int ATERMParseAssociationResponse(u16* response) {
u16* optionCursor = response + 4;
u8* optionValue;
u16* responseEnd;
@@ -1317,7 +1317,7 @@ int ATERM_814033F0(u16* response) {
return result;
}
int ATERM_81403614(u8* destination, const char* source, s32 length) {
int ATERMParseHexBytes(u8* destination, const char* source, s32 length) {
s32 value = 0;
s32 characterIndex = 0;
@@ -1349,7 +1349,7 @@ int ATERM_81403614(u8* destination, const char* source, s32 length) {
return 1;
}
int ATERM_814036D8(void) {
int ATERMApplyScanSecuritySettings(void) {
s32 result = 1;
char* sourceKey;
char* outputKey;
@@ -1389,7 +1389,7 @@ int ATERM_814036D8(void) {
break;
case 10:
gAtermConfigurationResult.setupMode = 1;
ATERM_81403614((u8*)outputKey, keyString, 10);
ATERMParseHexBytes((u8*)outputKey, keyString, 10);
break;
case 13:
gAtermConfigurationResult.setupMode = 2;
@@ -1397,7 +1397,7 @@ int ATERM_814036D8(void) {
break;
case 26:
gAtermConfigurationResult.setupMode = 2;
ATERM_81403614((u8*)outputKey, keyString, 0x1A);
ATERMParseHexBytes((u8*)outputKey, keyString, 0x1A);
break;
case 16:
gAtermConfigurationResult.setupMode = 3;
@@ -1405,7 +1405,7 @@ int ATERM_814036D8(void) {
break;
case 32:
gAtermConfigurationResult.setupMode = 3;
ATERM_81403614((u8*)outputKey, keyString, 0x20);
ATERMParseHexBytes((u8*)outputKey, keyString, 0x20);
break;
default:
result = -7;
@@ -1432,7 +1432,7 @@ int ATERM_814036D8(void) {
return result;
}
s32 ATERM_814038C8(void) {
s32 ATERMRunConfigProtocol(void) {
OSMessageQueue waitQueue;
OSMessage waitBuffer[1];
OSMessage waitMessage;
@@ -1459,7 +1459,7 @@ s32 ATERM_814038C8(void) {
OSSetAlarmTag(&waitAlarm, (u32)&waitQueue);
OSSetAlarm(&waitAlarm,
(__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6) * 500,
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&waitQueue, &waitMessage, 1);
switch (gAtermProtocolState) {
case 0:
@@ -1467,7 +1467,7 @@ s32 ATERM_814038C8(void) {
case 1:
{
AtermProgress progress;
result = ATERM_81402A24();
result = ATERMDiscoverAccessPoints();
if (result != 1) {
failed = 1;
break;
@@ -1485,7 +1485,7 @@ s32 ATERM_814038C8(void) {
break;
}
case 2:
result = ATERM_814021BC();
result = ATERMStartNetworkStack();
if (result != 1) {
failed = 1;
break;
@@ -1525,11 +1525,11 @@ s32 ATERM_814038C8(void) {
break;
}
peerAddress.length = 8;
ATERM_814031DC((AtermAssociationRequest*)gAtermConfigurationResult.connectionPrefix);
ATERMBuildAssociationRequest((AtermAssociationRequest*)gAtermConfigurationResult.connectionPrefix);
receivedLength = SORecvFrom(socket, gAtermConfigurationResult.packetBuffer,
sizeof(gAtermConfigurationResult.packetBuffer), 4, &peerAddress);
if (receivedLength > 0 &&
ATERM_81402FC0((AtermPacket*)gAtermConfigurationResult.packetBuffer, &gAtermResponseMode)) {
ATERMParsePacket((AtermPacket*)gAtermConfigurationResult.packetBuffer, &gAtermResponseMode)) {
AtermProgress progress;
gAtermDeadline = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6)) + 30000;
gAtermProtocolState = 5;
@@ -1588,7 +1588,7 @@ s32 ATERM_814038C8(void) {
longOption++;
}
optionEnd = (u8*)longOption;
gAtermMessageLength = ATERM_81402E40((u16*)gAtermConfigurationResult.packetBuffer, 2,
gAtermMessageLength = ATERMBuildEncryptedMessage((u16*)gAtermConfigurationResult.packetBuffer, 2,
(u16*)response->data, optionEnd - gAtermRequestOptions + 8, NULL);
sendAddress.length = 8;
sendAddress.family = 2;
@@ -1628,7 +1628,7 @@ s32 ATERM_814038C8(void) {
} else if (sequence != 3) {
payloadLength = 0;
} else if (gAtermConfigurationResult.connectionPrefix != NULL) {
ATERM_81404A18((u16*)response->authentication.payload, (u16*)payload,
ATERMAesKeyUnwrap((u16*)response->authentication.payload, (u16*)payload,
payloadLength, gAtermConfigurationResult.connectionPrefix, 16);
payloadLength -= 8;
} else {
@@ -1660,7 +1660,7 @@ s32 ATERM_814038C8(void) {
digestContext.state[1] = 0xEFCDAB89;
digestContext.state[2] = 0x98BADCFE;
digestContext.state[3] = 0x10325476;
ATERM_81405ACC(&digestContext, &authenticationTime, sizeof(authenticationTime));
ATERMMd5Update(&digestContext, &authenticationTime, sizeof(authenticationTime));
digestLength[0] = digestContext.bitCountLow;
digestLength[1] = digestContext.bitCountLow >> 8;
digestLength[2] = digestContext.bitCountLow >> 16;
@@ -1670,9 +1670,9 @@ s32 ATERM_814038C8(void) {
digestLength[6] = digestContext.bitCountHigh >> 16;
digestLength[7] = digestContext.bitCountHigh >> 24;
digestBytes = (digestContext.bitCountLow >> 3) & 0x3F;
ATERM_81405ACC(&digestContext, gAtermDigestFill,
ATERMMd5Update(&digestContext, gAtermDigestFill,
digestBytes < 56 ? 56 - digestBytes : 120 - digestBytes);
ATERM_81405ACC(&digestContext, digestLength, sizeof(digestLength));
ATERMMd5Update(&digestContext, digestLength, sizeof(digestLength));
response->authentication.digest[0] = digestContext.state[0];
response->authentication.digest[1] = digestContext.state[0] >> 8;
response->authentication.digest[2] = digestContext.state[0] >> 16;
@@ -1724,7 +1724,7 @@ s32 ATERM_814038C8(void) {
memcpy(option->value, response->authentication.digest, 8);
gAtermReplyLength = (u8*)(option + 1) - response->data;
response->authentication.decoded.length = gAtermReplyLength - 8;
gAtermMessageLength = ATERM_81402E40((u16*)gAtermConfigurationResult.packetBuffer, 4,
gAtermMessageLength = ATERMBuildEncryptedMessage((u16*)gAtermConfigurationResult.packetBuffer, 4,
(u16*)response->data, gAtermReplyLength, gAtermConfigurationResult.connectionPrefix);
sendAddress.length = 8;
sendAddress.family = 2;
@@ -1758,14 +1758,14 @@ s32 ATERM_814038C8(void) {
} else if (sequence != 5) {
payloadLength = 0;
} else if (sessionKey != NULL) {
ATERM_81404A18((u16*)response->authentication.payload, (u16*)payload,
ATERMAesKeyUnwrap((u16*)response->authentication.payload, (u16*)payload,
payloadLength, sessionKey, 16);
payloadLength -= 8;
} else {
memcpy(response->authentication.payload, payload, payloadLength);
}
gAtermReplyLength = payloadLength;
if (payloadLength != 0 && ATERM_814033F0((u16*)response->data)) {
if (payloadLength != 0 && ATERMParseAssociationResponse((u16*)response->data)) {
gAtermProtocolState = 9;
retries = 0;
gAtermMode = gScanSettings.ssid[0] != 0;
@@ -1795,7 +1795,7 @@ s32 ATERM_814038C8(void) {
memcpy(option->value, &gAtermMode, 1);
gAtermReplyLength = (u8*)(option + 1) - response->data;
response->authentication.decoded.length = gAtermReplyLength - 8;
gAtermMessageLength = ATERM_81402E40((u16*)gAtermConfigurationResult.packetBuffer, 6,
gAtermMessageLength = ATERMBuildEncryptedMessage((u16*)gAtermConfigurationResult.packetBuffer, 6,
(u16*)response->data, gAtermReplyLength, sessionKey);
if (NCDGetLinkStatus() != 5) {
lastSendTime = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6)) + 1000;
@@ -1817,7 +1817,7 @@ s32 ATERM_814038C8(void) {
if (now >= lastSendTime + 1000) {
if (++retries >= 10) {
failed = 1;
result = ATERM_814036D8();
result = ATERMApplyScanSecuritySettings();
} else {
gAtermProtocolState = 9;
}
@@ -1840,7 +1840,7 @@ s32 ATERM_814038C8(void) {
u8 gAtermDigestFill[64] = { 0x80 };
s32 ATERMi_AutoConfigThread(void) {
s32 result = ATERM_814038C8();
s32 result = ATERMRunConfigProtocol();
AtermProgress progress;
u32 equalityMask;
s32 completedState;
@@ -1864,7 +1864,7 @@ s32 ATERMi_AutoConfigThread(void) {
return 0;
}
int ATERM_81404844(u16* destination, u16* source, u32 length, void* key, u32 keyLength) {
int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength) {
u32 expandedKey[80];
union { u32 words[4]; u8 bytes[16]; } block;
union { u64 value; u8 bytes[8]; } counter;
@@ -1889,7 +1889,7 @@ int ATERM_81404844(u16* destination, u16* source, u32 length, void* key, u32 key
return 0;
}
rounds = ATERM_81404BFC(expandedKey, key, keyLength << 3);
rounds = ATERMAesExpandEncryptKey(expandedKey, key, keyLength << 3);
destinationBytes = (u8*)destination;
sourceBytes = (const u8*)source;
memcpy(destinationBytes + 8, sourceBytes, length);
@@ -1901,7 +1901,7 @@ int ATERM_81404844(u16* destination, u16* source, u32 length, void* key, u32 key
outputBlock = destinationBytes + blockOffset;
memcpy(stateBytes + 8, outputBlock, 8);
ATERM_81405254(expandedKey, rounds, stateBytes, stateBytes);
ATERMAesEncryptBlock(expandedKey, rounds, stateBytes, stateBytes);
counter.value = (u64)(s64)blockIndex + passBase;
stateBytes[0] ^= counter.bytes[0];
stateBytes[1] ^= counter.bytes[1];
@@ -1918,7 +1918,7 @@ int ATERM_81404844(u16* destination, u16* source, u32 length, void* key, u32 key
return 1;
}
int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 keyLength) {
int ATERMAesKeyUnwrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength) {
u32 expandedKey[80];
union { u32 words[4]; u8 bytes[16]; } block;
union { u64 value; u8 bytes[8]; } counter;
@@ -1942,7 +1942,7 @@ int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 key
return 0;
}
rounds = ATERM_8140502C(expandedKey, key, keyLength << 3);
rounds = ATERMAesExpandDecryptKey(expandedKey, key, keyLength << 3);
destinationBytes = (u8*)destination;
sourceBytes = (const u8*)source;
memcpy(block.words, sourceBytes, 8);
@@ -1963,7 +1963,7 @@ int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 key
stateBytes[6] ^= counter.bytes[6];
stateBytes[7] ^= counter.bytes[7];
memcpy(stateBytes + 8, outputBlock, 8);
ATERM_81405690(expandedKey, rounds, stateBytes, stateBytes);
ATERMAesDecryptBlock(expandedKey, rounds, stateBytes, stateBytes);
memcpy(outputBlock, stateBytes + 8, 8);
}
}
@@ -1986,7 +1986,7 @@ int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 key
((u32)keyBytes[(index) * 4 + 2] << 8) ^ \
keyBytes[(index) * 4 + 3])
int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
int ATERMAesExpandEncryptKey(u32* expandedKey, const void* key, u32 keyBits) {
const u8* keyBytes = (const u8*)key;
u32* roundKey = expandedKey;
@@ -2096,8 +2096,8 @@ int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
(inverseTable0[byte0] ^ inverseTable1[byte1]); \
}
int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits) {
int rounds = ATERM_81404BFC(expandedKey, key, keyBits);
int ATERMAesExpandDecryptKey(u32* expandedKey, const void* key, u32 keyBits) {
int rounds = ATERMAesExpandEncryptKey(expandedKey, key, keyBits);
u32* roundKey;
s32 roundCount;
s32 firstIndex;
@@ -2145,7 +2145,7 @@ int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits) {
#undef ATERM_AES_TRANSFORM_KEY
void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
void ATERMAesEncryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
u32 state0, state1, state2, state3;
u32 next0, next1, next2, next3;
s32 roundPairs;
@@ -2232,7 +2232,7 @@ void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* out
output[15] = state3;
}
void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
void ATERMAesDecryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
u32 state0, state1, state2, state3;
u32 next0, next1, next2, next3;
s32 roundPairs;
@@ -2319,9 +2319,9 @@ void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* out
output[15] = state3;
}
void ATERM_81405D0C(u32 state[4], const u8 block[64]);
void ATERMMd5Transform(u32 state[4], const u8 block[64]);
void ATERM_81405ACC(AtermMd5Context* context, void* input, u32 length) {
void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length) {
u8* data = (u8*)input;
u32 bufferIndex = (context->bitCountLow >> 3) & 0x3F;
u32 bytesToFill;
@@ -2338,9 +2338,9 @@ void ATERM_81405ACC(AtermMd5Context* context, void* input, u32 length) {
for (copiedBytes = 0; copiedBytes < bytesToFill; copiedBytes++) {
context->buffer8[bufferIndex + copiedBytes] = data[copiedBytes];
}
ATERM_81405D0C(context->state, context->buffer8);
ATERMMd5Transform(context->state, context->buffer8);
for (copiedBytes = bytesToFill; copiedBytes + 63 < length; copiedBytes += 64) {
ATERM_81405D0C(context->state, data + copiedBytes);
ATERMMd5Transform(context->state, data + copiedBytes);
}
bufferIndex = 0;
} else {
@@ -2358,7 +2358,7 @@ void ATERM_81405ACC(AtermMd5Context* context, void* input, u32 length) {
(A) += (B); \
} while (0)
void ATERM_81405D0C(u32 state[4], const u8 block[64]) {
void ATERMMd5Transform(u32 state[4], const u8 block[64]) {
u32 byteIndex;
u32 index;
const u8* inputWord;
@@ -2452,7 +2452,7 @@ void ATERM_81405D0C(u32 state[4], const u8 block[64]) {
}
#undef ATERM_MD5_STEP
void ATERM_8140684C(OSAlarm* alarm, OSContext* context) {
void ATERMAlarmWakeQueue(OSAlarm* alarm, OSContext* context) {
OSMessageQueue* queue = (OSMessageQueue*)alarm->tag;
OSSendMessage(queue, NULL, 0);
}
@@ -2525,7 +2525,7 @@ int ATERMi_ApConfigEnd(void) {
OSSetAlarmTag(&cancelAlarm, (u32)&cancelQueue);
OSSetAlarm(&cancelAlarm,
OSMillisecondsToTicks(100),
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&cancelQueue, &cancelMessage, 1);
}
@@ -2534,7 +2534,7 @@ int ATERMi_ApConfigEnd(void) {
OSSetAlarmTag(&joinAlarm, (u32)&joinQueue);
OSSetAlarm(&joinAlarm,
OSMillisecondsToTicks(500),
ATERM_8140684C);
ATERMAlarmWakeQueue);
OSReceiveMessage(&joinQueue, &joinMessage, 1);
while (OSIsThreadTerminated(&sAtermThread) == 0) {
OSJoinThread(&sAtermThread, NULL);

View File

@@ -28,26 +28,27 @@ int ATERMi_ApConfigEnd();
namespace ipl {
namespace scene {
extern "C" MEMAllocator RakuRakuThread_810BDDD0;
MEMAllocator RakuRakuThread_810BDDD0;
extern "C" MEMAllocator sRakuAllocator;
MEMAllocator sRakuAllocator;
struct RakuStatus {
RakuProgress progress;
RakuConfiguration configuration;
};
extern "C" RakuStatus RakuRakuThread_810BDDE0;
RakuStatus RakuRakuThread_810BDDE0;
extern "C" OSMessageQueue RakuRakuThread_810BDED4;
OSMessageQueue RakuRakuThread_810BDED4;
static OSTime startTime;
static bool active;
static OSMessage messageSlot;
extern "C" RakuStatus sRakuStatus;
RakuStatus sRakuStatus;
extern "C" OSMessageQueue sRakuMsgQueue;
OSMessageQueue sRakuMsgQueue;
static u32 startTimeHigh = 0;
static u32 startTimeLow = 0;
static bool active = false;
static OSMessage messageSlot = NULL;
static int displayState = 1;
extern "C" {
static void* RakuRakuThread_813FDEF0(u32, s32 size);
static void RakuRakuThread_813FDEFC(u32, void* block, s32);
static void* RakuRakuThread_813FDF08(u32 size);
static void RakuRakuThread_813FDF18(void* block);
static void* RakuSocketAlloc(u32, s32 size);
static void RakuSocketFree(u32, void* block, s32);
static void* RakuAtermAlloc(u32 size);
static void RakuAtermFree(void* block);
}
struct RakuStack {
@@ -60,7 +61,7 @@ public:
virtual ~RakuRakuThread();
virtual void* Run();
virtual void unk_0x2C() = 0;
void RakuRakuThread_813FDA04();
void syncRakuProgress();
static void progressCallback(RakuProgress* progress);
void destroy();
int start();
@@ -78,15 +79,17 @@ private:
MEMHeapHandle mHeap;
};
void RakuRakuThread::RakuRakuThread_813FDA04() {
void RakuRakuThread::syncRakuProgress() {
BOOL interrupts = OSDisableInterrupts();
RakuRakuThread_810BDDE0.progress = *(RakuProgress*)this;
startTime = OSGetTime();
sRakuStatus.progress = *(RakuProgress*)this;
OSTime time = OSGetTime();
startTimeHigh = time >> 32;
startTimeLow = time;
OSRestoreInterrupts(interrupts);
}
void RakuRakuThread::progressCallback(RakuProgress* progress) {
((RakuRakuThread*)progress)->RakuRakuThread_813FDA04();
((RakuRakuThread*)progress)->syncRakuProgress();
}
RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
@@ -101,12 +104,12 @@ RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
active = false;
mFinished = 0;
mRunning = 0;
OSInitMessageQueue(&RakuRakuThread_810BDED4, &messageSlot, 1);
OSInitMessageQueue(&sRakuMsgQueue, &messageSlot, 1);
}
RakuRakuThread::~RakuRakuThread() {
if (mRunning) {
OSJamMessage(&RakuRakuThread_810BDED4, (OSMessage)2, 1);
OSJamMessage(&sRakuMsgQueue, (OSMessage)2, 1);
WaitForThreadExit();
}
destroy();
@@ -114,7 +117,7 @@ RakuRakuThread::~RakuRakuThread() {
void RakuRakuThread::destroy() {
if (active) {
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
u32 start = OSGetTick();
while ((u32)(OSGetTick() - start) / (OS_TIMER_CLOCK / 1000) < 2000) {
RakuProgress progress;
@@ -127,7 +130,7 @@ void RakuRakuThread::destroy() {
}
if (mHeap != NULL) {
MEMDestroyExpHeap(mHeap);
memset(&RakuRakuThread_810BDDD0, 0, sizeof(MEMAllocator));
memset(&sRakuAllocator, 0, sizeof(MEMAllocator));
mHeap = NULL;
}
}
@@ -137,21 +140,23 @@ int RakuRakuThread::start() {
return 0;
}
BOOL interrupts = OSDisableInterrupts();
startTime = OSGetTime();
OSTime time = OSGetTime();
startTimeHigh = time >> 32;
startTimeLow = time;
mHeap = MEMCreateExpHeapEx(mHeapBuffer, 0x40000, 2);
MEMInitAllocatorForExpHeap(&RakuRakuThread_810BDDD0, mHeap, 32);
MEMInitAllocatorForExpHeap(&sRakuAllocator, mHeap, 32);
mPriority = OSGetThreadPriority(OSGetCurrentThread()) - 1;
active = true;
mFinished = 0;
memset(&RakuRakuThread_810BDDE0.configuration, 0, sizeof(RakuConfiguration));
memset(&RakuRakuThread_810BDDE0.progress, 0, sizeof(RakuProgress));
memset(&sRakuStatus.configuration, 0, sizeof(RakuConfiguration));
memset(&sRakuStatus.progress, 0, sizeof(RakuProgress));
SOLibraryConfig socketConfig;
socketConfig.alloc = RakuRakuThread_813FDEF0;
socketConfig.free = RakuRakuThread_813FDEFC;
socketConfig.alloc = RakuSocketAlloc;
socketConfig.free = RakuSocketFree;
SOInit(&socketConfig);
ATERMi_ApConfigStart(mPriority, 200,
progressCallback,
RakuRakuThread_813FDF08, RakuRakuThread_813FDF18, 4096);
RakuAtermAlloc, RakuAtermFree, 4096);
if (!mRunning) {
mRunning = 1;
memset(mStack, 0, 4);
@@ -165,12 +170,12 @@ int RakuRakuThread::start() {
void* RakuRakuThread::Run() {
OSMessage message;
while (true) {
while (OSReceiveMessage(&RakuRakuThread_810BDED4, &message, 0)) {
while (OSReceiveMessage(&sRakuMsgQueue, &message, 0)) {
if ((s32)message == 2) {
return this;
}
}
OSReceiveMessage(&RakuRakuThread_810BDED4, &message, 1);
OSReceiveMessage(&sRakuMsgQueue, &message, 1);
if ((s32)message == 2) {
break;
}
@@ -184,17 +189,17 @@ void* RakuRakuThread::Run() {
return this;
}
static void* RakuRakuThread_813FDEF0(u32, s32 size) {
return MEMAllocFromAllocator(&RakuRakuThread_810BDDD0, size);
static void* RakuSocketAlloc(u32, s32 size) {
return MEMAllocFromAllocator(&sRakuAllocator, size);
}
static void RakuRakuThread_813FDEFC(u32, void* block, s32) {
MEMFreeToAllocator(&RakuRakuThread_810BDDD0, block);
static void RakuSocketFree(u32, void* block, s32) {
MEMFreeToAllocator(&sRakuAllocator, block);
}
static void* RakuRakuThread_813FDF08(u32 size) {
return MEMAllocFromAllocator(&RakuRakuThread_810BDDD0, size);
static void* RakuAtermAlloc(u32 size) {
return MEMAllocFromAllocator(&sRakuAllocator, size);
}
static void RakuRakuThread_813FDF18(void* block) {
MEMFreeToAllocator(&RakuRakuThread_810BDDD0, block);
static void RakuAtermFree(void* block) {
MEMFreeToAllocator(&sRakuAllocator, block);
}
int RakuRakuThread::getState() {
@@ -202,7 +207,7 @@ int RakuRakuThread::getState() {
return 0;
}
BOOL interrupts = OSDisableInterrupts();
switch (RakuRakuThread_810BDDE0.progress.state) {
switch (sRakuStatus.progress.state) {
case 1: displayState = 1; break;
case 2: displayState = 2; break;
case 3: displayState = 2; break;
@@ -213,15 +218,15 @@ int RakuRakuThread::getState() {
default: displayState = 1; break;
}
if (displayState != 6 && displayState != 7 &&
((u32)OSGetTime() - (u32)startTime) / (OS_TIMER_CLOCK / 1000) >= 90000) {
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
((u32)OSGetTime() - startTimeLow) / (OS_TIMER_CLOCK / 1000) >= 90000) {
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
}
OSRestoreInterrupts(interrupts);
return displayState;
}
int RakuRakuThread::cancel() {
return OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
return OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
}
int RakuRakuThread::finish(NCDApConfig* config, int* result) {
@@ -231,23 +236,23 @@ int RakuRakuThread::finish(NCDApConfig* config, int* result) {
}
return 1;
}
s32 state = RakuRakuThread_810BDDE0.progress.state;
s32 state = sRakuStatus.progress.state;
if ((u32)(state - 6) > 1) {
return 0;
}
if (!mFinished) {
if (state == 6) {
ATERMi_ApConfigGetResult(&RakuRakuThread_810BDDE0.configuration);
ATERMi_ApConfigGetResult(&sRakuStatus.configuration);
printInfo();
}
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
return 0;
}
SOFinish();
active = false;
destroy();
if (config != NULL) {
RakuConfiguration* settings = &RakuRakuThread_810BDDE0.configuration;
RakuConfiguration* settings = &sRakuStatus.configuration;
memcpy(config->ssid, settings->ssid, 32);
config->ssidLength = strlen(settings->ssid);
if (settings->security == 1) {
@@ -273,7 +278,7 @@ int RakuRakuThread::finish(NCDApConfig* config, int* result) {
}
}
if (result != NULL) {
*result = RakuRakuThread_810BDDE0.progress.result;
*result = sRakuStatus.progress.result;
}
return 1;
}

View File

@@ -17,8 +17,16 @@ namespace ipl {
class SensitivityDrawing {
public:
static void draw(nand::File* texture);
private:
static void verticalScale(f32 height, f32& scale);
static f32 horizontalScale(f32 width);
static f32 projectY(s32 y, f32 scale);
};
void SensitivityDrawing::verticalScale(f32 height, f32& scale) { scale = 0.5f * height / 768.0f; }
f32 SensitivityDrawing::horizontalScale(f32 width) { return 0.5f * width / 1024.0f; }
f32 SensitivityDrawing::projectY(s32 y, f32 scale) { return (y - 384) * scale; }
void SensitivityDrawing::draw(nand::File* texture) {
GXRenderModeObj renderMode = *System::getRenderModeObj();
nw4r::ut::Rect projection;
@@ -47,8 +55,9 @@ void SensitivityDrawing::draw(nand::File* texture) {
GXInitTexObjWrapMode(&image, GX_MIRROR, GX_MIRROR);
f32 width = projection.GetWidth();
f32 height = projection.GetHeight();
f32 horizontalScale = (0.5f * width) / 1024.0f;
f32 verticalScale = (0.5f * height) / 768.0f;
f32 horizontalScale = SensitivityDrawing::horizontalScale(width);
f32 verticalScale;
SensitivityDrawing::verticalScale(height, verticalScale);
int sample = WPADGetLatestIndexInBuf(controller->getChannel());
DPDObject* object;
DPDObject* first;
@@ -76,7 +85,7 @@ void SensitivityDrawing::draw(nand::File* texture) {
if (object->size != 0) {
f32 radius = 0.15f * (object->size + 25);
f32 x = (object->x - 512) * horizontalScale;
f32 y = (object->y - 384) * verticalScale;
f32 y = projectY(object->y, verticalScale);
GXColor foreground = {255, 255, 255, 255};
nw4r::ut::Rect rectangle(x - radius, -y + radius - -45.0f,
x + radius, -y - radius - -45.0f);

View File

@@ -36,12 +36,6 @@ extern "C" int abs(int value);
extern "C" void __VISetAdjustingValues(s32 horizontal, s32 vertical);
namespace ipl {
namespace scene {
static s32 browserScrollDirection;
}
}
namespace ipl {
class SensitivityDrawing {
public:
@@ -149,6 +143,7 @@ namespace ipl {
void* Setting::mem1Buffer_;
void* Setting::mem2Buffer_;
static s32 browserScrollDirection;
Setting::Setting(EGG::Heap* heap, int arg) : FaderSceneBase(heap) {
unk_0x5C = 0;
@@ -417,7 +412,7 @@ namespace ipl {
"Setup/ScreenSave.html", "Setup/ScreenSave.html",
"Setup/ScreenSave.html", "Setup/ScreenSave.html",
"Setup/ScreenSave.html", "Setup/ScreenSave.html",
"Setup/ScreenSave.html", "Calendar"};
"Setup/ScreenSave.html", "Setup/ScreenSave.html"};
char basePath[100];
char browserPath[100];
@@ -443,8 +438,8 @@ namespace ipl {
snprintf(browserPath, sizeof(browserPath), basePath, regionCodes[regionIndex],
languageCodes[System::getLanguage()], regionPages[regionIndex]);
} else if (mInitialArgument == ARG_UNK_6) {
const char* pageNames[] = {"Display", "Sound", "Parental_Control", "Internet",
"Wiiconnect24", "Update", "Update"};
const char* pageNames[] = {"Calendar", "Display", "Sound", "Parental_Control",
"Internet", "Wiiconnect24", "Update"};
int directPage;
for (directPage = 0; directPage < 7; directPage++) {
if (strstr(mpStringBuffer->netSettingArg, pageNames[directPage]) != NULL) {
@@ -2167,8 +2162,8 @@ namespace ipl {
const char* versionSuffix[12] = {"J", "U", "E", "", "", "J", "K", "", "", "", "", "C"};
u32 versionData[24] = {
0x00010008, 0x48414B4A, 0x00010008, 0x48414B45, 0x00010008, 0x48414B50,
0, 0, 0, 0, 0, 0, 0x00010008, 0x48414B4A, 0x00010008, 0x48414B4B,
0, 0, 0, 0, 0, 0, 0x00010008, 0x48414B43,
0, 0, 0, 0, 0x00010008, 0x48414B4A, 0x00010008, 0x48414B4B,
0, 0, 0, 0, 0, 0, 0, 0, 0x00010008, 0x48414B43,
};
u32 region = System::getRegion();
sprintf(mpStringBuffer->version, "Ver. %d.%d%s", 4, 3, versionSuffix[region]);
@@ -3745,13 +3740,13 @@ namespace ipl {
layout::Animator* animation = mpWaitLayout->getAnim(0);
animation->initFrame();
animation->restart();
mpWaitLayout->FindPaneByName("G_Wait")->SetVisible(true);
mpWaitLayout->FindPaneByName("N_Wait")->SetVisible(true);
snd::getSystem()->startSE("WIPL_SE_COPYING");
}
void Setting::waitFinish() {
mpWaitLayout->getAnim(0)->stop();
mpWaitLayout->FindPaneByName("G_Wait")->SetVisible(false);
mpWaitLayout->FindPaneByName("N_Wait")->SetVisible(false);
snd::getSystem()->startSE("WIPL_SE_COPY_FINISH");
}
@@ -3849,5 +3844,12 @@ namespace ipl {
return mIsResetAcceptable;
}
extern const wchar_t scNumber[10] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'
};
extern const wchar_t scNumber2[10] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'
};
} // namespace scene
} // namespace ipl

View File

@@ -5,17 +5,22 @@
static OSThread usbapThread;
static u8 usbapStack[4096];
static OSMessageQueue usbapMessageQ;
static wchar_t usbapNickname[11];
static wchar_t usbapNickname[12];
static OSMessage registrationMessage;
static void (*registrationCallback)(int);
static s32 registrationMode;
static u16 enabledChannels;
static u8* scanBuffer;
struct RegisteredAccessPoints {
u8 count;
u8 addresses[20][6];
};
static RegisteredAccessPoints* registeredAccessPoints;
// Registration buffer: a count byte followed by twenty MAC addresses.
static u8* registeredAccessPoints;
static inline int FindRegisteredAddress(const u8* registered, const u8* address) {
int index;
for (index = 0; index < 20; ++index) {
if (memcmp(address, &registered[index * WD_BSSID_LENGTH + 1], WD_BSSID_LENGTH) == 0) break;
}
return index;
}
extern "C" {
static void* DoRegistration(void*);
@@ -26,7 +31,7 @@ extern "C" BOOL USBAPStartRegistration(void*, void*, u32 priority, u32 mode,
u16* buffer, u8* accessPoints) {
BOOL interrupts = OSDisableInterrupts();
scanBuffer = (u8*)buffer;
registeredAccessPoints = (RegisteredAccessPoints*)accessPoints;
registeredAccessPoints = accessPoints;
if (usbapThread.state != 0 && !OSIsThreadTerminated(&usbapThread)) {
OSRestoreInterrupts(interrupts);
return FALSE;
@@ -78,8 +83,13 @@ struct USBAPScan {
};
static void* DoRegistration(void*) {
BOOL success;
int failed, found, index;
s32 count;
WDBssDesc* accessPoint;
int result;
int address;
const u8* registered;
BOOL success;
if (WDCheckEnableChannel(&enabledChannels) != 0) {
success = FALSE;
if (registrationCallback != NULL) {
@@ -116,25 +126,20 @@ static void* DoRegistration(void*) {
memset(scan.ssidMask, 0, 8);
memset(&scan.ssidMask[8], 255, 24);
if (WDScanOnce(scanBuffer, 2048, (WDScanParam*)&scan) == 0) {
u16 count = *(u16*)scanBuffer;
WDBssDesc* accessPoint = (WDBssDesc*)&scanBuffer[2];
int found = 0;
int failed = 0;
for (int index = 0; index < count; ++index) {
count = *(u16*)scanBuffer;
accessPoint = (WDBssDesc*)&scanBuffer[2];
found = 0;
failed = 0;
for (index = 0; index < count; ++index) {
if (accessPoint->ssidLength == 32 && strncmp((char*)accessPoint->ssid, "NWCUSBAP", 8) == 0) {
RegisteredAccessPoints* registered = registeredAccessPoints;
int address;
for (address = 0; address < 20; ++address) {
if (memcmp(accessPoint->bssid, registered->addresses[address], 6) == 0) {
break;
}
}
registered = registeredAccessPoints;
address = FindRegisteredAddress(registered, accessPoint->bssid);
if (address == 20) {
USBAPSSID* response = (USBAPSSID*)accessPoint->ssid;
if (response->flags == 1) {
memcpy(registeredAccessPoints->addresses[registeredAccessPoints->count], accessPoint->bssid, 6);
memcpy(&registeredAccessPoints[registeredAccessPoints[0] * WD_BSSID_LENGTH + 1], accessPoint->bssid, WD_BSSID_LENGTH);
found = 1;
++registeredAccessPoints->count;
++registeredAccessPoints[0];
} else if (response->flags == 0) {
failed = 1;
}

View File

@@ -36,7 +36,7 @@ namespace ipl {
}
TextWriter::TextWriter(EGG::Heap* heap)
: FaderSceneBase(heap), mState(STATE_NORMAL), mSelectedFaceId(-1), mpNigaoe(NULL), mbClosing(false), unk_0x7D(true),
: FaderSceneBase(heap), mState(STATE_NORMAL), mSelectedFaceId(-1), mpNigaoe(NULL), mbClosing(false), mbResetAcceptable(true),
mNwc24ErrCountdown(0) {
setSceneParentFlags(SCN_PARENTFLAG_DRAW | SCN_PARENTFLAG_CALC);
}
@@ -87,7 +87,7 @@ namespace ipl {
mSelectedFaceId = -1;
mpNigaoe = NULL;
mbClosing = false;
unk_0x7D = true;
mbResetAcceptable = true;
mNwc24ErrCountdown = 0;
// Text balloon for Mii face
@@ -398,7 +398,7 @@ namespace ipl {
snd::getSystem()->startSE("WIPL_SE_DECIDE");
unk_0x7D = false;
mbResetAcceptable = false;
// Copy memo contents
wmemcpy(mWCString, getMemoInputForm()->getSendString()->getWCString(), WC_STRING_LENGTH);
@@ -412,7 +412,7 @@ namespace ipl {
closeNWC24();
unk_0x7D = true;
mbResetAcceptable = true;
// Receive sent memo
System::receiveImmediately();

View File

@@ -10,13 +10,6 @@
#undef IPL_SOUND_RECT_OUT_OF_LINE
#undef AutoLock
extern "C" void __ct__Q23EGG20SimpleAudioMgrWithFxFv();
extern "C" void __dt__Q34nw4r3snd11SoundHandleFv();
extern "C" void __dl__FPv();
extern "C" {
void __destroy_arr();
void __dt__Q33ipl3snd10tagSSeInfoFv();
}
extern "C" void _seBlk__Q23ipl3snd();
extern "C" nw4r::snd::SoundHandle* _mainBGMHandle__Q23ipl3snd;
extern "C" const f32 scSoundZeroF;
@@ -24,19 +17,9 @@ extern "C" const f32 scSoundOneF;
extern "C" const f32 scSoundTwoF;
extern "C" const f32 scSoundThirtyF;
extern "C" const f32 scSoundSixtyF;
extern "C" {
void _savegpr_29();
void pauseOffSE__Q33ipl3snd6SystemFv();
void pauseOnSE__Q33ipl3snd6SystemFv();
}
extern "C" void _restgpr_29();
extern "C" void _savegpr_24();
extern "C" void _restgpr_24();
extern "C" void _savegpr_26();
extern "C" void _restgpr_26();
extern "C" void sBannerSoundPlayer__Q23ipl3snd();
extern "C" void pause__17BannerSoundPlayerFb();
extern "C" void initFx__Q33ipl3snd6SystemFv();
extern "C" void GetInstance__Q44nw4r3snd6detail9AxManagerFv();
extern "C" void ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi();
extern "C" void stop__17BannerSoundPlayerFUl();
@@ -45,9 +28,8 @@ extern "C" void SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi();
namespace ipl {
namespace snd {
extern "C" void __vt__Q33ipl3snd6System();
System::System() {
inline System::System() {
}
struct tagSSeInfo {
@@ -59,39 +41,30 @@ namespace ipl {
u32 id;
};
tagSSeInfo::tagSSeInfo() {
inline tagSSeInfo::tagSSeInfo() {
}
BOOL m_isLocked;
struct tagSBgmInfo {
nw4r::snd::SoundHandle handle;
tagSBgmInfo();
~tagSBgmInfo();
};
tagSBgmInfo::tagSBgmInfo() {
inline tagSBgmInfo::tagSBgmInfo() {
}
tagSSeInfo::~tagSSeInfo() {
inline tagSSeInfo::~tagSSeInfo() {
}
tagSBgmInfo::~tagSBgmInfo() {
inline tagSBgmInfo::~tagSBgmInfo() {
}
extern nw4r::snd::SoundHandle _bgmBlk;
extern tagSSeInfo _seBlk[16];
extern nw4r::snd::SoundHandle* _mainBGMHandle;
extern "C" asm void __dt__Q33ipl3snd6UnkClsFv() {
nofralloc
lis r3, _seBlk__Q23ipl3snd@ha
lis r4, __dt__Q33ipl3snd10tagSSeInfoFv@ha
addi r3, r3, _seBlk__Q23ipl3snd@l
li r5, 0xc
addi r4, r4, __dt__Q33ipl3snd10tagSSeInfoFv@l
li r6, 0x10
b __destroy_arr
}
tagSSeInfo _seBlk[16];
tagSBgmInfo _bgmBlk;
System sSystem;
BannerSoundPlayer sBannerSoundPlayer;
nw4r::snd::SoundHandle* _mainBGMHandle;
BOOL m_isLocked;
static const nw4r::snd::FxReverbHi::ReverbHiParam reverbHiParam = {
0.0f,
@@ -102,183 +75,6 @@ namespace ipl {
1.0f,
};
void System::stopBGM(int frames) {
if (_mainBGMHandle && _mainBGMHandle->IsAttachedSound()) {
_mainBGMHandle->Stop(frames);
}
}
void System::muteOnBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(0.0f, frames);
}
void System::muteOffBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(1.0f, frames);
}
void System::pauseOnSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(true, 5);
}
}
}
void System::pauseOffSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(false, 5);
}
}
}
void System::pauseOnBGM() {
if (_mainBGMHandle) {
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(true, 5);
pauseOnSE();
sBannerSoundPlayer.pause(true);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_A, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_B, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_C, 250);
}
}
void System::pauseOffBGM() {
if (_mainBGMHandle) {
initFx();
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(false, 5);
pauseOffSE();
sBannerSoundPlayer.pause(false);
}
}
extern "C" asm void stopSE__Q33ipl3snd6SystemFPQ34nw4r3snd11SoundHandlei() {
nofralloc
stwu r1, -0x30(r1)
mflr r0
stw r0, 0x34(r1)
addi r11, r1, 0x30
bl _savegpr_24
cmpwi r4, 0
mr r24, r4
mr r25, r5
beq stopSE_done
lwz r0, 0(r4)
cmpwi r0, 0
beq stopSE_done
li r26, 0
lis r3, 1
lis r28, _seBlk__Q23ipl3snd@ha
li r31, 0
mr r29, r26
subi r30, r3, 1
addi r28, r28, _seBlk__Q23ipl3snd@l
stopSE_loop:
add r27, r28, r31
cmplw r24, r27
bne stopSE_next
lwz r3, 0(r27)
cmpwi r3, 0
beq stopSE_clear
lwz r12, 0(r3)
mr r4, r25
lwz r12, 0x18(r12)
mtctr r12
bctrl
stopSE_clear:
stw r29, 0x4(r27)
stw r30, 0x8(r27)
stopSE_next:
addi r26, r26, 1
addi r31, r31, 0xc
cmpwi r26, 0x10
blt stopSE_loop
stopSE_done:
addi r11, r1, 0x30
bl _restgpr_24
lwz r0, 0x34(r1)
mtlr r0
addi r1, r1, 0x30
blr
}
extern "C" asm void resetAllSound__Q33ipl3snd6SystemFv() {
nofralloc
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
addi r11, r1, 0x20
bl _savegpr_26
li r26, 0
lis r28, _seBlk__Q23ipl3snd@ha
lis r3, 1
li r31, 0
mr r29, r26
addi r28, r28, _seBlk__Q23ipl3snd@l
subi r30, r3, 1
resetAllSound_loop:
lwzx r3, r28, r31
add r27, r28, r31
cmpwi r3, 0
beq resetAllSound_clear
lwz r12, 0(r3)
li r4, 0
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_clear:
stw r29, 0x4(r27)
addi r26, r26, 1
cmpwi r26, 0x10
addi r31, r31, 0xc
stw r30, 0x8(r27)
blt resetAllSound_loop
lwz r3, _mainBGMHandle__Q23ipl3snd
cmpwi r3, 0
beq resetAllSound_banner
lwz r0, 0(r3)
cmpwi r0, 0
beq resetAllSound_banner
lwz r3, 0(r3)
li r4, 0
lwz r12, 0(r3)
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_banner:
lis r31, sBannerSoundPlayer__Q23ipl3snd@ha
li r4, 0
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl stop__17BannerSoundPlayerFUl
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 0
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 1
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 2
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
lfs f1, scSoundZeroF
li r4, 0
bl SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi
lfs f1, scSoundZeroF
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl setMasterVolume__17BannerSoundPlayerFf
addi r11, r1, 0x20
bl _restgpr_26
lwz r0, 0x24(r1)
mtlr r0
addi r1, r1, 0x20
blr
}
void System::shutup(BOOL shutUpDMA) {
if (m_isLocked == shutUpDMA) {
return;
@@ -315,32 +111,10 @@ namespace ipl {
sBannerSoundPlayer.setMasterVolume(0.9f);
}
extern "C" const f32 scSoundZeroF = 0.0f;
void System::stopBannerSound(int unk) {
sBannerSoundPlayer.stop(unk);
}
BOOL System::checkTmpSoundFile(void* data, u32 size) {
return sBannerSoundPlayer.checkData(data, size, false);
}
void System::initFx() {
setFxReverbHi(nw4r::snd::AUX_A, &reverbHiParam);
}
#pragma force_active on
}
}
namespace nw4r {
namespace snd {
SoundHandle::SoundHandle() : mSound(NULL) {}
}
}
namespace ipl {
namespace snd {
void System::calc() {
EGG::SimpleAudioMgr::calc();
sBannerSoundPlayer.calc();
@@ -351,9 +125,9 @@ namespace snd {
return NULL;
}
EGG::ArcPlayer::startSound(&_bgmBlk, bgmName);
_mainBGMHandle = &_bgmBlk;
return &_bgmBlk;
EGG::ArcPlayer::startSound(&_bgmBlk.handle, bgmName);
_mainBGMHandle = &_bgmBlk.handle;
return &_bgmBlk.handle;
}
nw4r::snd::SoundHandle* System::startSE(const char* sndName) {
@@ -422,7 +196,7 @@ namespace snd {
}
block->handle.Stop(0);
mSoundArchivePlayer.StartSound(&block->handle, sndIndex);
EGG::ArcPlayer::startSound(&block->handle, sndIndex);
block->id = sndIndex;
return (int)block;
}
@@ -520,6 +294,27 @@ namespace snd {
return (int)block;
}
void System::stopBGM(int frames) {
if (_mainBGMHandle && _mainBGMHandle->IsAttachedSound()) {
_mainBGMHandle->Stop(frames);
}
}
void System::stopSE(nw4r::snd::SoundHandle* handle, int frames) {
tagSSeInfo* block;
int i;
if (handle != NULL && handle->IsAttachedSound()) {
for (i = 0; i < 16; i++) {
block = &_seBlk[i];
if (handle == &block->handle) {
block->handle.Stop(frames);
block->name = NULL;
block->id = 0xFFFF;
}
}
}
}
void System::stopAllSound(int unk) {
int frame;
tagSSeInfo* block;
@@ -543,6 +338,137 @@ namespace snd {
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_C, frame);
}
extern "C" asm void resetAllSound__Q33ipl3snd6SystemFv() {
nofralloc
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
addi r11, r1, 0x20
bl _savegpr_26
li r26, 0
lis r28, _seBlk__Q23ipl3snd@ha
lis r3, 1
li r31, 0
mr r29, r26
addi r28, r28, _seBlk__Q23ipl3snd@l
subi r30, r3, 1
resetAllSound_loop:
lwzx r3, r28, r31
add r27, r28, r31
cmpwi r3, 0
beq resetAllSound_clear
lwz r12, 0(r3)
li r4, 0
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_clear:
stw r29, 0x4(r27)
addi r26, r26, 1
cmpwi r26, 0x10
addi r31, r31, 0xc
stw r30, 0x8(r27)
blt resetAllSound_loop
lwz r3, _mainBGMHandle__Q23ipl3snd
cmpwi r3, 0
beq resetAllSound_banner
lwz r0, 0(r3)
cmpwi r0, 0
beq resetAllSound_banner
lwz r3, 0(r3)
li r4, 0
lwz r12, 0(r3)
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_banner:
lis r31, sBannerSoundPlayer__Q23ipl3snd@ha
li r4, 0
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl stop__17BannerSoundPlayerFUl
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 0
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 1
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 2
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
lfs f1, scSoundZeroF
li r4, 0
bl SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi
lfs f1, scSoundZeroF
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl setMasterVolume__17BannerSoundPlayerFf
addi r11, r1, 0x20
bl _restgpr_26
lwz r0, 0x24(r1)
mtlr r0
addi r1, r1, 0x20
blr
}
}
}
namespace nw4r {
namespace snd {
inline SoundHandle::SoundHandle() : mSound(NULL) {}
}
}
namespace ipl {
namespace snd {
void System::muteOnBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(scSoundZeroF, frames);
}
void System::muteOffBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(scSoundOneF, frames);
}
void System::pauseOnBGM() {
if (_mainBGMHandle) {
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(true, 5);
pauseOnSE();
sBannerSoundPlayer.pause(true);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_A, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_B, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_C, 250);
}
}
void System::pauseOffBGM() {
if (_mainBGMHandle) {
initFx();
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(false, 5);
pauseOffSE();
sBannerSoundPlayer.pause(false);
}
}
void System::pauseOnSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(true, 5);
}
}
}
void System::pauseOffSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(false, 5);
}
}
}
void System::setOutputMode(EAudioOutputMode mode) {
nw4r::snd::OutputMode outputMode;
@@ -624,6 +550,14 @@ namespace snd {
return sBannerSoundPlayer.start(data, size);
}
void System::stopBannerSound(int unk) {
sBannerSoundPlayer.stop(unk);
}
BOOL System::checkTmpSoundFile(void* data, u32 size) {
return sBannerSoundPlayer.checkData(data, size, false);
}
long System::clipGELT_S32(long value, long lo, long hi) {
long range = hi - lo;
@@ -642,5 +576,10 @@ namespace snd {
return value;
}
extern "C" const f32 scSoundZeroF = 0.0f;
extern "C" const f32 scSoundTwoF = 2.0f;
extern "C" const f32 scSoundOneF = 1.0f;
extern "C" const f32 scSoundThirtyF = 30.0f;
extern "C" const f32 scSoundSixtyF = 60.0f;
} // namespace snd
} // namespace ipl

View File

@@ -1,3 +1,4 @@
#define IPL_KEYBOARD_MEMO_GET_SAVE_DATA
#define IPL_SOUND_RECT_OUT_OF_LINE
#include "system/iplKeyboard.h"
@@ -218,9 +219,7 @@ namespace ipl {
u8* usedSystemDict = System::getZiDicData(i);
u8* usedOemDict = System::getZiDicData(oemIndex);
if (usedSystemDict == NULL) {
usedSystemDict = systemDict;
}
usedSystemDict = usedSystemDict != NULL ? usedSystemDict : systemDict;
if (usedOemDict == NULL) {
usedOemDict = oemDict;
}
@@ -745,3 +744,7 @@ namespace ipl {
}
} // namespace keyboard
} // namespace ipl
textinput::extend::savedata::MemoSetting textinput::extend::memo::Manager::getSaveData() {
return mMemoSetting;
}

View File

@@ -150,7 +150,7 @@ namespace ipl {
myWork->sdWriteProtected = FALSE;
myWork->prevAsyncResult = RESULT_WORKING;
unk_0x04 = false;
mbCancel = false;
OSResumeThread(&myWork->thread);
}
@@ -1235,7 +1235,7 @@ namespace ipl {
int result;
OSReport("NandSDWorker: cleaning partial nand app...\n");
for (int i = 0; i < titleIdCount; i++) {
if (unk_0x04 != false) {
if (mbCancel != false) {
return RESULT_UNK_18;
}
@@ -4877,7 +4877,7 @@ namespace ipl {
strncat(fmtStr, fileName, NAND_MAX_PATH);
while (faErr == FA_ERR_SUCCESS) {
if (unk_0x04 != false) {
if (mbCancel != false) {
return RESULT_UNK_18;
}

View File

@@ -1015,51 +1015,28 @@ namespace ipl {
return -1;
}
asm int Manager::isEqualChannel(register ESTitleId titleId0, register ESTitleId titleId1) {
nofralloc
xor r3, r6, r8
xor r0, r5, r7
or. r0, r3, r0
bne isEqualChannel_L1
li r3, -2
blr
isEqualChannel_L1:
li r3, -0x100
li r0, -1
and r9, r6, r3
and r3, r8, r3
and r4, r5, r0
and r0, r7, r0
xor r3, r9, r3
xor r0, r4, r0
or. r0, r3, r0
bne isEqualChannel_L4
clrlwi r3, r6, 0x18
xori r0, r3, 0x41
cmpwi r0, 0
beq isEqualChannel_L2
clrlwi r0, r8, 0x18
xori r0, r0, 0x41
cmpwi r0, 0
bne isEqualChannel_L2
li r3, 0
blr
isEqualChannel_L2:
xori r0, r3, 0x41
cmpwi r0, 0
bne isEqualChannel_L3
clrlwi r0, r8, 0x18
xori r0, r0, 0x41
cmpwi r0, 0
beq isEqualChannel_L3
li r3, 1
blr
isEqualChannel_L3:
li r3, -1
blr
isEqualChannel_L4:
li r3, -1
blr
int Manager::isEqualChannel(ESTitleId titleId0, ESTitleId titleId1) {
if (titleId0 == titleId1) {
return -2;
}
if (TITLE_NO_REGION(titleId0) == TITLE_NO_REGION(titleId1)) {
if (TITLE_REGION(titleId0) != TITLE_REGION_ALL) {
if (TITLE_REGION(titleId1) == TITLE_REGION_ALL) {
return 0;
}
}
if (TITLE_REGION(titleId0) == TITLE_REGION_ALL) {
if (TITLE_REGION(titleId1) != TITLE_REGION_ALL) {
return 1;
}
}
return -1;
}
return -1;
}
int Manager::isDefaultChannel(ESTitleId32 titleType, ESTitleId32 titleCode) {

View File

@@ -196,45 +196,12 @@ namespace ipl {
smArg.mbFontResLoaded = true;
}
#ifdef __MWERKS__
asm void System::constructSND_(register void* work) {
nofralloc
stwu r1, -0x10(r1)
mflr r0
li r4, 0x20
stw r0, 0x14(r1)
stw r31, 0xc(r1)
lis r31, smArg__Q23ipl6System@ha
addi r31, r31, smArg__Q23ipl6System@l
stw r30, 0x8(r1)
lwz r3, 0x14(r31)
lwz r5, 0xf4(r31)
lwz r12, 0(r3)
lwz r30, 0xa0(r5)
lwz r12, 0x24(r12)
mtctr r12
bctrl
lwz r5, 0x14(r31)
lis r7, sSystem__Q23ipl3snd@ha
mr r6, r3
mr r4, r30
addi r3, r7, sSystem__Q23ipl3snd@l
bl initOnMemory__Q33ipl3snd6SystemFPCvPQ23EGG4HeapUl
li r0, 1
stb r0, 0x2b7(r31)
lwz r0, 0x14(r1)
lwz r31, 0xc(r1)
lwz r30, 0x8(r1)
mtlr r0
addi r1, r1, 0x10
blr
}
#else
void System::constructSND_(void* work) {
snd::getSystem()->initOnMemory(smArg.mResources.file[Arg::SOUND]->getBuffer(), getSoundHeap(), getSoundHeap()->getAllocatableSize(32));
const void* buffer = smArg.mResources.file[Arg::SOUND]->getBuffer();
u32 size = getSoundHeap()->getAllocatableSize(32);
snd::getSystem()->initOnMemory(buffer, getSoundHeap(), size);
smArg.mbSndResLoaded = true;
}
#endif
void* System::loadZiDIC_(void* arcData, const char* fileName) {
void* buffer = NULL;

View File

@@ -10,7 +10,7 @@ from pathlib import Path
EXPECTED_DOL_SHA1 = "26116613f624061ba99c8d1a299aaa6efa85670d"
EXPECTED_TOTAL_UNITS = 1027
EXPECTED_TOTAL_CODE = 2995188
EXPECTED_TOTAL_CODE = 2995176
EXPECTED_TOTAL_DATA = 1832684
EXPECTED_TOTAL_FUNCTIONS = 12563
INTEGER_PATTERN = re.compile(r"-?(0|[1-9][0-9]*)\Z")

View File

@@ -0,0 +1,122 @@
# Data lane d1
Base eecf16f0, fetched origin before inspection. Owned sources agree with origin/main. Initial full quick gate PASS, SHA1 26116613f624061ba99c8d1a299aaa6efa85670d, zero regressions.
| Unit | Initial matched data / total | Initial exact functions | Initial matched code |
|---|---|---|---|
| OSUtf | 0 / 48704 | 4 / 4 | 568 / 568 |
| iplKeyboard | 8 / 1184 | 30 / 32 | 4680 / 6024 |
| iplController | 80 / 696 | 84 / 84 | 5708 / 5708 |
| d_nhttp | 16 / 720 | 22 / 22 | 3180 / 3180 |
All four pool_diff checks identical. Inspected both ELF symbol tables, all owned non-text section bytes, and relocation records with pyelftools.
## OSUtf
The 93 typed u16 lookup pages exactly match. The only 372 differing bytes are the 93 non-null pointers in UcsSjisTable. Original extraction retained absolute DOL addresses without relocation records because symbols.txt marks the pointer table noreloc. Built C table has 93 R_PPC_ADDR32 relocations to the correct UcsXX pages. First original values at offsets 0xba40, 0xba4c, 0xba50 are 0x81674228, 0x81674428, 0x81674628, precisely Ucs00, Ucs03, Ucs04 in symbols.txt. Remove noreloc only from the pointer table and describe data:4byte. Keep the u16 pages noreloc. No symbol address, size, section boundary, source object, or total byte count changes. Regenerated extraction now reports .data 100%, matched_data 48704/48704.
## iplController
All 616 original .data bytes and all 133 relocation records match built prefix exactly. All other sections match. Built .data is 752 bytes: Base vtable is 140 bytes instead of original extraction's 144, followed by a 140-byte weak Interface vtable at 0x264. Original trailing four bytes are zero without relocations, not a virtual slot. Existing original vtables and member-pointer objects have identical typed source and relocations. Extra weak abstract-base vtable is linker discarded in the already Matching unit, and current DOL hash proves linked data. No dummy padding, forced placement, or removing real virtual functions is justified.
## d_nhttp
Built .data 701 bytes is identical to original 704-byte prefix; last three extraction bytes are zero linker alignment. Built .sdata 6 bytes is identical to original 8-byte prefix; last two bytes zero alignment, and this section already scores 100%. The only relocation is __NHTTPVersion to first version string at offset zero on both sides. .sbss 8 bytes exact. No missing table or object. Changing array counts or adding padding would violate task policy. Already Matching DOL proves these linked bytes.
## iplKeyboard
Built .data 1161 bytes is byte-identical to original 1168-byte prefix. Last seven extraction bytes are zero alignment. Built .sdata 6 bytes is identical to original 8-byte prefix, with two zero alignment bytes. .sdata2 exact. All 85 .data relocation offsets and target names match; twelve create switch-table addends differ by exactly four bytes because create has 317 versus 318 instructions. Other data discrepancy is coarse original string symbols versus individual compiler literals. Do not shrink symbols or alter ownership to hide that. Investigate create source variations for switch-table instruction addresses.
Clean full four-unit gate PASS after OSUtf metadata correction; zero regressions, exact counts 4/30/84/22 unchanged, global matched data 93.05085 -> 95.70837. DOL hash correct.
Keyboard create attempt 1: separate ArcResourceLink declaration/assignment and omit value-initialization parentheses. Output unchanged, 317/318 instructions, objdiff 94.18239%. Reverted.
Keyboard create attempt 2: obtain the archive buffer directly at ArcResourceLink::Set instead of extending its lifetime across allocation. 317/318 instructions, 93.03459% objdiff, exact counts unchanged. Reverted.
Keyboard create attempt 3: separate allocator declaration/assignment and declare OEM dictionary before system dictionary. 317/318 instructions, 94.22956% objdiff, exact counts unchanged. Changed loop register assignment but did not recover the missing instruction or switch-table addends. Reverted; fuzzy gain alone is not accepted. Remaining create is 94.18239%, with allocation register lifetimes, loop registers, and one-instruction size discrepancy. Three distinct source attempts complete.
Keyboard getSaveData attempt 1: under a macro defined only by iplKeyboard.cpp, declare the existing virtual getter out of line, then implement the real member as `return mMemoSetting`. This emits the real function already present in the original object, without forcing references or changing any vtable slot. ctxdiff 18/18 instructions, diffs 0; exact-name objdiff 100%. Unit exact functions 30 -> 31 and matched code 4680 -> 4752. No new assembly. Other header consumers retain their existing inline definition. Stop iteration on this function because it is exact.
Final upstream check: origin/main advanced to 9eb08c48 while this leaf was running. None of the four owned units or the guarded getter header changed between eecf16f0 and current origin/main. No rebase or cross-worktree operations performed.
Data-lane audit: OSUtf has no unresolved section; all functions exact. Controller has no unresolved function, no byte or relocation difference in original section ranges, and only the linker-discarded weak Interface table beyond them. NHTTP has no unresolved function and only final zero alignment bytes in .data. Keyboard has exactly one open function, create, with three distinct source attempts above; getter is now exact. No additional non-text sections, missing statics, initializer differences, or pointer-table differences were found in these four original objects. Section ownership and symbol sizes remain unchanged throughout.
## Final verification
Clean non-quick four-unit gate PASS. Full build ok; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; regressions 0; forbidden patterns 0; readability warnings 0. Fresh pool_diff checks all identical. Fresh getter ctxdiff 18/18 instructions, diffs 0. Final exact counts OSUtf 4/4, keyboard 31/32, controller 84/84, NHTTP 22/22. Final matched data OSUtf 48704/48704, keyboard 8/1184, controller 80/696, NHTTP 16/720. Final matched code OSUtf 568/568, keyboard 4752/6024, controller 5708/5708, NHTTP 3180/3180. The gate passes but the all-data-100% objective is not met for the latter three units; no claim of completion for those sections. All remaining genuine unmatched functions have three distinct attempts recorded. Final full gate output is /tmp/data-d1.final-gate.txt.
# Round 2, after #730
Fresh leaf HEAD bcb2ac0e equals fetched origin/main at start. Initial quick three-unit gate PASS, DOL SHA1 correct, zero regressions. Keyboard data 8/1184, exact 31/32, code 4752/6024; controller data 80/696, exact 84/84, code 5708/5708; NHTTP data 16/720, exact 22/22, code 3180/3180. All three pool_diff checks identical. Rechecked ELF bytes, nm, objdump symbol tables and relocations. Prior round's byte/relocation findings remain reproducible.
Inspect the installed objdiff 3.4.5 data comparison algorithm to distinguish relocation mismatches from legal linker tail alignment; do not alter comparison settings or tool code to hide mismatches. Investigate source changes and extraction metadata only when supported by byte/relocation evidence.
Round 2 keyboard create attempt 1: replace the second loop's parallel OEM induction variable with the meaningful expression `i + EZTX_LANG_MAX`. Objdiff create 94.50944%, 313/318 instructions, no exact function loss. Compiler strength-reduces both indices into one byte offset and removes five instructions instead of recovering the target's independently maintained OEM index. Not accepted.
Objdiff 3.4.5 diff_data_section compares bytes up to maximum data symbol extent and only uses raw byte match percentage when every original relocation matches. This explains keyboard .data's 25% despite identical bytes: create jump-table relocations fail. The final keyboard data string ends at 1161 on both sides, so those seven section tail bytes do not obstruct .data matching. NHTTP original last coarse blob includes tail alignment and extends to 704 while built last literal ends at 701, so its 99.786476% score is the byte ratio 2*701/(704+701). Controller's extra weak Interface table extends built symbol extent to 752 against original 616. These are specific measured causes, not guessed missing objects. Do not change symbol sizes or suppress the real extra source vtable to fake matching.
Round 2 keyboard create attempt 2: express both OEM indices as `i + EZTX_LANG_MAX`, removing parallel induction variables. 309/318 instructions, create 92.28616%, no exact function loss. Both loops strength-reduce OEM addressing to the system byte offset plus 40, unlike target's separate index addition and shift. Reverted.
Round 2 keyboard create attempt 4, memo_declaration_order: src 0x4f4 base 0x4f8 insns 317/318; create 94.157234%; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 5, memo_copy_initialization: src 0x4b8 base 0x4f8 insns 302/318; create 87.8522%; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 6, dictionary_fallback_order: src 0x4f4 base 0x4f8 insns 317/318; create 93.83648%; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 7, dictionary_ternary_fallback: src 0x4fc base 0x4f8 insns 319/318; create 93.93082%; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 8, oem_load_after_system_fallback: src 0x4f4 base 0x4f8 insns 317/318; create 94.57861%; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 9, signed_counter_unsigned_oem: src 0x4f4 base 0x4f8 insns 317/318; create 94.18239%; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 3: use unsigned loop induction variables for both dictionaries, retaining parallel OEM indices. Output unchanged at 317/318 instructions and 94.18239%; exact functions remain 31. Reverted.
Round 2 controller vtable attempt 1: make the abstract Interface destructor an inline non-pure destructor under a source-only header guard. Abstractness remains enforced by decide and setForceInvalid; this tests whether the pure destructor caused unwanted table emission. All 84 original functions remain 100%, but extra Interface table remains and .data stays 92.03601%. Reverted both source and header; no justification for changing destructor semantics without a match.
Round 2 keyboard create attempt 10, system_ternary_fallback: src 0x4f8 base 0x4f8 insns 318/318; create 94.00944% ; code 4752, data 1176, exact-name functions 31.
Round 2 keyboard create attempt 11, oem_ternary_fallback: src 0x4f8 base 0x4f8 insns 318/318; create 94.00944% ; code 4752, data 1176, exact-name functions 31.
Round 2 keyboard create attempt 12, system_inverted_ternary: src 0x4f4 base 0x4f8 insns 317/318; create 94.35535% ; code 4752, data 8, exact-name functions 31.
Round 2 keyboard create attempt 13, oem_inverted_ternary: src 0x4f4 base 0x4f8 insns 317/318; create 94.35535% ; code 4752, data 8, exact-name functions 31.
Round 2 candidate: retain attempt 10's ordinary system dictionary fallback selection `usedSystemDict != NULL ? usedSystemDict : systemDict`. OEM selection remains unchanged. The resulting create has 318 instructions, and all twelve destination switch-table relocation addends now exactly match the original object. Both .data byte extents are 1161, and every one of the 85 original .data relocation records matches; objdiff .data is 100%, raising matched_data from 8 to 1176 of 1184. No string, symbol, section ownership, source object, or data byte is altered; no padding or assembly is introduced. This is a genuine relocation-data match from a readable conditional expression, even though create remains instruction-nonexact at 94.00944%. Instruction-exact count remains 31/32. Attempts 11 through 13 are not retained. The data-lane task permits improvements with unchanged exact counts; the generic worker count-growth criterion is not met.
Candidate quick three-unit gate PASS, zero regressions, zero forbidden patterns, zero readability warnings, correct DOL SHA1. Keyboard .data 100%; .sdata remains 85.71429%, .sdata2 100%. Controller .data 92.03601%; other data sections 100%. NHTTP .data 99.786476%; .sdata and .sbss 100%. No original extab/extabindex, .bss, or additional small-data sections are present in the owned objects.
Remaining keyboard .sdata contains `arc\0` at offset 0, followed by empty 16-bit wchar string at offset 4. Source literal is 2 bytes, extraction labels it as a 4-byte object including two alignment zeros. All instructions using it still match exactly. Changing L"" to an artificially longer null literal or enlarging its symbol would fabricate storage; neither is accepted. NHTTP and controller residual section differences remain exactly the extraction alignment/weak-vtable findings above. They contain no unmatched functions. All failed experimental source and header changes were restored before the candidate gate.
Attempts 4-9 detail: 4 reverses the two MemoSetting declarations; 5 uses direct initialization for the loaded setting and copied setting; 6 reverses system/OEM fallback statement order; 7 expresses both fallback selections as ternaries; 8 postpones the OEM pointer load until after system fallback selection; 9 moves OEM induction initialization outside the first loop and uses an unsigned system index. Each was independently compiled, measured, and reverted. Attempts 10/12 use respectively non-null/null-first system ternaries; 11/13 use respectively non-null/null-first OEM ternaries. Only 10 is retained. The single remaining unmatched function, keyboard create, has thirteen distinct source-level experiments in this round, in addition to the three original attempts. Controller and NHTTP have zero remaining unmatched original functions.
Final fetch during verification reached f6fd2780; owned three sources do not differ between this branch's base and fetched origin/main. The worktree remains on its assigned leaf branch.
## Round 2 final clean gate
Final non-quick gate over all three units PASS. Full 43U build succeeds and DOL SHA1 is 26116613f624061ba99c8d1a299aaa6efa85670d. Regressions 0; forbidden additions 0; readability warnings 0; all pools identical. Keyboard exact functions 31 -> 31, matched code 4752 -> 4752, matched data 8 -> 1176 of 1184; .data 100%. Controller exact 84 -> 84, code 5708 -> 5708, data 80 -> 80 of 696. NHTTP exact 22 -> 22, code 3180 -> 3180, data 16 -> 16 of 720. No instruction-exact function count dropped. Fresh relocation comparison confirms every original keyboard .data relocation matches. Final gate output /tmp/data-d1-r2.final-gate.txt.
Incomplete data sections: keyboard .sdata 85.71429% from extracted empty-string extent; controller .data 92.03601% from linker-discarded weak Interface vtable and unit-boundary alignment; NHTTP .data 99.786476% from last extraction blob covering three tail alignment zeros. No symbol size or section boundary has been changed to improve the score. The all-data-100% goal remains incomplete. Remaining function create is 94.00944%, 318/318 instructions with 210 instruction differences; register allocation, dictionary-loop instruction scheduling, and MemoSetting temporary stack placement still differ. Every remaining function has at least three distinct logged attempts; all thirteen are retained as evidence, with only the data-exact candidate in the source diff.
# Round 3, after #739
Base 775167f4 fetched origin/main before starting. Initial quick gate PASS, DOL SHA1 correct, instruction-exact functions controller 84/84, NHTTP 22/22, keyboard 31/32. Matched data respectively 80/696, 16/720, 1176/1184; matched code respectively 5708/5708, 3180/3180, 4752/6024. All string pools identical. The human explicitly authorizes proven symbol extent corrections that exclude alignment or neighbour bytes while keeping addresses and section totals unchanged. This supersedes earlier rounds' interpretation that every extent correction was forbidden.
Controller proof: lbl_816346A8 -> kDownMember__Q23ipl10controller, same address 0x816346A8 and size 12; Master::down relocations at .text+0xcb6/+0xcc2 load it, and member-pointer words {0,0x14,0} encode Interface::down's vtable offset, byte-identical to the typed source member pointer.
Controller proof: lbl_816346B4 -> kDownTrgMember__Q23ipl10controller, same address 0x816346B4 and size 12; Master::downTrg relocations at .text+0xcf6/+0xd02 load it, and words {0,0x18,0} encode Interface::downTrg, matching the source member pointer.
Controller proof: lbl_816346C0 -> kUpTrgMember__Q23ipl10controller, same address 0x816346C0 and size 12; Master::upTrg relocations at .text+0xd36/+0xd42 load it, and words {0,0x1c,0} encode Interface::upTrg, matching the source member pointer.
Controller proof: lbl_816346CC -> kRepeatMember__Q23ipl10controller, same address 0x816346CC and size 12; Master::repeat relocations at .text+0xd7e/+0xd8a load it, and words {0,0x30,0} encode Interface::repeat, matching the source member pointer.
Controller extent proof: __vt__Q33ipl10controller4Base at unchanged 0x81634880 is 0x8c, not 0x90: the real class has two header words plus 33 virtual entries, with 33 target relocations from +0x08 through final Base::read at +0x88; the compiler emits exactly 140 bytes, and the final unrelocated zero word at +0x8c is alignment before neighbour FreeStyle at 0x81634910. Leave that word unowned, keep .data section size 616 and all addresses unchanged. Extra emitted weak Interface table is ignored, not suppressed.
Controller measurement after proven four renames and Base extent correction: every non-text section 100%, matched_data 696/696. No source or section boundary change.
NHTTP extent proof: lbl_8166D328 stays at 0x8166D328 and spans the real emitted diagnostic string pool from compiler literal @1000 at unit .data+0xb8 through @1126 at +0x29c, a char[33] holding NHTTPDisableVerifyOptionForDebug and its final NUL at +0x2bc; its real pool extent is 0x205, not 0x208. Both objects agree on all 517 bytes in that span and every literal's internal offset; the three bytes +0x2bd..+0x2bf are unreferenced trailing alignment. NHTTPAddHeaderField's .text+0x452/+0x45a relocations reference the pool start; the source's last function references the final ordinary literal. Leave those three alignment bytes unowned, with .data size still 704 and all addresses unchanged. No symbol rename is needed because .data has no relocations and its byte comparison then spans the same emitted pool extent.
NHTTP measurement after proven string-pool extent correction: .data, .sdata, .sbss all 100%, matched_data 720/720; all 22 original functions remain exact in objdiff.
Keyboard extent proof: lbl_816961FC stays at 0x816961FC, with size 2 instead of 4: start's .text+0xf84 and +0xfe4 SDA relocations load the same ordinary empty wchar_t literal for setWCString and setTitleText; wchar_t[1] is 2 bytes in the target ABI, the compiled symbol @17447 is size 2 at identical .sdata+4 with bytes 0000, and the following two zero bytes are section alignment. Leave them unowned; .sdata stays 8 bytes and the entire unit stays 1184 data bytes. The other .sdata object, "arc", already has matching address and four-byte extent; do not rename it or any unrelated compiler literal.
Keyboard measurement after the proven empty-wide-string extent correction: .data, .sdata and .sdata2 all 100%, matched_data 1184/1184; exact-name functions remain 31/32. Controller and NHTTP also retain every non-text section at 100%. All seven metadata edits are backed by the one-line proofs above. No source files, build configuration, split boundaries, addresses, section totals, bytes, or weak-table emission are changed. Remaining keyboard create is code work and is outside this completed data-only lane; prior rounds logged thirteen distinct attempts without reducing its exact function count.
## Round 3 final verification
Clean non-quick gate over controller, NHTTP and keyboard PASS. Full 43U build passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. Regressions 0, forbidden patterns 0, readability warnings 0, all pools identical. Controller data 80 -> 696/696, instruction-exact 84 -> 84, matched code 5708 -> 5708. NHTTP data 16 -> 720/720, instruction-exact 22 -> 22, matched code 3180 -> 3180. Keyboard data 1176 -> 1184/1184, instruction-exact 31 -> 31, matched code 4752 -> 4752. Fresh report asserts every owned non-text section is 100%, matched_data equals unchanged total_data, and original section sizes are unchanged. Data-lane goal achieved. Remaining keyboard create stays 94.00944%; its instruction differences are outside data scope and its prior thirteen attempts are logged. No new source experiment is needed for this metadata-only lane. Final full gate output /tmp/data-d1-r3.final-gate.txt, final report /tmp/data-d1-r3.final-report.json.

View File

@@ -0,0 +1,253 @@
# data-d10 rework
The prior candidate was rejected for edits outside assigned ownership. This replacement starts from origin/main and resolves symbols by section plus absolute address within splits.txt ranges, never by generated name alone.
## RFL_MiddleDatabase
POOL IDENTICAL up to 0 (mine=0 base=0)
Ownership: extab 0x81330bc0-0x81330c10, extabindex 0x81331b30-0x81331ba8
- extab:0x81330bc0 @2294 -> @2302; 8 bytes unchanged; index relocation identifies updateHDBcallback_, paired length 488, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b30 @2295 -> @2303; 12 bytes unchanged; index relocation identifies updateHDBcallback_, paired length 488, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330bc8 @2312 -> @2320; 8 bytes unchanged; index relocation identifies loadHiddenDataSync_, paired length 372, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b3c @2313 -> @2321; 12 bytes unchanged; index relocation identifies loadHiddenDataSync_, paired length 372, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330bd0 @2327 -> @2335; 8 bytes unchanged; index relocation identifies updateHiddenOld_, paired length 340, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b48 @2328 -> @2336; 12 bytes unchanged; index relocation identifies updateHiddenOld_, paired length 340, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330bd8 @2347 -> @2355; 8 bytes unchanged; index relocation identifies loadHiddenRandomSync_, paired length 316, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b54 @2348 -> @2356; 12 bytes unchanged; index relocation identifies loadHiddenRandomSync_, paired length 316, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330be0 @2373 -> @2381; 8 bytes unchanged; index relocation identifies updateHDBRandcallback_, paired length 404, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b60 @2374 -> @2382; 12 bytes unchanged; index relocation identifies updateHDBRandcallback_, paired length 404, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330be8 @2434 -> @2442; 8 bytes unchanged; index relocation identifies updateHiddenRandom_, paired length 732, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b6c @2435 -> @2443; 12 bytes unchanged; index relocation identifies updateHiddenRandom_, paired length 732, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330bf0 @2447 -> @2455; 8 bytes unchanged; index relocation identifies updateRandom_, paired length 248, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b78 @2448 -> @2456; 12 bytes unchanged; index relocation identifies updateRandom_, paired length 248, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330bf8 @2464 -> @2472; 8 bytes unchanged; index relocation identifies RFLUpdateMiddleDBAsync, paired length 92, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b84 @2465 -> @2473; 12 bytes unchanged; index relocation identifies RFLUpdateMiddleDBAsync, paired length 92, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330c00 @2482 -> @2490; 8 bytes unchanged; index relocation identifies RFLiUpdateMiddleDBAsync, paired length 312, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b90 @2483 -> @2491; 12 bytes unchanged; index relocation identifies RFLiUpdateMiddleDBAsync, paired length 312, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
- extab:0x81330c08 @2497 -> @2505; 8 bytes unchanged; index relocation identifies RFLiGetCharInfoMiddleDB, paired length 156, unwind bytes identical; owned range 0x81330bc0-0x81330c10.
- extabindex:0x81331b9c @2498 -> @2506; 12 bytes unchanged; index relocation identifies RFLiGetCharInfoMiddleDB, paired length 156, unwind bytes identical; owned range 0x81331b30-0x81331ba8.
## RFL_MakeTex
POOL IDENTICAL up to 0 (mine=0 base=0)
Ownership: extab 0x813309c0-0x81330a00, extabindex 0x81331830-0x81331890, .rodata 0x8161d358-0x8161d418, .sdata2 0x816950b0-0x81695170
- extab:0x813309c0 @2834 -> @2842; 8 bytes unchanged; index relocation identifies RFLiSetupCopyTex, paired length 304, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x81331830 @2835 -> @2843; 12 bytes unchanged; index relocation identifies RFLiSetupCopyTex, paired length 304, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309c8 @3102 -> @3110; 8 bytes unchanged; index relocation identifies RFLiMakeTexture, paired length 4232, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x8133183c @3103 -> @3111; 12 bytes unchanged; index relocation identifies RFLiMakeTexture, paired length 4232, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309d0 @3139 -> @3147; 8 bytes unchanged; index relocation identifies RFLiSetup2DCameraAndParam, paired length 472, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x81331848 @3140 -> @3148; 12 bytes unchanged; index relocation identifies RFLiSetup2DCameraAndParam, paired length 472, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309d8 @3153 -> @3161; 8 bytes unchanged; index relocation identifies RFLiSetTev4Mouth, paired length 584, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x81331854 @3154 -> @3162; 12 bytes unchanged; index relocation identifies RFLiSetTev4Mouth, paired length 584, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309e0 @3179 -> @3187; 8 bytes unchanged; index relocation identifies RFLiSetTev4Eye, paired length 688, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x81331860 @3180 -> @3188; 12 bytes unchanged; index relocation identifies RFLiSetTev4Eye, paired length 688, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309e8 @3227 -> @3235; 8 bytes unchanged; index relocation identifies RFLiSetFaceParts, paired length 1288, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x8133186c @3228 -> @3236; 12 bytes unchanged; index relocation identifies RFLiSetFaceParts, paired length 1288, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309f0 @3251 -> @3259; 8 bytes unchanged; index relocation identifies RFLiCapture, paired length 2156, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x81331878 @3252 -> @3260; 12 bytes unchanged; index relocation identifies RFLiCapture, paired length 2156, unwind bytes identical; owned range 0x81331830-0x81331890.
- extab:0x813309f8 @3267 -> @3275; 8 bytes unchanged; index relocation identifies RFLiDrawQuad, paired length 504, unwind bytes identical; owned range 0x813309c0-0x81330a00.
- extabindex:0x81331884 @3268 -> @3276; 12 bytes unchanged; index relocation identifies RFLiDrawQuad, paired length 504, unwind bytes identical; owned range 0x81331830-0x81331890.
## RFL_DataUtility
POOL IDENTICAL up to 0 (mine=0 base=0)
Ownership: extab 0x81330c30-0x81330c58, extabindex 0x81331bd8-0x81331c14, .rodata 0x8161e070-0x8161e080
- extab:0x81330c30 @2175 -> @2183; 8 bytes unchanged; index relocation identifies RFLiCheckValidInfo, paired length 1124, unwind bytes identical; owned range 0x81330c30-0x81330c58.
- extabindex:0x81331bd8 @2176 -> @2184; 12 bytes unchanged; index relocation identifies RFLiCheckValidInfo, paired length 1124, unwind bytes identical; owned range 0x81331bd8-0x81331c14.
- extab:0x81330c38 @2237 -> @2245; 8 bytes unchanged; index relocation identifies RFLiIsValidOnNAND, paired length 44, unwind bytes identical; owned range 0x81330c30-0x81330c58.
- extabindex:0x81331be4 @2238 -> @2246; 12 bytes unchanged; index relocation identifies RFLiIsValidOnNAND, paired length 44, unwind bytes identical; owned range 0x81331bd8-0x81331c14.
- extab:0x81330c40 @2281 -> @2289; 8 bytes unchanged; index relocation identifies RFLiPickupCharInfo, paired length 320, unwind bytes identical; owned range 0x81330c30-0x81330c58.
- extabindex:0x81331bf0 @2282 -> @2290; 12 bytes unchanged; index relocation identifies RFLiPickupCharInfo, paired length 320, unwind bytes identical; owned range 0x81331bd8-0x81331c14.
- extab:0x81330c48 @2298 -> @2306; 8 bytes unchanged; index relocation identifies copyChar2Additional_, paired length 400, unwind bytes identical; owned range 0x81330c30-0x81330c58.
- extabindex:0x81331bfc @2299 -> @2307; 12 bytes unchanged; index relocation identifies copyChar2Additional_, paired length 400, unwind bytes identical; owned range 0x81331bd8-0x81331c14.
- extab:0x81330c50 @2304 -> @2312; 8 bytes unchanged; index relocation identifies RFLGetAdditionalInfo, paired length 84, unwind bytes identical; owned range 0x81330c30-0x81330c58.
- extabindex:0x81331c08 @2305 -> @2313; 12 bytes unchanged; index relocation identifies RFLGetAdditionalInfo, paired length 84, unwind bytes identical; owned range 0x81331bd8-0x81331c14.
## RFL_NWC24
POOL IDENTICAL up to 15 (mine=15 base=15)
Ownership: extab 0x81330c58-0x81330c78, extabindex 0x81331c14-0x81331c44, .data 0x8166f0f0-0x8166f2c8
- extab:0x81330c58 @1981 -> @1986; 8 bytes unchanged; index relocation identifies RFLiNWC24Msg2CharData, paired length 120, unwind bytes identical; owned range 0x81330c58-0x81330c78.
- extabindex:0x81331c14 @1982 -> @1987; 12 bytes unchanged; index relocation identifies RFLiNWC24Msg2CharData, paired length 120, unwind bytes identical; owned range 0x81331c14-0x81331c44.
- extab:0x81330c60 @1990 -> @1995; 8 bytes unchanged; index relocation identifies RFLiSetOfficial2NWC24Msg, paired length 216, unwind bytes identical; owned range 0x81330c58-0x81330c78.
- extabindex:0x81331c20 @1991 -> @1996; 12 bytes unchanged; index relocation identifies RFLiSetOfficial2NWC24Msg, paired length 216, unwind bytes identical; owned range 0x81331c14-0x81331c44.
- extab:0x81330c68 @2044 -> @2049; 8 bytes unchanged; index relocation identifies RFLiNWC24Msg2HiddenAsync, paired length 392, unwind bytes identical; owned range 0x81330c58-0x81330c78.
- extabindex:0x81331c2c @2045 -> @2050; 12 bytes unchanged; index relocation identifies RFLiNWC24Msg2HiddenAsync, paired length 392, unwind bytes identical; owned range 0x81331c14-0x81331c44.
- extab:0x81330c70 @2129 -> @2134; 8 bytes unchanged; index relocation identifies makeNWC24MsgforExchange_, paired length 2256, unwind bytes identical; owned range 0x81330c58-0x81330c78.
- extabindex:0x81331c38 @2130 -> @2135; 12 bytes unchanged; index relocation identifies makeNWC24MsgforExchange_, paired length 2256, unwind bytes identical; owned range 0x81331c14-0x81331c44.
Ownership audit: 54 name-only changes; every changed absolute address is inside exactly one assigned unit range. Addresses, extents, attributes and section totals unchanged. RFL_Model, RFL_Database, RFL_HiddenDatabase and RFL_NANDLoader have no configuration edits.
## Baseline gate
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLFaceLib/src/RFL_MiddleDatabase] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_MiddleDatabase] objdiff: code 3648/3648 data 80/200 functions 13/13 fuzzy 100.0000 linked code 3648
[libs/RVLFaceLib/src/RFL_MiddleDatabase] instruction-exact functions: 13/13
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section .text size 3648 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section extab size 80 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section extabindex size 120 match 95.5
[libs/RVLFaceLib/src/RFL_MiddleDatabase] baseline: code 3648/3648 data 80 functions 13 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_MakeTex] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_MakeTex] objdiff: code 10396/10396 data 448/544 functions 10/10 fuzzy 100.0000 linked code 10396
[libs/RVLFaceLib/src/RFL_MakeTex] instruction-exact functions: 10/10
[libs/RVLFaceLib/src/RFL_MakeTex] section .rodata size 192 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section .sdata2 size 192 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section .text size 10396 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section extab size 64 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section extabindex size 96 match 86.25
[libs/RVLFaceLib/src/RFL_MakeTex] baseline: code 10396/10396 data 448 functions 10 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_DataUtility] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_DataUtility] objdiff: code 2244/2244 data 56/116 functions 6/6 fuzzy 100.0000 linked code 2244
[libs/RVLFaceLib/src/RFL_DataUtility] instruction-exact functions: 6/6
[libs/RVLFaceLib/src/RFL_DataUtility] section .rodata size 16 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] section .text size 2244 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] section extab size 40 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] section extabindex size 60 match 86.0
[libs/RVLFaceLib/src/RFL_DataUtility] baseline: code 2244/2244 data 56 functions 6 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_NWC24] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_NWC24] objdiff: code 2992/2992 data 504/552 functions 5/5 fuzzy 100.0000 linked code 2992
[libs/RVLFaceLib/src/RFL_NWC24] instruction-exact functions: 5/5
[libs/RVLFaceLib/src/RFL_NWC24] section .data size 472 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section .text size 2992 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section extab size 32 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section extabindex size 48 match 92.5
[libs/RVLFaceLib/src/RFL_NWC24] baseline: code 2992/2992 data 504 functions 5 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_Model] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_Model] objdiff: code 7788/7788 data 552/552 functions 15/15 fuzzy 100.0000 linked code 7788
[libs/RVLFaceLib/src/RFL_Model] instruction-exact functions: 15/15
[libs/RVLFaceLib/src/RFL_Model] section .data size 16 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .rodata size 272 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .sdata2 size 64 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .text size 7788 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section extab size 80 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section extabindex size 120 match 100.0
[libs/RVLFaceLib/src/RFL_Model] baseline: code 7788/7788 data 552 functions 15 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_Database] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_Database] objdiff: code 7508/7508 data 688/688 functions 39/39 fuzzy 100.0000 linked code 7508
[libs/RVLFaceLib/src/RFL_Database] instruction-exact functions: 38/39
[libs/RVLFaceLib/src/RFL_Database] section .sdata2 size 8 match 100.0
[libs/RVLFaceLib/src/RFL_Database] section .text size 7508 match 100.0
[libs/RVLFaceLib/src/RFL_Database] section extab size 272 match 100.0
[libs/RVLFaceLib/src/RFL_Database] section extabindex size 408 match 100.0
[libs/RVLFaceLib/src/RFL_Database] baseline: code 7508/7508 data 688 functions 39 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 88.57407 -> 88.57407
global fuzzy_match_percent: 99.45531 -> 99.45531
global complete_code_percent: 63.07103 -> 63.07103
global matched_data_percent: 97.78074 -> 97.78074
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
Independent address audit passed on the actual git diff. The RFL_Model range beginning 0x81330970 and all neighboring unowned ranges retain origin/main names exactly. MakeTex was checked before edits and still had 448/544 matched data, so its eight unwind entries required pairing.
## Fresh report and instruction audit
All 1023 unowned units have identical measures, function results and section results before/after, including Model, Database, HiddenDatabase and NANDLoader. All owned sections are 100%.
- RFL_MiddleDatabase updateHDBcallback_: src 0x1e8 base 0x1e8 insns 122/122; diffs 0: []
- RFL_MiddleDatabase loadHiddenDataSync_: src 0x174 base 0x174 insns 93/93; diffs 0: []
- RFL_MiddleDatabase updateHiddenOld_: src 0x154 base 0x154 insns 85/85; diffs 0: []
- RFL_MiddleDatabase loadHiddenRandomSync_: src 0x13c base 0x13c insns 79/79; diffs 0: []
- RFL_MiddleDatabase updateHDBRandcallback_: src 0x194 base 0x194 insns 101/101; diffs 0: []
- RFL_MiddleDatabase updateHiddenRandom_: src 0x2dc base 0x2dc insns 183/183; diffs 0: []
- RFL_MiddleDatabase updateRandom_: src 0xf8 base 0xf8 insns 62/62; diffs 0: []
- RFL_MiddleDatabase RFLGetMiddleDBBufferSize: src 0x8 base 0x8 insns 2/2; diffs 0: []
- RFL_MiddleDatabase RFLInitMiddleDB: src 0xac base 0xac insns 43/43; diffs 0: []
- RFL_MiddleDatabase RFLUpdateMiddleDBAsync: src 0x5c base 0x5c insns 23/23; diffs 0: []
- RFL_MiddleDatabase RFLiUpdateMiddleDBAsync: src 0x138 base 0x138 insns 78/78; diffs 0: []
- RFL_MiddleDatabase RFLGetMiddleDBStoredSize: src 0x8 base 0x8 insns 2/2; diffs 0: []
- RFL_MiddleDatabase RFLiGetCharInfoMiddleDB: src 0x9c base 0x9c insns 39/39; diffs 0: []
libs/RVLFaceLib/src/RFL_MiddleDatabase: data 80 -> 200/200; instruction-exact 13 -> 13; code 3648 -> 3648/3648.
- RFL_MakeTex RFLiSetupCopyTex: src 0x130 base 0x130 insns 76/76; diffs 0: []
- RFL_MakeTex RFLiMakeTexture: src 0x1088 base 0x1088 insns 1058/1058; diffs 0: []
- RFL_MakeTex RFLiSetup2DCameraAndParam: src 0x1d8 base 0x1d8 insns 118/118; diffs 0: []
- RFL_MakeTex RFLiSetTev4Mouth: src 0x248 base 0x248 insns 146/146; diffs 0: []
- RFL_MakeTex RFLiSetTev4Eye: src 0x2b0 base 0x2b0 insns 172/172; diffs 0: []
- RFL_MakeTex RFLiSetFaceParts: src 0x508 base 0x508 insns 322/322; diffs 0: []
- RFL_MakeTex RFLiCapture: src 0x86c base 0x86c insns 539/539; diffs 0: []
- RFL_MakeTex RFLiDrawQuad: src 0x1f8 base 0x1f8 insns 126/126; diffs 0: []
- RFL_MakeTex RFLiGetMaxMaskRsl: src 0x68 base 0x68 insns 26/26; diffs 0: []
- RFL_MakeTex RFLiGetMaskBufSize: src 0x40 base 0x40 insns 16/16; diffs 0: []
libs/RVLFaceLib/src/RFL_MakeTex: data 448 -> 544/544; instruction-exact 10 -> 10; code 10396 -> 10396/10396.
- RFL_DataUtility copyChar2Additional_: src 0x190 base 0x190 insns 100/100; diffs 0: []
- RFL_DataUtility RFLiCheckValidInfo: src 0x464 base 0x464 insns 281/281; diffs 0: []
- RFL_DataUtility RFLiIsValidOnNAND: src 0x2c base 0x2c insns 11/11; diffs 0: []
- RFL_DataUtility RFLiIsSameFaceCore: src 0x110 base 0x110 insns 68/68; diffs 0: []
- RFL_DataUtility RFLiPickupCharInfo: src 0x140 base 0x140 insns 80/80; diffs 0: []
- RFL_DataUtility RFLGetAdditionalInfo: src 0x54 base 0x54 insns 21/21; diffs 0: []
libs/RVLFaceLib/src/RFL_DataUtility: data 56 -> 116/116; instruction-exact 6 -> 6; code 2244 -> 2244/2244.
- RFL_NWC24 RFLiNWC24Msg2CharData: src 0x78 base 0x78 insns 30/30; diffs 0: []
- RFL_NWC24 RFLiSetOfficial2NWC24Msg: src 0xd8 base 0xd8 insns 54/54; diffs 0: []
- RFL_NWC24 RFLiNWC24Msg2HiddenAsync: src 0x188 base 0x188 insns 98/98; diffs 0: []
- RFL_NWC24 makeNWC24MsgforExchange_: src 0x8d0 base 0x8d0 insns 564/564; diffs 0: []
- RFL_NWC24 RFLiMakeNWC24MsgforExchange: src 0x8 base 0x8 insns 2/2; diffs 0: []
libs/RVLFaceLib/src/RFL_NWC24: data 504 -> 552/552; instruction-exact 5 -> 5; code 2992 -> 2992/2992.
Remaining owned target nonmatching functions: none. Uncertain mappings: none.
## Final full gate
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLFaceLib/src/RFL_MiddleDatabase] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_MiddleDatabase] objdiff: code 3648/3648 data 200/200 functions 13/13 fuzzy 100.0000 linked code 3648
[libs/RVLFaceLib/src/RFL_MiddleDatabase] instruction-exact functions: 13/13
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section .text size 3648 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section extab size 80 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section extabindex size 120 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] baseline: code 3648/3648 data 80 functions 13 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_MakeTex] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_MakeTex] objdiff: code 10396/10396 data 544/544 functions 10/10 fuzzy 100.0000 linked code 10396
[libs/RVLFaceLib/src/RFL_MakeTex] instruction-exact functions: 10/10
[libs/RVLFaceLib/src/RFL_MakeTex] section .rodata size 192 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section .sdata2 size 192 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section .text size 10396 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section extab size 64 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section extabindex size 96 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] baseline: code 10396/10396 data 448 functions 10 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_DataUtility] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_DataUtility] objdiff: code 2244/2244 data 116/116 functions 6/6 fuzzy 100.0000 linked code 2244
[libs/RVLFaceLib/src/RFL_DataUtility] instruction-exact functions: 6/6
[libs/RVLFaceLib/src/RFL_DataUtility] section .rodata size 16 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] section .text size 2244 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] section extab size 40 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] section extabindex size 60 match 100.0
[libs/RVLFaceLib/src/RFL_DataUtility] baseline: code 2244/2244 data 56 functions 6 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_NWC24] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_NWC24] objdiff: code 2992/2992 data 552/552 functions 5/5 fuzzy 100.0000 linked code 2992
[libs/RVLFaceLib/src/RFL_NWC24] instruction-exact functions: 5/5
[libs/RVLFaceLib/src/RFL_NWC24] section .data size 472 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section .text size 2992 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section extab size 32 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section extabindex size 48 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] baseline: code 2992/2992 data 504 functions 5 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_Model] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_Model] objdiff: code 7788/7788 data 552/552 functions 15/15 fuzzy 100.0000 linked code 7788
[libs/RVLFaceLib/src/RFL_Model] instruction-exact functions: 15/15
[libs/RVLFaceLib/src/RFL_Model] section .data size 16 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .rodata size 272 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .sdata2 size 64 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .text size 7788 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section extab size 80 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section extabindex size 120 match 100.0
[libs/RVLFaceLib/src/RFL_Model] baseline: code 7788/7788 data 552 functions 15 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_Database] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_Database] objdiff: code 7508/7508 data 688/688 functions 39/39 fuzzy 100.0000 linked code 7508
[libs/RVLFaceLib/src/RFL_Database] instruction-exact functions: 38/39
[libs/RVLFaceLib/src/RFL_Database] section .sdata2 size 8 match 100.0
[libs/RVLFaceLib/src/RFL_Database] section .text size 7508 match 100.0
[libs/RVLFaceLib/src/RFL_Database] section extab size 272 match 100.0
[libs/RVLFaceLib/src/RFL_Database] section extabindex size 408 match 100.0
[libs/RVLFaceLib/src/RFL_Database] baseline: code 7508/7508 data 688 functions 39 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 88.57407 -> 88.57407
global fuzzy_match_percent: 99.45531 -> 99.45531
global complete_code_percent: 63.07103 -> 63.07103
global matched_data_percent: 97.78074 -> 97.79842
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
note: config touched: config/43U/symbols.txt (orchestrator reviews every config/symbols change)
GATE PASS
```

Some files were not shown because too many files have changed in this diff Show More