Compare commits

...

86 Commits

Author SHA1 Message Date
coah
0ab7ff0970 docs(agents): add orchestrator handoff section (tools, state, pickup steps) 2026-10-02 03:44:28 +00: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
github-actions[bot]
f533c9f0f5 docs: update progress [skip ci] 2026-10-01 23:51:36 +00:00
github-actions[bot]
1366528dd6 docs: update progress [skip ci] 2026-10-01 23:50:59 +00:00
coah
bd27e72a48 match(tiPcKeyboard): LayoutByNW4R::updateInput (#670)
Force a u16 temporary for the Korean keymap table load so MWCC emits
clrlwi after lhz (instead of mr).
2026-10-01 18:50:45 -05:00
coah
08c53bbe23 cleanup(AOSS): name crypto and connect helpers (#669)
- AOSS_81401C9C → AOSSInitKeySchedule
- AOSS_81401DC0 → AOSSInitCrc32Table
- AOSS_81401E80 → AOSSXorBufferWithKey
- AOSS_81400830 → AOSSDecryptMessage
- AOSS_81401BBC → AOSSBuildInterfaceOption
- AOSS_814020CC → AOSSConnectAndAwaitHost

DOL sha1 unchanged.
2026-10-01 18:50:19 -05:00
coah
483005a940 link(d_nhttp_private): flip Matching after 100% objdiff (#668)
Unit is instruction-exact (7/7, 1320/1320) with clean C source.
Full 43U build keeps DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d.

Co-authored-by: linker <linker@local>
2026-10-01 18:50:14 -05:00
coah
b18d01602a cleanup(CardSequence): name card-thread helpers (#667)
Rename address-suffixed CardSequence_* helpers to descriptive names
(send/poll/map/clear/refresh/thread/error/state/icon/move).

DOL sha1 unchanged.
2026-10-01 18:49:47 -05:00
coah
e38a4cebfe cleanup(MemoryCardManager): rename qsort comparator (#666)
iplMemoryCardManager_813CD034 → compareMemoryCardSortEntries

DOL sha1 unchanged.
2026-10-01 18:49:40 -05:00
coah
81dc9d2b3d cleanup(pf_code): rename pf_valid_fn_char_8162E6B0 to pf_valid_fn_char (#664)
Drop address suffix so source matches symbols.txt. Clear scope:local so
NonMatching pf_path splits resolve the same global.
2026-10-01 18:49:14 -05:00
coah
f645518810 cleanup(vi3in1): rename Vdac_Flag_Changed_816991E0 to Vdac_Flag_Changed (#663)
Drop address suffix so source matches symbols.txt. Clear scope:local so
NonMatching vi.c splits resolve the same global.
2026-10-01 18:48:47 -05:00
coah
51713e735e cleanup(AOSSLink): name sleep/IP helpers and NCD config BSS (#662)
- AOSS_813FD17C → AOSSi_SleepAlarmHandler
- AOSS_813FD18C → AOSSi_SleepMs
- AOSS_813FD25C → AOSSi_StoreIpv4Octets
- AOSS_810BD4A8 → AOSSi_NcdIfConfig
- AOSS_810BD608 → AOSSi_NcdIpConfig

DOL sha1 unchanged.
2026-10-01 18:48:41 -05:00
coah
ca998ad7cf cleanup(puh_msc): rename uhg_msc_memid_8169971C to uhg_msc_memid (#661)
Drop address suffix on the MSC memory-pool id so source matches
symbols.txt. Mark the symbol global so NonMatching puh_msc_blk
splits resolve the same name.
2026-10-01 18:46:27 -05:00
github-actions[bot]
486c20c623 docs: update progress [skip ci] 2026-10-01 23:46:01 +00:00
coah
6adb0dc52e cleanup(CHANSVm): rename FormatString and LookupScopedObject (#660)
- CHANSVm_8145049C → CHANSVmFormatString
- CHANSVm_81455654 → CHANSVmLookupScopedObject

Unit remains carefully Equivalent; DOL sha1 unchanged.
2026-10-01 18:45:59 -05:00
coah
c9f64372cf cleanup(CHANSVm): rename blob offset/size helpers and MakeU64 (#659)
- CHANSVm_81450D14 → CHANSVmBlobResolveOffset
- CHANSVm_81451314 → CHANSVmBlobGetCount
- CHANSVm_81451348 → CHANSVmBlobHasSpace
- CHANSVm_814540E0 → CHANSVmMakeU64

Unit still Matching; DOL sha1 unchanged.
2026-10-01 18:45:53 -05:00
coah
9f4a70db74 match(pf_fat): PFFAT_GetSectorSpecified (#658)
Rewrite the error cleanup as switch(error) so MWCC emits the
target beq/b/li epilogue instead of a collapsed bne/li.

Unit pf_fat: 30/35 -> 31/35 funcs; 9900 -> 9968 / 12572 code bytes.
DOL sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
2026-10-01 18:45:26 -05:00
coah
e305e6047c cleanup(CHANSVm): name float/int/string convert helpers (#657)
- CHANSVm_8144B1D8 → CHANSVmFloatSign
- CHANSVm_8144B30C → CHANSVmConvertToIntFromFloat
- CHANSVm_8144B430 → CHANSVmConvertToFloatFromUndefined
- CHANSVm_8144B470 → CHANSVmConvertToFloatFromInt
- CHANSVm_8144B4D4 → CHANSVmConvertToFloatFromStr
- CHANSVm_8144B62C → CHANSVmFloatToWString
- CHANSVm_8144B734 → CHANSVmConvertToStrFromFloat

Verified ok + sha1 26116613f624061ba99c8d1a299aaa6efa85670d.
2026-10-01 18:45:19 -05:00
coah
df48bc9f76 Restore SD title switch block emission order (#656) 2026-10-01 18:43:05 -05:00
coah
3bd814f042 cleanup(SDMemory): rename iplSDMemory_813EE358 to containsTitleId (#655)
Helper scans a title-id list for a match; unused SDMemory* param kept.
Verified ok + sha1 26116613f624061ba99c8d1a299aaa6efa85670d.
2026-10-01 18:42:39 -05:00
coah
51b78ed7da cleanup(iplBalloon): name fade/align/margin fields (#654)
Rename TextBalloon unk_ members and ctor/setPos params.

Co-authored-by: coah <coah80@users.noreply.github.com>
2026-10-01 18:40:27 -05:00
coah
3eb5d8faee cleanup(iplAOSSThread): name stack sentinel like RakuStack (#653)
Replace *(u32*)(mpStackBuffer + 0x3FC0) with AOSSStack::sentinel.

Co-authored-by: coah <coah80@users.noreply.github.com>
2026-10-01 18:40:21 -05:00
coah
d99950fc88 cleanup(tiCandidateBox): drop unused sdata2 float decls (#652)
Removed seven bare extern lbl_81694D* decls that were never referenced.
Verified ok + sha1 26116613f624061ba99c8d1a299aaa6efa85670d.
2026-10-01 18:38:09 -05:00
coah
98d03059bd cleanup(iplBoardObject): rename Cos/Sin Ghidra locals (#651)
dVar2 → cosF, dVar3 → sinF in BoardObject::stt_stand.

Co-authored-by: coah <coah80@users.noreply.github.com>
2026-10-01 18:37:42 -05:00
coah
830e2f3920 cleanup(iplSound): name pitch/volume sdata2 float constants (#650)
lbl_816946A8 → scSoundTwoF (2.0f), lbl_816946AC → scSoundOneF (1.0f),
lbl_816946B0 → scSoundThirtyF (30.0f), lbl_816946B4 → scSoundSixtyF (60.0f).
2026-10-01 18:37:35 -05:00
coah
c1b00d8a14 cleanup(Date): drop unused lbl_816948F0 sdata2 decl (#649)
Bare extern was never referenced; scDateZeroF remains.
Verified ok + sha1 26116613f624061ba99c8d1a299aaa6efa85670d.
2026-10-01 18:37:29 -05:00
coah
9acdd7f8dc cleanup(WDScan): name OUI sdata/sdata2 padding bytes (#648)
Rename leftover lbl_* pad bytes that sit between the RSN/WPA OUI
triples (and after scWpaFindOui*) so force_active and locals match
the existing sc* naming.
2026-10-01 18:37:02 -05:00
91 changed files with 2711 additions and 1857 deletions

164
AGENTS.md
View File

@@ -164,9 +164,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 +245,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 +325,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% | 87.96% | 62.33% | 92.07% |
| 99.39% | 88.26% | 62.75% | 92.12% |
units 919/1027 complete, functions 12224/12563 matched.
units 923/1027 complete, functions 12245/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

@@ -29,8 +29,8 @@ force_active:
- strspn
- strcspn
- padding__Q23ipl5scene
- lbl_81695063
- lbl_81695067
- scRsnOuiPad
- scWpaOuiPad
- __vt__Q49textinput6extend4memo19NigaoeEventObserver
# textinput::toolbar::csPaneToAnimation points one past the end of csAninationFile.

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
@@ -3551,12 +3551,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

View File

@@ -27,7 +27,7 @@ BS2Allocator = .bss:0x8108B6E0; // type:object size:0x10 scope:global
BS2StateFlags = .bss:0x8108B6F0; // type:object size:0x20
Block = .bss:0x8108B720; // type:object size:0x30 align:32
PartitionInfoBuf = .bss:0x8108B760; // type:object size:0x800 align:32 data:4byte
lbl_8108BF60 = .bss:0x8108BF60; // type:object size:0x30 data:4byte
CoverBlock = .bss:0x8108BF60; // type:object size:0x30 data:4byte
BS2CacheFileInfo = .bss:0x8108BF90; // type:object size:0x8C
BS2NandBlock = .bss:0x8108C01C; // type:object size:0xBC
PartitionParams = .bss:0x8108C0E0; // type:object size:0x1DE00 scope:local align:32
@@ -37,7 +37,7 @@ GameTOCBuf = .bss:0x810A9F20; // type:object size:0x20 align:32
bi3 = .bss:0x810A9F40; // type:object size:0x2000 align:32 data:4byte
AppLoaderHdr = .bss:0x810ABF40; // type:object size:0x20 align:32 data:4byte
bi2 = .bss:0x810ABF60; // type:object size:0x2000 align:32 data:4byte
lbl_810ADF60 = .bss:0x810ADF60; // type:object size:0x20 align:32 data:4byte
UpdateDiskID = .bss:0x810ADF60; // type:object size:0x20 align:32 data:4byte
TicketViewsBuf = .bss:0x810ADF80; // type:object size:0x3600 scope:local align:32
Flags0 = .bss:0x810B1580; // type:object size:0x800 scope:local
Flags1 = .bss:0x810B1D80; // type:object size:0x800 scope:local
@@ -81,11 +81,11 @@ usbapStack = .bss:0x810BC460; // type:object size:0x1000
usbapMessageQ = .bss:0x810BD460; // type:object size:0x20
usbapNickname = .bss:0x810BD480; // type:object size:0x18
m_allocator__Q23ipl5scene = .bss:0x810BD498; // type:object size:0x10
AOSS_810BD4A8 = .bss:0x810BD4A8; // type:object size:0x160 data:byte
AOSS_810BD608 = .bss:0x810BD608; // type:object size:0x7C8 data:4byte
RakuRakuThread_810BDDD0 = .bss:0x810BDDD0; // type:object size:0x10
RakuRakuThread_810BDDE0 = .bss:0x810BDDE0; // type:object size:0xF4 data:4byte
RakuRakuThread_810BDED4 = .bss:0x810BDED4; // type:object size:0x24
AOSSi_NcdIfConfig = .bss:0x810BD4A8; // type:object size:0x160 data:byte
AOSSi_NcdIpConfig = .bss:0x810BD608; // type:object size:0x7C8 data:4byte
sRakuAllocator = .bss:0x810BDDD0; // type:object size:0x10
sRakuStatus = .bss:0x810BDDE0; // type:object size:0xF4 data:4byte
sRakuMsgQueue = .bss:0x810BDED4; // type:object size:0x24
AOSS_810BDEF8 = .bss:0x810BDEF8; // type:object size:0x20 data:4byte
AOSS_810BDF18 = .bss:0x810BDF18; // type:object size:0x6A0
AOSS_810BE5B8 = .bss:0x810BE5B8; // type:object size:0x280
@@ -4290,7 +4290,7 @@ __dt__Q43ipl5scene10MemoryBase9AnmButtonFv = .text:0x813CCF34; // type:function
__dt__Q43ipl5scene10MemoryBase6ButtonFv = .text:0x813CCF74; // type:function size:0x40
__dt__Q43ipl5scene10MemoryBase3AnmFv = .text:0x813CCFB4; // type:function size:0x40
__dt__Q33ipl5scene15MemoryBaseEventFv = .text:0x813CCFF4; // type:function size:0x40
iplMemoryCardManager_813CD034 = .text:0x813CD034; // type:function size:0x78
compareMemoryCardSortEntries = .text:0x813CD034; // type:function size:0x78
calc__Q33ipl5scene17MemoryCardManagerFv = .text:0x813CD0AC; // type:function size:0x4C
isSlotReady__Q33ipl5scene17MemoryCardManagerFUc = .text:0x813CD0F8; // type:function size:0x44
isSlotNoCard__Q33ipl5scene17MemoryCardManagerFUc = .text:0x813CD13C; // type:function size:0x40
@@ -4399,31 +4399,31 @@ getCardSlotState__Q23ipl10memorycardFv = .text:0x813D2024; // type:function size
getCardLastSrcSlot__Q23ipl10memorycardFv = .text:0x813D202C; // type:function size:0x10
getCardLastSendCmd__Q23ipl10memorycardFv = .text:0x813D203C; // type:function size:0x10
getCardLastCMDFCmdResult__Q23ipl10memorycardFv = .text:0x813D204C; // type:function size:0x10
CardSequence_813D205C = .text:0x813D205C; // type:function size:0x44
sendCardUnmountCmd = .text:0x813D205C; // type:function size:0x44
sendCardFormatCmd__Q23ipl10memorycardFUc = .text:0x813D20A0; // type:function size:0x50
sendCardCopyCmd__Q23ipl10memorycardFUcs = .text:0x813D20F0; // type:function size:0x54
sendCardMoveCmd__Q23ipl10memorycardFUcs = .text:0x813D2144; // type:function size:0x54
sendCardDeleteCmd__Q23ipl10memorycardFUcs = .text:0x813D2198; // type:function size:0x54
sendCardThreadStopCmd__Q23ipl10memorycardFv = .text:0x813D21EC; // type:function size:0x40
CardSequence_813D222C = .text:0x813D222C; // type:function size:0x110
CardSequence_813D233C = .text:0x813D233C; // type:function size:0x9C
pollCardSlot = .text:0x813D222C; // type:function size:0x110
mapCardErrorCode = .text:0x813D233C; // type:function size:0x9C
probeCard__Q23ipl10memorycardFv = .text:0x813D23D8; // type:function size:0x288
initCardThread__Q23ipl10memorycardFv = .text:0x813D2660; // type:function size:0x29C
shutdownCardThread__Q23ipl10memorycardFv = .text:0x813D28FC; // type:function size:0x148
getIconStateArray__Q23ipl10memorycardFv = .text:0x813D2A44; // type:function size:0x10
getIconComment__Q23ipl10memorycardFUcs = .text:0x813D2A54; // type:function size:0x20
CardSequence_813D2A74 = .text:0x813D2A74; // type:function size:0xCC
CardSequence_813D2B40 = .text:0x813D2B40; // type:function size:0x14C
CardSequence_813D2C8C = .text:0x813D2C8C; // type:function size:0x4B4
CardSequence_813D3140 = .text:0x813D3140; // type:function size:0xCC
CardSequence_813D320C = .text:0x813D320C; // type:function size:0x9C
CardSequence_813D32A8 = .text:0x813D32A8; // type:function size:0xD8
CardSequence_813D3380 = .text:0x813D3380; // type:function size:0x58
CardSequence_813D33D8 = .text:0x813D33D8; // type:function size:0x4C
CardSequence_813D3424 = .text:0x813D3424; // type:function size:0x800
CardSequence_813D3C24 = .text:0x813D3C24; // type:function size:0x14
CardSequence_813D3C38 = .text:0x813D3C38; // type:function size:0xDC
CardSequence_813D3D14 = .text:0x813D3D14; // type:function size:0x980
clearCardFileEntry = .text:0x813D2A74; // type:function size:0xCC
refreshCardSlotInfo = .text:0x813D2B40; // type:function size:0x14C
cardThreadMain = .text:0x813D2C8C; // type:function size:0x4B4
markAllCardFilesDirty = .text:0x813D3140; // type:function size:0xCC
handleCardMountResult = .text:0x813D320C; // type:function size:0x9C
reportCardThreadError = .text:0x813D32A8; // type:function size:0xD8
sendCardSlotState = .text:0x813D3380; // type:function size:0x58
clearAllCardFileEntries = .text:0x813D33D8; // type:function size:0x4C
loadCardFileIcons = .text:0x813D3424; // type:function size:0x800
clearCardWritePending = .text:0x813D3C24; // type:function size:0x14
checkCardFileDuplicate = .text:0x813D3C38; // type:function size:0xDC
runCardMoveOrCopy = .text:0x813D3D14; // type:function size:0x980
IPLContestInitialize = .text:0x813D4694; // type:function size:0xBC
IPLContestStart = .text:0x813D4750; // type:function size:0x14
IPLContestProcess = .text:0x813D4764; // type:function size:0x6E8
@@ -4866,7 +4866,7 @@ onDialogState9__Q33ipl5scene8SDMemoryFv = .text:0x813EDF04; // type:function siz
onDialogState10__Q33ipl5scene8SDMemoryFv = .text:0x813EDFA8; // type:function size:0x130
onDialogState11__Q33ipl5scene8SDMemoryFv = .text:0x813EE0D8; // type:function size:0xE0
onDialogState12__Q33ipl5scene8SDMemoryFv = .text:0x813EE1B8; // type:function size:0x1A0
iplSDMemory_813EE358 = .text:0x813EE358; // type:function size:0x44
iplSDMemory_containsTitleId = .text:0x813EE358; // type:function size:0x44
onDialogState13__Q33ipl5scene8SDMemoryFv = .text:0x813EE39C; // type:function size:0xEC
onDialogState14__Q33ipl5scene8SDMemoryFv = .text:0x813EE488; // type:function size:0x1C4
onDialogState15__Q33ipl5scene8SDMemoryFv = .text:0x813EE64C; // type:function size:0x12C
@@ -5133,11 +5133,11 @@ cancel__Q33ipl5scene10AOSSThreadFv = .text:0x813FCE20; // type:function size:0x5
finish__Q33ipl5scene10AOSSThreadFP13NCDAossConfigPi = .text:0x813FCE70; // type:function size:0x2FC
printInfo__Q33ipl5scene10AOSSThreadFv = .text:0x813FD16C; // type:function size:0x4
AOSSi_Cancel = .text:0x813FD170; // type:function size:0xC
AOSS_813FD17C = .text:0x813FD17C; // type:function size:0x10
AOSS_813FD18C = .text:0x813FD18C; // type:function size:0x88
AOSSi_SleepAlarmHandler = .text:0x813FD17C; // type:function size:0x10
AOSSi_SleepMs = .text:0x813FD18C; // type:function size:0x88
AOSSi_Alloc = .text:0x813FD214; // type:function size:0x24
AOSSi_Free = .text:0x813FD238; // type:function size:0x24
AOSS_813FD25C = .text:0x813FD25C; // type:function size:0x2C
AOSSi_StoreIpv4Octets = .text:0x813FD25C; // type:function size:0x2C
AOSSi_SetNCDIPAddr = .text:0x813FD288; // type:function size:0x7C
AOSSi_InitLocal = .text:0x813FD304; // type:function size:0x68
AOSSi_EndLocal = .text:0x813FD36C; // type:function size:0x34
@@ -5146,62 +5146,62 @@ AOSSi_WLANConnect = .text:0x813FD72C; // type:function size:0x26C
AOSSi_Sleep = .text:0x813FD998; // type:function size:0x4
AOSSi_Status = .text:0x813FD99C; // type:function size:0x34
AOSS_SetCallback = .text:0x813FD9D0; // type:function size:0x34
RakuRakuThread_813FDA04__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDA04; // type:function size:0x6C scope:local
syncRakuProgress__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDA04; // type:function size:0x6C scope:local
__ct__Q33ipl5scene14RakuRakuThreadFPQ23EGG4Heap = .text:0x813FDA70; // type:function size:0xD8
__dt__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDB48; // type:function size:0xA4
destroy__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDBEC; // type:function size:0xD8
start__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDCC4; // type:function size:0x180
Run__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDE44; // type:function size:0xAC
RakuRakuThread_813FDEF0 = .text:0x813FDEF0; // type:function size:0xC scope:local
RakuRakuThread_813FDEFC = .text:0x813FDEFC; // type:function size:0xC scope:local
RakuRakuThread_813FDF08 = .text:0x813FDF08; // type:function size:0x10 scope:local
RakuRakuThread_813FDF18 = .text:0x813FDF18; // type:function size:0x10 scope:local
RakuSocketAlloc = .text:0x813FDEF0; // type:function size:0xC scope:local
RakuSocketFree = .text:0x813FDEFC; // type:function size:0xC scope:local
RakuAtermAlloc = .text:0x813FDF08; // type:function size:0x10 scope:local
RakuAtermFree = .text:0x813FDF18; // type:function size:0x10 scope:local
getState__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDF28; // type:function size:0x128
cancel__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FE050; // type:function size:0x14
finish__Q33ipl5scene14RakuRakuThreadFP11NCDApConfigPi = .text:0x813FE064; // type:function size:0x214
printInfo__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FE278; // type:function size:0x4
AOSSi_Init = .text:0x813FE27C; // type:function size:0x22C
AOSS_Init_old = .text:0x813FE4A8; // type:function size:0x18C0
AOSS_813FFD68 = .text:0x813FFD68; // type:function size:0x36C
AOSSValidateInitConfig = .text:0x813FFD68; // type:function size:0x36C
AOSS_CheckAP = .text:0x814000D4; // type:function size:0xE0
AOSS_814001B4 = .text:0x814001B4; // type:function size:0x13C
AOSS_814002F0 = .text:0x814002F0; // type:function size:0x1E0
AOSS_814004D0 = .text:0x814004D0; // type:function size:0x1D4
AOSS_814006A4 = .text:0x814006A4; // type:function size:0x18C
AOSS_81400830 = .text:0x81400830; // type:function size:0x504
AOSS_81400D34 = .text:0x81400D34; // type:function size:0xD8
AOSS_81400E0C = .text:0x81400E0C; // type:function size:0x2F8
AOSS_81401104 = .text:0x81401104; // type:function size:0x180
AOSS_81401284 = .text:0x81401284; // type:function size:0x128
AOSS_814013AC = .text:0x814013AC; // type:function size:0x1C8
AOSS_81401574 = .text:0x81401574; // type:function size:0x204
AOSS_81401778 = .text:0x81401778; // type:function size:0x444
AOSS_81401BBC = .text:0x81401BBC; // type:function size:0xE0
AOSS_81401C9C = .text:0x81401C9C; // type:function size:0x124
AOSS_81401DC0 = .text:0x81401DC0; // type:function size:0xC0
AOSS_81401E80 = .text:0x81401E80; // type:function size:0x24C
AOSS_814020CC = .text:0x814020CC; // type:function size:0xF0
ATERM_814021BC = .text:0x814021BC; // type:function size:0x268
ATERM_81402424 = .text:0x81402424; // type:function size:0x348
ATERM_8140276C = .text:0x8140276C; // type:function size:0x2B8
ATERM_81402A24 = .text:0x81402A24; // type:function size:0x41C
ATERM_81402E40 = .text:0x81402E40; // type:function size:0x180
ATERM_81402FC0 = .text:0x81402FC0; // type:function size:0x21C
ATERM_814031DC = .text:0x814031DC; // type:function size:0x214
ATERM_814033F0 = .text:0x814033F0; // type:function size:0x224
ATERM_81403614 = .text:0x81403614; // type:function size:0xC4
ATERM_814036D8 = .text:0x814036D8; // type:function size:0x1F0
ATERM_814038C8 = .text:0x814038C8; // type:function size:0xEDC
AOSSDispatchReceiveState = .text:0x814001B4; // type:function size:0x13C
AOSSHandleDiscoverReply = .text:0x814002F0; // type:function size:0x1E0
AOSSHandleAuthReply = .text:0x814004D0; // type:function size:0x1D4
AOSSHandleFinalReply = .text:0x814006A4; // type:function size:0x18C
AOSSDecryptMessage = .text:0x81400830; // type:function size:0x504
AOSSCheckAccessPointName = .text:0x81400D34; // type:function size:0xD8
AOSSParseNetworkSettings = .text:0x81400E0C; // type:function size:0x2F8
AOSSParseWepConfig = .text:0x81401104; // type:function size:0x180
AOSSParsePskConfig = .text:0x81401284; // type:function size:0x128
AOSSApplyAuthOptions = .text:0x814013AC; // type:function size:0x1C8
AOSSSendDiscoveryRequest = .text:0x81401574; // type:function size:0x204
AOSSSendHelloRequest = .text:0x81401778; // type:function size:0x444
AOSSBuildInterfaceOption = .text:0x81401BBC; // type:function size:0xE0
AOSSInitKeySchedule = .text:0x81401C9C; // type:function size:0x124
AOSSInitCrc32Table = .text:0x81401DC0; // type:function size:0xC0
AOSSXorBufferWithKey = .text:0x81401E80; // type:function size:0x24C
AOSSConnectAndAwaitHost = .text:0x814020CC; // type:function size:0xF0
ATERMStartNetworkStack = .text:0x814021BC; // type:function size:0x268
ATERMScanAccessPoints = .text:0x81402424; // type:function size:0x348
ATERMFindChangedApRecord = .text:0x8140276C; // type:function size:0x2B8
ATERMDiscoverAccessPoints = .text:0x81402A24; // type:function size:0x41C
ATERMBuildEncryptedMessage = .text:0x81402E40; // type:function size:0x180
ATERMParsePacket = .text:0x81402FC0; // type:function size:0x21C
ATERMBuildAssociationRequest = .text:0x814031DC; // type:function size:0x214
ATERMParseAssociationResponse = .text:0x814033F0; // type:function size:0x224
ATERMParseHexBytes = .text:0x81403614; // type:function size:0xC4
ATERMApplyScanSecuritySettings = .text:0x814036D8; // type:function size:0x1F0
ATERMRunConfigProtocol = .text:0x814038C8; // type:function size:0xEDC
ATERMi_AutoConfigThread = .text:0x814047A4; // type:function size:0xA0
ATERM_81404844 = .text:0x81404844; // type:function size:0x1D4
ATERM_81404A18 = .text:0x81404A18; // type:function size:0x1E4
ATERM_81404BFC = .text:0x81404BFC; // type:function size:0x430
ATERM_8140502C = .text:0x8140502C; // type:function size:0x228
ATERM_81405254 = .text:0x81405254; // type:function size:0x43C
ATERM_81405690 = .text:0x81405690; // type:function size:0x43C
ATERM_81405ACC = .text:0x81405ACC; // type:function size:0x240
ATERM_81405D0C = .text:0x81405D0C; // type:function size:0xB40
ATERM_8140684C = .text:0x8140684C; // type:function size:0x10
ATERMAesKeyWrap = .text:0x81404844; // type:function size:0x1D4
ATERMAesKeyUnwrap = .text:0x81404A18; // type:function size:0x1E4
ATERMAesExpandEncryptKey = .text:0x81404BFC; // type:function size:0x430
ATERMAesExpandDecryptKey = .text:0x8140502C; // type:function size:0x228
ATERMAesEncryptBlock = .text:0x81405254; // type:function size:0x43C
ATERMAesDecryptBlock = .text:0x81405690; // type:function size:0x43C
ATERMMd5Update = .text:0x81405ACC; // type:function size:0x240
ATERMMd5Transform = .text:0x81405D0C; // type:function size:0xB40
ATERMAlarmWakeQueue = .text:0x8140684C; // type:function size:0x10
ATERMi_ApConfigStart = .text:0x8140685C; // type:function size:0x19C
ATERMi_ApConfigEnd = .text:0x814069F8; // type:function size:0x204
ATERMi_ApConfigGetState = .text:0x81406BFC; // type:function size:0x8C
@@ -6670,19 +6670,19 @@ CHANSVmStrCpyToU16FromU8 = .text:0x8144B058; // type:function size:0x34
CHANSVmStrCpyToU8FromU16 = .text:0x8144B08C; // type:function size:0x44
CHANSVmStrCpyToU8FromStringObject = .text:0x8144B0D0; // type:function size:0xB4
VmIsNan = .text:0x8144B184; // type:function size:0x54 scope:local
CHANSVm_8144B1D8 = .text:0x8144B1D8; // type:function size:0x20 scope:local
CHANSVmFloatSign = .text:0x8144B1D8; // type:function size:0x20 scope:local
VmIntToFloat = .text:0x8144B1F8; // type:function size:0x50 scope:local
CHANSVmParseInt = .text:0x8144B248; // type:function size:0xC4 scope:local
CHANSVm_8144B30C = .text:0x8144B30C; // type:function size:0xAC scope:local
CHANSVmConvertToIntFromFloat = .text:0x8144B30C; // type:function size:0xAC scope:local
CHANSVmConvertToIntFromStr = .text:0x8144B3B8; // type:function size:0x70
CHANSVmConvertToIntFromArray = .text:0x8144B428; // type:function size:0x8
CHANSVm_8144B430 = .text:0x8144B430; // type:function size:0x40
CHANSVm_8144B470 = .text:0x8144B470; // type:function size:0x64
CHANSVm_8144B4D4 = .text:0x8144B4D4; // type:function size:0x14C
CHANSVmConvertToFloatFromUndefined = .text:0x8144B430; // type:function size:0x40
CHANSVmConvertToFloatFromInt = .text:0x8144B470; // type:function size:0x64
CHANSVmConvertToFloatFromStr = .text:0x8144B4D4; // type:function size:0x14C
CHANSVmConvertToStrFromUndefined = .text:0x8144B620; // type:function size:0xC
CHANSVm_8144B62C = .text:0x8144B62C; // type:function size:0x58 scope:local
CHANSVmFloatToWString = .text:0x8144B62C; // type:function size:0x58 scope:local
CHANSVmConvertToStrFromInt = .text:0x8144B684; // type:function size:0xB0
CHANSVm_8144B734 = .text:0x8144B734; // type:function size:0xDC
CHANSVmConvertToStrFromFloat = .text:0x8144B734; // type:function size:0xDC
CHANSVmConvertToStrFromArray = .text:0x8144B810; // type:function size:0x10
CHANSVmConvertObjectTypeError = .text:0x8144B820; // type:function size:0x50
CHANSVmGetEnumedType = .text:0x8144B870; // type:function size:0x6C scope:local
@@ -6804,14 +6804,14 @@ VmStringSplice = .text:0x8144FDD8; // type:function size:0x1E4
VmStringSplit = .text:0x8144FFBC; // type:function size:0x378
VmStringToLowerCase = .text:0x81450334; // type:function size:0xB4
VmStringToUpperCase = .text:0x814503E8; // type:function size:0xB4
CHANSVm_8145049C = .text:0x8145049C; // type:function size:0x6BC
CHANSVmFormatString = .text:0x8145049C; // type:function size:0x6BC
VmStringFormat = .text:0x81450B58; // type:function size:0x4C
VmGetStrFromObjHdr = .text:0x81450BA4; // type:function size:0x24
VmGetIntFromObjHdr = .text:0x81450BC8; // type:function size:0x24
VmBlobInitValue = .text:0x81450BEC; // type:function size:0x20 scope:local
VmBlobCreateDirect = .text:0x81450C0C; // type:function size:0xAC scope:local
VmBlobGetDataBufferDirect = .text:0x81450CB8; // type:function size:0x5C scope:local
CHANSVm_81450D14 = .text:0x81450D14; // type:function size:0xB8
CHANSVmBlobResolveOffset = .text:0x81450D14; // type:function size:0xB8
VmBlobCtor = .text:0x81450DCC; // type:function size:0xA8 scope:local
VmBlobDtor = .text:0x81450E74; // type:function size:0x28 scope:local
VmBlobGetOffset = .text:0x81450E9C; // type:function size:0x68
@@ -6820,8 +6820,8 @@ VmBlobSkip = .text:0x81450FC8; // type:function size:0xF0
VmBlobGetLength = .text:0x814510B8; // type:function size:0x68
VmBlobSetLength = .text:0x81451120; // type:function size:0xF8
VmBlobFill = .text:0x81451218; // type:function size:0xFC
CHANSVm_81451314 = .text:0x81451314; // type:function size:0x34
CHANSVm_81451348 = .text:0x81451348; // type:function size:0x50
CHANSVmBlobGetCount = .text:0x81451314; // type:function size:0x34
CHANSVmBlobHasSpace = .text:0x81451348; // type:function size:0x50
VmBlobGetString = .text:0x81451398; // type:function size:0xC8
VmBlobSetString = .text:0x81451460; // type:function size:0x12C
VmBlobGetWString = .text:0x8145158C; // type:function size:0xE0
@@ -6857,7 +6857,7 @@ VmBlobSetS32 = .text:0x814532E4; // type:function size:0xD8
VmBlobSetS64 = .text:0x814533BC; // type:function size:0xE4
vmBlobParsePackFormatString = .text:0x814534A0; // type:function size:0x1D0
VmBlobPackCommon = .text:0x81453670; // type:function size:0xA70 scope:local
CHANSVm_814540E0 = .text:0x814540E0; // type:function size:0x6C
CHANSVmMakeU64 = .text:0x814540E0; // type:function size:0x6C
VmBlobCreate = .text:0x8145414C; // type:function size:0x8
VmBlobPack = .text:0x81454154; // type:function size:0x8
VmBlobUnpack = .text:0x8145415C; // type:function size:0x814
@@ -6875,7 +6875,7 @@ CHANSVmGetFreeExeSize = .text:0x81455198; // type:function size:0x28
CHANSVmAddExe = .text:0x814551C0; // type:function size:0x3F8
VmOffsU32ToPtr = .text:0x814555B8; // type:function size:0x18 scope:local
CHANSConvertModuleOfsToPtr = .text:0x814555D0; // type:function size:0x84
CHANSVm_81455654 = .text:0x81455654; // type:function size:0x8C
CHANSVmLookupScopedObject = .text:0x81455654; // type:function size:0x8C
VmPushFuncReturnInfo = .text:0x814556E0; // type:function size:0x1AC scope:local
VmReturnWithValue = .text:0x8145588C; // type:function size:0x1D4 scope:local
CHANSVmLinkModules = .text:0x81455A60; // type:function size:0x2F4
@@ -14198,7 +14198,7 @@ ca_ppki = .rodata:0x8162DBB8; // type:object size:0x400 noreloc
ms_dpki = .rodata:0x8162DFB8; // type:object size:0x240 noreloc
ms_ppki = .rodata:0x8162E1F8; // type:object size:0x240 noreloc
@1272 = .rodata:0x8162E438; // type:object size:0x278 scope:local data:4byte
pf_valid_fn_char = .rodata:0x8162E6B0; // type:object size:0x60 scope:local noreloc
pf_valid_fn_char = .rodata:0x8162E6B0; // type:object size:0x60 noreloc
fat_special_values = .rodata:0x8162E710; // type:object size:0x3C
cp932_to_unicode = .rodata:0x8162E750; // type:object size:0x4272 data:2byte
fa_nand_func = .rodata:0x816329C8; // type:object size:0x20
@@ -20244,10 +20244,10 @@ lbl_81694654 = .sdata2:0x81694654; // type:object size:0x4 align:4 data:float
@10044 = .sdata2:0x8169469C; // type:object size:0x4 scope:local align:4 data:float
lbl_816946A0 = .sdata2:0x816946A0; // type:object size:0x4 align:4 data:float
scSoundZeroF = .sdata2:0x816946A4; // type:object size:0x4 align:4 data:float
lbl_816946A8 = .sdata2:0x816946A8; // type:object size:0x4 align:4 data:float
lbl_816946AC = .sdata2:0x816946AC; // type:object size:0x4 align:4 data:float
lbl_816946B0 = .sdata2:0x816946B0; // type:object size:0x4 align:4 data:float
lbl_816946B4 = .sdata2:0x816946B4; // type:object size:0x4 align:4 data:float
scSoundTwoF = .sdata2:0x816946A8; // type:object size:0x4 align:4 data:float
scSoundOneF = .sdata2:0x816946AC; // type:object size:0x4 align:4 data:float
scSoundThirtyF = .sdata2:0x816946B0; // type:object size:0x4 align:4 data:float
scSoundSixtyF = .sdata2:0x816946B4; // type:object size:0x4 align:4 data:float
lbl_816946B8 = .sdata2:0x816946B8; // type:object size:0x8 align:8 data:double
lbl_816946C0 = .sdata2:0x816946C0; // type:object size:0x8 align:8 data:double
lbl_816946C8 = .sdata2:0x816946C8; // type:object size:0x8 align:8 data:double
@@ -21694,7 +21694,7 @@ Tick = .sdata:0x81696520; // type:object size:0x4 scope:local data:4byte
@2844 = .sdata:0x81696562; // type:object size:0x5 scope:local data:string
@2845 = .sdata:0x81696567; // type:object size:0x8 scope:local data:string
@3032 = .sdata:0x8169656F; // type:object size:0x8 scope:local data:string
lbl_81696578 = .sdata:0x81696578; // type:object size:0x4 data:4byte
TicketViews = .sdata:0x81696578; // type:object size:0x4 data:4byte
lbl_8169657C = .sdata:0x8169657C; // type:object size:0x8 data:string
lbl_81696584 = .sdata:0x81696584; // type:object size:0x7
lbl_8169658B = .sdata:0x8169658B; // type:object size:0x5 data:string
@@ -22275,8 +22275,8 @@ lbl_81697394 = .sdata:0x81697394; // type:object size:0x4 data:wstring
lbl_81697398 = .sdata:0x81697398; // type:object size:0x4
lbl_8169739C = .sdata:0x8169739C; // type:object size:0x4
lbl_816973A0 = .sdata:0x816973A0; // type:object size:0x4 data:4byte
lbl_816973A4 = .sdata:0x816973A4; // type:object size:0x6 data:string
lbl_816973AC = .sdata:0x816973AC; // type:object size:0x6 data:string
scN_KOR = .sdata:0x816973A4; // type:object size:0x6 data:string
scN_CHN = .sdata:0x816973AC; // type:object size:0x6 data:string
sbCompatibleFilterEnabled__Q39textinput9inputform13DeadKeyStream = .sdata:0x816973B2; // type:object size:0x1 data:byte
mbHyphen__Q29textinput9inputform = .sdata:0x816973B3; // type:object size:0x1 data:byte
lbl_816973B4 = .sdata:0x816973B4; // type:object size:0x4
@@ -23349,60 +23349,60 @@ BS2BootType = .sbss:0x816989FC; // type:object size:0x4 scope:global data:4byte
BS2VideoMode = .sbss:0x81698A00; // type:object size:0x4 data:4byte
InvalidSram = .sbss:0x81698A04; // type:object size:0x4 data:4byte
State = .sbss:0x81698A08; // type:object size:0x4 scope:local data:4byte
lbl_81698A0C = .sbss:0x81698A0C; // type:object size:0x4 scope:local data:4byte
lbl_81698A10 = .sbss:0x81698A10; // type:object size:0x4 scope:local data:4byte
lbl_81698A14 = .sbss:0x81698A14; // type:object size:0x4 scope:local data:4byte
lbl_81698A18 = .sbss:0x81698A18; // type:object size:0x4 scope:local data:4byte
lbl_81698A1C = .sbss:0x81698A1C; // type:object size:0x4 scope:local data:4byte
DvdReadPending = .sbss:0x81698A0C; // type:object size:0x4 scope:local data:4byte
BannerAllocation = .sbss:0x81698A10; // type:object size:0x4 scope:local data:4byte
BannerBuffer = .sbss:0x81698A14; // type:object size:0x4 scope:local data:4byte
BannerAvailable = .sbss:0x81698A18; // type:object size:0x4 scope:local data:4byte
Allocator = .sbss:0x81698A1C; // type:object size:0x4 scope:local data:4byte
StartingGame = .sbss:0x81698A20; // type:object size:0x4 data:4byte
lbl_81698A24 = .sbss:0x81698A24; // type:object size:0x4 scope:local data:4byte
lbl_81698A28 = .sbss:0x81698A28; // type:object size:0x4 scope:local data:4byte
lbl_81698A2C = .sbss:0x81698A2C; // type:object size:0x4 scope:local data:4byte
lbl_81698A30 = .sbss:0x81698A30; // type:object size:0x4 scope:local data:4byte
RestartRequested = .sbss:0x81698A24; // type:object size:0x4 scope:local data:4byte
PartitionOpen = .sbss:0x81698A28; // type:object size:0x4 scope:local data:4byte
CacheSeekComplete = .sbss:0x81698A2C; // type:object size:0x4 scope:local data:4byte
LoadingTitle = .sbss:0x81698A30; // type:object size:0x4 scope:local data:4byte
FatalErrorFlag = .sbss:0x81698A34; // type:object size:0x4 data:4byte
RetryErrorFlag = .sbss:0x81698A38; // type:object size:0x4 data:4byte
UpdateErrorFlag = .sbss:0x81698A3C; // type:object size:0x4 data:4byte
AbortFlag = .sbss:0x81698A40; // type:object size:0x4 data:4byte
lbl_81698A44 = .sbss:0x81698A44; // type:object size:0x4 data:4byte
lbl_81698A48 = .sbss:0x81698A48; // type:object size:0x4 data:4byte
lbl_81698A4C = .sbss:0x81698A4C; // type:object size:0x4 scope:local data:4byte
lbl_81698A50 = .sbss:0x81698A50; // type:object size:0x4 scope:local data:4byte
lbl_81698A54 = .sbss:0x81698A54; // type:object size:0x4 scope:local data:4byte
lbl_81698A58 = .sbss:0x81698A58; // type:object size:0x4 scope:local data:4byte
lbl_81698A5C = .sbss:0x81698A5C; // type:object size:0x4 scope:local data:4byte
lbl_81698A60 = .sbss:0x81698A60; // type:object size:0x8 scope:local data:4byte
lbl_81698A68 = .sbss:0x81698A68; // type:object size:0x8 scope:local data:4byte
lbl_81698A70 = .sbss:0x81698A70; // type:object size:0x8 data:4byte
lbl_81698A78 = .sbss:0x81698A78; // type:object size:0x4 data:4byte
lbl_81698A7C = .sbss:0x81698A7C; // type:object size:0x4 scope:local data:4byte
lbl_81698A80 = .sbss:0x81698A80; // type:object size:0x4 scope:local data:4byte
lbl_81698A84 = .sbss:0x81698A84; // type:object size:0x4 data:4byte
lbl_81698A88 = .sbss:0x81698A88; // type:object size:0x4 data:4byte
lbl_81698A8C = .sbss:0x81698A8C; // type:object size:0x4 data:4byte
lbl_81698A90 = .sbss:0x81698A90; // type:object size:0x4 data:4byte
lbl_81698A94 = .sbss:0x81698A94; // type:object size:0x4 data:4byte
lbl_81698A98 = .sbss:0x81698A98; // type:object size:0x4 data:4byte
lbl_81698A9C = .sbss:0x81698A9C; // type:object size:0x4 data:4byte
lbl_81698AA0 = .sbss:0x81698AA0; // type:object size:0x8 data:4byte
lbl_81698AA8 = .sbss:0x81698AA8; // type:object size:0x4 data:4byte
lbl_81698AAC = .sbss:0x81698AAC; // type:object size:0x4 data:4byte
lbl_81698AB0 = .sbss:0x81698AB0; // type:object size:0x4 data:4byte
lbl_81698AB4 = .sbss:0x81698AB4; // type:object size:0x4 data:4byte
lbl_81698AB8 = .sbss:0x81698AB8; // type:object size:0x4 data:4byte
lbl_81698ABC = .sbss:0x81698ABC; // type:object size:0x4 data:4byte
lbl_81698AC0 = .sbss:0x81698AC0; // type:object size:0x4 data:4byte
lbl_81698AC4 = .sbss:0x81698AC4; // type:object size:0x4 data:4byte
lbl_81698AC8 = .sbss:0x81698AC8; // type:object size:0x4 data:4byte
lbl_81698ACC = .sbss:0x81698ACC; // type:object size:0x4 data:4byte
lbl_81698AD0 = .sbss:0x81698AD0; // type:object size:0x4 data:4byte
lbl_81698AD4 = .sbss:0x81698AD4; // type:object size:0x4 data:4byte
lbl_81698AD8 = .sbss:0x81698AD8; // type:object size:0x4 scope:local data:4byte
lbl_81698ADC = .sbss:0x81698ADC; // type:object size:0x4 scope:local data:4byte
lbl_81698AE0 = .sbss:0x81698AE0; // type:object size:0x4 scope:local data:4byte
lbl_81698AE4 = .sbss:0x81698AE4; // type:object size:0x4 scope:local data:4byte
lbl_81698AE8 = .sbss:0x81698AE8; // type:object size:0x4 scope:local data:4byte
lbl_81698AEC = .sbss:0x81698AEC; // type:object size:0x4 scope:local data:4byte
lbl_81698AF0 = .sbss:0x81698AF0; // type:object size:0x4 scope:local data:4byte
CacheFailed = .sbss:0x81698A44; // type:object size:0x4 data:4byte
RegionValid = .sbss:0x81698A48; // type:object size:0x4 data:4byte
NandPending = .sbss:0x81698A4C; // type:object size:0x4 scope:local data:4byte
CancelNand = .sbss:0x81698A50; // type:object size:0x4 scope:local data:4byte
LowReadResult = .sbss:0x81698A54; // type:object size:0x4 scope:local data:4byte
CacheCommandComplete = .sbss:0x81698A58; // type:object size:0x4 scope:local data:4byte
AudioBufferUnconfigured = .sbss:0x81698A5C; // type:object size:0x4 scope:local data:4byte
ResetTime = .sbss:0x81698A60; // type:object size:0x8 scope:local data:4byte
SpinupDeadline = .sbss:0x81698A68; // type:object size:0x8 scope:local data:4byte
CoverPollTime = .sbss:0x81698A70; // type:object size:0x8 data:4byte
DriveWasReset = .sbss:0x81698A78; // type:object size:0x4 data:4byte
TitleTicketView = .sbss:0x81698A7C; // type:object size:0x4 scope:local data:4byte
CurrentTmd = .sbss:0x81698A80; // type:object size:0x4 scope:local data:4byte
TitleCode = .sbss:0x81698A84; // type:object size:0x4 data:4byte
RequiredIosHigh = .sbss:0x81698A88; // type:object size:0x4 data:4byte
RequiredIosLow = .sbss:0x81698A8C; // type:object size:0x4 data:4byte
GamePartition = .sbss:0x81698A90; // type:object size:0x4 data:4byte
UpdatePartition = .sbss:0x81698A94; // type:object size:0x4 data:4byte
PartitionCursor = .sbss:0x81698A98; // type:object size:0x4 data:4byte
DataToc = .sbss:0x81698A9C; // type:object size:0x4 data:4byte
GameToc = .sbss:0x81698AA0; // type:object size:0x8 data:4byte
CoverOpenTimeHigh = .sbss:0x81698AA8; // type:object size:0x4 data:4byte
CoverOpenTimeLow = .sbss:0x81698AAC; // type:object size:0x4 data:4byte
NandTransferred = .sbss:0x81698AB0; // type:object size:0x4 data:4byte
NandLength = .sbss:0x81698AB4; // type:object size:0x4 data:4byte
NandBuffer = .sbss:0x81698AB8; // type:object size:0x4 data:4byte
NandFile = .sbss:0x81698ABC; // type:object size:0x4 data:4byte
NandOperation = .sbss:0x81698AC0; // type:object size:0x4 data:4byte
NandCompletion = .sbss:0x81698AC4; // type:object size:0x4 data:4byte
LoaderOffset = .sbss:0x81698AC8; // type:object size:0x4 data:4byte
LoaderLength = .sbss:0x81698ACC; // type:object size:0x4 data:4byte
LoaderAddress = .sbss:0x81698AD0; // type:object size:0x4 data:4byte
CacheLength = .sbss:0x81698AD4; // type:object size:0x4 data:4byte
BannerLength = .sbss:0x81698AD8; // type:object size:0x4 scope:local data:4byte
DvdTransferLength = .sbss:0x81698ADC; // type:object size:0x4 scope:local data:4byte
DvdTransferred = .sbss:0x81698AE0; // type:object size:0x4 scope:local data:4byte
DvdProgress = .sbss:0x81698AE4; // type:object size:0x4 scope:local data:4byte
LoaderClose = .sbss:0x81698AE8; // type:object size:0x4 scope:local data:4byte
LoaderMain = .sbss:0x81698AEC; // type:object size:0x4 scope:local data:4byte
LoaderInit = .sbss:0x81698AF0; // type:object size:0x4 scope:local data:4byte
pEntries = .sbss:0x81698AF8; // type:object size:0x4 scope:local data:4byte
EntriesCount = .sbss:0x81698AFC; // type:object size:0x4 scope:local data:4byte
pFlags = .sbss:0x81698B00; // type:object size:0x4 scope:local data:4byte
@@ -23750,7 +23750,7 @@ flushFlag3in1 = .sbss:0x816991CC; // type:object size:0x4 scope:local data:4byte
flushFlag = .sbss:0x816991D0; // type:object size:0x4 scope:local data:4byte
retraceCount = .sbss:0x816991D4; // type:object size:0x4 scope:local data:4byte
__i2c_ident_first = .sbss:0x816991D8; // type:object size:0x4 scope:local data:4byte
Vdac_Flag_Changed = .sbss:0x816991E0; // type:object size:0x4 scope:local data:4byte
Vdac_Flag_Changed = .sbss:0x816991E0; // type:object size:0x4 data:4byte
__level = .sbss:0x816991E4; // type:object size:0x4 scope:local data:4byte
__gamma = .sbss:0x816991E8; // type:object size:0x4 scope:local data:4byte
__type = .sbss:0x816991EC; // type:object size:0x4 scope:local data:4byte
@@ -24048,7 +24048,7 @@ g_detach_func = .sbss:0x8169970C; // type:object size:0x4 scope:local data:4byte
st_uhs_msc_status = .sbss:0x81699710; // type:object size:0x4 scope:local data:4byte
st_uhs_msc_msgid = .sbss:0x81699714; // type:object size:0x4 scope:local data:4byte
st_uhs_msc_tskid = .sbss:0x81699718; // type:object size:0x4 scope:local data:4byte
uhg_msc_memid = .sbss:0x8169971C; // type:object size:0x4 scope:local data:4byte
uhg_msc_memid = .sbss:0x8169971C; // type:object size:0x4 data:4byte
st_uhs_msc_blk_buf = .sbss:0x81699720; // type:object size:0x4 scope:local data:4byte
__sdCardStatus = .sbss:0x81699728; // type:object size:0x4 scope:local data:4byte
__sdReq = .sbss:0x8169972C; // type:object size:0x4 scope:local data:4byte

View File

@@ -689,7 +689,7 @@ config.libs = [
]
),
IPLSection("sound", [
Object(NonMatching, "sound/iplSound.cpp"),
Object(Matching, "sound/iplSound.cpp"),
]
),
IPLSection("iplwww", [
@@ -869,7 +869,7 @@ 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"),
@@ -934,7 +934,7 @@ config.libs = [
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/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
@@ -1063,7 +1063,7 @@ config.libs = [
Object(NonMatching, "nhttp/NHTTP_socket_RVL.c"),
Object(NonMatching, "nhttp/NHTTP_stdlib_RVL.c"),
Object(NonMatching, "nhttp/NHTTP_thread.c"),
Object(NonMatching, "nhttp/d_nhttp_private.c"),
Object(Matching, "nhttp/d_nhttp_private.c"),
Object(Matching, "nhttp/d_nhttp.c"),
Object(Matching, "nhttp/d_nhttp_common.c"),
]

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;
@@ -149,6 +151,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

@@ -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

@@ -14,8 +14,8 @@ namespace ipl {
WAIT_UNTIL_FADE_IN = 15
};
TextBalloon(EGG::Heap* heap, nand::LayoutFile* layoutFile, const char* directory, const char* fileName, const ipl::math::VEC3& unk2,
f32 unk3 = 120.0f, f32 unk4 = 30.0f);
TextBalloon(EGG::Heap* heap, nand::LayoutFile* layoutFile, const char* directory, const char* fileName, const ipl::math::VEC3& initialPos,
f32 margin16x9 = 120.0f, f32 margin4x3 = 30.0f);
~TextBalloon();
void calc();
@@ -31,7 +31,7 @@ namespace ipl {
void fadeout();
void fadeoutForce();
void setPos(const math::VEC3& pos, bool unk0, int unk1);
void setPos(const math::VEC3& pos, bool use16x9X, int hAlign);
void updatePos(const math::VEC3& pos);
void set_translate(const math::VEC3& trans);
@@ -50,7 +50,7 @@ namespace ipl {
undefined4 unk_0x00;
undefined4 unk_0x04;
BOOL unk_0x08;
BOOL mbWaitingFadeIn; // 0x08
layout::Object* mpLayout; // 0x0C
@@ -60,10 +60,10 @@ namespace ipl {
u32 mTextLen; // 0x18
math::VEC3 mBalloonPos; // 0x1C
undefined4 unk_0x28;
undefined unk_0x2C;
f32 unk_0x30;
f32 unk_0x34;
undefined4 mHAlign; // 0x28
undefined mbUse16x9X; // 0x2C
f32 mMargin16x9; // 0x30
f32 mMargin4x3; // 0x34
int mWaitUntilFadeIn; // 0x38

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

@@ -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

@@ -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

@@ -103,10 +103,10 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
if (length == 1) return 1;
count = --length;
ordinals[count] |= 0x8000;
ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1, __zi8_work_data) & 2;
ZI_WORK->cangjieEnabled = 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) {
if (ZI_WORK->cangjieEnabled != 0) {
switch (*data & 7) {
case 2:
offset = 2;

View File

@@ -42,7 +42,7 @@ typedef struct UHF_MSC_MESSAGE {
} UHF_MSC_MESSAGE;
extern UHF_MSC_DEVICE uhg_msc_blk_device_tbl[8];
extern s32 uhg_msc_memid_8169971C;
extern s32 uhg_msc_memid;
s32 uhf_ker_set_priority(s32 task_id, s32 priority);
void* uhf_ker_get_memory_block(s32 pool, u32 size, u32 alignment);
s32 uhf_ker_release_memory_block(s32 pool, void* block);

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

@@ -20,8 +20,8 @@ typedef void (*USBKBDEventCallback)(void*, char*);
typedef void (*USBKBDCmdLEDCallback)(BOOL success, void* cbarg);
typedef struct USBKBDCmdLED {
vu32 unk_0x00;
vu8 unk_0x04;
vu32 device; // 0x00
vu8 ledBits; // 0x04
} USBKBDCmdLED;
typedef struct USBKBDCmdLEDAsync {

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;

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

@@ -1,6 +1,6 @@
#include <private/fa/puh_msc.h>
s32 uhg_msc_memid_8169971C;
s32 uhg_msc_memid;
static s32 st_uhs_msc_tskid;
static s32 st_uhs_msc_msgid;
static s32 st_uhs_msc_status;
@@ -47,13 +47,13 @@ static s32 _uhf_msc_api_send_message(UHF_MSC_PARAMETERS* parameters, u32 command
s32 result = 0;
s32 semaphore;
UHF_MSC_MESSAGE* message;
message = uhf_ker_get_memory_block(uhg_msc_memid_8169971C, sizeof(UHF_MSC_MESSAGE), 4);
message = uhf_ker_get_memory_block(uhg_msc_memid, sizeof(UHF_MSC_MESSAGE), 4);
if (message == NULL) {
return -12;
}
semaphore = uhf_ker_create_sem(0, 0);
if (semaphore <= 0) {
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, message);
uhf_ker_release_memory_block(uhg_msc_memid, message);
return -12;
}
message->command = command;
@@ -61,7 +61,7 @@ static s32 _uhf_msc_api_send_message(UHF_MSC_PARAMETERS* parameters, u32 command
message->result = &result;
message->parameters = *parameters;
if (uhf_ker_send_message(st_uhs_msc_msgid, message, 0) != 0) {
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, message);
uhf_ker_release_memory_block(uhg_msc_memid, message);
uhf_ker_delete_sem(semaphore);
return -12;
}

View File

@@ -287,13 +287,13 @@ s32 _uhf_msc_blk_send_message(UHF_MSC_PARAMETERS* parameters, u32 command) {
s32 semaphore;
UHF_MSC_MESSAGE* message;
s32 mailbox = uhf_msc_get_message_id();
message = uhf_ker_get_memory_block(uhg_msc_memid_8169971C, sizeof(UHF_MSC_MESSAGE), 4);
message = uhf_ker_get_memory_block(uhg_msc_memid, sizeof(UHF_MSC_MESSAGE), 4);
if (message == NULL) {
return -1;
}
semaphore = uhf_ker_create_sem(0, 0);
if (semaphore <= 0) {
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, message);
uhf_ker_release_memory_block(uhg_msc_memid, message);
return -1;
}
message->command = command;
@@ -301,7 +301,7 @@ s32 _uhf_msc_blk_send_message(UHF_MSC_PARAMETERS* parameters, u32 command) {
message->result = &result;
message->parameters = *parameters;
if (uhf_ker_send_message(mailbox, message, 0) != 0) {
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, message);
uhf_ker_release_memory_block(uhg_msc_memid, message);
uhf_ker_delete_sem(semaphore);
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

@@ -1,7 +1,7 @@
#include <private/vf/PrFILE2/pf_types.h>
// clang-format off
const pf_u8 pf_valid_fn_char_8162E6B0[96] = {
const pf_u8 pf_valid_fn_char[96] = {
1, 3, 0, 3, 3, 3, 3, 3, 3, 3, 0, 1, 1, 3, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 1, 0, 1, 0, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,

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) {
@@ -1282,11 +1279,13 @@ s32 PFFAT_GetSectorSpecified(PFFAT_FFD* file, u32 fileSectorIndex,
error = PFFAT_GetSector(file, fileSectorIndex, clusterIndex != 0, 0,
sector);
if (error != 0) {
goto done;
switch (error) {
case 0:
error = 0;
break;
default:
break;
}
error = 0;
done:
return error;
}
@@ -1873,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] =
@@ -1886,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

@@ -56,7 +56,7 @@ typedef struct PF_PATH_VOLUME_SET {
} PF_PATH_VOLUME_SET;
extern PF_PATH_VOLUME_SET pf_vol_set;
extern const pf_u8 pf_valid_fn_char_8162E6B0[96];
extern const pf_u8 pf_valid_fn_char[96];
extern void PFSTR_SetCodeMode(PF_STR*, pf_u32);
extern pf_u32 PFSTR_GetCodeMode(PF_STR*);
extern pf_s8* PFSTR_GetStrPos(PF_STR*, pf_u32);
@@ -75,9 +75,9 @@ extern pf_u32 PFPATH_CheckExtShortNameSignature(PF_STR*);
extern pf_u32 PFPATH_CheckExtShortName(PF_STR*, pf_u32, pf_bool);
extern void PFCODE_Divide_Width(pf_s32, pf_s16*, pf_s16*);
#define VALID_PATH_CHAR(x, b) ((pf_u8)(x) >= 0x80 || ((pf_u8)(x) >= ' ' && (pf_valid_fn_char_8162E6B0[(pf_u8)(x) - ' '] & b)))
#define VALID_PATH_CHAR(x, b) ((pf_u8)(x) >= 0x80 || ((pf_u8)(x) >= ' ' && (pf_valid_fn_char[(pf_u8)(x) - ' '] & b)))
#define VALID_PATH_WCHAR(x, b) \
((x) >= 0x80 || (pf_u8)(x) >= ' ' && ((pf_u8)(x) & 0xFF00) == 0 && (pf_valid_fn_char_8162E6B0[(pf_u8)((x & 0x00FF) - ' ')] & b))
((x) >= 0x80 || (pf_u8)(x) >= ' ' && ((pf_u8)(x) & 0xFF00) == 0 && (pf_valid_fn_char[(pf_u8)((x & 0x00FF) - ' ')] & b))
pf_s32 PFPATH_DoSplitPath(PF_STR* p_path, PF_STR* p_dir_path, PF_STR* p_filename, pf_u32 wildcard) {
pf_s8* p;

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

@@ -101,8 +101,8 @@ USBKBDErr USBKBDSetLED(u32 device, u8 ledBits, USBKBDCmdLED* cmd) {
return USB_KBD_ERR_NOT_INIT;
}
cmd->unk_0x04 = ledBits;
cmd->unk_0x00 = device;
cmd->ledBits = ledBits;
cmd->device = device;
return IOS_Write(usbKbdFd, cmd, sizeof(USBKBDCmdLED)) != IPC_RESULT_OK ? USB_KBD_ERR_FATAL : USB_KBD_ERR_OK;
}
@@ -118,8 +118,8 @@ USBKBDErr USBKBDSetLEDAsync(u32 device, u8 ledBits, USBKBDCmdLEDAsync* cmd, USBK
if (usbKbdFd < 0) {
return USB_KBD_ERR_NOT_INIT;
}
cmd->base.unk_0x00 = device;
cmd->base.unk_0x04 = ledBits;
cmd->base.device = device;
cmd->base.ledBits = ledBits;
cmd->cb = cb;
cmd->cbArg = cbArg;

View File

@@ -12,7 +12,7 @@
extern void SIRefreshSamplingRate(void);
extern void VISetRGBModeImm(void);
extern void __VISetRevolutionModeSimple(void);
extern volatile u32 Vdac_Flag_Changed_816991E0;
extern volatile u32 Vdac_Flag_Changed;
extern void __VISetYUVSEL(u32 enable);
extern void __VISetFilter4EURGB60(u32 enable);
extern void __VISetCGMS(void);
@@ -324,8 +324,8 @@ position_interrupt:
}
old_tvtype = currentTvType;
if (flushFlag3in1 != 0) {
while (Vdac_Flag_Changed_816991E0 != 0) {
changeBit = 1U << (31 - __cntlzw(Vdac_Flag_Changed_816991E0));
while (Vdac_Flag_Changed != 0) {
changeBit = 1U << (31 - __cntlzw(Vdac_Flag_Changed));
switch (changeBit) {
case 1:
__VISetCGMS();
@@ -352,7 +352,7 @@ position_interrupt:
__VISetRGBModeImm();
break;
}
Vdac_Flag_Changed_816991E0 &= ~changeBit;
Vdac_Flag_Changed &= ~changeBit;
}
flushFlag3in1 = 0;
}

View File

@@ -138,7 +138,7 @@ static s32 Vdac_Flag_Region;
static s32 __type;
static s32 __gamma;
static s32 __level;
volatile u32 Vdac_Flag_Changed_816991E0;
volatile u32 Vdac_Flag_Changed;
static void __VISetCCSEL(u8 flag) {
u8 data[2];
@@ -339,7 +339,7 @@ void VISetCGMS(u8 wd0, u8 wd1, u8 wd2) {
__wd0 = wd0;
__wd1 = wd1;
__wd2 = wd2;
Vdac_Flag_Changed_816991E0 |= 1;
Vdac_Flag_Changed |= 1;
}
}
@@ -382,7 +382,7 @@ void VISetMacrovision(s32 type) {
if ((__type != type) || (__tvType != tvFormat)) {
__type = type;
__tvType = tvFormat;
Vdac_Flag_Changed_816991E0 |= 8;
Vdac_Flag_Changed |= 8;
}
}
@@ -448,7 +448,7 @@ void VISetTrapFilter(BOOL filter) {
return;
}
__filter = filter;
Vdac_Flag_Changed_816991E0 |= 0x20;
Vdac_Flag_Changed |= 0x20;
}
void __VISetRGBOverDrive(void) {
@@ -468,7 +468,7 @@ void __VISetRGBOverDrive(void) {
}
void VISetRGBModeImm(void) {
Vdac_Flag_Changed_816991E0 |= 0x80;
Vdac_Flag_Changed |= 0x80;
}
void __VISetRGBModeImm(void) {
@@ -520,34 +520,34 @@ void __VISetRevolutionMode(void) {
__wd0 = 0;
__wd1 = 0;
__wd2 = 0;
Vdac_Flag_Changed_816991E0 |= 1;
Vdac_Flag_Changed |= 1;
}
if ((__gp1 != 0) || (__gp2 != 0) || (__gp3 != 0) || (__gp4 != 0)) {
__gp1 = 0;
__gp2 = 0;
__gp3 = 0;
__gp4 = 0;
Vdac_Flag_Changed_816991E0 |= 2;
Vdac_Flag_Changed |= 2;
}
if ((__cc1 != 0) || (__cc2 != 0) || (__cc3 != 0) || (__cc4 != 0)) {
__cc1 = 0;
__cc2 = 0;
__cc3 = 0;
__cc4 = 0;
Vdac_Flag_Changed_816991E0 |= 4;
Vdac_Flag_Changed |= 4;
}
VISetMacrovision(1);
if (__filter != 0) {
__filter = 0;
Vdac_Flag_Changed_816991E0 |= 0x20;
Vdac_Flag_Changed |= 0x20;
}
if (__level != 0) {
__level = 0;
Vdac_Flag_Changed_816991E0 |= 0x40;
Vdac_Flag_Changed |= 0x40;
}
if (__gamma != 10) {
__gamma = 10;
Vdac_Flag_Changed_816991E0 |= 0x10;
Vdac_Flag_Changed |= 0x10;
}
VIFlush();
VIWaitForRetrace();
@@ -588,7 +588,7 @@ void VISetWSS(u8 gp1, u8 gp2, u8 gp3, u8 gp4) {
__gp2 = gp2;
__gp3 = gp3;
__gp4 = gp4;
Vdac_Flag_Changed_816991E0 |= 2;
Vdac_Flag_Changed |= 2;
}
}
@@ -598,14 +598,14 @@ void VISetClosedCaption(u8 cc1, u8 cc2, u8 cc3, u8 cc4) {
__cc2 = cc2;
__cc3 = cc3;
__cc4 = cc4;
Vdac_Flag_Changed_816991E0 |= 4;
Vdac_Flag_Changed |= 4;
}
}
void VISetRGBOverDrive(s32 level) {
if (__level != level) {
__level = level;
Vdac_Flag_Changed_816991E0 |= 0x40;
Vdac_Flag_Changed |= 0x40;
}
}

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

@@ -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

@@ -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

@@ -127,10 +127,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

@@ -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 {
@@ -103,9 +104,9 @@ s32 NHTTPi_strToInt(const char* string, s32 length) {
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;
int digit;
BOOL started;
s32 length;
output = destination;
length = 0;
@@ -135,18 +136,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

@@ -13,22 +13,22 @@
const u8 scRsnOui0 = 0;
const u8 scRsnOui1 = 0x0F;
const u8 scRsnOui2 = 0xAC;
const u8 lbl_81695063 = 0;
const u8 scRsnOuiPad = 0;
const u8 scWpaOui0 = 0;
const u8 scWpaOui1 = 0x50;
const u8 scWpaOui2 = 0xF2;
const u8 lbl_81695067 = 0;
const u8 scWpaOuiPad = 0;
#pragma pop
#pragma push
#pragma section sconst_type ".sdata"
const u8 scWpaFindOui0 = 0;
const u8 scWpaFindOui1 = 0x50;
const u8 scWpaFindOui2 = 0xF2;
const u8 lbl_81697D73 = 0;
const u8 lbl_81697D74 = 0;
const u8 lbl_81697D75 = 0;
const u8 lbl_81697D76 = 0;
const u8 lbl_81697D77 = 0;
const u8 scWpaFindOuiPad0 = 0;
const u8 scWpaFindOuiPad1 = 0;
const u8 scWpaFindOuiPad2 = 0;
const u8 scWpaFindOuiPad3 = 0;
const u8 scWpaFindOuiPad4 = 0;
#pragma pop
#define scRsnOui0 (*((volatile const u8*)&scRsnOui0))

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

@@ -604,7 +604,7 @@ vmBoolInt VmIsNan(vmFloat value) {
return isnan(value) || value == VM_NAN;
}
double CHANSVm_8144B1D8(double value) {
double CHANSVmFloatSign(double value) {
// Clamp to -1.0~1.0
return value < 0.0 ? -1.0 : value > 0.0 ? 1.0 : value;
}
@@ -650,14 +650,14 @@ static s32 CHANSVmParseInt(CHANSVmObjHdr* obj, s32 base, u64* out) {
return 0;
}
CHANSVmObjHdr* CHANSVm_8144B30C(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* CHANSVmConvertToIntFromFloat(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
// Convert to int from float
CHANSVmObjHdr* newObj = CHANSVmNewObject(vm, vmFalse, vmNull, CHANS_VM_OBJ_TYPE_INTEGER, 0);
if (newObj != vmNull) {
if (VmIsNan(object->value.float_v)) {
newObj->value.int_v = 0;
} else {
newObj->value.int_v = (u64)(CHANSVm_8144B1D8(object->value.float_v) * floor(fabs(object->value.float_v)));
newObj->value.int_v = (u64)(CHANSVmFloatSign(object->value.float_v) * floor(fabs(object->value.float_v)));
}
}
return newObj;
@@ -675,7 +675,7 @@ CHANSVmObjHdr* CHANSVmConvertToIntFromArray(CHANSVm* vm, CHANSVmObjType type, CH
return vmNull;
}
CHANSVmObjHdr* CHANSVm_8144B430(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* CHANSVmConvertToFloatFromUndefined(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* result = CHANSVmNewObject(vm, vmFalse, vmNull, CHANS_VM_OBJ_TYPE_FLOAT, 0);
if (result != vmNull) {
result->value.float_v = VM_NAN;
@@ -683,7 +683,7 @@ CHANSVmObjHdr* CHANSVm_8144B430(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr*
return result;
}
CHANSVmObjHdr* CHANSVm_8144B470(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* intObj) {
CHANSVmObjHdr* CHANSVmConvertToFloatFromInt(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* intObj) {
CHANSVmObjHdr* result = CHANSVmNewObject(vm, vmFalse, vmNull, CHANS_VM_OBJ_TYPE_FLOAT, 0);
if (result != vmNull) {
result->value.float_v = VmIntToFloat(intObj->value.int_v);
@@ -771,7 +771,7 @@ static inline s32 CHANSVmParseFloat(CHANSVmObjHdr* obj, f64* out) {
return 0;
}
CHANSVmObjHdr* CHANSVm_8144B4D4(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* CHANSVmConvertToFloatFromStr(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
// Convert string keyword into float value
CHANSVmObjHdr* newObj = CHANSVmNewObject(vm, vmFalse, vmNull, CHANS_VM_OBJ_TYPE_FLOAT, 0);
@@ -785,7 +785,7 @@ CHANSVmObjHdr* CHANSVmConvertToStrFromUndefined(CHANSVm* vm, CHANSVmObjType type
return (CHANSVmObjHdr*)CHANSVmConstStringObjectUndefined_;
}
s32 CHANSVm_8144B62C(vmWString buf, u32 len, vmFloat val) NO_INLINE {
s32 CHANSVmFloatToWString(vmWString buf, u32 len, vmFloat val) NO_INLINE {
s32 result = snprintf((char*)buf, len / 2, scFloatPrintfFmt, val);
CHANSVmStrCpyToU16FromU8(buf, (vmString)buf, result);
return VM_STR_LENGTH(result);
@@ -815,7 +815,7 @@ error:
return vmNull;
}
CHANSVmObjHdr* CHANSVm_8144B734(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* value) {
CHANSVmObjHdr* CHANSVmConvertToStrFromFloat(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* value) {
const CHANSVmObjHdr* base;
CHANSVmObjHdr* newObj;
s32 result;
@@ -835,7 +835,7 @@ CHANSVmObjHdr* CHANSVm_8144B734(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr*
newObj = CHANSVmNewObject(vm, vmFalse, vmNull, CHANS_VM_OBJ_TYPE_STRING, VM_STRING_SIZE);
if (newObj != vmNull) {
result = CHANSVm_8144B62C(newObj->value.wstring_v->spData, VM_STRING_SIZE, value->value.float_v);
result = CHANSVmFloatToWString(newObj->value.wstring_v->spData, VM_STRING_SIZE, value->value.float_v);
newObj->value.wstring_v->len = result;
if (newObj->value.wstring_v->len == 0) {
goto error;
@@ -904,9 +904,9 @@ char scVmGetResultType[] = "VmGetResultType";
// clang-format off
const VmConvertEntry VmTypeConvertFuncTbl[] = {
{vmNull, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError},
{CHANSVmConvertObjectTypeError, vmNull, CHANSVm_8144B30C, CHANSVmConvertToIntFromStr, CHANSVmConvertToIntFromArray, CHANSVmConvertObjectTypeError},
{CHANSVm_8144B430, CHANSVm_8144B470, vmNull, CHANSVm_8144B4D4, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError},
{CHANSVmConvertToStrFromUndefined, CHANSVmConvertToStrFromInt, CHANSVm_8144B734, vmNull, CHANSVmConvertToStrFromArray, CHANSVmConvertObjectTypeError},
{CHANSVmConvertObjectTypeError, vmNull, CHANSVmConvertToIntFromFloat, CHANSVmConvertToIntFromStr, CHANSVmConvertToIntFromArray, CHANSVmConvertObjectTypeError},
{CHANSVmConvertToFloatFromUndefined, CHANSVmConvertToFloatFromInt, vmNull, CHANSVmConvertToFloatFromStr, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError},
{CHANSVmConvertToStrFromUndefined, CHANSVmConvertToStrFromInt, CHANSVmConvertToStrFromFloat, vmNull, CHANSVmConvertToStrFromArray, CHANSVmConvertObjectTypeError},
{CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, vmNull, CHANSVmConvertObjectTypeError},
{CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError, vmNull},
};
@@ -2183,7 +2183,7 @@ static u32 VmArrayJoinSub(CHANSVmObjHdr* obj, CHANSVmObjHdr* array, wchar_t* sep
if (offset + 0x80 > bufSize) {
goto error;
}
elemLen = CHANSVm_8144B62C((vmWString)((u8*)(*obj->value.ptr_v) + offset), 0x80, chunk->elements[countInChunk].value.float_v);
elemLen = CHANSVmFloatToWString((vmWString)((u8*)(*obj->value.ptr_v) + offset), 0x80, chunk->elements[countInChunk].value.float_v);
break;
}
case CHANS_VM_TYPE_ARRAY: {
@@ -3400,7 +3400,7 @@ VmMethodDefine(String, ToUpperCase) {
return vmFalse;
}
CHANSVmObjHdr* CHANSVm_8145049C(CHANSVm* vm, CHANSVmObjHdr* obj, u32 arg) {
CHANSVmObjHdr* CHANSVmFormatString(CHANSVm* vm, CHANSVmObjHdr* obj, u32 arg) {
u8 pad0[8];
u8 tempBuf[16];
u8 fmtBufData[32];
@@ -3745,7 +3745,7 @@ null_return:
VmMethodDefine(String, Format) {
u32 result;
if (VmParentObj != vmNull && VmParentObj->type == CHANS_VM_TYPE_CLASS_REF) {
result = (u32)CHANSVm_8145049C(VmInst, VmReturnObj, 0);
result = (u32)CHANSVmFormatString(VmInst, VmReturnObj, 0);
return result != 0;
}
return 0;
@@ -3775,10 +3775,10 @@ int VmGetIntFromObjHdr(CHANSVmObjHdr* object) {
return 0;
}
u32 CHANSVm_81451314(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit);
BOOL CHANSVm_81451348(BlobHeader* blob, s64 size);
u32 CHANSVmBlobGetCount(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit);
BOOL CHANSVmBlobHasSpace(BlobHeader* blob, s64 size);
CHANSVmObjHdr* CHANSVmNewBlobObject(CHANSVm* VmInst, CHANSVmObjHdr* obj, u32 size, void* src, u32 count);
static u64 CHANSVm_814540E0(u32 upper, u32 lower);
static u64 CHANSVmMakeU64(u32 upper, u32 lower);
static void VmBlobInitValue(BlobHeader* blob, u32 size) {
if (blob != vmNull) {
@@ -3834,7 +3834,7 @@ static u8* VmBlobGetDataBufferDirect(CHANSVmObjHdr* obj) {
return vmNull;
}
BOOL CHANSVm_81450D14(BlobHeader* blob, s64 val, u32* out) {
BOOL CHANSVmBlobResolveOffset(BlobHeader* blob, s64 val, u32* out) {
s64 pos;
if (blob == vmNull) {
@@ -3901,7 +3901,7 @@ VmMethodDefine(Blob, Seek) {
return 0;
}
if (CHANSVm_81450D14(blob, val->value.int_v, &tmp)) {
if (CHANSVmBlobResolveOffset(blob, val->value.int_v, &tmp)) {
blob->offset = tmp;
} else {
return 0;
@@ -3988,9 +3988,9 @@ VmMethodDefine(Blob, Fill) {
return 0;
}
count = blob != vmNull ? CHANSVm_81451314(blob, fill, blob->offset) : 0;
count = blob != vmNull ? CHANSVmBlobGetCount(blob, fill, blob->offset) : 0;
if (CHANSVm_81451348(blob, count)) {
if (CHANSVmBlobHasSpace(blob, count)) {
memset(blob->pData + blob->offset, (u8)val->value.int_v, count);
blob->offset += count;
return 1;
@@ -3999,7 +3999,7 @@ VmMethodDefine(Blob, Fill) {
return 0;
}
u32 CHANSVm_81451314(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit) {
u32 CHANSVmBlobGetCount(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit) {
if (ptr != vmNull) {
return *(u32*)((u8*)ptr + 4);
}
@@ -4013,7 +4013,7 @@ u32 CHANSVm_81451314(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit) {
return 0;
}
BOOL CHANSVm_81451348(BlobHeader* blob, s64 size) {
BOOL CHANSVmBlobHasSpace(BlobHeader* blob, s64 size) {
u32 curOff = blob->offset;
return size >= 0 && (s64)(blob->size - curOff) >= size;
}
@@ -4028,7 +4028,7 @@ VmMethodDefine(Blob, GetString) {
}
size = (u32)arg->value.int_v;
if (CHANSVm_81451348(blob, size)) {
if (CHANSVmBlobHasSpace(blob, size)) {
CHANSVmErr err = CHANSVmSetU16StringFromU8(VmInst, VmReturnObj, (char*)(blob->pData + blob->offset), size);
blob->offset += size;
return err == CHANS_VM_OK;
@@ -4058,7 +4058,7 @@ VmMethodDefine(Blob, SetString) {
}
}
if (CHANSVm_81451348(blob, size)) {
if (CHANSVmBlobHasSpace(blob, size)) {
memset(blob->pData + blob->offset, 0, size);
CHANSVmStrCpyToU8FromU16(blob->pData + blob->offset, strData, charCount);
blob->offset += size;
@@ -4076,7 +4076,7 @@ VmMethodDefine(Blob, GetWString) {
return 0;
}
if (CHANSVm_81451348(blob, VM_STR_LENGTH(arg->value.int_v))) {
if (CHANSVmBlobHasSpace(blob, VM_STR_LENGTH(arg->value.int_v))) {
CHANSVmErr err = CHANSVmSetU16String(VmInst, VmReturnObj, (wchar_t*)(blob->pData + blob->offset), (u32)arg->value.int_v << 1);
u32 oldOffset = blob->offset;
u64 length = VM_STR_LENGTH(arg->value.int_v);
@@ -4113,7 +4113,7 @@ VmMethodDefine(Blob, SetWString) {
}
}
if (CHANSVm_81451348(blob, size)) {
if (CHANSVmBlobHasSpace(blob, size)) {
memcpy(blob->pData + blob->offset, strData, strLen);
if (strLen < size) {
memset(blob->pData + blob->offset + strLen, 0, size - strLen);
@@ -4184,8 +4184,8 @@ VmMethodDefine(Blob, CopyRangeFrom) {
srcOff = 0;
destOff = 0;
if (CHANSVm_81450D14(destBlob, destOffObj->value.int_v, &destOff) != 0 && CHANSVm_81450D14(srcBlob, srcOffObj->value.int_v, &srcOff) != 0) {
count = CHANSVm_81451314(srcBlob, countObj, srcOff);
if (CHANSVmBlobResolveOffset(destBlob, destOffObj->value.int_v, &destOff) != 0 && CHANSVmBlobResolveOffset(srcBlob, srcOffObj->value.int_v, &srcOff) != 0) {
count = CHANSVmBlobGetCount(srcBlob, countObj, srcOff);
{
u32 destinationOffset = destOff;
okFlag = (s64)count >= 0 && (s64)(destBlob->size - destinationOffset) >= (s64)count;
@@ -4213,9 +4213,9 @@ VmMethodDefine(Blob, GetBlob) {
if (blob == vmNull)
return 0;
count = blob != vmNull ? CHANSVm_81451314(blob, arg, blob->offset) : 0;
count = blob != vmNull ? CHANSVmBlobGetCount(blob, arg, blob->offset) : 0;
if (CHANSVm_81451348(blob, count)) {
if (CHANSVmBlobHasSpace(blob, count)) {
if (CHANSVmNewBlobObject(VmInst, VmReturnObj, count, blob->offset + blob->pData, count) != vmNull) {
blob->offset += count;
return 1;
@@ -4262,7 +4262,7 @@ VmMethodDefine(Blob, SetBlob) {
}
}
if (CHANSVm_81451348(destBlob, logicalSize)) {
if (CHANSVmBlobHasSpace(destBlob, logicalSize)) {
memmove(destBlob->pData + *(u32*)&destBlob->offset, srcBlob->pData + srcBlob->offset, copySize);
if (copySize < logicalSize) {
memset(destBlob->offset + destBlob->pData + copySize, 0, logicalSize - copySize);
@@ -4284,9 +4284,9 @@ VmMethodDefine(Blob, GetHexString) {
return vmFalse;
}
count = blob != vmNull ? CHANSVm_81451314(blob, arg, blob->offset) : 0;
count = blob != vmNull ? CHANSVmBlobGetCount(blob, arg, blob->offset) : 0;
if (CHANSVm_81451348(blob, count) && CHANSVmNewObject(VmInst, vmFalse, VmReturnObj, CHANS_VM_OBJ_TYPE_STRING, count * 4) != vmNull) {
if (CHANSVmBlobHasSpace(blob, count) && CHANSVmNewObject(VmInst, vmFalse, VmReturnObj, CHANS_VM_OBJ_TYPE_STRING, count * 4) != vmNull) {
wchar_t* dest = (wchar_t*)VmGetStrFromObjHdr(VmReturnObj);
u8* src = blob->pData;
u32 offset = blob->offset;
@@ -4352,8 +4352,8 @@ VmMethodDefine(Blob, CalcRangeSHA1Digest) {
return 0;
}
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
{
u32 off = offset;
@@ -4417,8 +4417,8 @@ VmMethodDefine(Blob, CalcRangeMD5Digest) {
return 0;
}
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
{
u32 off = offset;
@@ -4464,8 +4464,8 @@ VmMethodDefine(Blob, CalcRangeCRC16) {
return 0;
}
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
{
u32 off = offset;
if (((s64)size >= 0LL && (s64)(blob->size - off) >= (s64)size) != vmFalse) {
@@ -4500,8 +4500,8 @@ VmMethodDefine(Blob, CalcRangeCRC32) {
return 0;
}
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
{
u32 off = offset;
@@ -4573,8 +4573,8 @@ VmMethodDefine(Blob, CalcRangeHMAC) {
return 0;
}
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
off = offset;
if (((s64)size >= 0LL && (s64)(blob->size - off) >= (s64)size) != vmFalse) {
NETHMACContext ctx;
@@ -5202,7 +5202,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
copySize = paramValue;
}
if (copySize < 0 || !CHANSVm_81451348(parentBlob, copySize)) {
if (copySize < 0 || !CHANSVmBlobHasSpace(parentBlob, copySize)) {
goto error;
}
@@ -5220,7 +5220,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
break;
}
case 5: {
if (paramValue < 0 || !CHANSVm_81451348(parentBlob, paramValue)) {
if (paramValue < 0 || !CHANSVmBlobHasSpace(parentBlob, paramValue)) {
goto error;
}
if (paramValue > 0) {
@@ -5247,7 +5247,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
goto error;
}
if (!CHANSVm_81451348(parentBlob, elemSize * count)) {
if (!CHANSVmBlobHasSpace(parentBlob, elemSize * count)) {
goto error;
}
@@ -5342,7 +5342,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
break;
}
case 8: {
*(u64*)packBuf = CHANSVm_814540E0(packBuf[0], packBuf[1]);
*(u64*)packBuf = CHANSVmMakeU64(packBuf[0], packBuf[1]);
break;
}
}
@@ -5379,7 +5379,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
goto error;
}
if (!CHANSVm_81451348(parentBlob, elemSize * count)) {
if (!CHANSVmBlobHasSpace(parentBlob, elemSize * count)) {
goto error;
}
@@ -5424,7 +5424,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
}
bufSize = (count + 1) / 2;
if (!CHANSVm_81451348(parentBlob, bufSize)) {
if (!CHANSVmBlobHasSpace(parentBlob, bufSize)) {
goto error;
}
@@ -5472,7 +5472,7 @@ error:
return vmFalse;
}
static u64 CHANSVm_814540E0(u32 upper, u32 lower) {
static u64 CHANSVmMakeU64(u32 upper, u32 lower) {
// Read U64 and byte-swap
u64 x = (u64)upper << 32 | lower;
return x >> 56 & 0x00000000000000ffULL | x >> 40 & 0x000000000000ff00ULL | x >> 24 & 0x0000000000ff0000ULL | x >> 8 & 0x00000000ff000000ULL |
@@ -5648,7 +5648,7 @@ VmMethodDefine(Blob, Unpack) {
} else {
count = outVal;
}
if (count < 0 || !CHANSVm_81451348(srcBlob, count)) {
if (count < 0 || !CHANSVmBlobHasSpace(srcBlob, count)) {
goto error;
}
@@ -5663,7 +5663,7 @@ VmMethodDefine(Blob, Unpack) {
break;
}
case 5: {
if (outVal < 0 || !CHANSVm_81451348(srcBlob, outVal)) {
if (outVal < 0 || !CHANSVmBlobHasSpace(srcBlob, outVal)) {
goto error;
}
@@ -5682,7 +5682,7 @@ VmMethodDefine(Blob, Unpack) {
} else {
count = outVal;
}
if (count < 0 || !CHANSVm_81451348(srcBlob, outSize * count)) {
if (count < 0 || !CHANSVmBlobHasSpace(srcBlob, outSize * count)) {
goto error;
}
@@ -5710,7 +5710,7 @@ VmMethodDefine(Blob, Unpack) {
break;
}
case 8: {
unpackBuf.value = CHANSVm_814540E0(unpackBuf.words[0], unpackBuf.words[1]);
unpackBuf.value = CHANSVmMakeU64(unpackBuf.words[0], unpackBuf.words[1]);
break;
}
}
@@ -5794,7 +5794,7 @@ VmMethodDefine(Blob, Unpack) {
}
count = (srcBlob->size - srcBlob->offset) / outSize;
}
if ((s32)count < 0 || !CHANSVm_81451348(srcBlob, outSize * count)) {
if ((s32)count < 0 || !CHANSVmBlobHasSpace(srcBlob, outSize * count)) {
goto error;
}
@@ -5845,7 +5845,7 @@ VmMethodDefine(Blob, Unpack) {
}
bufSize = (s32)(count + 1) / 2;
if (!CHANSVm_81451348(srcBlob, bufSize)) {
if (!CHANSVmBlobHasSpace(srcBlob, bufSize)) {
goto error;
}
@@ -6466,7 +6466,7 @@ void CHANSConvertModuleOfsToPtr(CHANSVmModule* ptr) {
VmOffsU32ToPtr((void**)&ptr->pLineTbl, ptr);
}
static CHANSVmObjHdr* CHANSVm_81455654(CHANSVm* vm, s32 id) {
static CHANSVmObjHdr* CHANSVmLookupScopedObject(CHANSVm* vm, s32 id) {
CHANSVmObjHdr* data = vmNull;
CHANSVmPrivate* pVm = (CHANSVmPrivate*)vm;
CHANSVmExecutionCtx* ctx = pVm->pActiveCtx;
@@ -6755,7 +6755,7 @@ static CHANSVmErr VmReturnWithValue(CHANSVm* vm, u32 val) {
}
} else {
for (i = 0; i < pVm->pActiveCtx->pDbg->moduleCount; i++) {
if (CHANSVmDeleteObject(vm, CHANSVm_81455654(vm, i)) != CHANS_VM_OK) {
if (CHANSVmDeleteObject(vm, CHANSVmLookupScopedObject(vm, i)) != CHANS_VM_OK) {
return CHANS_VM_ERR_RETURN;
}
}
@@ -6873,7 +6873,7 @@ CHANSVmErr CHANSVmLinkModules(CHANSVm* vm, vmS32 unk0) {
CHANSVmObjHdr* obj;
if (idx >= module->moduleCount) {
goto pass3_idx_err;
} else if (obj = CHANSVm_81455654(vm, idx), obj == vmNull) {
} else if (obj = CHANSVmLookupScopedObject(vm, idx), obj == vmNull) {
goto pass3_obj_err;
} else if (obj->type == CHANS_VM_OBJ_TYPE_BLANK) {
goto pass3_success;
@@ -7602,7 +7602,7 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
break;
}
case CHANS_VM_OBJ_TYPE_FLOAT: {
invertedVal = (s64)(CHANSVm_8144B1D8(pAcc->value.float_v) * floor(fabs(pAcc->value.float_v)));
invertedVal = (s64)(CHANSVmFloatSign(pAcc->value.float_v) * floor(fabs(pAcc->value.float_v)));
break;
}
case CHANS_VM_OBJ_TYPE_STRING: {
@@ -7818,7 +7818,7 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
result = CHANS_VM_ERR_GET_PROPERTY_NAME;
arrayIdx = 0;
imm16Val = VM_READ_BE_U16(operandBuf, 0);
foundObj = CHANSVm_81455654(vm, imm16Val);
foundObj = CHANSVmLookupScopedObject(vm, imm16Val);
accumulator = &pVm->accumulator;
if (foundObj != vmNull && accumulator->type == CHANS_VM_OBJ_TYPE_INTEGER &&
(computedAddr = accumulator->value.data.len, (u64)accumulator->value.int_v <= ~1U)) {
@@ -7954,7 +7954,7 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
if (operandBuf == vmNull) {
return CHANS_VM_ERR_CODE_RANGE;
}
foundObj = CHANSVm_81455654(vm, (VM_READ_BE_U16(operandBuf, 0)) & 0x1FFF);
foundObj = CHANSVmLookupScopedObject(vm, (VM_READ_BE_U16(operandBuf, 0)) & 0x1FFF);
result = VmDeleteCommon(vm, foundObj);
break;
}
@@ -7982,12 +7982,12 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
imm16Val = (opcodeVal << 8 | operandBuf[1]) & 0x1FFF;
switch (opcodeVal & CHANS_VM_OP_SYMBOL_STORE) {
case 0: {
foundObj = CHANSVm_81455654(vm, imm16Val);
foundObj = CHANSVmLookupScopedObject(vm, imm16Val);
result = VmStore(vm, &pVm->accumulator, foundObj);
break;
}
case CHANS_VM_OP_SYMBOL_STORE: {
foundObj = CHANSVm_81455654(vm, imm16Val);
foundObj = CHANSVmLookupScopedObject(vm, imm16Val);
result = VmStore(vm, foundObj, &pVm->accumulator);
break;
}

View File

@@ -5,13 +5,6 @@
#include <new>
extern "C" const f32 lbl_81694D90;
extern "C" const f32 lbl_81694DA8;
extern "C" const f32 lbl_81694DAC;
extern "C" const f32 lbl_81694DB0;
extern "C" const f32 lbl_81694DB4;
extern "C" const f32 lbl_81694DBC;
extern "C" const double lbl_81694DC8;
extern "C" void _savegpr_24();
extern "C" void _restgpr_24();
extern "C" void GetFont__Q34nw4r3lyt8TextBoxCFv();

View File

@@ -338,8 +338,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 +347,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 +356,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 +371,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) {
@@ -500,7 +497,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 {

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:
@@ -2539,11 +2543,14 @@ namespace textinput {
u32 koreanCode = code;
if (caps)
koreanCode = util::reverseLetterCaseW(koreanCode);
u16 mapped;
if (koreanCode >= L'a' && koreanCode <= L'z')
koreanCode = KOREAN_LOWER[static_cast<u16>(koreanCode) - L'a'];
mapped = KOREAN_LOWER[static_cast<u16>(koreanCode) - L'a'];
else if (koreanCode >= L'A' && koreanCode <= L'Z')
koreanCode = KOREAN_UPPER[static_cast<u16>(koreanCode) - L'A'];
code = koreanCode;
mapped = KOREAN_UPPER[static_cast<u16>(koreanCode) - L'A'];
else
mapped = koreanCode;
code = mapped;
}
}
animation = searchAnmPane(code);

View File

@@ -485,16 +485,16 @@ namespace ipl {
}
void BoardObject::stt_stand() {
f32 degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
f32 dVar2 = nw4r::math::CosFIdx(degrees * 0.7111111f);
degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
f32 dVar3 = nw4r::math::SinFIdx(degrees * 0.7111111f);
f32 degrees = mStandData.mAngleIdx * 30.0f + 30.0f;
f32 cosF = nw4r::math::CosFIdx(degrees * 0.7111111f);
degrees = mStandData.mAngleIdx * 30.0f + 30.0f;
f32 sinF = nw4r::math::SinFIdx(degrees * 0.7111111f);
math::VEC2 standPos;
__ct__Q33ipl4math4VEC2Fff(&standPos, dVar3 * 160.0f, dVar2 * 160.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.unk_0x08)) + (standPos * mStandData.unk_0x08)) / 10.0f);
__ct__Q33ipl4math4VEC2Fff(&standPos, sinF * 160.0f, cosF * 160.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,14 +306,13 @@ namespace ipl {
void Date::initEvent() {
mpGui->init();
mpPaneAnims[ANIM_PANE_BTN_HOVER]->initAnmFrame(0.0f);
unk_0x3C = 0;
mPointCount = 0;
onCmdRecv(3);
}
#pragma push
#pragma section sconst_type ".sdata2"
extern "C" const f32 scDateZeroF = 0.0f;
extern "C" const f32 lbl_816948F0;
#pragma pop
} // namespace scene
} // namespace ipl

View File

@@ -45,7 +45,7 @@ struct CardThreadState {
MEMAllocator sAllocator_;
static CardThreadState* sThread;
extern "C" void* CardSequence_813D2C8C();
extern "C" void* cardThreadMain();
static char sCardSlotName[3] = "AB";
FileInfo* getCardDirState() {
@@ -68,7 +68,7 @@ long getCardLastCMDFCmdResult() {
return sThread->completionResult;
}
extern "C" s32 CardSequence_813D205C(u8 slot) {
extern "C" s32 sendCardUnmountCmd(u8 slot) {
sThread->sourceSlot = slot;
sThread->lastCommand = 9;
sThread->lastResult = -21;
@@ -114,12 +114,12 @@ void sendCardDeleteCmd(u8 slot, s16 fileNo) {
}
void sendCardThreadStopCmd() NO_INLINE {
CardSequence_813D205C(0);
CardSequence_813D205C(1);
sendCardUnmountCmd(0);
sendCardUnmountCmd(1);
OSSendMessage(&sThread->requests, (OSMessage)0xB, 0);
}
extern "C" void CardSequence_813D222C(u8 slot) {
extern "C" void pollCardSlot(u8 slot) {
s32 result;
if (sThread->valid == 1) {
@@ -139,7 +139,7 @@ extern "C" void CardSequence_813D222C(u8 slot) {
}
}
if (result == 0) {
if (sThread->slots[slot].state > 2 && CardSequence_813D205C(slot)) {
if (sThread->slots[slot].state > 2 && sendCardUnmountCmd(slot)) {
sThread->slots[slot].changed = 0;
}
}
@@ -148,7 +148,7 @@ done:
return;
}
extern "C" s32 CardSequence_813D233C(s32 result) {
extern "C" s32 mapCardErrorCode(s32 result) {
switch (result) {
case 0:
return 0;
@@ -186,8 +186,8 @@ extern "C" s32 CardSequence_813D233C(s32 result) {
void probeCard() {
OSMessage message;
CardSequence_813D222C(0);
CardSequence_813D222C(1);
pollCardSlot(0);
pollCardSlot(1);
while (OSReceiveMessage(&sThread->responses, &message, 0)) {
s16 slot = (s16)(((u32)message >> 16) & 1);
s8 command = (u8)(u32)message;
@@ -251,9 +251,9 @@ checkCommand:
break;
}
sThread->lastResult = CardSequence_813D233C((s8)(((u32)message << 16) >> 24));
sThread->lastResult = mapCardErrorCode((s8)(((u32)message << 16) >> 24));
if ((s8)(u8)(u32)message != 0 && (s8)(u8)(u32)message != 9) {
sThread->completionResult = CardSequence_813D233C((s8)(((u32)message << 16) >> 24));
sThread->completionResult = mapCardErrorCode((s8)(((u32)message << 16) >> 24));
if (sThread->sourceSlot != (s16)(((u32)message >> 16) & 1)) {
sThread->destinationFileNo = (u32)message >> 24;
}
@@ -302,7 +302,7 @@ void initCardThread() {
OSInitMessageQueue(&sThread->responses, sThread->responseMessages, 0x10);
OSInitMessageQueue(&sThread->requests, sThread->requestMessages, 0x10);
OSCreateThread(&sThread->thread, (void* (*)(void*))CardSequence_813D2C8C, 0,
OSCreateThread(&sThread->thread, (void* (*)(void*))cardThreadMain, 0,
sThread->stack + sizeof(sThread->stack), 0x8000, 0x11, 0);
OSResumeThread(&sThread->thread);
OSSendMessage(&sThread->requests, (OSMessage)10, 0);
@@ -348,7 +348,7 @@ const char* getIconComment(u8 slot, s16 index) {
return sThread->comments[slot][index];
}
extern "C" void CardSequence_813D2A74(s32 slot, s32 index) {
extern "C" void clearCardFileEntry(s32 slot, s32 index) {
BOOL interrupts = OSDisableInterrupts();
sThread->files[slot][index].fileNo = 0;
sThread->files[slot][index].size = 0;
@@ -360,7 +360,7 @@ extern "C" void CardSequence_813D2A74(s32 slot, s32 index) {
OSRestoreInterrupts(interrupts);
}
extern "C" void CardSequence_813D2B40(s32 slot) {
extern "C" void refreshCardSlotInfo(s32 slot) {
u16 memSize;
u32 sectorSize;
s32 freeBytes;
@@ -391,12 +391,12 @@ extern "C" void CardSequence_813D2B40(s32 slot) {
}
}
extern "C" s32 CardSequence_813D320C(s32 slot, s32 result);
extern "C" s32 CardSequence_813D32A8(s32 slot, s32 state, s32 result);
extern "C" void CardSequence_813D3380(s32 slot, s32 state, s32 fileNo);
extern "C" void CardSequence_813D33D8(s32 slot);
extern "C" s32 CardSequence_813D3424(s32 slot, s32 fileNo, CARDDir* dir);
extern "C" void CardSequence_813D3D14(s32 slot, s16 fileNo, s32 command);
extern "C" s32 handleCardMountResult(s32 slot, s32 result);
extern "C" s32 reportCardThreadError(s32 slot, s32 state, s32 result);
extern "C" void sendCardSlotState(s32 slot, s32 state, s32 fileNo);
extern "C" void clearAllCardFileEntries(s32 slot);
extern "C" s32 loadCardFileIcons(s32 slot, s32 fileNo, CARDDir* dir);
extern "C" void runCardMoveOrCopy(s32 slot, s16 fileNo, s32 command);
static inline void sendValidityResponse(u32 command, u32 valid) {
union {
@@ -408,7 +408,7 @@ static inline void sendValidityResponse(u32 command, u32 valid) {
OSSendMessage(&sThread->responses, (OSMessage)reply.value, 1);
}
extern "C" void* CardSequence_813D2C8C() {
extern "C" void* cardThreadMain() {
struct CardThreadLocals {
u8 compareName[6];
u32 message;
@@ -455,7 +455,7 @@ loopStart:
command = (local.message >> 14) & 4;
result = CARDMount(slot, sThread->mountBuffers[command / 4], 0);
if (result < 0) {
result = CardSequence_813D320C(slot, result);
result = handleCardMountResult(slot, result);
if (result != 0) {
goto mountContinue;
}
@@ -467,11 +467,11 @@ loopStart:
}
mountContinue:
CardSequence_813D33D8(slot);
clearAllCardFileEntries(slot);
for (file = 0; file < 0x7F; ++file) {
result = __CARDGetStatusEx(slot, (s16)file, &local.mountDir);
if (result < 0) {
result = CardSequence_813D320C(slot, result);
result = handleCardMountResult(slot, result);
if (result != 0) {
continue;
}
@@ -496,16 +496,16 @@ loopStart:
goto mountError;
}
} else {
result = CardSequence_813D3424(slot, (s16)file, &local.mountDir);
result = loadCardFileIcons(slot, (s16)file, &local.mountDir);
if (result < 0) {
goto mountError;
}
}
}
}
CardSequence_813D2B40(slot);
refreshCardSlotInfo(slot);
sThread->mounted[command / 4] = 1;
CardSequence_813D3380(slot, 0, 0);
sendCardSlotState(slot, 0, 0);
OSReport("Slot %c\n", sCardSlotName[slot]);
for (listingFile = 0; listingFile < 0x7F; ++listingFile) {
if (__CARDGetStatusEx(slot, (u16)listingFile, &local.listingDir) == 0) {
@@ -519,30 +519,30 @@ loopStart:
mountError:
OSReport("MountError\n");
CardSequence_813D32A8(slot, 0, result);
reportCardThreadError(slot, 0, result);
break;
}
case 9:
CardSequence_813D32A8((local.message >> 16) & 1, 9, -3);
reportCardThreadError((local.message >> 16) & 1, 9, -3);
break;
case 1: {
slot = (local.message >> 16) & 1;
result = CARDFormat(slot);
if (result < 0) {
CardSequence_813D32A8(slot, 1, result);
reportCardThreadError(slot, 1, result);
} else {
sThread->mounted[slot] = 1;
CardSequence_813D2B40(slot);
CardSequence_813D3380(slot, 1, 0);
refreshCardSlotInfo(slot);
sendCardSlotState(slot, 1, 0);
}
break;
}
case 2:
CardSequence_813D3D14((local.message >> 16) & 1,
runCardMoveOrCopy((local.message >> 16) & 1,
(s16)(u8)(local.message >> 24), (s8)command);
break;
case 3:
CardSequence_813D3D14((local.message >> 16) & 1,
runCardMoveOrCopy((local.message >> 16) & 1,
(s16)(u8)(local.message >> 24), (s8)command);
break;
case 4: {
@@ -550,11 +550,11 @@ loopStart:
fileNo = (s16)(local.message >> 24);
result = CARDFastDelete(slot, fileNo);
if (result < 0) {
CardSequence_813D32A8(slot, 4, result);
reportCardThreadError(slot, 4, result);
} else {
CardSequence_813D2A74(slot, fileNo);
CardSequence_813D2B40(slot);
CardSequence_813D3380(slot, 4, (u8)fileNo);
clearCardFileEntry(slot, fileNo);
refreshCardSlotInfo(slot);
sendCardSlotState(slot, 4, (u8)fileNo);
}
break;
}
@@ -581,7 +581,7 @@ loopStart:
++outerSlot;
} while (outerSlot < 2);
CardSequence_813D3380(0, 0xC, 0);
sendCardSlotState(0, 0xC, 0);
break;
default:
break;
@@ -593,9 +593,9 @@ loopCheck:
return 0;
}
extern "C" s32 CardSequence_813D3C38(s32 slot, s16 fileNo);
extern "C" s32 checkCardFileDuplicate(s32 slot, s16 fileNo);
extern "C" void CardSequence_813D3140() {
extern "C" void markAllCardFilesDirty() {
u32 slot = 0;
s32 fileNo;
@@ -607,7 +607,7 @@ extern "C" void CardSequence_813D3140() {
sThread->files[slot][fileNo].unk_0x06 = 0;
if (sThread->mounted[slot] != 0 &&
sThread->mounted[slot ^ 1] != 0 &&
CardSequence_813D3C38((u8)slot, (s16)fileNo) < 0) {
checkCardFileDuplicate((u8)slot, (s16)fileNo) < 0) {
sThread->files[slot][fileNo].unk_0x06 = flagValue;
}
++fileNo;
@@ -618,7 +618,7 @@ extern "C" void CardSequence_813D3140() {
} while ((s32)slot < 2);
}
extern "C" s32 CardSequence_813D320C(s32 slot, s32 result) {
extern "C" s32 handleCardMountResult(s32 slot, s32 result) {
if (result == -5) {
goto reportError;
}
@@ -640,32 +640,32 @@ repairedCard:
{
result = CARDCheck(slot);
if (result < 0) {
return CardSequence_813D32A8(slot, 0, result);
return reportCardThreadError(slot, 0, result);
}
OSReport("CardThread:Broken Card Repaired\n");
return 1;
}
reportError:
return CardSequence_813D32A8(slot, 0, result);
return reportCardThreadError(slot, 0, result);
}
extern "C" s32 CardSequence_813D32A8(s32 slot, s32 state, s32 result) {
extern "C" s32 reportCardThreadError(s32 slot, s32 state, s32 result) {
if (result != -7 && result != -27 && result != -8 && result != -9 &&
(CardSequence_813D33D8(slot), result != -6) && result != -13) {
(clearAllCardFileEntries(slot), result != -6) && result != -13) {
OSReport("DEBUG: UnmountCard %d \n", slot);
CARDUnmount(slot);
sThread->mounted[slot & 0xFF] = 0;
}
OSReport("DEBUG: CardThread error %d %d\n", state, result);
CardSequence_813D3140();
markAllCardFilesDirty();
OSSendMessage(&sThread->responses,
(OSMessage)(((slot & 1) << 16) | ((result & 0xFF) << 8) | (state & 0xFF)), 1);
return 0;
}
extern "C" void CardSequence_813D3380(s32 slot, s32 state, s32 fileNo) {
CardSequence_813D3140();
extern "C" void sendCardSlotState(s32 slot, s32 state, s32 fileNo) {
markAllCardFilesDirty();
OSMessageQueue* queue = &sThread->responses;
union CardThreadMessage {
u32 value;
@@ -683,15 +683,15 @@ extern "C" void CardSequence_813D3380(s32 slot, s32 state, s32 fileNo) {
OSSendMessage(queue, (OSMessage)message.value, 1);
}
extern "C" void CardSequence_813D33D8(s32 slot) {
extern "C" void clearAllCardFileEntries(s32 slot) {
s32 file = 0;
do {
CardSequence_813D2A74(slot, (s16)file);
clearCardFileEntry(slot, (s16)file);
file = file + 1;
} while (file < 0x7F);
}
extern "C" s32 CardSequence_813D3424(s32 slot, s32 fileNo, CARDDir* dir) {
extern "C" s32 loadCardFileIcons(s32 slot, s32 fileNo, CARDDir* dir) {
struct CardSequenceFileData {
s32 commentSectorSize;
s32 sectorSize;
@@ -922,11 +922,11 @@ closeFileSuccess:
return 0;
}
extern "C" void CardSequence_813D3C24(s32, s32) {
extern "C" void clearCardWritePending(s32, s32) {
sThread->writePending = 0;
}
extern "C" s32 CardSequence_813D3C38(s32 slot, s16 fileNo) {
extern "C" s32 checkCardFileDuplicate(s32 slot, s16 fileNo) {
CARDDir sourceDir;
CARDDir otherDir;
s32 result = __CARDGetStatusEx(slot, fileNo, &sourceDir);
@@ -950,7 +950,7 @@ extern "C" s32 CardSequence_813D3C38(s32 slot, s16 fileNo) {
return 0;
}
extern "C" void CardSequence_813D3D14(s32 slot, s16 fileNo, s32 command) {
extern "C" void runCardMoveOrCopy(s32 slot, s16 fileNo, s32 command) {
CARDDir createStatus;
CARDDir checkedStatus;
CARDDir ioStatus;
@@ -970,10 +970,10 @@ extern "C" void CardSequence_813D3D14(s32 slot, s16 fileNo, s32 command) {
s32 statusResult;
s32 stage;
result = CardSequence_813D3C38(slot, fileNo);
result = checkCardFileDuplicate(slot, fileNo);
if (result < 0) {
CardSequence_813D32A8(slot, command, result);
reportCardThreadError(slot, command, result);
goto finish;
}
@@ -999,7 +999,7 @@ sectorSizeCheck:
goto sectorSizeDone;
}
sectorSizeError:
CardSequence_813D32A8(slot, command, sectorError);
reportCardThreadError(slot, command, sectorError);
goto finish;
sectorSizeDone:
;
@@ -1023,7 +1023,7 @@ sectorSizeDone:
result = CARDGetResultCode(slot);
}
if (result < 0) {
CardSequence_813D32A8(slot, command, result);
reportCardThreadError(slot, command, result);
goto finish;
}
@@ -1056,7 +1056,7 @@ createDone:
;
}
if (destinationFileNo < 0) {
CardSequence_813D32A8(destinationSlot, command, destinationFileNo);
reportCardThreadError(destinationSlot, command, destinationFileNo);
goto finish;
}
@@ -1099,7 +1099,7 @@ createDone:
sThread->writePending = 1;
ioResult = CARDWriteAsync(&sThread->destinationFile,
sThread->transferBuffer, size, offset,
CardSequence_813D3C24);
clearCardWritePending);
if (ioResult < 0) {
goto copyIoFailure;
}
@@ -1176,7 +1176,7 @@ copyIoDone:
}
} else {
metadataCopied = TRUE;
result = CardSequence_813D3424(destinationSlot, destinationFileNo,
result = loadCardFileIcons(destinationSlot, destinationFileNo,
&sourceStatus);
if (result < 0) {
OSReport("Can't read icon for move dstfile\n");
@@ -1214,7 +1214,7 @@ copyIoDone:
s32 setResult = result;
if (result == -3) {
CARDFastDelete(slot, fileNo);
CardSequence_813D2A74(slot, fileNo);
clearCardFileEntry(slot, fileNo);
} else {
s32 restoreResult = __CARDSetStatusEx(slot, fileNo, &moveStatus);
if (restoreResult < 0) {
@@ -1227,13 +1227,13 @@ copyIoDone:
stage = 3;
result = CARDFastDelete(slot, fileNo);
if (result >= 0) {
CardSequence_813D2A74(slot, fileNo);
clearCardFileEntry(slot, fileNo);
stage = 4;
result = __CARDGetStatusEx(destinationSlot,
destinationFileNo, &moveStatus);
if (result >= 0) {
stage = 5;
if ((result = CardSequence_813D3424(
if ((result = loadCardFileIcons(
destinationSlot, destinationFileNo, &moveStatus)) < 0) {
goto moveStatusError;
}
@@ -1270,10 +1270,10 @@ moveStatusDone:
}
if (result >= 0) {
CardSequence_813D2B40(slot);
CardSequence_813D2B40(destinationSlot);
CardSequence_813D3380(slot, 0, fileNo & 0xFF);
CardSequence_813D3380(destinationSlot, command, destinationFileNo & 0xFF);
refreshCardSlotInfo(slot);
refreshCardSlotInfo(destinationSlot);
sendCardSlotState(slot, 0, fileNo & 0xFF);
sendCardSlotState(destinationSlot, command, destinationFileNo & 0xFF);
goto finish;
}
@@ -1281,7 +1281,7 @@ cleanup:
destinationSlot = slot ^ 1;
result = CARDGetResultCode(destinationSlot);
if (result < 0) {
CardSequence_813D32A8(destinationSlot, command, result);
reportCardThreadError(destinationSlot, command, result);
} else {
if (temporaryCreated && !metadataCopied) {
CARDFastDelete(destinationSlot, destinationFileNo);
@@ -1289,18 +1289,18 @@ cleanup:
if (metadataCopied) {
if (__CARDGetStatusEx(destinationSlot, destinationFileNo,
&createStatus) == 0) {
CardSequence_813D3424(destinationSlot, destinationFileNo, &createStatus);
loadCardFileIcons(destinationSlot, destinationFileNo, &createStatus);
}
}
CardSequence_813D2B40(destinationSlot);
CardSequence_813D3380(destinationSlot, 0, fileNo & 0xFF);
refreshCardSlotInfo(destinationSlot);
sendCardSlotState(destinationSlot, 0, fileNo & 0xFF);
}
result = CARDGetResultCode(slot);
if (result < 0) {
CardSequence_813D32A8(slot, command, result);
reportCardThreadError(slot, command, result);
} else {
CardSequence_813D2B40(slot);
CardSequence_813D3380(slot, 0, fileNo & 0xFF);
refreshCardSlotInfo(slot);
sendCardSlotState(slot, 0, fileNo & 0xFF);
}
finish:

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

@@ -11,7 +11,7 @@ struct MemoryCardSortEntry {
s64 key;
};
extern "C" int iplMemoryCardManager_813CD034(const void* first, const void* second) {
extern "C" int compareMemoryCardSortEntries(const void* first, const void* second) {
const MemoryCardSortEntry* a = static_cast<const MemoryCardSortEntry*>(first);
const MemoryCardSortEntry* b = static_cast<const MemoryCardSortEntry*>(second);
s64 bKey = b->key;
@@ -92,7 +92,7 @@ void MemoryCardManager::sort_file_array(u8 slot) {
mFile[slot][file].unk_0x08 = 0;
}
}
qsort(mFile[slot], 0x7f, sizeof(MCFile), iplMemoryCardManager_813CD034);
qsort(mFile[slot], 0x7f, sizeof(MCFile), compareMemoryCardSortEntries);
}
void MemoryCardManager::sendCardCmdMove(u8 slot, s16 index) {

View File

@@ -934,7 +934,7 @@ namespace ipl {
}
}
extern "C" bool iplSDMemory_813EE358(const SDMemory* memory,
extern "C" bool iplSDMemory_containsTitleId(const SDMemory* memory,
ESTitleId titleId,
const ESTitleId* titleIds, u32 titleCount) {
for (u32 i = 0; i < titleCount; i++) {
@@ -951,7 +951,7 @@ namespace ipl {
s32 result = mpSDChannelSelect->getWorker()->get_async_result();
if (result == 0) {
ESTitleId titleId = mTitleIds[mCurrentTitle];
if (iplSDMemory_813EE358(this, titleId,
if (iplSDMemory_containsTitleId(this, titleId,
mNandTitleIds, mNandTitleCount)) {
mDialogState = 17;
} else {
@@ -984,8 +984,8 @@ namespace ipl {
swprintf(mCurrentTitleName, 0x107f, L"%ls\n%ls", titleName, message);
System::getDialog()->setTitleForSDMemory(mCurrentTitleName);
if (iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) ||
iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) {
if (iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) ||
iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) {
ESTitleId titleId = mTitleIds[mCurrentTitle];
if (iplSDChannelSelect_813DB478(mpSDChannelSelect, titleId)) {
mDialogState = 14;
@@ -1064,7 +1064,7 @@ namespace ipl {
mCurrentTitle++;
if (mTitleCount > mCurrentTitle) {
ESTitleId nextTitleId = mTitleIds[mCurrentTitle];
if (iplSDMemory_813EE358(this, nextTitleId,
if (iplSDMemory_containsTitleId(this, nextTitleId,
mNandTitleIds, mNandTitleCount)) {
mDialogState = 17;
} else {

View File

@@ -311,9 +311,9 @@ FaderSceneCommand SDChannelTitle::calcNormal() {
case 18: if (SCCheckStatus() != 1) { mState = 21; } break;
case 19: iplSDChannelTitle_startCopyProgress(this); break;
case 20: iplSDChannelTitle_updateCopyPrepare(this); break;
case 23: iplSDChannelTitle_updateMemoryCalc(this); break;
case 21: iplSDChannelTitle_updateEnqueueNotice(this); break;
case 22: iplSDChannelTitle_updateCopyProgress(this); break;
case 23: iplSDChannelTitle_updateMemoryCalc(this); break;
case 24: iplSDChannelTitle_loadTitleBanner(this); break;
case 25: iplSDChannelTitle_updateBannerLoad(this); break;
case 26: iplSDChannelTitle_showCopyError(this); break;

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 AOSS_81400830(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);
void AOSS_81401C9C(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32 stateLength);
void AOSS_81401DC0(u32 seed, u32* table);
s16 AOSS_81401BBC(void* buffer);
int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket);
int AOSS_81401778(void* packet, void* request, int socket);
int AOSS_81401E80(void* packet, s32 length, char* key, int keyLength);
int AOSS_814020CC(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 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 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 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 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;
@@ -652,7 +652,7 @@ int AOSS_Init_old(AOSSInitInput* input)
}
goto finish_initialization;
wait_for_initial_link:
state = AOSS_814020CC(&settings,s_accessPointConfig);
state = AOSSConnectAndAwaitHost(&settings,s_accessPointConfig);
if (state == -1) {
input->status = 0xf;
if (s_accessPointConfig) {
@@ -860,7 +860,7 @@ request_socket_cleanup_complete:
memset(s_accessPointConfig,0,0x58);
initialWait = waitIntervals.limits.connection;
for (waitAttempt = 0; waitAttempt < (short)initialWait; waitAttempt++) {
requestResult = AOSS_814020CC(&settings,s_accessPointConfig);
requestResult = AOSSConnectAndAwaitHost(&settings,s_accessPointConfig);
if (requestResult == -1) {
input->status = 0xf;
if (s_accessPointConfig) {
@@ -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:
@@ -969,7 +969,7 @@ request_socket_cleanup_complete:
memset(s_responseBuffer,0,0x5dc);
memcpy(messageIdentity,&requestRecords.records[2],8);
manufacturerLength = strlen(s_manufacturer);
AOSS_81401E80(messageIdentity,8,s_manufacturer,manufacturerLength);
AOSSXorBufferWithKey(messageIdentity,8,s_manufacturer,manufacturerLength);
receivedLength = SOHtoNs(1);
packetWords->initialLength = receivedLength;
packetWords->initialType = 0;
@@ -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;
}
@@ -1206,7 +1206,7 @@ wait_for_packet:
memset(s_accessPointConfig,0,0x58);
initialWait = waitIntervals.limits.connection;
for (waitAttempt = 0; waitAttempt < (short)initialWait; waitAttempt++) {
state = AOSS_814020CC(&settings,s_accessPointConfig);
state = AOSSConnectAndAwaitHost(&settings,s_accessPointConfig);
if (state == -1) {
input->status = 0xf;
if (s_accessPointConfig) {
@@ -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;
@@ -1611,26 +1611,26 @@ int AOSS_814001B4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
(*count)++;
return state;
}
if (AOSS_81400830((AOSSDecryptionMessage*)&packet->message) > 0) {
if (AOSSDecryptMessage((AOSSDecryptionMessage*)&packet->message) > 0) {
(*count)++;
return state;
}
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;
@@ -1652,7 +1652,7 @@ int AOSS_814002F0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
manufacturerLength = strlen(s_manufacturer);
reply = &packet->message.payload.reply;
requestRecord = &request->records[0];
AOSS_81401E80(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
AOSSXorBufferWithKey(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
compareResult = memcmp(requestRecord->address, packet->message.payload.manufacturerAddress, 6);
if (compareResult != 0) {
validationResult = -1;
@@ -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;
@@ -1724,7 +1724,7 @@ int AOSS_814004D0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
operationResult = 0;
reply = &packet->message.payload.reply;
manufacturerLength = strlen(s_manufacturer);
AOSS_81401E80(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
AOSSXorBufferWithKey(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
compareResult = memcmp(request->records[1].address,
packet->message.payload.manufacturerAddress, 6);
if (compareResult != 0) {
@@ -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;
@@ -1788,7 +1788,7 @@ int AOSS_814006A4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
errorCode = 0;
manufacturerLength = strlen(s_manufacturer);
AOSS_81401E80(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
AOSSXorBufferWithKey(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
compareResult = memcmp(request->records[2].address,
packet->message.payload.manufacturerAddress, 6);
if (compareResult != 0) {
@@ -1828,7 +1828,7 @@ int AOSS_814006A4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestR
return result;
}
int AOSS_81400830(AOSSDecryptionMessage* message) {
int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
u32 checksum;
u8 manufacturerAddress[8];
AOSSKeySchedule schedule;
@@ -1850,14 +1850,14 @@ int AOSS_81400830(AOSSDecryptionMessage* message) {
int result;
memcpy(manufacturerAddress, message->manufacturerAddress, sizeof(manufacturerAddress));
result = AOSS_81401E80(manufacturerAddress, sizeof(manufacturerAddress), s_manufacturer,
result = AOSSXorBufferWithKey(manufacturerAddress, sizeof(manufacturerAddress), s_manufacturer,
strlen(s_manufacturer));
if (result == -1) {
s_errorCode = 2;
return -100;
}
result = AOSS_81400D34(SONtoHs(message->command), manufacturerAddress);
result = AOSSCheckAccessPointName(SONtoHs(message->command), manufacturerAddress);
if (result != 0) {
return result;
}
@@ -1886,7 +1886,7 @@ int AOSS_81400830(AOSSDecryptionMessage* message) {
} else {
memcpy(s_packetState.keyNonce, &encrypted->keyNonce, sizeof(encrypted->keyNonce));
memcpy(s_packetState.keyAddress, s_accessPointName, sizeof(s_accessPointName));
AOSS_81401C9C(&schedule, s_packetState.keyNonce,
AOSSInitKeySchedule(&schedule, s_packetState.keyNonce,
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), dataLength);
outputCursor = decryptedData;
@@ -1906,7 +1906,7 @@ int AOSS_81400830(AOSSDecryptionMessage* message) {
}
crc = 0xffffffff;
AOSS_81401DC0(0, s_crcTable);
AOSSInitCrc32Table(0, s_crcTable);
for (crcIndex = 0; crcIndex < (s32)dataLength; crcIndex++) {
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[crcIndex]) & 0xff];
}
@@ -1931,7 +1931,7 @@ int AOSS_81400830(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;
@@ -2257,7 +2257,7 @@ int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket) {
responsePayload = response->payload;
memcpy(s_accessPointName, &request->records[0], 8);
memcpy(accessPointName, s_accessPointName, 8);
recordLength = AOSS_81401BBC(&requestRecord->record);
recordLength = AOSSBuildInterfaceOption(&requestRecord->record);
if (recordLength < 0) {
s_errorCode = 3;
if (requestRecord != 0) {
@@ -2269,7 +2269,7 @@ int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket) {
requestRecord->length = SOHtoNs(recordLength);
requestLength = recordLength + 4;
memcpy(responsePayload, requestRecord, requestLength);
encryptionResult = AOSS_81401E80(accessPointName, 8, s_manufacturer, 6);
encryptionResult = AOSSXorBufferWithKey(accessPointName, 8, s_manufacturer, 6);
if (encryptionResult != 0) {
s_errorCode = 2;
if (requestRecord != 0) {
@@ -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;
@@ -2343,7 +2343,7 @@ int AOSS_81401778(void* packet, void* request, int socket) {
const u32* crcTable;
sequence = 1;
checksum = 0xffffffff;
AOSS_81401DC0(0, s_crcTable);
AOSSInitCrc32Table(0, s_crcTable);
crcTable = s_crcTable;
{
u32 part;
@@ -2361,7 +2361,7 @@ int AOSS_81401778(void* packet, void* request, int socket) {
memcpy(&payload->encrypted.key.nonce, &nonce, 2);
memcpy(s_packetState.keyNonce, payload->encrypted.key.nonceBytes, 2);
memcpy(s_packetState.keyAddress, s_accessPointName, 8);
AOSS_81401C9C(&construction.schedule, s_packetState.keyNonce,
AOSSInitKeySchedule(&construction.schedule, s_packetState.keyNonce,
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), 8);
for (index = 0; index < 8; index++) {
state = construction.schedule.bytes;
@@ -2386,7 +2386,7 @@ int AOSS_81401778(void* packet, void* request, int socket) {
}
memcpy(construction.accessPointName, &requestRecords->records[1], 8);
encryptionResult = AOSS_81401E80(construction.accessPointName, 8, s_manufacturer, 6);
encryptionResult = AOSSXorBufferWithKey(construction.accessPointName, 8, s_manufacturer, 6);
if (encryptionResult != 0) {
s_errorCode = 2;
return -1;
@@ -2415,7 +2415,7 @@ int AOSS_81401778(void* packet, void* request, int socket) {
return 0;
}
s16 AOSS_81401BBC(void* buffer) {
s16 AOSSBuildInterfaceOption(void* buffer) {
AOSSOptionRecord* record = (AOSSOptionRecord*)buffer;
u32 optionValue;
s16 dataLength;
@@ -2439,7 +2439,7 @@ s16 AOSS_81401BBC(void* buffer) {
return (s16)(dataLength + 10);
}
void AOSS_81401C9C(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32 stateLength) {
void AOSSInitKeySchedule(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32 stateLength) {
u32 index = 0;
u32 keyIndex;
u32 swapIndex;
@@ -2471,7 +2471,7 @@ void AOSS_81401C9C(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32
}
}
void AOSS_81401DC0(u32 seed, u32* table) {
void AOSSInitCrc32Table(u32 seed, u32* table) {
u32 index;
u32 value;
@@ -2488,7 +2488,7 @@ void AOSS_81401DC0(u32 seed, u32* table) {
}
}
int AOSS_81401E80(void* packet, s32 length, char* key, int keyLength) {
int AOSSXorBufferWithKey(void* packet, s32 length, char* key, int keyLength) {
u8* temporaryHalf;
s32 halfLength = length / 2;
u8* packetHalf;
@@ -2542,7 +2542,7 @@ int AOSS_81401E80(void* packet, s32 length, char* key, int keyLength) {
return result;
}
int AOSS_814020CC(void* settings, void* config) {
int AOSSConnectAndAwaitHost(void* settings, void* config) {
s32 connectionAttempts = 0;
u32 ticksPerMillisecond;

View File

@@ -12,8 +12,8 @@ static u8 secondaryDns[4];
static void* (*allocateMemory)(u32, s32);
static void (*releaseMemory)(u32, void*, s32);
static void (*statusCallback)(void);
static NCDIfConfig AOSS_810BD4A8;
static NCDIpConfig AOSS_810BD608;
static NCDIfConfig AOSSi_NcdIfConfig;
static NCDIpConfig AOSSi_NcdIpConfig;
struct AOSSRate {
u16 mask;
@@ -60,11 +60,11 @@ void AOSSi_Cancel(void) {
AOSSi_cancel_flag = 1;
}
void AOSS_813FD17C(OSAlarm* alarm, OSContext* context) {
void AOSSi_SleepAlarmHandler(OSAlarm* alarm, OSContext* context) {
OSSendMessage((OSMessageQueue*)alarm->tag, NULL, 0);
}
void AOSS_813FD18C(u32 milliseconds) {
void AOSSi_SleepMs(u32 milliseconds) {
OSMessage storage;
OSMessage message;
OSMessageQueue queue;
@@ -72,7 +72,7 @@ void AOSS_813FD18C(u32 milliseconds) {
OSInitMessageQueue(&queue, &storage, 1);
OSCreateAlarm(&alarm);
OSSetAlarmTag(&alarm, (u32)&queue);
OSSetAlarm(&alarm, (u32)(milliseconds * (OS_TIMER_CLOCK / 1000)), AOSS_813FD17C);
OSSetAlarm(&alarm, (u32)(milliseconds * (OS_TIMER_CLOCK / 1000)), AOSSi_SleepAlarmHandler);
OSReceiveMessage(&queue, &message, 1);
}
@@ -89,7 +89,7 @@ void AOSSi_Free(void* block) {
}
}
void AOSS_813FD25C(u8* destination, u32 address) {
void AOSSi_StoreIpv4Octets(u8* destination, u32 address) {
int index;
for (index = 0; index < 4; ++index) {
*destination++ = address >> ((3 - index) * 8);
@@ -97,11 +97,11 @@ void AOSS_813FD25C(u8* destination, u32 address) {
}
int AOSSi_SetNCDIPAddr(u32 address, u32 netmask, u32 gateway, u32 dns1, u32 dns2) {
AOSS_813FD25C(ipAddress, address);
AOSS_813FD25C(ipNetmask, netmask);
AOSS_813FD25C(ipGateway, gateway);
AOSS_813FD25C(primaryDns, dns1);
AOSS_813FD25C(secondaryDns, dns2);
AOSSi_StoreIpv4Octets(ipAddress, address);
AOSSi_StoreIpv4Octets(ipNetmask, netmask);
AOSSi_StoreIpv4Octets(ipGateway, gateway);
AOSSi_StoreIpv4Octets(primaryDns, dns1);
AOSSi_StoreIpv4Octets(secondaryDns, dns2);
return 0;
}
@@ -150,7 +150,7 @@ startup:
goto unlock;
}
++startupRetries;
AOSS_813FD18C(10);
AOSSi_SleepMs(10);
goto startup;
}
if (WD_GetInfo(&info) == 0) {
@@ -231,7 +231,7 @@ startup:
*output = list;
break;
}
AOSS_813FD18C(100);
AOSSi_SleepMs(100);
}
AOSSi_Free(buffer);
}
@@ -242,7 +242,7 @@ cleanup:
goto unlock;
}
++cleanupRetries;
AOSS_813FD18C(10);
AOSSi_SleepMs(10);
goto cleanup;
}
unlock:
@@ -252,7 +252,7 @@ unlock:
return -1;
}
++unlockRetries;
AOSS_813FD18C(10);
AOSSi_SleepMs(10);
goto unlock;
}
return result;
@@ -262,7 +262,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
int retries = 0;
int result = 0;
WD_Info info ATTRIBUTE_ALIGN(32);
NCDIfConfig* interfaceConfig = &AOSS_810BD4A8;
NCDIfConfig* interfaceConfig = &AOSSi_NcdIfConfig;
NCDIpConfig* ipConfig;
memset(interfaceConfig, 0, sizeof(*interfaceConfig));
interfaceConfig->selectedMedia = 1;
@@ -288,7 +288,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
}
interfaceConfig->netif.wireless.config.manual.ssidLength = (u8)connection->ssidLength;
memcpy(interfaceConfig->netif.wireless.config.manual.ssid, connection->ssid, connection->ssidLength);
ipConfig = &AOSS_810BD608;
ipConfig = &AOSSi_NcdIpConfig;
memset(ipConfig, 0, sizeof(*ipConfig));
ipConfig->adjust.maxTransferUnit = 1300;
ipConfig->adjust.tcpRetransTimeout = 100;
@@ -303,7 +303,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
if (NCDSetIpConfig(ipConfig) != 0) {
result = -1;
}
if (result == 0 && NCDSetIfConfig(&AOSS_810BD4A8) != 0) {
if (result == 0 && NCDSetIfConfig(&AOSSi_NcdIfConfig) != 0) {
result = -1;
}
if (result == 0) {
@@ -317,7 +317,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
break;
}
++retries;
AOSS_813FD18C(10);
AOSSi_SleepMs(10);
}
}
if (result == 0) {
@@ -335,7 +335,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
}
void AOSSi_Sleep(u32 milliseconds) {
AOSS_813FD18C(milliseconds);
AOSSi_SleepMs(milliseconds);
}
int AOSSi_Status(void) {

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

@@ -64,6 +64,11 @@ namespace ipl {
static s32 sAOSSState;
static s32 sAOSSUnk;
struct AOSSStack {
u32 storage[4080];
u32 sentinel;
};
class AOSSThread : public utility::ut_thread {
public:
AOSSThread(EGG::Heap* heap);
@@ -84,7 +89,7 @@ namespace ipl {
private:
s32 mState; // 0x32C
s32 mThreadPriority; // 0x330
u8* mpStackBuffer; // 0x334
AOSSStack* mpStack; // 0x334
u8* mpHeapBuffer; // 0x338
MEMHeapHandle mpExpHeap; // 0x33C
AOSSConfig mAoss; // 0x340
@@ -94,7 +99,7 @@ namespace ipl {
mpExpHeap = NULL;
sAOSSState = 0;
mpHeapBuffer = (u8*)heap->alloc(0x40000, 0x20);
mpStackBuffer = (u8*)heap->alloc(0x1000, 0x20);
mpStack = (AOSSStack*)heap->alloc(0x1000, 0x20);
}
void AOSSThread::destroy(int flag) {
@@ -137,8 +142,8 @@ namespace ipl {
mThreadPriority = OSGetThreadPriority(OSGetCurrentThread()) - 2;
sAOSSState = 1;
SOInit(&config);
memset(mpStackBuffer, 0, 4);
Create(mpStackBuffer, 0x1000, mThreadPriority, TRUE);
memset(mpStack, 0, 4);
Create(mpStack, 0x1000, mThreadPriority, TRUE);
OSRestoreInterrupts(level);
return 1;
@@ -178,7 +183,7 @@ namespace ipl {
mAoss.unk_0x04 = 4;
NETGetWirelessMacAddress(mAoss.mac);
*(u32*)(mpStackBuffer + 0x3FC0) = 0x97654321;
mpStack->sentinel = 0x97654321;
mState = AOSSi_Init(&mAoss);
AOSSi_EndLocal();

View File

@@ -28,26 +28,26 @@ 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;
extern "C" RakuStatus sRakuStatus;
RakuStatus sRakuStatus;
extern "C" OSMessageQueue sRakuMsgQueue;
OSMessageQueue sRakuMsgQueue;
static OSTime startTime;
static bool active;
static OSMessage messageSlot;
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 +60,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 +78,15 @@ private:
MEMHeapHandle mHeap;
};
void RakuRakuThread::RakuRakuThread_813FDA04() {
void RakuRakuThread::syncRakuProgress() {
BOOL interrupts = OSDisableInterrupts();
RakuRakuThread_810BDDE0.progress = *(RakuProgress*)this;
sRakuStatus.progress = *(RakuProgress*)this;
startTime = OSGetTime();
OSRestoreInterrupts(interrupts);
}
void RakuRakuThread::progressCallback(RakuProgress* progress) {
((RakuRakuThread*)progress)->RakuRakuThread_813FDA04();
((RakuRakuThread*)progress)->syncRakuProgress();
}
RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
@@ -101,12 +101,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 +114,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 +127,7 @@ void RakuRakuThread::destroy() {
}
if (mHeap != NULL) {
MEMDestroyExpHeap(mHeap);
memset(&RakuRakuThread_810BDDD0, 0, sizeof(MEMAllocator));
memset(&sRakuAllocator, 0, sizeof(MEMAllocator));
mHeap = NULL;
}
}
@@ -139,19 +139,19 @@ int RakuRakuThread::start() {
BOOL interrupts = OSDisableInterrupts();
startTime = OSGetTime();
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 +165,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 +184,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 +202,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;
@@ -214,14 +214,14 @@ int RakuRakuThread::getState() {
}
if (displayState != 6 && displayState != 7 &&
((u32)OSGetTime() - (u32)startTime) / (OS_TIMER_CLOCK / 1000) >= 90000) {
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
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 +231,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 +273,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

@@ -10,9 +10,9 @@
namespace ipl {
namespace scene {
TextBalloon::TextBalloon(EGG::Heap* heap, nand::LayoutFile* layoutFile, const char* directory, const char* fileName, const math::VEC3& unk2,
f32 unk3, f32 unk4)
: unk_0x08(FALSE), mpText(NULL), mTextLen(0), mBalloonPos(unk2), unk_0x28(0), unk_0x2C(1), unk_0x30(unk3), unk_0x34(unk4),
TextBalloon::TextBalloon(EGG::Heap* heap, nand::LayoutFile* layoutFile, const char* directory, const char* fileName, const math::VEC3& initialPos,
f32 margin16x9, f32 margin4x3)
: mbWaitingFadeIn(FALSE), mpText(NULL), mTextLen(0), mBalloonPos(initialPos), mHAlign(0), mbUse16x9X(1), mMargin16x9(margin16x9), mMargin4x3(margin4x3),
mWaitUntilFadeIn(0) {
mpLayout = new (heap, 4) layout::Object(heap, layoutFile, directory, fileName);
mpLayout->bind("my_IplTopBalloon_a_BalloonInOut.brlan");
@@ -31,7 +31,7 @@ namespace ipl {
void TextBalloon::calc() {
mpLayout->calc();
switch (unk_0x08) {
switch (mbWaitingFadeIn) {
case TRUE: {
break;
}
@@ -73,7 +73,7 @@ namespace ipl {
balloonPane->SetVisible(false);
unk_0x08 = FALSE;
mbWaitingFadeIn = FALSE;
}
void TextBalloon::fadein() {
@@ -81,7 +81,7 @@ namespace ipl {
mpLayout->FindPaneByName("N_Balloon")->SetVisible(false);
mWaitUntilFadeIn = 0;
unk_0x08 = TRUE;
mbWaitingFadeIn = TRUE;
set_textbox(mpText);
set_translate(mBalloonPos);
@@ -91,17 +91,17 @@ namespace ipl {
void TextBalloon::fadeinNoSetTextbox() {
if (mpText != NULL) {
mWaitUntilFadeIn = 0;
unk_0x08 = TRUE;
mbWaitingFadeIn = TRUE;
set_translate(mBalloonPos);
}
}
void TextBalloon::setPos(const math::VEC3& pos, bool unk0, int unk1) {
void TextBalloon::setPos(const math::VEC3& pos, bool use16x9X, int hAlign) {
mBalloonPos = pos;
unk_0x28 = unk1;
unk_0x2C = unk0;
mHAlign = hAlign;
mbUse16x9X = use16x9X;
nw4r::ut::Rect proj16x9;
nw4r::ut::Rect proj4x3;
@@ -109,7 +109,7 @@ namespace ipl {
System::getProjectionRect(&proj16x9);
System::getProjectionRect4x3(&proj4x3);
if (unk_0x2C == 0) {
if (mbUse16x9X == 0) {
mBalloonPos.x *= proj4x3.GetWidth() / proj16x9.GetWidth();
}
}
@@ -122,7 +122,7 @@ namespace ipl {
System::getProjectionRect(&proj16x9);
System::getProjectionRect4x3(&proj4x3);
if (unk_0x2C == 0) {
if (mbUse16x9X == 0) {
mBalloonPos.x *= proj4x3.GetWidth() / proj16x9.GetWidth();
}
@@ -133,27 +133,27 @@ namespace ipl {
if (mWaitUntilFadeIn++ > WAIT_UNTIL_FADE_IN) {
anm_fadein();
snd::getSystem()->startSE("WIPL_SE_BALLOON");
unk_0x08 = FALSE;
mbWaitingFadeIn = FALSE;
}
}
void TextBalloon::fadeout() {
if (!unk_0x08) {
if (!mbWaitingFadeIn) {
mpLayout->setAnmType(ANIM_TYPE_BACKWARD);
mpLayout->start();
}
unk_0x08 = FALSE;
mbWaitingFadeIn = FALSE;
}
void TextBalloon::fadeoutForce() {
if (!unk_0x08) {
if (!mbWaitingFadeIn) {
if (mpLayout->getAnim()->getAnmType() == ANIM_TYPE_FORWARD) {
mpLayout->getAnim()->setAnmType(ANIM_TYPE_BACKWARD);
mpLayout->getAnim()->restart();
}
} else if (unk_0x08 == TRUE) {
} else if (mbWaitingFadeIn == TRUE) {
mWaitUntilFadeIn = 0;
unk_0x08 = FALSE;
mbWaitingFadeIn = FALSE;
}
}
@@ -167,9 +167,9 @@ namespace ipl {
f32 temp0;
if (SCGetAspectRatio() == SC_ASPECT_RATIO_16x9) {
temp0 = unk_0x30;
temp0 = mMargin16x9;
} else {
temp0 = unk_0x34;
temp0 = mMargin4x3;
}
nw4r::lyt::Pane* balloonPane = mpLayout->FindPaneByName("N_Balloon");
@@ -181,7 +181,7 @@ namespace ipl {
System::getProjectionRect(&proj16x9);
System::getProjectionRect4x3(&proj4x3);
switch (unk_0x28) {
switch (mHAlign) {
case 1: {
temp1 = get_size("W_Base")->width / 2;
break;
@@ -192,7 +192,7 @@ namespace ipl {
}
}
if (unk_0x2C == 0) {
if (mbUse16x9X == 0) {
temp1 *= proj4x3.GetWidth() / proj16x9.GetWidth();
}

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,33 +10,16 @@
#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;
extern "C" const f32 lbl_816946AC;
extern "C" const f32 lbl_816946A8;
extern "C" const f32 lbl_816946B0;
extern "C" const f32 lbl_816946B4;
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" const f32 scSoundOneF;
extern "C" const f32 scSoundTwoF;
extern "C" const f32 scSoundThirtyF;
extern "C" const f32 scSoundSixtyF;
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;
}
@@ -500,26 +274,47 @@ namespace snd {
if (block->handle.detail_GetAttachedSound() != NULL) {
block->handle.detail_GetAttachedSound()->SetPan(pan);
}
f32 pitch = lbl_816946A8 * y / rect.right;
if (lbl_816946AC < pitch) {
pitch = lbl_816946AC;
f32 pitch = scSoundTwoF * y / rect.right;
if (scSoundOneF < pitch) {
pitch = scSoundOneF;
}
if (block->handle.detail_GetAttachedSound() != NULL) {
block->handle.detail_GetAttachedSound()->SetVolume(pitch, 0);
}
if (lbl_816946B0 < y) {
f32 pitch2 = y / lbl_816946B0;
if (scSoundThirtyF < y) {
f32 pitch2 = y / scSoundThirtyF;
if (block->handle.detail_GetAttachedSound() != NULL) {
block->handle.detail_GetAttachedSound()->SetPitch(pitch2);
}
} else if (lbl_816946B4 < y) {
} else if (scSoundSixtyF < y) {
if (block->handle.detail_GetAttachedSound() != NULL) {
block->handle.detail_GetAttachedSound()->SetPitch(lbl_816946A8);
block->handle.detail_GetAttachedSound()->SetPitch(scSoundTwoF);
}
}
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

@@ -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

@@ -0,0 +1,224 @@
"""Compare relocated switch destinations after checking instructions with ctxdiff.
Usage: python jump_table_diff.py <unit> <function> [--table <reference-symbol>]
Paths follow ctxdiff.py: build/43U/{src,obj}/<unit>.o. Requires pyelftools.
Exit 0: all selected tables match (or no tables); 1: mismatch; 2: invalid or
ambiguous input. This checks relative destinations, not behavioral equivalence.
Automatic selection covers jumptable_* symbols and multi-entry data objects
whose R_PPC_ADDR32 entries all target the selected function, with at least one
interior destination for objects lacking the jumptable_ prefix. This includes
compiler-generated @ names and custom names, but excludes ordinary callback
tables/vtables. Source locations are inferred from corresponding function relocations,
never from an assumption that both data sections have the same layout.
"""
import argparse
from dataclasses import dataclass
from pathlib import Path
import sys
from elftools.common.exceptions import ELFError
from elftools.elf.elffile import ELFFile
@dataclass(frozen=True)
class Symbol:
name: str
section: object
value: int
size: int
kind: str = "STT_OBJECT"
@dataclass(frozen=True)
class Relocation:
offset: int
kind: int
symbol: int
addend: int
@dataclass
class ObjectInfo:
sections: dict
symbols: list
relocations: dict
def symbol(self, name):
found = [s for s in self.symbols if s.name == name
and isinstance(s.section, int) and s.size]
if len(found) != 1:
raise ValueError("expected one defined symbol: " + name)
symbol = found[0]
if (symbol.section not in self.sections or symbol.value < 0
or symbol.size <= 0
or symbol.value + symbol.size > self.sections[symbol.section][1]):
raise ValueError("symbol is outside its section: " + name)
return symbol
def location(self, relocation):
if not 0 <= relocation.symbol < len(self.symbols):
raise ValueError("relocation symbol index is out of range")
symbol = self.symbols[relocation.symbol]
if not isinstance(symbol.section, int):
return None
if symbol.section not in self.sections:
raise ValueError("relocation symbol has an invalid section")
return symbol.section, symbol.value + relocation.addend
def relocs(self, section):
return self.relocations.get(section, {})
def read_object(path):
with open(path, "rb") as stream:
elf = ELFFile(stream)
if (elf.elfclass != 32 or elf.little_endian
or elf["e_machine"] != "EM_PPC" or elf["e_type"] != "ET_REL"):
raise ValueError("expected a relocatable big-endian ELF32 PowerPC object")
symtab = elf.get_section_by_name(".symtab")
if symtab is None:
raise ValueError("object has no .symtab")
symbols = [Symbol(s.name, s["st_shndx"], s["st_value"], s["st_size"],
s["st_info"]["type"]) for s in symtab.iter_symbols()]
sections = {}
relocations = {}
for index, section in enumerate(elf.iter_sections()):
sections[index] = (section.name, section["sh_size"])
if section["sh_type"] == "SHT_REL":
raise ValueError("REL relocations are unsupported; expected RELA")
if section["sh_type"] != "SHT_RELA":
continue
if elf.get_section(section["sh_link"]).name != ".symtab":
raise ValueError("relocation uses a different symbol table")
entries = relocations.setdefault(section["sh_info"], {})
for r in section.iter_relocations():
if r["r_offset"] in entries:
raise ValueError("multiple relocations at the same offset")
entries[r["r_offset"]] = Relocation(
r["r_offset"], r["r_info_type"], r["r_info_sym"], r["r_addend"])
return ObjectInfo(sections, symbols, relocations)
def jump_target(obj, relocation, function):
if relocation is None or relocation.kind != 1: # R_PPC_ADDR32
return None
location = obj.location(relocation)
if location is None or location[0] != function.section:
return None
offset = location[1] - function.value
if offset < 0 or offset >= function.size or offset % 4:
return None
return offset
def reference_tables(obj, function, name=None):
candidates = [obj.symbol(name)] if name else [
s for s in obj.symbols if s.size and (
s.name.startswith("jumptable_") or (
s.kind == "STT_OBJECT" and s.size >= 8
and isinstance(s.section, int)
and obj.sections[s.section][0] in (".data", ".rodata", ".sdata", ".sdata2")))]
result = []
for table in candidates:
if not isinstance(table.section, int) or table.size % 4:
if name:
raise ValueError("invalid reference table extent")
continue
section_size = obj.sections[table.section][1]
if table.value < 0 or table.value + table.size > section_size:
raise ValueError("reference table is outside its section")
targets = []
for offset in range(table.value, table.value + table.size, 4):
target = jump_target(obj, obj.relocs(table.section).get(offset), function)
if target is None:
break
targets.append(target)
if targets and len(targets) == table.size // 4:
if name or table.name.startswith("jumptable_") or any(targets):
result.append((table, targets))
elif name:
raise ValueError("reference table does not target the selected function")
return result
def source_table_location(source, reference, source_fn, reference_fn, table):
if source_fn.size != reference_fn.size:
raise ValueError("function sizes differ; check ctxdiff before table matching")
locations = set()
for relocation in reference.relocs(reference_fn.section).values():
if not reference_fn.value <= relocation.offset < reference_fn.value + reference_fn.size:
continue
if reference.location(relocation) != (table.section, table.value):
continue
offset = source_fn.value + relocation.offset - reference_fn.value
other = source.relocs(source_fn.section).get(offset)
if other is None or other.kind != relocation.kind:
raise ValueError("table-reference relocations differ; check ctxdiff")
location = source.location(other)
if location is None:
raise ValueError("source table reference is undefined")
if source.sections[location[0]][0] != reference.sections[table.section][0]:
raise ValueError("source table resolves to a different section")
locations.add(location)
if len(locations) != 1:
raise ValueError("cannot infer one source table from function relocations")
section, offset = next(iter(locations))
sizes = {s.size for s in source.symbols if s.section == section
and s.value == offset and s.size and s.kind != "STT_SECTION"}
if len(sizes) != 1:
raise ValueError("source table extent is missing or ambiguous")
size = next(iter(sizes))
if size % 4 or offset < 0 or offset + size > source.sections[section][1]:
raise ValueError("invalid source table extent")
return section, offset, size
def compare_table(source, reference, source_fn, reference_fn, table, expected):
section, offset, size = source_table_location(
source, reference, source_fn, reference_fn, table)
actual = [jump_target(source, source.relocs(section).get(i), source_fn)
for i in range(offset, offset + size, 4)]
differences = []
for i in range(max(len(actual), len(expected))):
src = actual[i] if i < len(actual) else None
ref = expected[i] if i < len(expected) else None
if i >= min(len(actual), len(expected)) or src != ref:
differences.append((i, src, ref))
return actual, differences
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("unit", help="e.g. src/scene/sdChannelSelect/iplSDChannelSelect")
parser.add_argument("function", help="exact function symbol used by ctxdiff")
parser.add_argument("--table", help="optional exact reference jump-table symbol")
args = parser.parse_args(argv)
try:
source = read_object(Path("build/43U/src") / (args.unit + ".o"))
reference = read_object(Path("build/43U/obj") / (args.unit + ".o"))
source_fn = source.symbol(args.function)
reference_fn = reference.symbol(args.function)
tables = reference_tables(reference, reference_fn, args.table)
mismatch = False
for table, expected in tables:
actual, differences = compare_table(
source, reference, source_fn, reference_fn, table, expected)
matched = sum(a == b for a, b in zip(actual, expected))
print("%s: %d/%d entries match (source=%d reference=%d)" %
(table.name, matched, len(expected), len(actual), len(expected)))
for index, src, ref in differences:
src_text = "unresolved/missing" if src is None else "+0x%X" % src
ref_text = "missing" if ref is None else "+0x%X" % ref
print(" [%d] source %s; reference %s" % (index, src_text, ref_text))
mismatch |= bool(differences)
print("Compared %d jump table(s); instruction correctness requires ctxdiff." % len(tables))
return 1 if mismatch else 0
except (OSError, ValueError, ELFError) as error:
print("ERROR: %s" % error, file=sys.stderr)
return 2
if __name__ == "__main__":
sys.exit(main())

View File

@@ -0,0 +1,172 @@
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Frame and branches match. Target leaves keyMode undefined on invalid enum; ours initializes it and adds mr r31,r30. No undefined-value experiments allowed.", "initial": [106, 105, 99], "fuzzy": 99.04762}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "label": "defined masked enum fallback", "compiled": true, "instructions": [106, 105, 101], "fuzzy": 99.04762, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "label": "defined direct-mode fallback", "compiled": true, "instructions": [106, 105, 101], "fuzzy": 99.04762, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "label": "defined current-mode fallback", "compiled": true, "instructions": [107, 105, 98], "fuzzy": 98.09524, "regressions": [], "measures": {"fuzzy_match_percent": 99.959274, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "instructions": [106, 105, 99]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Identical frame, branches and instruction counts; inlined setABCFlag flags and owner exchange r4/r6. Try setter argument boundary, owner lifetime, then declaration order.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "inline setter with explicit state and flags arguments", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "inline setter reads owner directly without temporary", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "bind key state reference before flag extraction", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Identical frame, branches and instruction counts; inlined setABCFlag flags and owner exchange r4/r6. Try setter argument boundary, owner lifetime, then declaration order.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "inline setter with explicit state and flags arguments", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "inline setter reads owner directly without temporary", "compiled": true, "instructions": [39, 39, 11], "fuzzy": 98.46154, "regressions": [], "measures": {"fuzzy_match_percent": 99.971214, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "bind key state reference before flag extraction", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Target frame 0x30 saves r30/r31; ours frame 0x40 saves r29/r30/r31. Target high byte load precedes mid and low byte grouped addition. Pointer and index order differ; correct endian expression/helper first.", "initial": [86, 84, 84], "fuzzy": 86.5}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "inline endian helper with high byte first and two addition groups", "compiled": true, "instructions": [84, 84, 48], "fuzzy": 83.72619, "regressions": [], "measures": {"fuzzy_match_percent": 93.22928, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "evaluate high byte group before low byte group", "compiled": true, "instructions": [86, 84, 85], "fuzzy": 82.27381, "regressions": [], "measures": {"fuzzy_match_percent": 93.09795, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "declare traversal index after pointers at endian helper boundary", "compiled": true, "instructions": [84, 84, 42], "fuzzy": 84.559525, "regressions": [], "measures": {"fuzzy_match_percent": 93.30463, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "instructions": [86, 84, 84]}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "retain best structural helper for ctxdiff and declaration search", "compiled": true, "instructions": [84, 84, 42], "fuzzy": 84.559525, "regressions": [], "measures": {"fuzzy_match_percent": 93.30463, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "declsearch", "function": "pdm_part_is_master_boot_sector", "result": "23 builds, structural 20 exact 42, no improvement"}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "instructions": [86, 84, 84]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Frame 0x2e0 and buffer/array offsets match, 276 instructions each; target groups endian addition as (byte2<<16 + byte0)+(byte3<<24 + byte1<<8), ours chained high-to-low additions. Target end-of-loop stores branch to common exit.", "initial": [276, 276, 146], "fuzzy": 82.56159}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "label": "group low and high endian additions to match target", "compiled": true, "instructions": [276, 276, 141], "fuzzy": 82.61957, "regressions": [], "measures": {"fuzzy_match_percent": 93.49731, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "label": "reverse start/count array declaration order after endian grouping", "compiled": true, "instructions": [276, 276, 148], "fuzzy": 82.58696, "regressions": [], "measures": {"fuzzy_match_percent": 93.48762, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "label": "common success exit from extended partition selection", "compiled": true, "instructions": [275, 276, 202], "fuzzy": 82.677536, "regressions": [], "measures": {"fuzzy_match_percent": 93.514534, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "instructions": [276, 276, 146]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "51 instructions each with identical frame, branches and arithmetic. ratio and start swap r0/r3. Try conversion helper, narrower ratio, independent sector ratios, then declaration search.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "inline start-sector conversion helper", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "use media-sector ratio with 16 bit type", "compiled": true, "instructions": [51, 51, 16], "fuzzy": 97.84314, "regressions": [], "measures": {"fuzzy_match_percent": 93.48009, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "separate physical and logical ratios", "compiled": true, "instructions": [51, 51, 16], "fuzzy": 97.84314, "regressions": [], "measures": {"fuzzy_match_percent": 93.48009, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 16]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "Arithmetic inline helper produced standalone exact match but regressed logical read/write. Test real helper argument order while protecting both callers.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order start,media_bps,bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order start,bps,media_bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order media_bps,start,bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order media_bps,bps,start", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order bps,start,media_bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order bps,media_bps,start", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 16]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "Conversion helper gives exact standalone but changes two already-exact inline callers. Try shared full conversion implementation with public wrapper and direct inline call sites, preserving real function.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "full physical-sector helper with public wrapper", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "logical read/write call shared implementation directly", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 16]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "After frame/branch/helper diagnosis and three structural trials, test setter branch inversion, shared mode temporary, flags assignment lifetime. Check standalone setter and other callers for regressions.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "setter early return on unchanged modifier flags", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "setter names retained input mode before comparison", "compiled": true, "instructions": [50, 49, 41], "fuzzy": 91.734695, "regressions": ["setABCFlag__Q59textinput8keyboard6pctype4Base8KeyStateFUl", "onlyQwerty__Q49textinput8keyboard6pctype4BaseFb", "setLangKeyActive__Q49textinput8keyboard6pctype4BaseFb", "create__Q49textinput8keyboard6pctype12LayoutByNW4RFP12MEMAllocator", "onlyQwerty__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "setLangKeyActive__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "updateInput__Q49textinput8keyboard6pctype12LayoutByNW4RFiffUlUlUlPv"], "measures": {"fuzzy_match_percent": 99.6742, "total_code": "28484", "matched_code": "24948", "matched_code_percent": 87.58601, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 131, "matched_functions_percent": 92.90781, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "separate assigned state and flags locals for declaration search", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "output": "fewer than two leading declarations; pass --lines START END\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "After frame/branch/helper diagnosis and three structural trials, test setter branch inversion, shared mode temporary, flags assignment lifetime. Check standalone setter and other callers for regressions.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "setter early return on unchanged modifier flags", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "setter names retained input mode before comparison", "compiled": true, "instructions": [40, 39, 34], "fuzzy": 94.48718, "regressions": ["setABCFlag__Q59textinput8keyboard6pctype4Base8KeyStateFUl", "onlyQwerty__Q49textinput8keyboard6pctype4BaseFb", "setLangKeyActive__Q49textinput8keyboard6pctype4BaseFb", "create__Q49textinput8keyboard6pctype12LayoutByNW4RFP12MEMAllocator", "onlyQwerty__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "setLangKeyActive__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "updateInput__Q49textinput8keyboard6pctype12LayoutByNW4RFiffUlUlUlPv"], "measures": {"fuzzy_match_percent": 99.6742, "total_code": "28484", "matched_code": "24948", "matched_code_percent": 87.58601, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 131, "matched_functions_percent": 92.90781, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "separate assigned state and flags locals for declaration search", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "output": "fewer than two leading declarations; pass --lines START END\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "9acff807814ebc31117a41f325bab0af803169cd", "remote_source_identical": true, "diagnosis": "126 instructions each, same frame. Target compares depth>=delay; target period step quotient precedes integer LFO resets and signed conversions; history stores follow all conversion stores. Try source/helper boundaries and history loop before register search.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "compute period step first then initialize integer state before conversions", "compiled": true, "instructions": [126, 126, 55], "fuzzy": 69.11905, "regressions": [], "measures": {"fuzzy_match_percent": 91.1535, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "clear history through nested channel/sample loops after LFO conversions", "compiled": true, "instructions": [126, 126, 32], "fuzzy": 92.92857, "regressions": [], "measures": {"fuzzy_match_percent": 95.62444, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "inline LFO state initialization separate from history initialization", "compiled": true, "instructions": [126, 126, 55], "fuzzy": 70.07143, "regressions": [], "measures": {"fuzzy_match_percent": 91.33234, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "retain history loop structural candidate for diagnosis", "compiled": true, "instructions": [126, 126, 32], "fuzzy": 92.92857, "regressions": [], "measures": {"fuzzy_match_percent": 95.62444, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "history loop and target depth comparison with original constant encounter order", "compiled": true, "instructions": [126, 126, 17], "fuzzy": 95.77778, "regressions": [], "measures": {"fuzzy_match_percent": 96.15946, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "integer LFO state first with original floating expression encounter order", "compiled": true, "instructions": [126, 126, 17], "fuzzy": 97.7381, "regressions": [], "measures": {"fuzzy_match_percent": 96.52757, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "load named LFO rate before conversion expressions", "compiled": true, "instructions": [126, 126, 21], "fuzzy": 97.53968, "regressions": [], "measures": {"fuzzy_match_percent": 96.49031, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "inspect closest structural initialization candidate", "compiled": true, "instructions": [126, 126, 17], "fuzzy": 97.7381, "regressions": [], "measures": {"fuzzy_match_percent": 96.52757, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "target step multiplication operand order and retained depth quotient", "compiled": true, "instructions": [126, 126, 18], "fuzzy": 94.47619, "regressions": [], "measures": {"fuzzy_match_percent": 95.915054, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "split meaningful float and loop declarations for allocation search", "compiled": true, "instructions": [126, 126, 18], "fuzzy": 94.47619, "regressions": [], "measures": {"fuzzy_match_percent": 95.915054, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "declsearch", "function": "__InitParams", "output": "fewer than two leading declarations; pass --lines START END\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "retain quotient then divide step by table length", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 97.2619, "regressions": [], "measures": {"fuzzy_match_percent": 96.43815, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "retain step and depth quotients before gradient conversion", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 94.15873, "regressions": [], "measures": {"fuzzy_match_percent": 95.85544, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "name phase step before period step and convert afterward", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 94.15873, "regressions": [], "measures": {"fuzzy_match_percent": 95.85544, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "origin": "426555a34f7dd162e14bc28ead5f55168f090eb8", "remote_source_identical": true, "diagnosis": "Target 65 instructions with 0x10 frame and signed 64-bit value negation, expanded signed 64-bit gradient product, CTR sample loop. Ours 51 instructions, truncates manually and decrements GPR. Restore signed shifts, compound multiplication width and fixed loop.", "initial": [51, 65, 65], "fuzzy": 68.53846}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "signed shifted 64 bit value and fixed count sample loop", "compiled": true, "instructions": [55, 65, 65], "fuzzy": 72.0, "regressions": [], "measures": {"fuzzy_match_percent": 91.637856, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "compound gradient product from signed widened difference", "compiled": true, "instructions": [61, 65, 65], "fuzzy": 62.215385, "regressions": [], "measures": {"fuzzy_match_percent": 90.69002, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "inline signed wide scaling helper for sample and gradient", "compiled": true, "instructions": [55, 65, 65], "fuzzy": 72.0, "regressions": [], "measures": {"fuzzy_match_percent": 91.637856, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "inspect compound widened gradient candidate", "compiled": true, "instructions": [61, 65, 65], "fuzzy": 62.215385, "regressions": [], "measures": {"fuzzy_match_percent": 90.69002, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "independent wide sample and gradient with shifts after both multiplications", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.07692, "regressions": [], "measures": {"fuzzy_match_percent": 92.71088, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "retain widened table difference directly in gradient product", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.30769, "regressions": [], "measures": {"fuzzy_match_percent": 92.73323, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "commute wide gradient operands after table subtraction", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.30769, "regressions": [], "measures": {"fuzzy_match_percent": 92.73323, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "compute sample product before widened table difference", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.07692, "regressions": [], "measures": {"fuzzy_match_percent": 92.71088, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "declare phase before signed value then assign phase", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.07692, "regressions": [], "measures": {"fuzzy_match_percent": 92.71088, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "declsearch", "function": "__CalcLFO", "output": "declaration block:\n u32 phase;\n s64 value;\nstart (8, 26)\nbest (8, 26) after 2 builds; source restored; best order was:\n u32 phase;\n s64 value;\n"}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "instructions": [51, 65, 65]}
{"event": "begin", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "origin": "31d0f12981dba19bb149c7904032cb1bf5529c79", "remote_source_identical": true, "diagnosis": "158 instructions and 0x40 frames each. Target loads round count first then key cursor; source state initializers live across round temporaries. Target XORs low-byte lookup with rotated byte8 and prior byte24/16 pair, while ours groups final two byte operands. Try XOR tree, helper round boundary, independent declarations.", "initial": [158, 158, 134], "fuzzy": 60.348103}
{"event": "pool", "unit": "libs/RevoEX/src/net/aes", "output": "POOL IDENTICAL up to 4 (mine=4 base=4)\n"}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "label": "explicit target low byte XOR association with nested high-byte pair", "compiled": true, "instructions": [158, 158, 134], "fuzzy": 60.348103, "regressions": [], "measures": {"fuzzy_match_percent": 75.11482, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "label": "inline encryption round lookup helper with target association", "compiled": true, "instructions": [158, 158, 139], "fuzzy": 53.83544, "regressions": [], "measures": {"fuzzy_match_percent": 73.61919, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "label": "separate leading state declarations from round-count and initial key loads", "compiled": true, "instructions": [158, 158, 134], "fuzzy": 60.348103, "regressions": [], "measures": {"fuzzy_match_percent": 75.11482, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "restored", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "instructions": [158, 158, 134]}
{"event": "begin", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "origin": "326273b6198accfc1e4062bacb677ed1eec1ab74", "remote_source_identical": true, "diagnosis": "Target 251 instructions versus 249, same 0x40 frame. Target computes context keys base once then round offset; source folds offset into context. Target inverse MixColumns mutates four/twice/value operands separately with rotated accumulator, ours reassociates XOR chains. Structural pointer and mix boundaries first.", "initial": [249, 251, 244], "fuzzy": 61.49004}
{"event": "pool", "unit": "libs/RevoEX/src/net/aes", "output": "POOL IDENTICAL up to 4 (mine=4 base=4)\n"}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "label": "mutate inverse MixColumns intermediate terms in target operand order", "compiled": true, "instructions": [249, 251, 244], "fuzzy": 62.74502, "regressions": [], "measures": {"fuzzy_match_percent": 75.57268, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "label": "retain key schedule base separately before round offset", "compiled": true, "instructions": [251, 251, 224], "fuzzy": 63.836655, "regressions": [], "measures": {"fuzzy_match_percent": 75.97093, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "label": "inline inverse MixColumns column helper", "compiled": true, "instructions": [249, 251, 241], "fuzzy": 62.84462, "regressions": [], "measures": {"fuzzy_match_percent": 75.60901, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "restored", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "instructions": [249, 251, 244]}
{"event": "begin", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Target 108 instructions vs 107. Target recomputes words from saved keyLength after memcpy; ours reuses rounds quotient. Target rotated substitution groups byte16 with byte24 then byte0 with byte8; bitfield transform flag is set before round count update. Try inline context setup and explicit substitution helper boundaries.", "initial": [107, 108, 81], "fuzzy": 88.98148}
{"event": "pool", "unit": "libs/RevoEX/src/net/aes", "output": "POOL IDENTICAL up to 4 (mine=4 base=4)\n"}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "label": "inline AES context setup before key word count computation", "compiled": true, "instructions": [107, 108, 77], "fuzzy": 92.73148, "regressions": [], "measures": {"fuzzy_match_percent": 75.70349, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "label": "set transformation bit before round count bitfield", "compiled": true, "instructions": [107, 108, 77], "fuzzy": 92.73148, "regressions": [], "measures": {"fuzzy_match_percent": 75.70349, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "label": "rotated key substitution grouped as target high and low pairs", "compiled": true, "instructions": [107, 108, 81], "fuzzy": 83.14815, "regressions": [], "measures": {"fuzzy_match_percent": 74.19913, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "restored", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "instructions": [107, 108, 81]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Register-only r4/r6 flags-owner exchange persists after setter boundary trials. Try getter inline boundary and modifier setter wrapper; retain only no-regression exact matches.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "modifier getter inline with state reference", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "modifier getter inline wrapping existing getter", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "modifier setter inline wrapping real member setter", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Register-only r4/r6 flags-owner exchange persists after setter boundary trials. Try getter inline boundary and modifier setter wrapper; retain only no-regression exact matches.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "modifier getter inline with state reference", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "modifier getter inline wrapping existing getter", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "modifier setter inline wrapping real member setter", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "History loop aligns stores and target compare, leaves 17 differences: phase/depth float scheduling and conversion outputs r7/r6/r5 plus zero r4. Introduce named signed conversion outputs and arithmetic lifetime before declaration search.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "separate signed fixed point conversion results from state stores", "compiled": true, "instructions": [126, 126, 23], "fuzzy": 95.53968, "regressions": [], "measures": {"fuzzy_match_percent": 96.11475, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "compute depth quotient before signed phase and period conversions", "compiled": true, "instructions": [126, 126, 26], "fuzzy": 93.69841, "regressions": [], "measures": {"fuzzy_match_percent": 95.769005, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "compound period scaling with retained quotient operand", "compiled": true, "instructions": [126, 126, 29], "fuzzy": 94.007935, "regressions": [], "measures": {"fuzzy_match_percent": 95.827126, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Standalone full conversion helper matches, but inline logical callers need fresh diagnosis; compare their changed register assignments before searching local declaration order.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "inspect inline logical callers after standalone wrapper match", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "keep logical read/write out-of-line call boundary proved by target using NO_INLINE", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": [], "measures": {"fuzzy_match_percent": 93.598495, "total_code": "3716", "matched_code": "2276", "matched_code_percent": 61.248653, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 18, "matched_functions_percent": 90.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "accepted", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 0], "full_gate": "full build: ok\nmain.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d\n[src/keyboard/tiPcKeyboard] pool: IDENTICAL\n[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0\n[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141\n[src/keyboard/tiPcKeyboard] section .bss size 16 match None\n[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0\n[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0\n[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0\n[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332\n[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762\n[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635\n[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615\n[src/keyboard/tiPcKeyboard] baseline: code 27712/28484 data 18548 functions 138 fuzzy 99.9733\n[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL\n[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 93.5985 linked code 0\n[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20\n[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.598495\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159\n[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2072/3716 data None functions 17 fuzzy 93.4801\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 1920/2684 data 48 functions 5 fuzzy 91.3025\n[libs/RevoEX/src/net/aes] pool: IDENTICAL\n[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0\n[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9\n[libs/RevoEX/src/net/aes] section .data size 200 match 100.0\n[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0\n[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0\n[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482\n[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103\n[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004\n[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148\n[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148\nregressions vs baseline: 0\nglobal matched_code_percent: 88.09116 -> 88.09798\nglobal fuzzy_match_percent: 99.38004 -> 99.38019\nglobal complete_code_percent: 62.52416 -> 62.52416\nglobal matched_data_percent: 92.11517 -> 92.11517\nforbidden patterns added (net, per file): 0\nreadability warnings (net, per file; must be 0 in the final result): 0\nGATE PASS\n"}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Partition conversion demonstrated inline public wrapper plus preserved out-of-line call boundary can correct register coloring. Try same legitimate initialization implementation boundary with original validation and repaired history loop.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "discarded", "function": "__InitParams", "reason": "definition-only NO_INLINE too late for earlier callers; wrapper symbol not emitted; no count attributed"}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Partition conversion demonstrated inline public wrapper plus preserved out-of-line call boundary can correct register coloring. Try same legitimate initialization implementation boundary with original validation and repaired history loop.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "initialization helper with integer state first and history loop", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 97.38095, "regressions": [], "measures": {"fuzzy_match_percent": 96.46051, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "initialization helper with original state order and history loop", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 95.42063, "regressions": [], "measures": {"fuzzy_match_percent": 96.0924, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "initialization helper with signed conversion locals", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 95.42063, "regressions": [], "measures": {"fuzzy_match_percent": 96.0924, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Closest 17 positional differences follow repaired history loop. Test direct period division instead of pre-folded reciprocal, signed loop indices, and loop helper lifetime, then stop after declaration search if no exact result.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "direct period divided by LFO table length", "compiled": true, "instructions": [126, 126, 16], "fuzzy": 97.81746, "regressions": [], "measures": {"fuzzy_match_percent": 96.54247, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "signed fixed channel and history sample traversal", "compiled": true, "instructions": [126, 126, 16], "fuzzy": 97.81746, "regressions": [], "measures": {"fuzzy_match_percent": 96.54247, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "inline history array loop helper after LFO conversion stores", "compiled": true, "instructions": [126, 126, 16], "fuzzy": 97.81746, "regressions": [], "measures": {"fuzzy_match_percent": 96.54247, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Structural and helper-boundary attempts exhausted; only flags/owner r4/r6 allocation differs. Run explicit-range declaration search over separately assigned state and flags locals.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "expose assigned modifier state and flags locals for final allocation check", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "output": "declaration block:\n Base::KeyState* state;\n u32 flags;\nstart (0, 8)\nbest (0, 8) after 2 builds; source restored; best order was:\n Base::KeyState* state;\n u32 flags;\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Structural and helper-boundary attempts exhausted; only flags/owner r4/r6 allocation differs. Run explicit-range declaration search over separately assigned state and flags locals.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "expose assigned modifier state and flags locals for final allocation check", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "output": "declaration block:\n Base::KeyState* state;\n u32 flags;\nstart (0, 8)\nbest (0, 8) after 2 builds; source restored; best order was:\n Base::KeyState* state;\n u32 flags;\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Direct period division removes operand mismatch; remaining 16 differences involve gradient/phase conversion scheduling and zero versus conversion-result GPR allocation. Try named compound phase calculation before independent gradient conversion.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "named compound phase quotient and retained depth quotient", "compiled": true, "instructions": [126, 126, 19], "fuzzy": 96.666664, "regressions": [], "measures": {"fuzzy_match_percent": 96.32638, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "split phase and traversal declarations before allocation search", "compiled": true, "instructions": [126, 126, 19], "fuzzy": 96.666664, "regressions": [], "measures": {"fuzzy_match_percent": 96.32638, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "declsearch", "function": "__InitParams", "output": "declaration block:\n f32 delay;\n f32 depth;\n f32 step;\n f32 phaseRate;\n u32 channel;\n u32 sample;\nstart (5, 19)\nbest (5, 19) after 36 builds; source restored; best order was:\n f32 delay;\n f32 depth;\n f32 step;\n f32 phaseRate;\n u32 channel;\n u32 sample;\n"}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "final_full_gate", "output": "full build: ok\nmain.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d\n[src/keyboard/tiPcKeyboard] pool: IDENTICAL\n[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0\n[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141\n[src/keyboard/tiPcKeyboard] section .bss size 16 match None\n[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0\n[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0\n[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0\n[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332\n[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762\n[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635\n[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615\n[src/keyboard/tiPcKeyboard] baseline: code 27712/28484 data 18548 functions 138 fuzzy 99.9733\n[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL\n[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 93.5985 linked code 0\n[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20\n[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.598495\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159\n[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2072/3716 data None functions 17 fuzzy 93.4801\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 1920/2684 data 48 functions 5 fuzzy 91.3025\n[libs/RevoEX/src/net/aes] pool: IDENTICAL\n[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0\n[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9\n[libs/RevoEX/src/net/aes] section .data size 200 match 100.0\n[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0\n[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0\n[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482\n[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103\n[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004\n[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148\n[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148\nregressions vs baseline: 0\nglobal matched_code_percent: 88.09116 -> 88.09798\nglobal fuzzy_match_percent: 99.38004 -> 99.38019\nglobal complete_code_percent: 62.52416 -> 62.52416\nglobal matched_data_percent: 92.11517 -> 92.11517\nforbidden patterns added (net, per file): 0\nreadability warnings (net, per file; must be 0 in the final result): 0\nGATE PASS\n", "compiled_attempts": 85, "attempt_counts": {"setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode": 3, "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb": 10, "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv": 10, "pdm_part_is_master_boot_sector": 4, "pdm_part_get_start_sector": 3, "pdm_part_chg_ltop": 13, "__InitParams": 24, "__CalcLFO": 9, "AESiEncryptBlock": 3, "AESiDecryptBlock": 3, "NETAESCreateEx": 3}, "source_commit": "92c886dd"}

View File

@@ -0,0 +1,97 @@
# Four-unit matching result, 2026-10-02
Source commit: 92c886dd, match partition sector conversion.
| Unit | Instruction-exact functions before -> after | Objdiff matched code bytes before -> after | Objdiff matched data bytes before -> after |
| --- | --- | --- | --- |
| src/keyboard/tiPcKeyboard | 138/141 -> 138/141 | 27712/28484 -> 27712/28484 | 18548/18564 -> 18548/18564 |
| libs/RVL_SDK/src/fa/pdm_partition | 17/20 -> 18/20 | 2072/3716 -> 2276/3716 | absent -> absent |
| libs/RVL_SDK/src/axfx/AXFXChorusExp | 5/7 -> 5/7 | 1920/2684 -> 1920/2684 | 48/48 -> 48/48 |
| libs/RevoEX/src/net/aes | 6/9 -> 6/9 | 684/2752 -> 684/2752 | 2800/2800 -> 2800/2800 |
## Accepted change
pdm_part_chg_ltop: 100.0% objdiff, 51/51 instructions, ctxdiff diffs 0. Extracted the unchanged conversion into an inline implementation and kept the public function out of line with NO_INLINE, matching the calls in the target's logical read/write functions. A wrapper without NO_INLINE matched conversion but expanded both callers from 57 to 87 instructions, so that candidate was rejected. Final logical read/write remain exact. Full clean gate has identical pools, zero regressions, zero forbidden patterns, zero readability warnings and the required DOL hash.
## Remaining functions
setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode, 99.04762%: 106/105 instructions; defined invalid-enum fallback adds mr r31,r30. Target default appears uninitialized. No undefined fallback introduced.
onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb, 99.081635%: 49/49 instructions; flags and owner exchange r4/r6, eight positional differences. Getter/setter boundaries and final explicit declaration search did not resolve allocation.
onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv, 98.84615%: 39/39 instructions; flags and owner exchange r4/r6, eight positional differences. Getter/setter boundaries and final explicit declaration search did not resolve allocation.
pdm_part_is_master_boot_sector, 86.5%: 86/84 instructions; extra saved register enlarges frame from target 0x30 to 0x40. Endian load scheduling and pointer allocation differ. Helper reduced frame and count, but remained non-exact.
pdm_part_get_start_sector, 82.56159%: 276/276 instructions; endian operand association, byte-load scheduling and retained traversal registers differ. Array and success-exit variants remained non-exact.
__InitParams, 69.9127%: 126/126 instructions; comparison operand order and floating/state-store scheduling differ. History-loop repair plus direct period division reached 97.81746%, 16 positional differences, but remained non-exact and was restored.
__CalcLFO, 68.53846%: 51/65 instructions; missing full signed 64-bit sample/gradient lifetime and CTR loop. Independent compound wide products reached 65/65 instructions, but retained 26 scheduling/allocation differences and were restored.
AESiEncryptBlock, 60.348103%: 158/158 instructions; initial state lifetime, table lookup scheduling and XOR associations differ. Three compiled helper/expression/declaration trials remained non-exact.
AESiDecryptBlock, 61.49004%: 249/251 instructions; target retains schedule base separately and different inverse MixColumns intermediate lifetimes. Base-pointer trial reached 251/251 but remained non-exact; restored.
NETAESCreateEx, 88.98148%: 107/108 instructions; quotient reuse prevents separate key-word recomputation, and substituted-byte association differs. Context initialization boundary reached 92.73148% but remained non-exact; restored.
## Attempt audit
85 compiled source attempts across all 11 initially open functions. Every remaining function has at least three distinct compiled source attempts. Declaration-search results and origin/main checks are recorded in sol-high-four-oct2.attempts.jsonl. Every function start fetched origin and compared current source with origin/main. Initial owned sources matched origin/main; subsequent differences were inspected owned experiments. No push, PR, worktree change, shared header change, or configure.py matching-status change.
## Files changed
- libs/RVL_SDK/src/fa/pdm_partition.c, committed in 92c886dd.
- tools/decomp-assist/sol-high-four-oct2.attempts.jsonl, attempt and validation evidence.
- tools/decomp-assist/sol-high-four-oct2.report.md, this report.
## Uncertainty
The intended invalid-enum fallback and the exact original LFO/compiler allocation boundaries remain unresolved. No uncertain source experiment was retained.
## Final full gate, copied verbatim
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/keyboard/tiPcKeyboard] pool: IDENTICAL
[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0
[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141
[src/keyboard/tiPcKeyboard] section .bss size 16 match None
[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0
[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0
[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0
[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0
[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0
[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0
[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332
[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762
[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635
[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615
[src/keyboard/tiPcKeyboard] baseline: code 27712/28484 data 18548 functions 138 fuzzy 99.9733
[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 93.5985 linked code 0
[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20
[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.598495
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159
[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2072/3716 data None functions 17 fuzzy 93.4801
[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL
[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0
[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7
[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0
[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536
[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127
[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846
[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 1920/2684 data 48 functions 5 fuzzy 91.3025
[libs/RevoEX/src/net/aes] pool: IDENTICAL
[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0
[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9
[libs/RevoEX/src/net/aes] section .data size 200 match 100.0
[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0
[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0
[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482
[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103
[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004
[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148
[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148
regressions vs baseline: 0
global matched_code_percent: 88.09116 -> 88.09798
global fuzzy_match_percent: 99.38004 -> 99.38019
global complete_code_percent: 62.52416 -> 62.52416
global matched_data_percent: 92.11517 -> 92.11517
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```

View File

@@ -0,0 +1,422 @@
# Four-unit matching attempts
Baseline measured live, not copied from task estimates. Only instruction-exact improvements retained. Failed compiler experiments do not count toward the three-attempt requirement.
## getControlKey__Q49textinput8keyboard6pctype4BaseFPc
Origin 30e1ef09380cb59719dcfbd2c00c52ca16473946, source identical
Diagnosis: 36/36 instructions; counter and element offset exchange r30/r31, prologue initialization moves. No branch or frame difference.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (36, 36, 8)
1. bind the selected control by reference before comparison: (34, 36, 23) objdiff 88.02778 pool/regression/scan PASS reverted
2. declare the traversal index in function scope: (36, 36, 8) objdiff 93.333336 pool/regression/scan PASS reverted
3. use a do while traversal preserving 16 bit index: compile failed /src/keyboard/tiPcKeyboard.d
Final restored (36, 36, 8)
Origin 30e1ef09380cb59719dcfbd2c00c52ca16473946, source identical
Diagnosis: Counter and offset coloring remains; try loop induction form after scoped-index and reference trials.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (36, 36, 8)
1. do while with preincremented 16 bit traversal index: (37, 36, 20) objdiff 90.55556 pool/regression/scan PASS reverted
Final restored (36, 36, 8)
Origin edfb253724595e3a6487d03a669d4a521f781e1d, source identical
Diagnosis: Register-only result after three loop/reference experiments. Test genuine inline key-state lookup boundary then declaration ordering.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (36, 36, 8)
1. inline control lookup with explicit key-state argument: compile failed ---------------------
Final restored (36, 36, 8)
Origin 17407ed1cbfa5f7f43ebd141902ceea0c73a1e64, source identical
Diagnosis: Register-only induction/element offset mismatch; name the widened control index so its declaration participates in real allocation.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (36, 36, 8)
1. explicit widened control index before traversal counter: (36, 36, 8) objdiff 93.333336 pool/regression/scan PASS reverted
start (2, 8)
best (2, 8) after 2 builds; source restored; best order was:
Final restored (36, 36, 8)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source identical
Diagnosis: Register-only result after three loop/reference experiments. Test genuine inline key-state lookup boundary then declaration ordering.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (36, 36, 8)
1. inline control lookup with explicit key-state argument: (36, 36, 0) objdiff 100 pool/regression/scan PASS retained for further trials
regressions vs baseline: 0
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
[agent/w1002/near7 21811470] match base::getcontrolkey
## setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode
Origin 30e1ef09380cb59719dcfbd2c00c52ca16473946, source identical
Diagnosis: 106/105; only extra mr r31,r30 initializes defined enum fallback. Target default-path value is not initialized. Keep defined behavior; test equivalent mappings.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (106, 105, 99)
1. select key mode with conditional expressions: (117, 105, 109) objdiff 88.46667 pool/regression/scan PASS reverted
2. reuse mode as direct numeric key mode: (88, 105, 100) objdiff 82.685715 pool/regression/scan FAIL reverted
3. signed intermediate enum mapping: (106, 105, 99) objdiff 99.04762 pool/regression/scan PASS reverted
Final restored (106, 105, 99)
## onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb
Origin 30e1ef09380cb59719dcfbd2c00c52ca16473946, source identical
Diagnosis: 49/49; inline setABCFlag owner and flags exchange r4/r6. Branches, stack and instruction schedule otherwise identical.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (49, 49, 8)
1. bind the key state pointer before querying flags: (49, 49, 8) objdiff 99.081635 pool/regression/scan PASS reverted
2. pass modifier combination directly into setter: (49, 49, 9) objdiff 99.081635 pool/regression/scan FAIL reverted
3. separate flags declaration and getter assignment: (49, 49, 8) objdiff 99.081635 pool/regression/scan PASS reverted
Final restored (49, 49, 8)
Origin edfb253724595e3a6487d03a669d4a521f781e1d, source identical
Diagnosis: Try actual setter owner load lifetime; standalone setter and every caller remain protected by gate regression check.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (49, 49, 8)
1. load owner after updating flags in real setter: (49, 49, 8) objdiff 99.081635 pool/regression/scan PASS reverted
Final restored (49, 49, 8)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source identical
Diagnosis: After three structural/helper/lifetime attempts, expose state pointer and flags as separately assigned locals for safe declaration search. Every local assigned before use.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (49, 49, 8)
2. put final round key before substituted bytes: (249, 251, 244) objdiff 61.49004 pool/regression/scan PASS reverted
Final restored (249, 251, 244)
fewer than two leading declarations; pass --lines START END
Final restored (49, 49, 8)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source differs; inspected below
Diagnosis: After three structural/helper/lifetime attempts, expose state pointer and flags as separately assigned locals for safe declaration search. Every local assigned before use.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (49, 49, 8)
start (0, 8)
best (0, 8) after 2 builds; source restored; best order was:
Final restored (49, 49, 8)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source differs; inspected below
Diagnosis: Structural branches and instructions identical, inline helper boundary changed control lookup coloring exactly. Try real shared shift-modifier operation boundary for both pressed and released events.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (49, 49, 8)
1. inline shared shift modifier operation with state first: (49, 49, 11) objdiff 98.77551 pool/regression/scan PASS reverted
2. inline shared shift modifier operation with enable flag first: (49, 49, 11) objdiff 98.77551 pool/regression/scan PASS reverted
Final restored (49, 49, 8)
## onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv
Origin 30e1ef09380cb59719dcfbd2c00c52ca16473946, source identical
Diagnosis: 39/39; inline owner and flags exchange r4/r6 only.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (39, 39, 8)
1. bind the key state pointer before querying flags: (39, 39, 8) objdiff 98.84615 pool/regression/scan PASS reverted
2. pass modifier combination directly into setter: (39, 39, 13) objdiff 92.30769 pool/regression/scan FAIL reverted
3. separate flags declaration and getter assignment: (39, 39, 8) objdiff 98.84615 pool/regression/scan PASS reverted
Final restored (39, 39, 8)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source identical
Diagnosis: After three structural/helper/lifetime attempts, expose state pointer and flags as separately assigned locals for safe declaration search. Every local assigned before use.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (39, 39, 8)
fewer than two leading declarations; pass --lines START END
Final restored (39, 39, 8)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source differs; inspected below
Diagnosis: After three structural/helper/lifetime attempts, expose state pointer and flags as separately assigned locals for safe declaration search. Every local assigned before use.
POOL IDENTICAL up to 204 (mine=204 base=204)
Initial (39, 39, 8)
start (0, 8)
best (0, 8) after 2 builds; source restored; best order was:
Final restored (39, 39, 8)
## AXFXChorusExpShutdown
Origin c1cccf1c2c9ef6531a5f914c1e67b7032dbbc273, source identical
Diagnosis: 36/36; fx and channel exchange r29/r30, identical frame/branches. Test helper boundary before declaration coloring.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (36, 36, 5)
1. declare channel before interrupt enabled: (36, 36, 0) objdiff 100 pool/regression/scan FAIL reverted
2. split enabled declaration and assignment: compile failed DK/src/axfx/AXFXChorusExp.d
3. use signed channel traversal: (36, 36, 5) objdiff 97.638885 pool/regression/scan FAIL reverted
Final restored (36, 36, 5)
Origin f095c9ea12ecefe57174107f9d1cb93ba6ebe1cf, source differs; inspected below
Diagnosis: Register-only loop mismatch after declaration/lifetime trials; use real delay-line freeing inline helper corresponding to allocation/bzero helpers.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (36, 36, 5)
1. inline delay line deallocation helper: (36, 36, 0) objdiff 100 pool/regression/scan PASS retained for further trials
regressions vs baseline: 0
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
[agent/w1002/near7 c10cacbe] match axfxchorusexpshutdown
## AXFXChorusExpCallback
Origin c1cccf1c2c9ef6531a5f914c1e67b7032dbbc273, source identical
Diagnosis: 216/216; input/output array stack offsets reversed, history induction updates and whole decrement scheduled differently, interpolation float accumulation differs. Fix structural operations before coloring.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (216, 216, 70)
1. declare input before output to match stack arrays: (216, 216, 74) objdiff 89.12037 pool/regression/scan PASS reverted
2. decrement remaining history samples before source wrap: (216, 216, 63) objdiff 89.15741 pool/regression/scan PASS retained for further trials
3. separate history increment from index masking: (216, 216, 11) objdiff 99.64352 pool/regression/scan PASS retained for further trials
Final restored (216, 216, 70)
Origin e5f4e0e1f4b38e8ac2f461523b2cb26ede5210f4, source identical
Diagnosis: Prior structural trials reduced 70 diffs to 11. Retain separate history increments and earlier whole decrement; then inspect arrays/induction coloring.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (216, 216, 70)
1. restore separate increments and decrement before wrap: (216, 216, 11) objdiff 99.64352 pool/regression/scan PASS retained for further trials
2. exchange input and output array declarations after loop repairs: (216, 216, 15) objdiff 99.625 pool/regression/scan PASS reverted
3. declare retained history index before fractional source indices: (216, 216, 11) objdiff 99.64352 pool/regression/scan PASS reverted
Final restored (216, 216, 70)
Origin fed31b69b6e31473842c24734915f62f8466a84f, source identical
Diagnosis: 11 remaining differences after loop fix are input/output expression operand order and stack pointer register allocation.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (216, 216, 70)
1. separate history increments and decrement before wrap: (216, 216, 11) objdiff 99.64352 pool/regression/scan PASS retained for further trials
2. read output before incremented bus input in dry addition: (216, 216, 0) objdiff 100 pool/regression/scan PASS retained for further trials
regressions vs baseline: 0
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
[agent/w1002/near7 6cc459c4] match axfxchorusexpcallback
## __InitParams
Origin c1cccf1c2c9ef6531a5f914c1e67b7032dbbc273, source identical
Diagnosis: 126/126; comparison reversed and independent integer resets, floating conversions and history stores reorder. Conversion locals needed before data stores; no inline helper boundary mismatch.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (126, 126, 56)
Origin c1cccf1c2c9ef6531a5f914c1e67b7032dbbc273, source identical
Diagnosis: 126/126; comparison reversed and independent integer resets, floating conversions and history stores reorder. Conversion locals needed before data stores; no inline helper boundary mismatch.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (126, 126, 56)
1. compare depth against delay in target operand order: (126, 126, 55) objdiff 69.992065 pool/regression/scan PASS retained for further trials
2. compute all signed LFO conversions in locals before state stores: (126, 126, 55) objdiff 69.75397 pool/regression/scan PASS reverted
3. multiply depth on left of fixed point scale: (126, 126, 55) objdiff 69.992065 pool/regression/scan PASS reverted
Final restored (126, 126, 56)
Origin 0d75b24a9634b51dd5a74eb4d7ce09dea02d681b, source differs; inspected below
Diagnosis: Move integer state initialization ahead of arithmetic conversions so history stores no longer interleave. Same constants and operation associations as original.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (126, 126, 56)
1. initialize integer LFO state before conversion stores: (126, 126, 55) objdiff 69.79365 pool/regression/scan PASS retained for further trials
2. depth on left in saturation comparison: (126, 126, 54) objdiff 69.87302 pool/regression/scan PASS retained for further trials
3. compute period step before phase and depth conversions: (126, 126, 55) objdiff 69.11905 pool/regression/scan FAIL reverted
Final restored (126, 126, 56)
Origin d17ab22bf0394165d00ce90513e36b576ee05d94, source differs; inspected below
Diagnosis: Try natural inline history clearing helper to establish arithmetic boundary matching target history stores after all conversion stores.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (126, 126, 56)
1. inline history clearing boundary after LFO conversion stores: (126, 126, 56) objdiff 69.9127 pool/regression/scan PASS reverted
Final restored (126, 126, 56)
## __CalcLFO
Origin c1cccf1c2c9ef6531a5f914c1e67b7032dbbc273, source identical
Diagnosis: 65 target; target retains signed 64 bit shifted sample and negation carry, ours manually assembles low word. Target unsigned sign >=1. Restore arithmetic width first.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (51, 65, 65)
1. use signed 64 bit shifts and retained sample value: (54, 65, 65) objdiff 61.46154 pool/regression/scan PASS retained for further trials
2. test unsigned LFO sign against one: (54, 65, 65) objdiff 62.384617 pool/regression/scan PASS reverted
3. widen accumulated last sample before gradient addition: (54, 65, 65) objdiff 61.46154 pool/regression/scan PASS reverted
Final restored (51, 65, 65)
Origin 0d75b24a9634b51dd5a74eb4d7ce09dea02d681b, source differs; inspected below
Diagnosis: Target gradient multiply expands 64-bit difference operand, sample shift/negation remain 64-bit. Target uses fixed-count CTR loop.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (51, 65, 65)
1. retain 64 bit gradient difference and signed sample with sign threshold: (54, 65, 65) objdiff 62.384617 pool/regression/scan PASS retained for further trials
2. fixed-count ascending for loop: (55, 65, 65) objdiff 72.0 pool/regression/scan PASS retained for further trials
3. name gradient product independently before shifted store: (55, 65, 65) objdiff 72.0 pool/regression/scan PASS reverted
Final restored (51, 65, 65)
Origin d17ab22bf0394165d00ce90513e36b576ee05d94, source differs; inspected below
Diagnosis: Try compound assignment preserving signed 64-bit multiplication intermediate instead of direct product expression, with fixed-count CTR loop.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (51, 65, 65)
1. compound 64 bit gradient multiplication with signed output: (61, 65, 65) objdiff 62.29231 pool/regression/scan PASS retained for further trials
Final restored (51, 65, 65)
## pdm_part_is_master_boot_sector
Origin d9fbf88fb8fcce715fab661f1fe8be49f007efcd, source identical
Diagnosis: 86/84; frame 64 vs 48 saves extra r29 from endian load association. Target start/count pointers r6/r7 and index r8. Target high byte loaded before middle byte, addition pair layout remains meaningful.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (86, 84, 84)
1. evaluate high byte pair before low byte pair: (86, 84, 85) objdiff 82.27381 pool/regression/scan PASS reverted
2. group little endian words as independent low and high halves: (86, 84, 85) objdiff 86.38095 pool/regression/scan PASS reverted
3. initialize traversal pointers at declaration after signature validation: compile failed /pdm_partition.d
Final restored (86, 84, 84)
Origin c8bb9f44da1ea63d0dad0a388957bcb5a4150fab, source identical
Diagnosis: Third compiling structural trial: high/middle byte loads ordered by named scalar parts; target saves one fewer callee register.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (86, 84, 84)
1. name high and low byte pairs before stores: (83, 84, 76) objdiff 81.34524 pool/regression/scan PASS retained for further trials
Final restored (86, 84, 84)
Origin d17ab22bf0394165d00ce90513e36b576ee05d94, source identical
Diagnosis: Named endian halves reduced frame/instruction count; preliminary start store must precede remaining buffer reads to preserve target alias dependency.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (86, 84, 84)
1. retain preliminary start store before count byte loads: (84, 84, 36) objdiff 86.95238 pool/regression/scan PASS retained for further trials
2. evaluate low start half before high start half: (84, 84, 36) objdiff 86.75 pool/regression/scan PASS reverted
start (27, 36)
improved (27, 34)
improved (27, 33)
improved (27, 32)
improved (27, 26)
best (27, 26) after 33 builds; kept in source:
Final restored (86, 84, 84)
## pdm_part_get_start_sector
Origin d9fbf88fb8fcce715fab661f1fe8be49f007efcd, source identical
Diagnosis: 276/276; endian macro operand association and load scheduling differ, preserved frame and control flow. Target reads middle bytes of several partitions first; grouping words affects scheduler.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (276, 276, 146)
1. use grouped high and low half endian addition at call sites: (276, 276, 140) objdiff 83.10507 pool/regression/scan PASS retained for further trials
2. interleave start and length array initialization by partition: (276, 276, 145) objdiff 83.065216 pool/regression/scan PASS reverted
3. separate requested partition declaration from member load: (276, 276, 140) objdiff 83.10507 pool/regression/scan PASS reverted
Final restored (276, 276, 146)
## pdm_part_chg_ltop
Origin d9fbf88fb8fcce715fab661f1fe8be49f007efcd, source identical
Diagnosis: 51/51; ratio and adjusted start exchange r0/r3 only. No structural differences. Try ratio lifetime/width then declaration search.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (51, 51, 16)
1. load media ratio before start sector: (51, 51, 16) objdiff 97.84314 pool/regression/scan PASS reverted
2. use separate logical and physical sector ratios: compile failed
3. commute the final logical-sector addition: (51, 51, 16) objdiff 97.745094 pool/regression/scan PASS reverted
Final restored (51, 51, 16)
Origin c8bb9f44da1ea63d0dad0a388957bcb5a4150fab, source identical
Diagnosis: Third compiling variation separates logical ratio lifetime with leading C declarations.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (51, 51, 16)
1. separate leading declaration for logical ratio: (51, 51, 16) objdiff 97.84314 pool/regression/scan PASS reverted
Register-only declaration search
Final restored (51, 51, 16)
Origin 17407ed1cbfa5f7f43ebd141902ceea0c73a1e64, source identical
Diagnosis: Structural source attempts exhausted; use declaration permutation search for remaining r0/r3 assignment.
POOL IDENTICAL up to 0 (mine=0 base=0)
Initial (51, 51, 16)
Register-only declaration search
start (0, 16)
best (0, 16) after 6 builds; source restored; best order was:
Final restored (51, 51, 16)
## AESiEncryptBlock
Origin 0d75b24a9634b51dd5a74eb4d7ce09dea02d681b, source identical
Diagnosis: 158/158; same 64-byte frame, four-word round and decrement branch. Target associates byte3/byte2 then byte1 then byte0 and round key; ours schedules final byte with byte1 separately. Operand association and local lifetime first.
POOL IDENTICAL up to 4 (mine=4 base=4)
Initial (158, 158, 134)
1. combine each round key into its corresponding next-word temporary: (158, 158, 137) objdiff 52.829113 pool/regression/scan PASS reverted
2. group each round lookup into high and low byte pairs: (158, 158, 134) objdiff 60.348103 pool/regression/scan PASS reverted
3. declare all next state words before round expressions: (158, 158, 134) objdiff 60.348103 pool/regression/scan PASS reverted
Final restored (158, 158, 134)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source identical
Diagnosis: Round key first XOR association and final substitution key-first association follow target merge order. Prior structural variants unchanged or regressed; these move operand roots.
POOL IDENTICAL up to 4 (mine=4 base=4)
Initial (158, 158, 134)
1. put round key at the XOR expression root: (158, 158, 137) objdiff 52.829113 pool/regression/scan PASS reverted
2. put final round key before substituted bytes: (158, 158, 134) objdiff 60.348103 pool/regression/scan PASS reverted
Final restored (158, 158, 134)
## AESiDecryptBlock
Origin 0d75b24a9634b51dd5a74eb4d7ce09dea02d681b, source identical
Diagnosis: 251 target; two-word unrolled key transform and same round frame. Target mix algebra uses successive xor-and-rotate stages; ours equivalent association changes scheduling. Round lookup differs as encryption.
POOL IDENTICAL up to 4 (mine=4 base=4)
Initial (249, 251, 244)
1. combine each round key into its corresponding next-word temporary: (249, 251, 244) objdiff 62.063744 pool/regression/scan PASS reverted
2. group each round lookup into high and low byte pairs: (249, 251, 244) objdiff 61.49004 pool/regression/scan PASS reverted
3. declare all next state words before round expressions: (249, 251, 244) objdiff 61.49004 pool/regression/scan PASS reverted
Final restored (249, 251, 244)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source identical
Diagnosis: Round key first XOR association and final substitution key-first association follow target merge order. Prior structural variants unchanged or regressed; these move operand roots.
POOL IDENTICAL up to 4 (mine=4 base=4)
Initial (249, 251, 244)
1. put round key at the XOR expression root: (249, 251, 244) objdiff 62.063744 pool/regression/scan PASS reverted
## NETAESCreateEx
Origin 0d75b24a9634b51dd5a74eb4d7ce09dea02d681b, source identical
Diagnosis: 107/108; target key word count recomputed after memcpy from saved keyLength; target rotate-substitute bytes associated in a different operand order. Independent declaration/operation lifetime first.
POOL IDENTICAL up to 4 (mine=4 base=4)
Initial (107, 108, 81)
1. compute schedule word count after memcpy: (107, 108, 81) objdiff 88.98148 pool/regression/scan PASS reverted
2. substitute rotated key bytes explicitly in target operand order: (107, 108, 81) objdiff 90.18519 pool/regression/scan PASS reverted
3. declare schedule before key expansion scalars: (107, 108, 81) objdiff 88.98148 pool/regression/scan PASS reverted
Final restored (107, 108, 81)
Origin a81b7c36fe25993fac3ad2a3009f16839aed40ec, source identical
Diagnosis: Target round count truncates to 8-bit before context store, then separately computes untruncated word count after memcpy. Factor the derived round count into typed temporary to avoid reused division.
POOL IDENTICAL up to 4 (mine=4 base=4)
Initial (107, 108, 81)
1. use 8 bit round count before context store: (107, 108, 81) objdiff 88.98148 pool/regression/scan PASS reverted
2. initialize word count independently after retaining context round count: (114, 108, 111) objdiff 72.99074 pool/regression/scan PASS reverted
3. use signed key word count matching SDK length domain: (107, 108, 81) objdiff 88.47222 pool/regression/scan PASS reverted
Final restored (107, 108, 81)
## Final open-function audit
setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode: 99.04762%, 3 compiling source trials; one extra move initializes the defined fallback; target default path appears uninitialized, preserved defined behavior.
onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb: 99.081635%, 7 compiling source trials; inline setter flags and owner registers r4/r6 exchanged after structural and declaration trials.
onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv: 98.84615%, 3 compiling source trials; inline setter flags and owner registers r4/r6 exchanged after structural and declaration trials.
pdm_part_is_master_boot_sector: 86.5%, 5 compiling source trials; endian byte-load association changes frame and saved registers; staged loads can fix frame but not schedule.
pdm_part_get_start_sector: 82.56159%, 3 compiling source trials; endian extraction load schedule and scalar register allocation.
pdm_part_chg_ltop: 97.84314%, 3 compiling source trials; ratio/start r0/r3 exchange; declsearch six orders unchanged.
__InitParams: 69.9127%, 7 compiling source trials; floating scheduling, compare operand order and state-store scheduling; 126 instructions each.
__CalcLFO: 68.53846%, 7 compiling source trials; signed 64-bit gradient multiplication boundary, shifted sample lifetime and loop scheduling.
AESiEncryptBlock: 60.348103%, 5 compiling source trials; round lookup/XOR operand association and temporary lifetimes; 158 instructions each.
AESiDecryptBlock: 61.49004%, 4 compiling source trials; key-transform algebra scheduling and round lookup/XOR operand association; 249 versus 251 instructions.
NETAESCreateEx: 88.98148%, 6 compiling source trials; derived word-count lifetime and key-substitution operand scheduling; 107 versus 108 instructions.
## Accepted instruction-exact results
getControlKey__Q49textinput8keyboard6pctype4BaseFPc
src 0x90 base 0x90 insns 36/36
diffs 0: []
AXFXChorusExpCallback
src 0x360 base 0x360 insns 216/216
diffs 0: []
AXFXChorusExpShutdown
src 0x90 base 0x90 insns 36/36
diffs 0: []
## Before -> after, instruction exact / matched code bytes / matched data bytes
tiPcKeyboard: 137/141 -> 138/141; 27568 -> 27712; 18548 -> 18548
pdm_partition: 17/20 -> 17/20; 2072 -> 2072; no data section
AXFXChorusExp: 3/7 -> 5/7; 912 -> 1920; 48 -> 48
aes: 6/9 -> 6/9; 684 -> 684; 2800 -> 2800
## Final full gate, all four units
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/keyboard/tiPcKeyboard] pool: IDENTICAL
[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0
[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141
[src/keyboard/tiPcKeyboard] section .bss size 16 match None
[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0
[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0
[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0
[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0
[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0
[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0
[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332
[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762
[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635
[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615
[src/keyboard/tiPcKeyboard] baseline: code 27568/28484 data 18548 functions 137 fuzzy 99.9396
[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2072/3716 data None/None functions 17/20 fuzzy 93.4801 linked code 0
[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 17/20
[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.48009
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_chg_ltop 97.84314
[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2072/3716 data None functions 17 fuzzy 93.4801
[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL
[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0
[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7
[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0
[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536
[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127
[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846
[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 912/2684 data 48 functions 3 fuzzy 87.7615
[libs/RevoEX/src/net/aes] pool: IDENTICAL
[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0
[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9
[libs/RevoEX/src/net/aes] section .data size 200 match 100.0
[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0
[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0
[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482
[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103
[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004
[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148
[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148
regressions vs baseline: 0
global matched_code_percent: 87.99755 -> 88.03601
global fuzzy_match_percent: 99.37608 -> 99.37956
global complete_code_percent: 62.37071 -> 62.37071
global matched_data_percent: 92.06847 -> 92.06847
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
## Source commits
6cc459c4 match axfxchorusexpcallback
c10cacbe match axfxchorusexpshutdown
21811470 match base::getcontrolkey
## Uncertainty
The enum default path appears uninitialized in the target; no undefined fallback was introduced. The exact LFO source boundary responsible for its expanded 64-bit gradient multiplication remains unresolved.

View File

@@ -0,0 +1,208 @@
import contextlib
from dataclasses import replace
import io
import unittest
from unittest.mock import patch
import jump_table_diff as tool
def fixture(entries=(0x10, 0x20, 0x30), function_offset=0x100,
table_offset=0x40, source=False, section_ids=(1, 2)):
text, data = section_ids
symbols = [
tool.Symbol("dispatch", text, function_offset, 0x80, "STT_FUNC"),
tool.Symbol("@123" if source else "jumptable_test", data,
table_offset, len(entries) * 4),
]
references = {
text: {
function_offset + 2: tool.Relocation(function_offset + 2, 6, 1, 0),
function_offset + 6: tool.Relocation(function_offset + 6, 4, 1, 0),
},
data: {table_offset + i * 4: tool.Relocation(table_offset + i * 4, 1, 0, value)
for i, value in enumerate(entries)},
}
return tool.ObjectInfo({text: (".text", 0x1000), data: (".data", 0x1000)},
symbols, references)
def compare(source, reference=None):
reference = reference or fixture()
src_fn = source.symbol("dispatch")
ref_fn = reference.symbol("dispatch")
table, expected = tool.reference_tables(reference, ref_fn, "jumptable_test")[0]
return tool.compare_table(source, reference, src_fn, ref_fn, table, expected)
class JumpTableTests(unittest.TestCase):
def test_infers_shifted_source_table_and_function(self):
source = fixture(source=True, function_offset=0x200, table_offset=0x90,
section_ids=(3, 4))
self.assertEqual(compare(source), ([0x10, 0x20, 0x30], []))
def test_detects_swapped_destinations_despite_same_function_size(self):
actual, differences = compare(fixture((0x20, 0x10, 0x30), source=True))
self.assertEqual(actual, [0x20, 0x10, 0x30])
self.assertEqual(differences, [(0, 0x20, 0x10), (1, 0x10, 0x20)])
def test_section_relative_code_reference(self):
source = fixture(source=True, table_offset=0x90)
source.symbols.append(tool.Symbol("", 2, 0, 0, "STT_SECTION"))
for offset, relocation in list(source.relocations[1].items()):
source.relocations[1][offset] = replace(relocation, symbol=2, addend=0x90)
self.assertEqual(compare(source)[1], [])
def test_section_relative_table_entries(self):
source = fixture(source=True)
source.symbols.append(tool.Symbol("", 1, 0, 0, "STT_SECTION"))
for offset, relocation in list(source.relocations[2].items()):
source.relocations[2][offset] = replace(
relocation, symbol=2, addend=0x100 + relocation.addend)
self.assertEqual(compare(source)[1], [])
def test_missing_entry_is_mismatch(self):
source = fixture(source=True)
del source.relocations[2][0x44]
self.assertEqual(compare(source)[1], [(1, None, 0x20)])
def test_wrong_relocation_kind_is_mismatch(self):
source = fixture(source=True)
source.relocations[2][0x44] = replace(source.relocations[2][0x44], kind=10)
self.assertEqual(compare(source)[1], [(1, None, 0x20)])
def test_out_of_function_destination_is_mismatch(self):
source = fixture(source=True)
source.relocations[2][0x44] = replace(source.relocations[2][0x44], addend=0x80)
self.assertEqual(compare(source)[1], [(1, None, 0x20)])
def test_extra_source_entry_is_not_a_pass(self):
self.assertEqual(compare(fixture((0x10, 0x20, 0x30, 0x40), source=True))[1],
[(3, 0x40, None)])
def test_short_source_table_is_not_a_pass(self):
self.assertEqual(compare(fixture((0x10, 0x20), source=True))[1],
[(2, None, 0x30)])
def test_different_function_sizes_reject_inference(self):
source = fixture(source=True)
source.symbols[0] = replace(source.symbols[0], size=0x84)
with self.assertRaisesRegex(ValueError, "function sizes differ"):
compare(source)
def test_disagreeing_code_references_reject_inference(self):
source = fixture(source=True)
source.relocations[1][0x106] = replace(source.relocations[1][0x106], addend=4)
with self.assertRaisesRegex(ValueError, "infer one source table"):
compare(source)
def test_missing_code_reference_rejects_inference(self):
source = fixture(source=True)
del source.relocations[1][0x106]
with self.assertRaisesRegex(ValueError, "table-reference relocations differ"):
compare(source)
def test_ambiguous_source_extent_rejects_inference(self):
source = fixture(source=True)
source.symbols.append(tool.Symbol("alias", 2, 0x40, 16))
with self.assertRaisesRegex(ValueError, "extent is missing or ambiguous"):
compare(source)
def test_different_source_section_rejects_inference(self):
source = fixture(source=True)
source.sections[2] = (".rodata", 0x1000)
with self.assertRaisesRegex(ValueError, "different section"):
compare(source)
def test_undefined_source_reference_rejects_inference(self):
source = fixture(source=True)
source.symbols[1] = replace(source.symbols[1], section="SHN_UNDEF")
with self.assertRaisesRegex(ValueError, "reference is undefined"):
compare(source)
def test_invalid_relocation_symbol_rejected(self):
source = fixture(source=True)
source.relocations[2][0x44] = replace(source.relocations[2][0x44], symbol=999)
with self.assertRaisesRegex(ValueError, "symbol index is out of range"):
compare(source)
def test_duplicate_function_rejected(self):
source = fixture(source=True)
source.symbols.append(source.symbols[0])
with self.assertRaisesRegex(ValueError, "one defined symbol"):
compare(source)
def test_out_of_section_symbol_rejected(self):
source = fixture(source=True)
source.symbols[0] = replace(source.symbols[0], size=0x2000)
with self.assertRaisesRegex(ValueError, "outside its section"):
compare(source)
def test_unrelated_reference_table_is_not_selected(self):
reference = fixture((0x80, 0x84, 0x88))
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
with self.assertRaisesRegex(ValueError, "does not target"):
tool.reference_tables(reference, reference.symbol("dispatch"), "jumptable_test")
def test_discovers_compiler_and_custom_names(self):
for name in ("@123", "scCharacterDispatch"):
reference = fixture()
reference.symbols[1] = replace(reference.symbols[1], name=name)
tables = tool.reference_tables(reference, reference.symbol("dispatch"))
self.assertEqual([(t.name, entries) for t, entries in tables],
[(name, [0x10, 0x20, 0x30])])
def test_custom_table_can_include_function_entry(self):
reference = fixture((0, 0x10, 0x20), source=True)
tables = tool.reference_tables(reference, reference.symbol("dispatch"))
self.assertEqual(tables[0][1], [0, 0x10, 0x20])
def test_function_entry_callback_array_is_not_auto_selected(self):
reference = fixture((0, 0, 0), source=True)
fn = reference.symbol("dispatch")
self.assertEqual(tool.reference_tables(reference, fn), [])
self.assertEqual(tool.reference_tables(reference, fn, "@123")[0][1],
[0, 0, 0])
def test_single_pointer_requires_explicit_name(self):
reference = fixture((0x10,), source=True)
fn = reference.symbol("dispatch")
self.assertEqual(tool.reference_tables(reference, fn), [])
self.assertEqual(tool.reference_tables(reference, fn, "@123")[0][1], [0x10])
def test_custom_table_requires_data_object(self):
reference = fixture(source=True)
reference.symbols[1] = replace(reference.symbols[1], kind="STT_NOTYPE")
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
reference.symbols[1] = replace(reference.symbols[1], kind="STT_OBJECT")
reference.sections[2] = (".text", 0x1000)
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
def test_custom_table_with_missing_or_external_entry_is_not_selected(self):
for entries in ((0x10, 0x20, 0x80), (0x10, 0x20, 0x30)):
reference = fixture(entries, source=True)
if entries[-1] == 0x30:
del reference.relocations[2][0x48]
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
def test_auto_custom_table_still_detects_swapped_entries(self):
reference = fixture(source=True)
source = fixture((0x20, 0x10, 0x30), source=True, table_offset=0x90)
with patch.object(tool, "read_object", side_effect=[source, reference]):
with contextlib.redirect_stdout(io.StringIO()) as output:
self.assertEqual(tool.main(["unused", "dispatch"]), 1)
self.assertIn("@123: 1/3 entries match", output.getvalue())
def test_cli_exit_codes(self):
for source, expected_status in [(fixture(source=True), 0),
(fixture((0x20, 0x10, 0x30), source=True), 1)]:
with patch.object(tool, "read_object", side_effect=[source, fixture()]):
with contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(tool.main(["unused", "dispatch"]), expected_status)
with patch.object(tool, "read_object", side_effect=ValueError("bad object")):
with contextlib.redirect_stderr(io.StringIO()):
self.assertEqual(tool.main(["unused", "dispatch"]), 2)
if __name__ == "__main__":
unittest.main()