Compare commits

..

1 Commits

Author SHA1 Message Date
coah
1c42679f0e cleanup(SDChannelObj): name address-suffixed C helpers
Rename iplSDChannelObj_813E* helpers to semantic names (setHeaps,
createBaseLayout, getLocalizedName, etc.) across the unit, callers,
header, and symbols.txt. Byte-identical: ok + sha1
26116613f624061ba99c8d1a299aaa6efa85670d; unit still ~90% code /
~99.99% fuzzy.
2026-10-01 18:29:30 -05:00
130 changed files with 3157 additions and 7074 deletions

164
AGENTS.md
View File

@@ -164,8 +164,9 @@ 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 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
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
range. Workers return changed paths, exact objdiff measurements, and validation
results. Fuzzy-only results are not accepted.
@@ -245,12 +246,6 @@ 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.
@@ -325,159 +320,6 @@ 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.46% | 88.57% | 62.98% | 97.20% |
| 99.38% | 87.96% | 62.33% | 92.07% |
units 925/1027 complete, functions 12264/12563 matched.
units 919/1027 complete, functions 12224/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
- scRsnOuiPad
- scWpaOuiPad
- lbl_81695063
- lbl_81695067
- __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:0x81694A78
.sdata2 start:0x81694A68 end:0x81694A80
.sdata start:0x81696C78 end:0x81696CA0
src/scene/memoryCard/iplMemoryCardBase.cpp:
.text start:0x813CC1FC end:0x813CD034
.data start:0x81652640 end:0x816526D0
.sdata2 start:0x81694A78 end:0x81694A88
.sdata2 start:0x81694A80 end:0x81694A88
src/scene/memoryCard/iplMemoryCardManager.cpp:
.text start:0x813CD034 end:0x813CE548
@@ -869,12 +869,11 @@ src/scene/setting/iplUSBAP.cpp:
.bss start:0x810BC148 end:0x810BD498
.text start:0x813FC520 end:0x813FC8FC
.data start:0x81657B08 end:0x81657B18
.sbss start:0x81698C08 end:0x81698C20
.sbss start:0x81698C08 end:0x81698C28
src/scene/setting/iplUSBAPThread.cpp:
.text start:0x813FC8FC end:0x813FCA0C
.data start:0x81657B18 end:0x81657B60
.sbss start:0x81698C20 end:0x81698C28
src/scene/setting/iplAOSSThread.cpp:
.bss start:0x810BD498 end:0x810BD4A8
@@ -3552,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:0x8168EBA0
.data start:0x8168E930 end:0x8168EB68
libs/RVL_SDK/src/bte/l2c_main.c:
.bss start:0x811725E0 end:0x81172DC8
.text start:0x815AD7BC end:0x815AE7EC
.data start:0x8168EBA0 end:0x8168EEA0
.data start:0x8168EB68 end:0x8168EEA0
libs/RVL_SDK/src/bte/l2c_utils.c:
.text start:0x815AE7EC end:0x815B06B0

View File

@@ -8,12 +8,9 @@ _database__7LibTVRC = .bss:0x81089760; // type:object size:0x20 data:4byte
_alarm__7LibTVRC = .bss:0x81089780; // type:object size:0x30
_tickWait__7LibTVRC = .bss:0x810897B0; // type:object size:0x10 data:4byte
mArg__Q33ipl7utility8Graphics = .bss:0x810897C0; // type:object size:0x84
@15968 = .bss:0x81089848; // type:object size:0xC scope:local
_seBlk__Q23ipl3snd = .bss:0x81089854; // type:object size:0xC0 data:4byte
@15969 = .bss:0x81089914; // type:object size:0xC scope:local
@15970 = .bss:0x81089920; // type:object size:0xC scope:local
sSystem__Q23ipl3snd = .bss:0x8108992C; // type:object size:0x62C data:4byte
@15971 = .bss:0x81089F58; // type:object size:0xC scope:local
unk__Q23ipl3snd = .bss:0x81089848; // type:object size:0xC
_seBlk__Q23ipl3snd = .bss:0x81089854; // type:object size:0xD8 data:4byte
sSystem__Q23ipl3snd = .bss:0x8108992C; // type:object size:0x63C data:4byte
sBannerSoundPlayer__Q23ipl3snd = .bss:0x81089F68; // type:object size:0x518 data:byte
runSliceMutex___Q37ext_ead3www13BrowserThread = .bss:0x8108A480; // type:object size:0x18
cap__Q23www9trasition = .bss:0x8108A498; // type:object size:0x20 scope:local data:4byte
@@ -30,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
CoverBlock = .bss:0x8108BF60; // type:object size:0x30 data:4byte
lbl_8108BF60 = .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
@@ -40,11 +37,11 @@ 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
UpdateDiskID = .bss:0x810ADF60; // type:object size:0x20 align:32 data:4byte
lbl_810ADF60 = .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
Thread = .bss:0x810B2580; // type:object size:0x1318 scope:local
Thread = .bss:0x810B2580; // type:object size:0x1320 scope:local
UpdateHeader0 = .bss:0x810B38A0; // type:object size:0x20 scope:local
UpdateHeader1 = .bss:0x810B38C0; // type:object size:0x20 scope:local
viewsBuf = .bss:0x810B38E0; // type:object size:0x3600 scope:local
@@ -84,21 +81,21 @@ 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
AOSSi_NcdIfConfig = .bss:0x810BD4A8; // type:object size:0x15E data:byte
AOSSi_NcdIpConfig = .bss:0x810BD608; // type:object size:0x7C4 data:4byte
sRakuAllocator = .bss:0x810BDDD0; // type:object size:0x10
sRakuStatus = .bss:0x810BDDE0; // type:object size:0xF4 data:4byte
sRakuMsgQueue = .bss:0x810BDED4; // type:object size:0x20
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
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
AOSS_810BE838 = .bss:0x810BE838; // type:object size:0x68
AOSS_810BE8A0 = .bss:0x810BE8A0; // type:object size:0x400
gNetworkSettings = .bss:0x810BECA0; // type:object size:0x924 data:4byte
gAccessPointName = .bss:0x810BF5C4; // type:object size:0x24
gScanSettings = .bss:0x810BF5E8; // type:object size:0x258
gAtermConfigurationResult = .bss:0x810BF840; // type:object size:0x900
gAtermResponseBuffer = .bss:0x810C0140; // type:object size:0x818 data:2byte
ATERM_810BECA0 = .bss:0x810BECA0; // type:object size:0x924 data:4byte
ATERM_810BF5C4 = .bss:0x810BF5C4; // type:object size:0x24
ATERM_810BF5E8 = .bss:0x810BF5E8; // type:object size:0x258
ATERM_810BF840 = .bss:0x810BF840; // type:object size:0x900
ATERM_810C0140 = .bss:0x810C0140; // type:object size:0x818 data:2byte
AtermThread = .bss:0x810C0958; // type:object size:0x318 scope:local align:32
Voices = .bss:0x810C0C80; // type:object size:0x1800 data:4byte
sZeroMem = .bss:0x810C2480; // type:object size:0x100 data:byte
@@ -4293,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
compareMemoryCardSortEntries = .text:0x813CD034; // type:function size:0x78
iplMemoryCardManager_813CD034 = .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
@@ -4402,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
sendCardUnmountCmd = .text:0x813D205C; // type:function size:0x44
CardSequence_813D205C = .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
pollCardSlot = .text:0x813D222C; // type:function size:0x110
mapCardErrorCode = .text:0x813D233C; // type:function size:0x9C
CardSequence_813D222C = .text:0x813D222C; // type:function size:0x110
CardSequence_813D233C = .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
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
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
IPLContestInitialize = .text:0x813D4694; // type:function size:0xBC
IPLContestStart = .text:0x813D4750; // type:function size:0x14
IPLContestProcess = .text:0x813D4764; // type:function size:0x6E8
@@ -4869,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_containsTitleId = .text:0x813EE358; // type:function size:0x44
iplSDMemory_813EE358 = .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
@@ -5136,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
AOSSi_SleepAlarmHandler = .text:0x813FD17C; // type:function size:0x10
AOSSi_SleepMs = .text:0x813FD18C; // type:function size:0x88
AOSS_813FD17C = .text:0x813FD17C; // type:function size:0x10
AOSS_813FD18C = .text:0x813FD18C; // type:function size:0x88
AOSSi_Alloc = .text:0x813FD214; // type:function size:0x24
AOSSi_Free = .text:0x813FD238; // type:function size:0x24
AOSSi_StoreIpv4Octets = .text:0x813FD25C; // type:function size:0x2C
AOSS_813FD25C = .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
@@ -5149,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
syncRakuProgress__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDA04; // type:function size:0x6C scope:local
RakuRakuThread_813FDA04__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
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
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
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
AOSSValidateInitConfig = .text:0x813FFD68; // type:function size:0x36C
AOSS_813FFD68 = .text:0x813FFD68; // type:function size:0x36C
AOSS_CheckAP = .text:0x814000D4; // type:function size:0xE0
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
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
ATERMi_AutoConfigThread = .text:0x814047A4; // type:function size:0xA0
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
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
ATERMi_ApConfigStart = .text:0x8140685C; // type:function size:0x19C
ATERMi_ApConfigEnd = .text:0x814069F8; // type:function size:0x204
ATERMi_ApConfigGetState = .text:0x81406BFC; // type:function size:0x8C
@@ -6673,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
CHANSVmFloatSign = .text:0x8144B1D8; // type:function size:0x20 scope:local
CHANSVm_8144B1D8 = .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
CHANSVmConvertToIntFromFloat = .text:0x8144B30C; // type:function size:0xAC scope:local
CHANSVm_8144B30C = .text:0x8144B30C; // type:function size:0xAC scope:local
CHANSVmConvertToIntFromStr = .text:0x8144B3B8; // type:function size:0x70
CHANSVmConvertToIntFromArray = .text:0x8144B428; // type:function size:0x8
CHANSVmConvertToFloatFromUndefined = .text:0x8144B430; // type:function size:0x40
CHANSVmConvertToFloatFromInt = .text:0x8144B470; // type:function size:0x64
CHANSVmConvertToFloatFromStr = .text:0x8144B4D4; // type:function size:0x14C
CHANSVm_8144B430 = .text:0x8144B430; // type:function size:0x40
CHANSVm_8144B470 = .text:0x8144B470; // type:function size:0x64
CHANSVm_8144B4D4 = .text:0x8144B4D4; // type:function size:0x14C
CHANSVmConvertToStrFromUndefined = .text:0x8144B620; // type:function size:0xC
CHANSVmFloatToWString = .text:0x8144B62C; // type:function size:0x58 scope:local
CHANSVm_8144B62C = .text:0x8144B62C; // type:function size:0x58 scope:local
CHANSVmConvertToStrFromInt = .text:0x8144B684; // type:function size:0xB0
CHANSVmConvertToStrFromFloat = .text:0x8144B734; // type:function size:0xDC
CHANSVm_8144B734 = .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
@@ -6807,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
CHANSVmFormatString = .text:0x8145049C; // type:function size:0x6BC
CHANSVm_8145049C = .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
CHANSVmBlobResolveOffset = .text:0x81450D14; // type:function size:0xB8
CHANSVm_81450D14 = .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
@@ -6823,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
CHANSVmBlobGetCount = .text:0x81451314; // type:function size:0x34
CHANSVmBlobHasSpace = .text:0x81451348; // type:function size:0x50
CHANSVm_81451314 = .text:0x81451314; // type:function size:0x34
CHANSVm_81451348 = .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
@@ -6860,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
CHANSVmMakeU64 = .text:0x814540E0; // type:function size:0x6C
CHANSVm_814540E0 = .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
@@ -6878,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
CHANSVmLookupScopedObject = .text:0x81455654; // type:function size:0x8C
CHANSVm_81455654 = .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
@@ -7287,7 +7284,7 @@ Zi8_814834AC = .text:0x814834AC; // type:function size:0x55C
Zi8GetKOcandidates = .text:0x81483A08; // type:function size:0xA74
Zi8LogError = .text:0x8148447C; // type:function size:0x4
Zi8ReplaceLastError = .text:0x81484480; // type:function size:0x4
Zi8MapKeyCode = .text:0x81484484; // type:function size:0x80
Zi8_81484484 = .text:0x81484484; // type:function size:0x80
ziNumKeysWithChars = .text:0x81484504; // type:function size:0xC4 scope:local
Zi8getKeyLayout = .text:0x814845C8; // type:function size:0x2D8
Zi8ChangeCharCase = .text:0x814848A0; // type:function size:0x48C
@@ -12686,7 +12683,7 @@ pdm_bpb_CalcBPBFields = .text:0x815C743C; // type:function size:0xE8
pdm_bpb_InitVolumeWithBootSector = .text:0x815C7524; // type:function size:0x31C
pdm_bpb_InitVolumeWithFSINFOSector = .text:0x815C7840; // type:function size:0xE8
pdm_disk_convert_sector_into_block = .text:0x815C7928; // type:function size:0xB0
pdm_disk_convert_block_into_sector = .text:0x815C79D8; // type:function size:0xB0
pdm_disk_convert_block_into_sector` = .text:0x815C79D8; // type:function size:0xB0
pdm_disk_init_disk_manager = .text:0x815C7A88; // type:function size:0x34
pdm_disk_add_disk = .text:0x815C7ABC; // type:function size:0x124
pdm_disk_del_disk = .text:0x815C7BE0; // type:function size:0x50
@@ -13274,7 +13271,7 @@ __nupSetAuditState__FUc = .text:0x815F0444; // type:function size:0x7C scope:loc
__nupBase64Encode__FPUcPUcUl = .text:0x815F04C0; // type:function size:0xFC scope:local
__nupGetAuditData__FP14NUPContextInfoPPc = .text:0x815F05BC; // type:function size:0x3D0 scope:local
__nupGetTmdView__FUxPP9ESTmdView = .text:0x815F098C; // type:function size:0xB4 scope:local
__nupGetBootVersion__FP14NUPContextInfoP14ESTitleVersion = .text:0x815F0A40; // type:function size:0x28C scope:local
__nupGetBootVersion__FP14ESTitleVersion = .text:0x815F0A40; // type:function size:0x28C scope:local
__nupGetTicket__FP12NUPTitleInfoPc = .text:0x815F0CCC; // type:function size:0x164 scope:local
__nupGetTmd__FP12NUPTitleInfoPc = .text:0x815F0E30; // type:function size:0x1E4 scope:local
__nupGetTitleSize__FP12NUPTitleInfo = .text:0x815F1014; // type:function size:0x22C scope:local
@@ -14201,9 +14198,9 @@ 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 noreloc
pf_valid_fn_char = .rodata:0x8162E6B0; // type:object size:0x60 scope:local noreloc
fat_special_values = .rodata:0x8162E710; // type:object size:0x3C
cp932_to_unicode = .rodata:0x8162E750; // type:object size:0x4272 data:2byte noreloc
cp932_to_unicode = .rodata:0x8162E750; // type:object size:0x4272 data:2byte
fa_nand_func = .rodata:0x816329C8; // type:object size:0x20
pfd_sddrv_func = .rodata:0x816329E8; // type:object size:0x20
sddrv_size_depend_tbl = .rodata:0x81632A08; // type:object size:0x150 data:4byte
@@ -15945,7 +15942,7 @@ lbl_8164DD80 = .data:0x8164DD80; // type:object size:0x37
lbl_8164DDB7 = .data:0x8164DDB7; // type:object size:0xAD
scPaneName_N_GCIcon = .data:0x8164DE64; // type:object size:0x9 data:string
scPaneName_N_DiscUpdateIcon = .data:0x8164DE6D; // type:object size:0x11 data:string
updateDiskState_jumptable = .data:0x8164DE80; // type:object size:0x1C scope:local
jumptable_8164DE80 = .data:0x8164DE80; // type:object size:0x1C scope:local
scSE_WSD_SELECT = .data:0x8164DE9C; // type:object size:0xB data:string
lbl_8164DEA7 = .data:0x8164DEA7; // type:object size:0x10 data:string
lbl_8164DEB7 = .data:0x8164DEB7; // type:object size:0x114
@@ -16961,9 +16958,9 @@ lbl_816567FD = .data:0x816567FD; // type:object size:0xF data:string
lbl_8165680C = .data:0x8165680C; // type:object size:0x18
lbl_81656824 = .data:0x81656824; // type:object size:0x18
lbl_8165683C = .data:0x8165683C; // type:object size:0xAC
sSettingAPButtonNames__Q23ipl5scene = .data:0x816568E8; // type:object size:0x10
sSettingAPTextNames__Q23ipl5scene = .data:0x816568F8; // type:object size:0x18
sSettingAPNumberNames__Q23ipl5scene = .data:0x81656910; // type:object size:0x18 data:4byte
lbl_816568E8 = .data:0x816568E8; // type:object size:0x10
lbl_816568F8 = .data:0x816568F8; // type:object size:0x18
lbl_81656910 = .data:0x81656910; // type:object size:0x18 data:4byte
lbl_81656928 = .data:0x81656928; // type:object size:0xD data:string
lbl_81656935 = .data:0x81656935; // type:object size:0xC data:string
lbl_81656941 = .data:0x81656941; // type:object size:0x9 data:string
@@ -17093,7 +17090,7 @@ jumptable_81657D5C = .data:0x81657D5C; // type:object size:0x58 scope:local
jumptable_81657DB8 = .data:0x81657DB8; // type:object size:0x28 scope:local
jumptable_81657DE0 = .data:0x81657DE0; // type:object size:0x84 scope:local
jumptable_81657E64 = .data:0x81657E64; // type:object size:0x2C scope:local
gAtermDigestFill = .data:0x81657E90; // type:object size:0x40
lbl_81657E90 = .data:0x81657E90; // type:object size:0x40
@10010 = .data:0x81657ED0; // type:object size:0xC scope:local data:string
@10021 = .data:0x81657EDC; // type:object size:0x13 scope:local data:string
__vt__Q33ipl5scene9SettingBg = .data:0x81657EF0; // type:object size:0x4C
@@ -17881,8 +17878,8 @@ __vt__Q49textinput6extend4memo13EditMemoState = .data:0x81667F48; // type:object
__vt__Q49textinput6extend4memo15AppearMemoState = .data:0x81667FA0; // type:object size:0x58
__vt__Q49textinput6extend4memo13DispMemoState = .data:0x81667FF8; // type:object size:0x58
__vt__Q49textinput6extend4memo5State = .data:0x81668050; // type:object size:0x58
__vt__Q49textinput6extend4memo7Manager = .data:0x816680A8; // type:object size:0x140
lbl_816681E8 = .data:0x816681E8; // type:object size:0x28
__vt__Q49textinput6extend4memo7Manager = .data:0x816680A8; // type:object size:0xCC
lbl_81668174 = .data:0x81668174; // type:object size:0x9C
lbl_81668210 = .data:0x81668210; // type:object size:0x9 data:string
lbl_8166821C = .data:0x8166821C; // type:object size:0x9 data:string
lbl_81668228 = .data:0x81668228; // type:object size:0x9 data:string
@@ -18922,7 +18919,7 @@ Ucs9D = .data:0x8167F428; // type:object size:0x200 scope:local noreloc
Ucs9E = .data:0x8167F628; // type:object size:0x200 scope:local noreloc
Ucs9F = .data:0x8167F828; // type:object size:0x200 scope:local noreloc
UcsFF = .data:0x8167FA28; // type:object size:0x200 scope:local noreloc
UcsSjisTable = .data:0x8167FC28; // type:object size:0x400 scope:local data:4byte
UcsSjisTable = .data:0x8167FC28; // type:object size:0x400 scope:local noreloc
@746 = .data:0x81680028; // type:object size:0x13 scope:local data:string
@747 = .data:0x8168003C; // type:object size:0x13 scope:local data:string
@751 = .data:0x81680050; // type:object size:0xC scope:local data:string
@@ -20247,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
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_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
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
@@ -20582,8 +20579,8 @@ lbl_81694C60 = .sdata2:0x81694C60; // type:object size:0x4 align:4 data:float
lbl_81694C64 = .sdata2:0x81694C64; // type:object size:0x4 align:4 data:float
lbl_81694C68 = .sdata2:0x81694C68; // type:object size:0x4 align:4 data:float
lbl_81694C70 = .sdata2:0x81694C70; // type:object size:0x8 align:8 data:double
aossDefaultConnection = .sdata2:0x81694C78; // type:object size:0x2 data:2byte
aossDefaultOptions = .sdata2:0x81694C7A; // type:object size:0x6 data:2byte
lbl_81694C78 = .sdata2:0x81694C78; // type:object size:0x2 data:2byte
lbl_81694C7A = .sdata2:0x81694C7A; // type:object size:0x6 data:2byte
lbl_81694C80 = .sdata2:0x81694C80; // type:object size:0x1 data:byte
lbl_81694C81 = .sdata2:0x81694C81; // type:object size:0x1 data:byte
lbl_81694C82 = .sdata2:0x81694C82; // type:object size:0x1 data:byte
@@ -20625,7 +20622,7 @@ scInputForm640F = .sdata2:0x81694D2C; // type:object size:0x4 align:4 data:float
scInputFormF32ConvertMagic = .sdata2:0x81694D30; // type:object size:0x8 align:8 data:double
scInputFormOneF = .sdata2:0x81694D38; // type:object size:0x4 align:4 data:float
scInputFormHalfF = .sdata2:0x81694D3C; // type:object size:0x4 align:4 data:float
scInputFormDegToFIdxF = .sdata2:0x81694D40; // type:object size:0x4 align:4 data:float
scInputForm0_7111111F = .sdata2:0x81694D40; // type:object size:0x4 align:4 data:float
scInputForm150F = .sdata2:0x81694D44; // type:object size:0x4 align:4 data:float
scInputForm30F = .sdata2:0x81694D48; // type:object size:0x4 align:4 data:float
scInputForm50F = .sdata2:0x81694D4C; // type:object size:0x4 align:4 data:float
@@ -21697,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
TicketViews = .sdata:0x81696578; // type:object size:0x4 data:4byte
lbl_81696578 = .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
@@ -22213,23 +22210,23 @@ lbl_816971D4 = .sdata:0x816971D4; // type:object size:0x8 data:wstring
@12299 = .sdata:0x816971E0; // type:object size:0x5 scope:local data:string
@12302 = .sdata:0x816971E5; // type:object size:0x5 scope:local data:string
lbl_816971F0 = .sdata:0x816971F0; // type:object size:0x4 data:string
displayState__Q23ipl5scene = .sdata:0x816971F8; // type:object size:0x4 data:4byte
s_socket = .sdata:0x81697200; // type:object size:0x4 data:4byte
s_manufacturer = .sdata:0x81697204; // type:object size:0x6 data:string
lbl_816971F8 = .sdata:0x816971F8; // type:object size:0x4 data:4byte
lbl_81697200 = .sdata:0x81697200; // type:object size:0x4 data:4byte
lbl_81697204 = .sdata:0x81697204; // type:object size:0x6 data:string
lbl_8169720C = .sdata:0x8169720C; // type:object size:0x4 data:4byte
lbl_81697210 = .sdata:0x81697210; // type:object size:0x8
gAtermDeadline = .sdata:0x81697218; // type:object size:0x4 data:4byte
gAtermScanLimit = .sdata:0x8169721C; // type:object size:0x4 data:4byte
gAtermScanBufferSize = .sdata:0x81697220; // type:object size:0x4 data:4byte
gDefaultIpAddress = .sdata:0x81697224; // type:object size:0x4
gDefaultSubnetMask = .sdata:0x81697228; // type:object size:0x4
gDefaultGateway = .sdata:0x8169722C; // type:object size:0x4
gDefaultPrimaryDns = .sdata:0x81697230; // type:object size:0x4
gDefaultSecondaryDns = .sdata:0x81697234; // type:object size:0x4
gAtermAossSsid = .sdata:0x81697238; // type:object size:0x7 data:string
gAtermRequestOptions = .sdata:0x81697240; // type:object size:0x4 data:4byte
gAtermUseSharedAddress = .sdata:0x81697244; // type:object size:0x4 data:4byte
gAtermProductName = .sdata:0x81697248; // type:object size:0x5 data:string
lbl_81697218 = .sdata:0x81697218; // type:object size:0x4 data:4byte
lbl_8169721C = .sdata:0x8169721C; // type:object size:0x4 data:4byte
lbl_81697220 = .sdata:0x81697220; // type:object size:0x4 data:4byte
lbl_81697224 = .sdata:0x81697224; // type:object size:0x4
lbl_81697228 = .sdata:0x81697228; // type:object size:0x4
lbl_8169722C = .sdata:0x8169722C; // type:object size:0x4
lbl_81697230 = .sdata:0x81697230; // type:object size:0x4
lbl_81697234 = .sdata:0x81697234; // type:object size:0x4
lbl_81697238 = .sdata:0x81697238; // type:object size:0x7 data:string
lbl_81697240 = .sdata:0x81697240; // type:object size:0x4 data:4byte
lbl_81697244 = .sdata:0x81697244; // type:object size:0x4 data:4byte
lbl_81697248 = .sdata:0x81697248; // type:object size:0x5 data:string
@10020 = .sdata:0x81697250; // type:object size:0x4 scope:local data:string
scBtnSoundType__Q23ipl5scene = .sdata:0x81697258; // type:object size:0x8 scope:local
@10722 = .sdata:0x81697260; // type:object size:0x4 scope:local data:string
@@ -22278,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
scN_KOR = .sdata:0x816973A4; // type:object size:0x6 data:string
scN_CHN = .sdata:0x816973AC; // type:object size:0x6 data:string
lbl_816973A4 = .sdata:0x816973A4; // type:object size:0x6 data:string
lbl_816973AC = .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
@@ -23352,70 +23349,70 @@ 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
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
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
StartingGame = .sbss:0x81698A20; // type:object size:0x4 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
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
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
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
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
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
MemAllocator = .sbss:0x81698B04; // type:object size:0x4 scope:local data:4byte
State = .sbss:0x81698B08; // type:object size:0x4 data:4byte
CurrentEntry = .sbss:0x81698B0C; // type:object size:0x4 data:4byte
RebootRequired = .sbss:0x81698B10; // type:object size:0x4 scope:local data:4byte
ContainsSeatTitles = .sbss:0x81698B14; // type:object size:0x4 scope:local data:4byte
UpdateImportState = .sbss:0x81698B18; // type:object size:0x4 scope:local data:4byte
UpdateImportResult = .sbss:0x81698B1C; // type:object size:0x4 scope:local data:4byte
lbl_81698B10 = .sbss:0x81698B10; // type:object size:0x4 scope:local data:4byte
lbl_81698B14 = .sbss:0x81698B14; // type:object size:0x4 scope:local data:4byte
lbl_81698B18 = .sbss:0x81698B18; // type:object size:0x4 scope:local data:4byte
lbl_81698B1C = .sbss:0x81698B1C; // type:object size:0x4 scope:local data:4byte
StartUpdate = .sbss:0x81698B20; // type:object size:0x4 data:4byte
CancelUpdate = .sbss:0x81698B24; // type:object size:0x4 data:4byte
UpdateProgress = .sbss:0x81698B28; // type:object size:0x4 scope:local data:4byte
@@ -23458,7 +23455,7 @@ sHeapBuf__Q33ipl5scene8NetSetup = .sbss:0x81698BD8; // type:object size:0x4 data
sHeap__Q33ipl5scene8NetSetup = .sbss:0x81698BDC; // type:object size:0x4 data:4byte
mem1Buffer___Q33ipl5scene7Setting = .sbss:0x81698BE0; // type:object size:0x4 data:4byte
mem2Buffer___Q33ipl5scene7Setting = .sbss:0x81698BE4; // type:object size:0x4 data:4byte
browserScrollDirection__Q23ipl5scene = .sbss:0x81698BE8; // type:object size:0x4 data:4byte
lbl_81698BE8 = .sbss:0x81698BE8; // type:object size:0x4 data:4byte
mID__Q33ipl3ncd10NCDSetting = .sbss:0x81698BF0; // type:object size:0x2 data:2byte
mMacNum__Q33ipl3ncd10NCDSetting = .sbss:0x81698BF4; // type:object size:0x4 data:4byte
mStackPass__Q33ipl8parental8Parental = .sbss:0x81698BF8; // type:object size:0x4
@@ -23475,43 +23472,43 @@ lbl_81698C28 = .sbss:0x81698C28; // type:object size:0x4 data:4byte
lbl_81698C2C = .sbss:0x81698C2C; // type:object size:0x4 data:4byte
lbl_81698C30 = .sbss:0x81698C30; // type:object size:0x4 data:4byte
AOSSi_cancel_flag = .sbss:0x81698C38; // type:object size:0x4 data:4byte
ipAddress = .sbss:0x81698C3C; // type:object size:0x4
ipNetmask = .sbss:0x81698C40; // type:object size:0x4
ipGateway = .sbss:0x81698C44; // type:object size:0x4
primaryDns = .sbss:0x81698C48; // type:object size:0x4
secondaryDns = .sbss:0x81698C4C; // type:object size:0x4
allocateMemory = .sbss:0x81698C50; // type:object size:0x4 data:4byte
releaseMemory = .sbss:0x81698C54; // type:object size:0x4 data:4byte
statusCallback = .sbss:0x81698C58; // type:object size:0x4 data:4byte
startTimeHigh__Q23ipl5scene = .sbss:0x81698C60; // type:object size:0x4 data:4byte
startTimeLow__Q23ipl5scene = .sbss:0x81698C64; // type:object size:0x4 data:4byte
active__Q23ipl5scene = .sbss:0x81698C68; // type:object size:0x1 data:byte
messageSlot__Q23ipl5scene = .sbss:0x81698C6C; // type:object size:0x4
s_accessPointList = .sbss:0x81698C70; // type:object size:0x4 data:4byte
s_accessPointConfig = .sbss:0x81698C74; // type:object size:0x4 data:4byte
s_accessPointName = .sbss:0x81698C78; // type:object size:0x8 data:byte
s_connectionState = .sbss:0x81698C80; // type:object size:0x4 data:4byte
s_errorCode = .sbss:0x81698C84; // type:object size:0x4 data:4byte
s_socketStarted = .sbss:0x81698C88; // type:object size:0x4 data:4byte
s_responseBuffer = .sbss:0x81698C8C; // type:object size:0x4 data:4byte
gAtermState = .sbss:0x81698C90; // type:object size:0x4 data:4byte
gAtermResult = .sbss:0x81698C94; // type:object size:0x4 data:4byte
gAtermProgressCallback = .sbss:0x81698C98; // type:object size:0x4 data:4byte
gAtermAllocate = .sbss:0x81698C9C; // type:object size:0x4 data:4byte
gAtermRelease = .sbss:0x81698CA0; // type:object size:0x4 data:4byte
gAtermAllocation = .sbss:0x81698CA4; // type:object size:0x4 data:4byte
gAtermThreadStarted = .sbss:0x81698CA8; // type:object size:0x4 data:4byte
gAtermSelectedRecordIndex = .sbss:0x81698CAC; // type:object size:0x4 data:4byte
gAtermSocketReady = .sbss:0x81698CB0; // type:object size:0x4 data:4byte
gAtermSocketStarted = .sbss:0x81698CB4; // type:object size:0x4 data:4byte
gAtermMessageLength = .sbss:0x81698CB8; // type:object size:0x4 data:4byte
gAtermReplyLength = .sbss:0x81698CBC; // type:object size:0x4 data:4byte
gAtermMode = .sbss:0x81698CC0; // type:object size:0x1 data:byte
gAtermResponseMode = .sbss:0x81698CC4; // type:object size:0x4 data:4byte
gAtermAddressBuffer = .sbss:0x81698CC8; // type:object size:0x8
gAtermProtocolState = .sbss:0x81698CD0; // type:object size:0x4 data:4byte
gAtermSelectedBssid = .sbss:0x81698CD4; // type:object size:0x8 data:byte
gAtermCancelRequested = .sbss:0x81698CDC; // type:object size:0x4 data:4byte
lbl_81698C3C = .sbss:0x81698C3C; // type:object size:0x4
lbl_81698C40 = .sbss:0x81698C40; // type:object size:0x4
lbl_81698C44 = .sbss:0x81698C44; // type:object size:0x4
lbl_81698C48 = .sbss:0x81698C48; // type:object size:0x4
lbl_81698C4C = .sbss:0x81698C4C; // type:object size:0x4
lbl_81698C50 = .sbss:0x81698C50; // type:object size:0x4 data:4byte
lbl_81698C54 = .sbss:0x81698C54; // type:object size:0x4 data:4byte
lbl_81698C58 = .sbss:0x81698C58; // type:object size:0x4 data:4byte
lbl_81698C60 = .sbss:0x81698C60; // type:object size:0x4 data:4byte
lbl_81698C64 = .sbss:0x81698C64; // type:object size:0x4 data:4byte
lbl_81698C68 = .sbss:0x81698C68; // type:object size:0x1 data:byte
lbl_81698C6C = .sbss:0x81698C6C; // type:object size:0x4
lbl_81698C70 = .sbss:0x81698C70; // type:object size:0x4 data:4byte
lbl_81698C74 = .sbss:0x81698C74; // type:object size:0x4 data:4byte
lbl_81698C78 = .sbss:0x81698C78; // type:object size:0x8 data:byte
lbl_81698C80 = .sbss:0x81698C80; // type:object size:0x4 data:4byte
lbl_81698C84 = .sbss:0x81698C84; // type:object size:0x4 data:4byte
lbl_81698C88 = .sbss:0x81698C88; // type:object size:0x4 data:4byte
lbl_81698C8C = .sbss:0x81698C8C; // type:object size:0x4 data:4byte
lbl_81698C90 = .sbss:0x81698C90; // type:object size:0x4 data:4byte
lbl_81698C94 = .sbss:0x81698C94; // type:object size:0x4 data:4byte
lbl_81698C98 = .sbss:0x81698C98; // type:object size:0x4 data:4byte
lbl_81698C9C = .sbss:0x81698C9C; // type:object size:0x4 data:4byte
lbl_81698CA0 = .sbss:0x81698CA0; // type:object size:0x4 data:4byte
lbl_81698CA4 = .sbss:0x81698CA4; // type:object size:0x4 data:4byte
lbl_81698CA8 = .sbss:0x81698CA8; // type:object size:0x4 data:4byte
lbl_81698CAC = .sbss:0x81698CAC; // type:object size:0x4 data:4byte
lbl_81698CB0 = .sbss:0x81698CB0; // type:object size:0x4 data:4byte
lbl_81698CB4 = .sbss:0x81698CB4; // type:object size:0x4 data:4byte
lbl_81698CB8 = .sbss:0x81698CB8; // type:object size:0x4 data:4byte
lbl_81698CBC = .sbss:0x81698CBC; // type:object size:0x4 data:4byte
lbl_81698CC0 = .sbss:0x81698CC0; // type:object size:0x1 data:byte
lbl_81698CC4 = .sbss:0x81698CC4; // type:object size:0x4 data:4byte
lbl_81698CC8 = .sbss:0x81698CC8; // type:object size:0x8
lbl_81698CD0 = .sbss:0x81698CD0; // type:object size:0x4 data:4byte
lbl_81698CD4 = .sbss:0x81698CD4; // type:object size:0x8 data:byte
lbl_81698CDC = .sbss:0x81698CDC; // type:object size:0x4 data:4byte
zeroBuffer = .sbss:0x81698CE0; // type:object size:0x4 data:4byte
sSysInit__19AxAdpcmSimplePlayer = .sbss:0x81698CE4; // type:object size:0x1 data:byte
sSysPauseFlag__19AxAdpcmSimplePlayer = .sbss:0x81698CE5; // type:object size:0x1 data:byte
@@ -23753,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 data:4byte
Vdac_Flag_Changed = .sbss:0x816991E0; // type:object size:0x4 scope:local 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
@@ -24051,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 data:4byte
uhg_msc_memid = .sbss:0x8169971C; // type:object size:0x4 scope:local 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(Matching, "sound/iplSound.cpp"),
Object(NonMatching, "sound/iplSound.cpp"),
]
),
IPLSection("iplwww", [
@@ -869,11 +869,11 @@ config.libs = [
),
IPLSection("setting", [
Object(NonMatching, "scene/setting/iplSetting.cpp"),
Object(Matching, "scene/setting/iplSensitivity.cpp"),
Object(NonMatching, "scene/setting/iplSensitivity.cpp"),
Object(Matching, "scene/setting/iplNCDSetting.cpp"),
Object(Matching, "scene/setting/iplParental.cpp"),
Object(Matching, "scene/setting/iplAPScanThread.cpp"),
Object(Matching, "scene/setting/iplUSBAP.cpp"),
Object(NonMatching, "scene/setting/iplUSBAP.cpp"),
Object(NonMatching, "scene/setting/iplUSBAPThread.cpp"),
Object(Matching, "scene/setting/iplAOSSThread.cpp"),
Object(NonMatching, "scene/setting/AOSSLink.c"),
@@ -933,8 +933,8 @@ config.libs = [
Object(Matching, "keyboard/MyTiBg.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiDebug.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiGUIManager.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiHKBManager.cpp", extra_cflags=["-O4,p"]),
Object(Matching, "keyboard/tiHwKeyboard.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/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(Matching, "nhttp/d_nhttp_private.c"),
Object(NonMatching, "nhttp/d_nhttp_private.c"),
Object(Matching, "nhttp/d_nhttp.c"),
Object(Matching, "nhttp/d_nhttp_common.c"),
]
@@ -1869,7 +1869,7 @@ config.libs = [
),
RVLSDKLib("nup", [
Object(NonMatching, "nup/nup.cpp"),
Object(Matching, "nup/nup_nhttp.cpp"),
Object(NonMatching, "nup/nup_nhttp.cpp"),
Object(Matching, "nup/nup_mem.cpp"),
]
),

View File

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

View File

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

View File

@@ -20,8 +20,6 @@ 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;
@@ -109,23 +107,10 @@ namespace textinput {
HKBManager* manager;
};
HKBManager() __attribute__((never_inline));
~HKBManager();
static HKBManager& getInstance() { return sInstance; }
void Initialize();
void ClearState();
u32 FilterCharacter(u32 code) const {
if (allowedCharacters == 0) return code;
u32 count = allowedCharacterCount;
if (count == 0) return code;
for (u32 index = 0; index < count; index++) {
if (static_cast<u16>(code) == allowedCharacters[index]) return code;
}
return 0;
}
void DetachDevice(KBDDevEvent* event) {
u8 device = event->device;
attached[device] = 0;
states[device].Clear();
}
u32 GetModifierState() const;
void SetCountry(u8 country);
void SetModifierState(u32 state, u32 mask);
@@ -164,7 +149,6 @@ 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 *);
#if defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
#ifdef TIMANAGER_IMPLEMENTATION
inline ~HWKeyboard();
#else
~HWKeyboard();
#endif
#if defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
#ifdef TIMANAGER_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) || defined(TIHWKEYBOARD_IMPLEMENTATION)
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_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,10 +46,9 @@ namespace textinput {
bool updateTappingShift_(input::HKBManager&);
#endif
void updateShift(input::HKBManager& hkbManager);
bool controlKeyTriggeredHandler(input::HKBManager&);
void controlKeyTriggeredHandler(input::HKBManager);
Manager *mgr() { return mpManager; }
const Manager *mgr() const { return mpManager; }
Manager* mpManager; // 0x10
u8 field_0x14; // 0x14

View File

@@ -113,8 +113,6 @@ 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

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

View File

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

View File

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

View File

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

View File

@@ -68,8 +68,8 @@ namespace ipl {
vBOOL mbAppearMsg; // 0x0C
private:
u32 mFocusState;
int mPendingFocusCmd;
u32 unk_0x10;
int unk_0x14;
layout::Object* mpLayout; // 0x18
gui::PaneManager* mpGui; // 0x1C
layout::PaneAnimator* mpCurrentPaneAnim; // 0x20
@@ -77,7 +77,7 @@ namespace ipl {
public:
utility::Date* mpDate; // 0x38
u32 mPointCount;
u32 unk_0x3C;
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& initialPos,
f32 margin16x9 = 120.0f, f32 margin4x3 = 30.0f);
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();
void calc();
@@ -31,7 +31,7 @@ namespace ipl {
void fadeout();
void fadeoutForce();
void setPos(const math::VEC3& pos, bool use16x9X, int hAlign);
void setPos(const math::VEC3& pos, bool unk0, int unk1);
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 mbWaitingFadeIn; // 0x08
BOOL unk_0x08;
layout::Object* mpLayout; // 0x0C
@@ -60,10 +60,10 @@ namespace ipl {
u32 mTextLen; // 0x18
math::VEC3 mBalloonPos; // 0x1C
undefined4 mHAlign; // 0x28
undefined mbUse16x9X; // 0x2C
f32 mMargin16x9; // 0x30
f32 mMargin4x3; // 0x34
undefined4 unk_0x28;
undefined unk_0x2C;
f32 unk_0x30;
f32 unk_0x34;
int mWaitUntilFadeIn; // 0x38

View File

@@ -42,7 +42,7 @@ namespace ipl {
};
virtual BOOL isResetAcceptable() const {
return mbResetAcceptable;
return unk_0x7D;
}
virtual void prepare();
@@ -108,7 +108,7 @@ namespace ipl {
static const int mToFace_Duration = 20;
bool mbClosing; // 0x7C
bool mbResetAcceptable;
bool unk_0x7D;
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);
void stopSE(nw4r::snd::SoundHandle* handle, int unk = 0);
int 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[3];
u32 unk_0x620[0x18];
};
// use getSystem() and getBannerPlayer() instead

View File

@@ -152,7 +152,7 @@ namespace ipl {
BOOL is_working();
#ifdef IPL_SD_CHANNEL_SELECT_CPP
void requestCancel() { mbCancel = true; }
void requestCancel() { unk_0x04 = 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 mbCancel; // 0x04
bool unk_0x04; // 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 remX; // 0x18
u8 remY; // 0x19
u8 unk_0x18;
u8 unk_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 remX; // 0x1808
u8 remY; // 0x1809
u8 unk_0x1808;
u8 unk_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->remX - 1) / state->scaleFactor;
state->stepYExt = (state->scaleFactor + work->remY - 1) / state->scaleFactor;
state->stepXExt = (state->scaleFactor + work->unk_0x1808 - 1) / state->scaleFactor;
state->stepYExt = (state->scaleFactor + work->unk_0x1809 - 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->remX = remX;
p->remY = remY;
p->unk_0x18 = remX;
p->unk_0x19 = 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->remX = remX;
work->remY = remY;
work->unk_0x1808 = remX;
work->unk_0x1809 = 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 cangjieEnabled; // 0x16
ziU8 unk_0x16;
ziU8 unk_0x17;
ziU8 subLanguage; // 0x18
ziU8 unk_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 language; // 0x538
ziU8 unk_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->subLanguage == 1) || (ZI_WORK->subLanguage == 0x80) || (ZI_WORK->subLanguage == 0x40))) {
((ZI_WORK->unk_0x18 == 1) || (ZI_WORK->unk_0x18 == 0x80) || (ZI_WORK->unk_0x18 == 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)->cangjieEnabled || request->elementCount > 6) {
if (!((struct __zi8_work_data_s*)work)->unk_0x16 || 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)->cangjieEnabled) {
if (((struct __zi8_work_data_s*)work)->unk_0x16) {
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)->cangjieEnabled) {
if (((struct __zi8_work_data_s*)work)->unk_0x16) {
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->language = parameters->language;
ZI_WORK->unk_0x538 = 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->subLanguage = parameters->subLanguage;
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1,ZI_WORK) & 2;
ZI_WORK->unk_0x18 = parameters->subLanguage;
ZI_WORK->unk_0x16 = 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->cangjieEnabled != '\0') {
if (ZI_WORK->unk_0x16 != '\0') {
candidateCount = Zi8GetChineseCandidates(parameters,options,ZI_WORK);
} else {
error = 0x708;
@@ -582,7 +582,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
}
}
else {
ZI_WORK->language = parameters->language;
ZI_WORK->unk_0x538 = 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->language = 0;
ZI_WORK->unk_0x538 = 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->cangjieEnabled = Zi8GetFormatVersion(1, ZI_WORK) & 2;
ZI_WORK->unk_0x16 = 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)->subLanguage;
((struct __zi8_work_data_s*)workData)->subLanguage = 1;
bak = ((struct __zi8_work_data_s*)workData)->unk_0x18;
((struct __zi8_work_data_s*)workData)->unk_0x18 = 1;
addr = Zi8GetTableAddress(1, 10, workData);
p = (ziU8*)addr;
v0 = (ziU16)((ziU16)p[0] | ((ziU16)p[1] << 8));
((struct __zi8_work_data_s*)workData)->subLanguage = 0;
((struct __zi8_work_data_s*)workData)->unk_0x18 = 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)->subLanguage = bak;
((struct __zi8_work_data_s*)workData)->unk_0x18 = 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->cangjieEnabled != 0) {
if (ZI_WORK->unk_0x16 != 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->cangjieEnabled != 0) {
if (ZI_WORK->unk_0x16 != 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->cangjieEnabled != 0) {
if (WORKP->unk_0x16 != 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->subLanguage) {
if (WORKP->unk_0x1B18 != ZI8_NULL && WORKP->unk_0x1B24 == WORKP->unk_0x18) {
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->cangjieEnabled = Zi8GetFormatVersion(1, __zi8_work_data) & 2;
ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1, __zi8_work_data) & 2;
entry = (ziChineseEntry*)Zi8GetTableAddress(1, 0, __zi8_work_data) + ordinals[0];
data = (ziU8*)Zi8GetTableAddress(1, 1, __zi8_work_data) + ((entry->offsetHigh & 15) << 16 | ((entry->offsetLow[0] << 8) | entry->offsetLow[1]));
if (ZI_WORK->cangjieEnabled != 0) {
if (ZI_WORK->unk_0x16 != 0) {
switch (*data & 7) {
case 2:
offset = 2;

View File

@@ -8,7 +8,7 @@ ziU16 Zi8GetTableCount(ziU8 language, ziU8 tableIndex, ziPtr __zi8_work_data);
ziU32 Zi8GetTableAddress(ziU8 language, ziU8 tableIndex, ziPtr __zi8_work_data);
ziU8 Zi8getKeyLayout(ziU8 language, ziWChar key, ziWChar* chars, ziU8 mode, ziPtr __zi8_work_data);
ziBool Zi8MapKeyCode(ziWChar character, ziWChar* output, ziPtr __zi8_work_data) {
ziBool Zi8_81484484(ziWChar character, ziWChar* output, ziPtr __zi8_work_data) {
if (character == 0xeffa) {
*output = 0;
} else if ((character >= 0xeff1) && (character <= 0xeff9)) {
@@ -58,7 +58,7 @@ ziBool Zi8getKeyLayout(ziU8 language, ziWChar key, ziWChar* chars, ziU8 mode, zi
*chars = 0;
if (ZI_WORK->userKeys[language] != 0) {
customTable = ZI_WORK->userKeys[language];
if (!Zi8MapKeyCode(key, &key, __zi8_work_data)) {
if (!Zi8_81484484(key, &key, __zi8_work_data)) {
return 0;
}
keyChars = customTable->lower[key];
@@ -87,7 +87,7 @@ tables_ready:
Zi8ReplaceLastError(0x962, __zi8_work_data);
return 0;
}
if (!Zi8MapKeyCode(key, &key, __zi8_work_data) || (key >= numKeys)) {
if (!Zi8_81484484(key, &key, __zi8_work_data) || (key >= numKeys)) {
Zi8ReplaceLastError(300, __zi8_work_data);
return 0;
}

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;
extern s32 uhg_msc_memid_8169971C;
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* outData; // 0x00
int outDataLen; // 0x04
u8* unk_0x00; // 0x00
int unk_0x04; // 0x04
u32 size; // 0x08
u16 length; // 0x0C
u8 flags; // 0x0E
u8 hdrLen; // 0x0F
u16 unk_0x0C; // 0x0C
u8 unk_0x0e; // 0x0E
u8 unk_0x0f; // 0x0F
} CXUncompContextRL;
typedef struct CXUncompContextLZ {
u8* outData; // 0x00
int outDataLen; // 0x04
u8* unk_0x00; // 0x00
int unk_0x04; // 0x04
u32 size; // 0x08
int length; // 0x0C
u8 lengthBytesLeft; // 0x10
u8 flags; // 0x11
u8 flagsLeft; // 0x12
u8 hdrLen; // 0x13
u8 lzType; // 0x14
int unk_0x0C; // 0x0C
u8 unk_0x10; // 0x10
u8 unk_0x11; // 0x11
u8 unk_0x12; // 0x12
u8 unk_0x13; // 0x13
u8 unk_0x14; // 0x14
u8 padding[3];
} CXUncompContextLZ;
@@ -52,10 +52,10 @@ typedef struct CXUncompContextHuffman {
u32 size; // 0x08
CXHuffmanDecodeTableEntry* decodeTable; // 0x0C
u32 bits; // 0x10
u32 wordBuffer; // 0x14
u32 unk_0x14; // 0x14
s16 decodeTableSize; // 0x18
u8 bitsLeft; // 0x1A
u8 wordBits; // 0x1B
u8 unk_0x1b; // 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 device; // 0x00
vu8 ledBits; // 0x04
vu32 unk_0x00;
vu8 unk_0x04;
} USBKBDCmdLED;
typedef struct USBKBDCmdLEDAsync {

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
#include <private/fa/puh_msc.h>
s32 uhg_msc_memid;
s32 uhg_msc_memid_8169971C;
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, sizeof(UHF_MSC_MESSAGE), 4);
message = uhf_ker_get_memory_block(uhg_msc_memid_8169971C, 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, message);
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, 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, message);
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, 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, sizeof(UHF_MSC_MESSAGE), 4);
message = uhf_ker_get_memory_block(uhg_msc_memid_8169971C, 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, message);
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, 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, message);
uhf_ker_release_memory_block(uhg_msc_memid_8169971C, 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;
}
static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u16 media_bps;
pf_u32 ratio;
pf_u32 start;
@@ -158,9 +158,6 @@ static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sec
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,8 +322,6 @@ 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;
@@ -372,10 +370,8 @@ 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;
}
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;
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);
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);
@@ -538,7 +534,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_u32 requested_size;
pf_s32 err;
pf_u32 previous_cluster;
pf_u32 next_cluster;
pf_u32 success_size;
@@ -548,7 +544,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_s32 err;
pf_u32 requested_size;
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[96] = {
const pf_u8 pf_valid_fn_char_8162E6B0[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,21 +784,6 @@ 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)
@@ -808,10 +793,13 @@ 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;
@@ -885,7 +873,18 @@ s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
file->last_cluster.max_chain_index = chainIndex;
*lastAllocatedCluster = lastFreeCluster;
firstFlushError = PFFAT_WriteFATCopies(volume, page);
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;
}
if (firstFlushError != 0) {
PFCACHE_FreeDataPage(volume, page);
return firstFlushError;
@@ -1232,6 +1231,8 @@ 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;
@@ -1247,10 +1248,12 @@ s32 PFFAT_GetSector(PFFAT_FFD* file, u32 fileSectorIndex, u32 mode,
}
chainIndex = fileSectorIndex >> volume->bpb.log2_sectors_per_cluster;
if (mode == 2) {
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);
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;
error = PFFAT_GetClusterAllocated(file, chainIndex, numClusters,
&cluster);
if (error != 0) {
@@ -1279,13 +1282,11 @@ s32 PFFAT_GetSectorSpecified(PFFAT_FFD* file, u32 fileSectorIndex,
error = PFFAT_GetSector(file, fileSectorIndex, clusterIndex != 0, 0,
sector);
switch (error) {
case 0:
error = 0;
break;
default:
break;
if (error != 0) {
goto done;
}
error = 0;
done:
return error;
}
@@ -1872,12 +1873,11 @@ s32 PFFAT_RefreshFSINFO(PF_VOLUME* volume)
error = 17;
}
if (error == 0) {
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;
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*)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,9 +1886,11 @@ s32 PFFAT_RefreshFSINFO(PF_VOLUME* volume)
(u8)(volume->num_free_clusters >> 24);
} else {
u32 freeClusters = volume->num_free_clusters;
u32 upperBytes = (freeClusters << 24) | ((freeClusters << 8) & 0x00FF0000);
u32 lowerBytes = (freeClusters >> 24) | ((freeClusters >> 8) & 0xFF00);
info->num_free_clusters.word = upperBytes | lowerBytes;
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.word =
(freeClusters << 24) |
((freeClusters & 0xFF00) << 8) |
((freeClusters >> 8) & 0xFF00) | (freeClusters >> 24);
}
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[96];
extern const pf_u8 pf_valid_fn_char_8162E6B0[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[(pf_u8)(x) - ' '] & b)))
#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_WCHAR(x, b) \
((x) >= 0x80 || (pf_u8)(x) >= ' ' && ((pf_u8)(x) & 0xFF00) == 0 && (pf_valid_fn_char[(pf_u8)((x & 0x00FF) - ' ')] & b))
((x) >= 0x80 || (pf_u8)(x) >= ' ' && ((pf_u8)(x) & 0xFF00) == 0 && (pf_valid_fn_char_8162E6B0[(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;
@@ -360,16 +360,17 @@ pf_bool PFPATH_MatchFileNameWithPattern(const pf_s8* file_name, PF_STR* p_patter
pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* matched_end) {
pf_u32 read_char;
pf_s32 recursive_error;
pf_s32 name_width;
pf_u16 name_char;
pf_u16 pattern_char;
pf_u16 converted_pattern;
pf_u16 converted_name;
pf_u16 name_char;
pf_s32 name_width;
pf_s32 pattern_width;
PF_PATH_VOLUME_SET* volume = &pf_vol_set;
while (*pattern != 0) {
pattern_width = pf_vol_set.codeset.oem_char_width(pattern);
name_width = pf_vol_set.codeset.oem_char_width(name);
pattern_width = volume->codeset.oem_char_width(pattern);
name_width = volume->codeset.oem_char_width(name);
if (pattern_width == 1) {
read_char = pf_toupper(*pattern);
} else {
@@ -398,18 +399,18 @@ pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* match
}
case '*': {
do {
pattern_width = pf_vol_set.codeset.oem_char_width(pattern);
if (pattern_width == 1) {
read_char = pf_toupper(*pattern);
} else {
pattern_width = volume->codeset.oem_char_width(pattern);
if (pattern_width != 1) {
read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)pattern);
} else {
read_char = pf_toupper(*pattern);
}
pattern_char = (pf_u16)read_char;
pattern += pattern_width;
if (pattern_char == '?') {
if (name_char == 0) { return 1; }
name += name_width;
name_width = pf_vol_set.codeset.oem_char_width(name);
name_width = volume->codeset.oem_char_width(name);
if (name_width == 1) { read_char = pf_toupper(*name); }
else { read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)name); }
name_char = (pf_u16)read_char;
@@ -427,7 +428,7 @@ pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* match
}
if (*matched_end != 0) { return recursive_error; }
}
name_width = pf_vol_set.codeset.oem_char_width(name);
name_width = volume->codeset.oem_char_width(name);
if (name_width == 1) {
read_char = pf_toupper(*name);
} else {

View File

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

View File

@@ -43,7 +43,7 @@ typedef struct __sdCbArg {
SDCallbackFunc cb; // 0x00
void* cbArg; // 0x04
SDDev* dev; // 0x08
u32 cmd; // 0x0C
u32 unk_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->cmd) {
switch (data->unk_0x0C) {
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->cmd = cmd;
data->unk_0x0C = 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->cmd = cmd;
data->unk_0x0C = 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->ledBits = ledBits;
cmd->device = device;
cmd->unk_0x04 = ledBits;
cmd->unk_0x00 = 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.device = device;
cmd->base.ledBits = ledBits;
cmd->base.unk_0x00 = device;
cmd->base.unk_0x04 = 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;
extern volatile u32 Vdac_Flag_Changed_816991E0;
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 != 0) {
changeBit = 1U << (31 - __cntlzw(Vdac_Flag_Changed));
while (Vdac_Flag_Changed_816991E0 != 0) {
changeBit = 1U << (31 - __cntlzw(Vdac_Flag_Changed_816991E0));
switch (changeBit) {
case 1:
__VISetCGMS();
@@ -352,7 +352,7 @@ position_interrupt:
__VISetRGBModeImm();
break;
}
Vdac_Flag_Changed &= ~changeBit;
Vdac_Flag_Changed_816991E0 &= ~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;
volatile u32 Vdac_Flag_Changed_816991E0;
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 |= 1;
Vdac_Flag_Changed_816991E0 |= 1;
}
}
@@ -382,7 +382,7 @@ void VISetMacrovision(s32 type) {
if ((__type != type) || (__tvType != tvFormat)) {
__type = type;
__tvType = tvFormat;
Vdac_Flag_Changed |= 8;
Vdac_Flag_Changed_816991E0 |= 8;
}
}
@@ -448,7 +448,7 @@ void VISetTrapFilter(BOOL filter) {
return;
}
__filter = filter;
Vdac_Flag_Changed |= 0x20;
Vdac_Flag_Changed_816991E0 |= 0x20;
}
void __VISetRGBOverDrive(void) {
@@ -468,7 +468,7 @@ void __VISetRGBOverDrive(void) {
}
void VISetRGBModeImm(void) {
Vdac_Flag_Changed |= 0x80;
Vdac_Flag_Changed_816991E0 |= 0x80;
}
void __VISetRGBModeImm(void) {
@@ -520,34 +520,34 @@ void __VISetRevolutionMode(void) {
__wd0 = 0;
__wd1 = 0;
__wd2 = 0;
Vdac_Flag_Changed |= 1;
Vdac_Flag_Changed_816991E0 |= 1;
}
if ((__gp1 != 0) || (__gp2 != 0) || (__gp3 != 0) || (__gp4 != 0)) {
__gp1 = 0;
__gp2 = 0;
__gp3 = 0;
__gp4 = 0;
Vdac_Flag_Changed |= 2;
Vdac_Flag_Changed_816991E0 |= 2;
}
if ((__cc1 != 0) || (__cc2 != 0) || (__cc3 != 0) || (__cc4 != 0)) {
__cc1 = 0;
__cc2 = 0;
__cc3 = 0;
__cc4 = 0;
Vdac_Flag_Changed |= 4;
Vdac_Flag_Changed_816991E0 |= 4;
}
VISetMacrovision(1);
if (__filter != 0) {
__filter = 0;
Vdac_Flag_Changed |= 0x20;
Vdac_Flag_Changed_816991E0 |= 0x20;
}
if (__level != 0) {
__level = 0;
Vdac_Flag_Changed |= 0x40;
Vdac_Flag_Changed_816991E0 |= 0x40;
}
if (__gamma != 10) {
__gamma = 10;
Vdac_Flag_Changed |= 0x10;
Vdac_Flag_Changed_816991E0 |= 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 |= 2;
Vdac_Flag_Changed_816991E0 |= 2;
}
}
@@ -598,14 +598,14 @@ void VISetClosedCaption(u8 cc1, u8 cc2, u8 cc3, u8 cc4) {
__cc2 = cc2;
__cc3 = cc3;
__cc4 = cc4;
Vdac_Flag_Changed |= 4;
Vdac_Flag_Changed_816991E0 |= 4;
}
}
void VISetRGBOverDrive(s32 level) {
if (__level != level) {
__level = level;
Vdac_Flag_Changed |= 0x40;
Vdac_Flag_Changed_816991E0 |= 0x40;
}
}

View File

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

View File

@@ -97,7 +97,7 @@ typedef struct NHTTPResponseInfo
s32 isSuccess;
s32 isHeaderParse;
s32 httpStatus;
volatile u32 recvBufLen;
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 date; // 0x28
u32 receivedDate; // 0x2C
u32 unk_0x28;
u32 unk_0x2C;
NWC24Data unk_0x30;
NWC24Data unk_0x38;
NWC24Data subject; // 0x40

View File

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

View File

@@ -55,9 +55,9 @@ CDBErr CDBAttrCheckAttrBuf(CDBAttr* attr) {
void CDBAttrInit(CDBAttr* attr) {
memset(&attr->buf, 0, sizeof(CDBAttrBuf));
attr->wiiIdValid = FALSE;
attr->dirty = FALSE;
attr->wiiIdDirty = FALSE;
attr->unk_0x408 = FALSE;
attr->unk_0x400 = FALSE;
attr->unk_0x404 = 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->dirty = TRUE;
attr->unk_0x400 = 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->dirty = TRUE;
attr->unk_0x400 = TRUE;
attrModifiedCount = 0;
memcpy(&attr->buf.cdbID.modifiedCount, &attrModifiedCount, sizeof(u32));
attr->dirty = TRUE;
attr->unk_0x400 = 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->wiiIdValid = TRUE;
attr->unk_0x408 = TRUE;
err = CDB_ERROR_OK;
attr->dirty = TRUE;
attr->wiiIdDirty = TRUE;
attr->unk_0x400 = TRUE;
attr->unk_0x404 = 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->dirty = TRUE;
attr->unk_0x400 = 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->dirty = TRUE;
attr->unk_0x400 = 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->wiiIdDirty = TRUE;
attr->unk_0x404 = TRUE;
return CDB_ERROR_OK;
}

File diff suppressed because it is too large Load Diff

View File

@@ -455,7 +455,7 @@ CDBErr CDBRecordGetId(CDBRecord* record, CDBId* id) {
} else {
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get maker code of the record ; the record is closed\n");
CDBReportError("can't get CDBId of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBLock();
@@ -933,7 +933,7 @@ CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize
if (CDBRecordKeyCompareByDate(&comparisonKey, &record->key) != 0) {
if (CDBIsPrintDebugMessage(3)) {
CDBReport_(3);
OSReport("ファイル名の改竄を検出\n");
OSReport("CDBRecordPrivateChangeOwner\n");
}
return CDB_ERROR_32;
}

View File

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

View File

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

View File

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

View File

@@ -67,11 +67,10 @@ 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) {
u8 rawCharacter = *(const u8*)string;
s8 character = LowerCase((s8)rawCharacter);
s8 character=LowerCase(*string);
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 {
@@ -104,9 +103,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};
char* output;
int digit;
BOOL started;
int digit;
char* output;
s32 length;
output = destination;
length = 0;
@@ -136,22 +135,18 @@ s32 NHTTPi_compareToken(const char* left, const char* right) {
}
s32 NHTTPi_strtonum(const char* string, u32 length) {
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';
int digits=0;
s32 value=0;
while(length--) {
int character=*string++;
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->date) {
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->unk_0x28) {
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->date;
entry->receivedDate = msg->receivedDate;
entry->date = msg->unk_0x28;
entry->receivedDate = msg->unk_0x2C;
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->date = entry->date;
msg->receivedDate = entry->receivedDate;
msg->unk_0x28 = entry->date;
msg->unk_0x2C = 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->date);
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->unk_0x28);
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->date, msg->msgId);
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->unk_0x28, 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->date, &date);
NWC24iDateToMinutes(&msg->unk_0x28, &date);
if (msg->type & 0x1000000)
NWC24iMinutesToDate(&date, msg->receivedDate);
NWC24iMinutesToDate(&date, msg->unk_0x2C);
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->date = 0;
msgObj->unk_0x28 = 0;
msgObj->type |= 0x200000;
msgObj->receivedDate = 0;
msgObj->unk_0x2C = 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->date);
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->unk_0x28);
return NWC24_OK;
}

View File

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

View File

@@ -313,18 +313,18 @@ asm void __div2u() {
cmpwi r3, 0x0
cntlzw r0, r3
cntlzw r9, r4
bne __div2u_L_815F9538
bne L_815F9538
addi r0, r9, 0x20
__div2u_L_815F9538:
L_815F9538:
cmpwi r5, 0x0
cntlzw r9, r5
cntlzw r10, r6
bne __div2u_L_815F954C
bne L_815F954C
addi r9, r10, 0x20
__div2u_L_815F954C:
L_815F954C:
cmpw r0, r9
subfic r10, r0, 0x40
bgt __div2u_L_815F9604
bgt L_815F9604
addi r9, r9, 0x1
subfic r9, r9, 0x40
add r0, r0, r9
@@ -332,49 +332,49 @@ __div2u_L_815F954C:
mtctr r9
cmpwi r9, 0x20
subi r7, r9, 0x20
blt __div2u_L_815F9584
blt L_815F9584
srw r8, r3, r7
li r7, 0x0
b __div2u_L_815F9598
__div2u_L_815F9584:
b L_815F9598
L_815F9584:
srw r8, r4, r9
subfic r7, r9, 0x20
slw r7, r3, r7
or r8, r8, r7
srw r7, r3, r9
__div2u_L_815F9598:
L_815F9598:
cmpwi r0, 0x20
subic r9, r0, 0x20
blt __div2u_L_815F95B0
blt L_815F95B0
slw r3, r4, r9
li r4, 0x0
b __div2u_L_815F95C4
__div2u_L_815F95B0:
b L_815F95C4
L_815F95B0:
slw r3, r3, r0
subfic r9, r0, 0x20
srw r9, r4, r9
or r3, r3, r9
slw r4, r4, r0
__div2u_L_815F95C4:
L_815F95C4:
li r10, -0x1
addic r7, r7, 0x0
__div2u_L_815F95CC:
L_815F95CC:
adde r4, r4, r4
adde r3, r3, r3
adde r8, r8, r8
adde r7, r7, r7
subfc r0, r6, r8
subfe. r9, r5, r7
blt __div2u_L_815F95F4
blt L_815F95F4
mr r8, r0
mr r7, r9
addic r0, r10, 0x1
__div2u_L_815F95F4:
bdnz __div2u_L_815F95CC
L_815F95F4:
bdnz L_815F95CC
adde r4, r4, r4
adde r3, r3, r3
blr
__div2u_L_815F9604:
L_815F9604:
li r4, 0x0
li r3, 0x0
blr
@@ -385,32 +385,32 @@ asm void __div2i() {
#ifdef __MWERKS__
stwu r1, -0x10(r1)
clrrwi. r9, r3, 31
beq __div2i_L_815F9624
beq L_815F9624
subfic r4, r4, 0x0
subfze r3, r3
__div2i_L_815F9624:
L_815F9624:
stw r9, 0x8(r1)
clrrwi. r10, r5, 31
beq __div2i_L_815F9638
beq L_815F9638
subfic r6, r6, 0x0
subfze r5, r5
__div2i_L_815F9638:
L_815F9638:
stw r10, 0xc(r1)
cmpwi r3, 0x0
cntlzw r0, r3
cntlzw r9, r4
bne __div2i_L_815F9650
bne L_815F9650
addi r0, r9, 0x20
__div2i_L_815F9650:
L_815F9650:
cmpwi r5, 0x0
cntlzw r9, r5
cntlzw r10, r6
bne __div2i_L_815F9664
bne L_815F9664
addi r9, r10, 0x20
__div2i_L_815F9664:
L_815F9664:
cmpw r0, r9
subfic r10, r0, 0x40
bgt __div2i_L_815F9738
bgt L_815F9738
addi r9, r9, 0x1
subfic r9, r9, 0x40
add r0, r0, r9
@@ -418,60 +418,60 @@ __div2i_L_815F9664:
mtctr r9
cmpwi r9, 0x20
subi r7, r9, 0x20
blt __div2i_L_815F969C
blt L_815F969C
srw r8, r3, r7
li r7, 0x0
b __div2i_L_815F96B0
__div2i_L_815F969C:
b L_815F96B0
L_815F969C:
srw r8, r4, r9
subfic r7, r9, 0x20
slw r7, r3, r7
or r8, r8, r7
srw r7, r3, r9
__div2i_L_815F96B0:
L_815F96B0:
cmpwi r0, 0x20
subic r9, r0, 0x20
blt __div2i_L_815F96C8
blt L_815F96C8
slw r3, r4, r9
li r4, 0x0
b __div2i_L_815F96DC
__div2i_L_815F96C8:
b L_815F96DC
L_815F96C8:
slw r3, r3, r0
subfic r9, r0, 0x20
srw r9, r4, r9
or r3, r3, r9
slw r4, r4, r0
__div2i_L_815F96DC:
L_815F96DC:
li r10, -0x1
addic r7, r7, 0x0
__div2i_L_815F96E4:
L_815F96E4:
adde r4, r4, r4
adde r3, r3, r3
adde r8, r8, r8
adde r7, r7, r7
subfc r0, r6, r8
subfe. r9, r5, r7
blt __div2i_L_815F970C
blt L_815F970C
mr r8, r0
mr r7, r9
addic r0, r10, 0x1
__div2i_L_815F970C:
bdnz __div2i_L_815F96E4
L_815F970C:
bdnz L_815F96E4
adde r4, r4, r4
adde r3, r3, r3
lwz r9, 0x8(r1)
lwz r10, 0xc(r1)
xor. r7, r9, r10
beq __div2i_L_815F9734
beq L_815F9734
cmpwi r9, 0x0
subfic r4, r4, 0x0
subfze r3, r3
__div2i_L_815F9734:
b __div2i_L_815F9740
__div2i_L_815F9738:
L_815F9734:
b L_815F9740
L_815F9738:
li r4, 0x0
li r3, 0x0
__div2i_L_815F9740:
L_815F9740:
addi r1, r1, 0x10
blr
#endif
@@ -482,18 +482,18 @@ asm void __mod2u() {
cmpwi r3, 0x0
cntlzw r0, r3
cntlzw r9, r4
bne __mod2u_L_815F975C
bne L_815F975C
addi r0, r9, 0x20
__mod2u_L_815F975C:
L_815F975C:
cmpwi r5, 0x0
cntlzw r9, r5
cntlzw r10, r6
bne __mod2u_L_815F9770
bne L_815F9770
addi r9, r10, 0x20
__mod2u_L_815F9770:
L_815F9770:
cmpw r0, r9
subfic r10, r0, 0x40
bgt __mod2u_L_815F9828
bgt L_815F9828
addi r9, r9, 0x1
subfic r9, r9, 0x40
add r0, r0, r9
@@ -501,49 +501,49 @@ __mod2u_L_815F9770:
mtctr r9
cmpwi r9, 0x20
subi r7, r9, 0x20
blt __mod2u_L_815F97A8
blt L_815F97A8
srw r8, r3, r7
li r7, 0x0
b __mod2u_L_815F97BC
__mod2u_L_815F97A8:
b L_815F97BC
L_815F97A8:
srw r8, r4, r9
subfic r7, r9, 0x20
slw r7, r3, r7
or r8, r8, r7
srw r7, r3, r9
__mod2u_L_815F97BC:
L_815F97BC:
cmpwi r0, 0x20
subic r9, r0, 0x20
blt __mod2u_L_815F97D4
blt L_815F97D4
slw r3, r4, r9
li r4, 0x0
b __mod2u_L_815F97E8
__mod2u_L_815F97D4:
b L_815F97E8
L_815F97D4:
slw r3, r3, r0
subfic r9, r0, 0x20
srw r9, r4, r9
or r3, r3, r9
slw r4, r4, r0
__mod2u_L_815F97E8:
L_815F97E8:
li r10, -0x1
addic r7, r7, 0x0
__mod2u_L_815F97F0:
L_815F97F0:
adde r4, r4, r4
adde r3, r3, r3
adde r8, r8, r8
adde r7, r7, r7
subfc r0, r6, r8
subfe. r9, r5, r7
blt __mod2u_L_815F9818
blt L_815F9818
mr r8, r0
mr r7, r9
addic r0, r10, 0x1
__mod2u_L_815F9818:
bdnz __mod2u_L_815F97F0
L_815F9818:
bdnz L_815F97F0
mr r4, r8
mr r3, r7
blr
__mod2u_L_815F9828:
L_815F9828:
blr
#endif
}
@@ -551,30 +551,30 @@ __mod2u_L_815F9828:
asm void __mod2i() {
#ifdef __MWERKS__
cmpwi cr7, r3, 0x0
bge cr7, __mod2i_L_815F983C
bge cr7, L_815F983C
subfic r4, r4, 0x0
subfze r3, r3
__mod2i_L_815F983C:
L_815F983C:
cmpwi r5, 0x0
bge __mod2i_L_815F984C
bge L_815F984C
subfic r6, r6, 0x0
subfze r5, r5
__mod2i_L_815F984C:
L_815F984C:
cmpwi r3, 0x0
cntlzw r0, r3
cntlzw r9, r4
bne __mod2i_L_815F9860
bne L_815F9860
addi r0, r9, 0x20
__mod2i_L_815F9860:
L_815F9860:
cmpwi r5, 0x0
cntlzw r9, r5
cntlzw r10, r6
bne __mod2i_L_815F9874
bne L_815F9874
addi r9, r10, 0x20
__mod2i_L_815F9874:
L_815F9874:
cmpw r0, r9
subfic r10, r0, 0x40
bgt __mod2i_L_815F9928
bgt L_815F9928
addi r9, r9, 0x1
subfic r9, r9, 0x40
add r0, r0, r9
@@ -582,52 +582,52 @@ __mod2i_L_815F9874:
mtctr r9
cmpwi r9, 0x20
subi r7, r9, 0x20
blt __mod2i_L_815F98AC
blt L_815F98AC
srw r8, r3, r7
li r7, 0x0
b __mod2i_L_815F98C0
__mod2i_L_815F98AC:
b L_815F98C0
L_815F98AC:
srw r8, r4, r9
subfic r7, r9, 0x20
slw r7, r3, r7
or r8, r8, r7
srw r7, r3, r9
__mod2i_L_815F98C0:
L_815F98C0:
cmpwi r0, 0x20
subic r9, r0, 0x20
blt __mod2i_L_815F98D8
blt L_815F98D8
slw r3, r4, r9
li r4, 0x0
b __mod2i_L_815F98EC
__mod2i_L_815F98D8:
b L_815F98EC
L_815F98D8:
slw r3, r3, r0
subfic r9, r0, 0x20
srw r9, r4, r9
or r3, r3, r9
slw r4, r4, r0
__mod2i_L_815F98EC:
L_815F98EC:
li r10, -0x1
addic r7, r7, 0x0
__mod2i_L_815F98F4:
L_815F98F4:
adde r4, r4, r4
adde r3, r3, r3
adde r8, r8, r8
adde r7, r7, r7
subfc r0, r6, r8
subfe. r9, r5, r7
blt __mod2i_L_815F991C
blt L_815F991C
mr r8, r0
mr r7, r9
addic r0, r10, 0x1
__mod2i_L_815F991C:
bdnz __mod2i_L_815F98F4
L_815F991C:
bdnz L_815F98F4
mr r4, r8
mr r3, r7
__mod2i_L_815F9928:
bge cr7, __mod2i_L_815F9934
L_815F9928:
bge cr7, L_815F9934
subfic r4, r4, 0x0
subfze r3, r3
__mod2i_L_815F9934:
L_815F9934:
blr
#endif
}
@@ -668,9 +668,9 @@ asm void __shr2i() {
slw r10, r3, r8
or r4, r4, r10
sraw r10, r3, r9
ble __shr2i_L_815F99A0
ble L_815F99A0
or r4, r4, r10
__shr2i_L_815F99A0:
L_815F99A0:
sraw r3, r3, r5
blr
#endif
@@ -680,13 +680,13 @@ asm void __cvt_sll_dbl() {
#ifdef __MWERKS__
stwu r1, -0x10(r1)
clrrwi. r5, r3, 31
beq __cvt_sll_dbl_L_815F99BC
beq L_815F99BC
subfic r4, r4, 0x0
subfze r3, r3
__cvt_sll_dbl_L_815F99BC:
L_815F99BC:
or. r7, r3, r4
li r6, 0x0
beq __cvt_sll_dbl_L_815F9A44
beq L_815F9A44
cntlzw r7, r3
cntlzw r8, r4
extlwi r9, r7, 5, 26
@@ -705,22 +705,22 @@ __cvt_sll_dbl_L_815F99BC:
clrlwi r7, r4, 21
cmpwi r7, 0x400
addi r6, r6, 0x43e
blt __cvt_sll_dbl_L_815F9A2C
bgt __cvt_sll_dbl_L_815F9A20
blt L_815F9A2C
bgt L_815F9A20
rlwinm. r7, r4, 0, 20, 20
beq __cvt_sll_dbl_L_815F9A2C
__cvt_sll_dbl_L_815F9A20:
beq L_815F9A2C
L_815F9A20:
addic r4, r4, 0x800
addze r3, r3
addze r6, r6
__cvt_sll_dbl_L_815F9A2C:
L_815F9A2C:
rotrwi r4, r4, 11
rlwimi r4, r3, 21, 0, 10
extrwi r3, r3, 20, 1
slwi r6, r6, 20
or r3, r6, r3
or r3, r5, r3
__cvt_sll_dbl_L_815F9A44:
L_815F9A44:
stw r3, 0x8(r1)
stw r4, 0xc(r1)
lfd f1, 0x8(r1)
@@ -734,7 +734,7 @@ asm void __cvt_ull_dbl() {
stwu r1, -0x10(r1)
or. r7, r3, r4
li r6, 0x0
beq __cvt_ull_dbl_L_815F9AE0
beq L_815F9AE0
cntlzw r7, r3
cntlzw r8, r4
extlwi r9, r7, 5, 26
@@ -753,21 +753,21 @@ asm void __cvt_ull_dbl() {
clrlwi r7, r4, 21
cmpwi r7, 0x400
addi r6, r6, 0x43e
blt __cvt_ull_dbl_L_815F9ACC
bgt __cvt_ull_dbl_L_815F9AC0
blt L_815F9ACC
bgt L_815F9AC0
rlwinm. r7, r4, 0, 20, 20
beq __cvt_ull_dbl_L_815F9ACC
__cvt_ull_dbl_L_815F9AC0:
beq L_815F9ACC
L_815F9AC0:
addic r4, r4, 0x800
addze r3, r3
addze r6, r6
__cvt_ull_dbl_L_815F9ACC:
L_815F9ACC:
rotrwi r4, r4, 11
rlwimi r4, r3, 21, 0, 10
extrwi r3, r3, 20, 1
slwi r6, r6, 20
or r3, r6, r3
__cvt_ull_dbl_L_815F9AE0:
L_815F9AE0:
stw r3, 0x8(r1)
stw r4, 0xc(r1)
lfd f1, 0x8(r1)
@@ -781,7 +781,7 @@ asm void __cvt_ull_flt() {
stwu r1, -0x10(r1)
or. r7, r3, r4
li r6, 0x0
beq __cvt_ull_flt_L_815F9B7C
beq L_815F9B7C
cntlzw r7, r3
cntlzw r8, r4
extlwi r9, r7, 5, 26
@@ -800,21 +800,21 @@ asm void __cvt_ull_flt() {
clrlwi r7, r4, 21
cmpwi r7, 0x400
addi r6, r6, 0x43e
blt __cvt_ull_flt_L_815F9B68
bgt __cvt_ull_flt_L_815F9B5C
blt L_815F9B68
bgt L_815F9B5C
rlwinm. r7, r4, 0, 20, 20
beq __cvt_ull_flt_L_815F9B68
__cvt_ull_flt_L_815F9B5C:
beq L_815F9B68
L_815F9B5C:
addic r4, r4, 0x800
addze r3, r3
addze r6, r6
__cvt_ull_flt_L_815F9B68:
L_815F9B68:
rotrwi r4, r4, 11
rlwimi r4, r3, 21, 0, 10
extrwi r3, r3, 20, 1
slwi r6, r6, 20
or r3, r6, r3
__cvt_ull_flt_L_815F9B7C:
L_815F9B7C:
stw r3, 0x8(r1)
stw r4, 0xc(r1)
lfd f1, 0x8(r1)
@@ -832,17 +832,17 @@ asm void __cvt_dbl_usll() {
lwz r4, 0xc(r1)
extrwi r5, r3, 11, 1
cmplwi r5, 0x3ff
bge __cvt_dbl_usll_L_815F9BBC
bge L_815F9BBC
li r3, 0x0
li r4, 0x0
b __cvt_dbl_usll_L_815F9C58
__cvt_dbl_usll_L_815F9BBC:
b L_815F9C58
L_815F9BBC:
mr r6, r3
clrlwi r3, r3, 12
oris r3, r3, 0x10
subi r5, r5, 0x433
cmpwi r5, 0x0
bge __cvt_dbl_usll_L_815F9BFC
bge L_815F9BFC
neg r5, r5
subfic r8, r5, 0x20
subic r9, r5, 0x20
@@ -852,21 +852,21 @@ __cvt_dbl_usll_L_815F9BBC:
srw r10, r3, r9
or r4, r4, r10
srw r3, r3, r5
b __cvt_dbl_usll_L_815F9C48
__cvt_dbl_usll_L_815F9BFC:
b L_815F9C48
L_815F9BFC:
cmpwi r5, 0xa
ble+ __cvt_dbl_usll_L_815F9C28
ble+ L_815F9C28
clrrwi. r6, r6, 31
beq __cvt_dbl_usll_L_815F9C18
beq L_815F9C18
lis r3, 0x8000
li r4, 0x0
b __cvt_dbl_usll_L_815F9C58
__cvt_dbl_usll_L_815F9C18:
b L_815F9C58
L_815F9C18:
lis r3, 0x7fff
ori r3, r3, 0xffff
li r4, -0x1
b __cvt_dbl_usll_L_815F9C58
__cvt_dbl_usll_L_815F9C28:
b L_815F9C58
L_815F9C28:
subfic r8, r5, 0x20
subic r9, r5, 0x20
slw r3, r3, r5
@@ -875,12 +875,12 @@ __cvt_dbl_usll_L_815F9C28:
slw r10, r4, r9
or r3, r3, r10
slw r4, r4, r5
__cvt_dbl_usll_L_815F9C48:
L_815F9C48:
clrrwi. r6, r6, 31
beq __cvt_dbl_usll_L_815F9C58
beq L_815F9C58
subfic r4, r4, 0x0
subfze r3, r3
__cvt_dbl_usll_L_815F9C58:
L_815F9C58:
addi r1, r1, 0x10
blr
#endif
@@ -894,19 +894,19 @@ asm void __cvt_dbl_ull() {
lwz r4, 0xc(r1)
extrwi r5, r3, 11, 1
cmplwi r5, 0x3ff
bge __cvt_dbl_ull_L_815F9C88
__cvt_dbl_ull_L_815F9C7C:
bge L_815F9C88
L_815F9C7C:
li r3, 0x0
li r4, 0x0
b __cvt_dbl_ull_L_815F9D00
__cvt_dbl_ull_L_815F9C88:
b L_815F9D00
L_815F9C88:
clrrwi. r6, r3, 31
bne __cvt_dbl_ull_L_815F9C7C
bne L_815F9C7C
clrlwi r3, r3, 12
oris r3, r3, 0x10
subi r5, r5, 0x433
cmpwi r5, 0x0
bge __cvt_dbl_ull_L_815F9CCC
bge L_815F9CCC
neg r5, r5
subfic r8, r5, 0x20
subic r9, r5, 0x20
@@ -916,14 +916,14 @@ __cvt_dbl_ull_L_815F9C88:
srw r10, r3, r9
or r4, r4, r10
srw r3, r3, r5
b __cvt_dbl_ull_L_815F9D00
__cvt_dbl_ull_L_815F9CCC:
b L_815F9D00
L_815F9CCC:
cmpwi r5, 0xb
ble+ __cvt_dbl_ull_L_815F9CE0
ble+ L_815F9CE0
li r3, -0x1
li r4, -0x1
b __cvt_dbl_ull_L_815F9D00
__cvt_dbl_ull_L_815F9CE0:
b L_815F9D00
L_815F9CE0:
subfic r8, r5, 0x20
subic r9, r5, 0x20
slw r3, r3, r5
@@ -932,7 +932,7 @@ __cvt_dbl_ull_L_815F9CE0:
slw r10, r4, r9
or r3, r3, r10
slw r4, r4, r5
__cvt_dbl_ull_L_815F9D00:
L_815F9D00:
addi r1, r1, 0x10
blr
#endif

View File

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

View File

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

View File

@@ -604,7 +604,7 @@ vmBoolInt VmIsNan(vmFloat value) {
return isnan(value) || value == VM_NAN;
}
double CHANSVmFloatSign(double value) {
double CHANSVm_8144B1D8(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* CHANSVmConvertToIntFromFloat(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* CHANSVm_8144B30C(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)(CHANSVmFloatSign(object->value.float_v) * floor(fabs(object->value.float_v)));
newObj->value.int_v = (u64)(CHANSVm_8144B1D8(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* CHANSVmConvertToFloatFromUndefined(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* CHANSVm_8144B430(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* CHANSVmConvertToFloatFromUndefined(CHANSVm* vm, CHANSVmObjType ty
return result;
}
CHANSVmObjHdr* CHANSVmConvertToFloatFromInt(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* intObj) {
CHANSVmObjHdr* CHANSVm_8144B470(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* CHANSVmConvertToFloatFromStr(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* object) {
CHANSVmObjHdr* CHANSVm_8144B4D4(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 CHANSVmFloatToWString(vmWString buf, u32 len, vmFloat val) NO_INLINE {
s32 CHANSVm_8144B62C(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* CHANSVmConvertToStrFromFloat(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* value) {
CHANSVmObjHdr* CHANSVm_8144B734(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* value) {
const CHANSVmObjHdr* base;
CHANSVmObjHdr* newObj;
s32 result;
@@ -835,7 +835,7 @@ CHANSVmObjHdr* CHANSVmConvertToStrFromFloat(CHANSVm* vm, CHANSVmObjType type, CH
newObj = CHANSVmNewObject(vm, vmFalse, vmNull, CHANS_VM_OBJ_TYPE_STRING, VM_STRING_SIZE);
if (newObj != vmNull) {
result = CHANSVmFloatToWString(newObj->value.wstring_v->spData, VM_STRING_SIZE, value->value.float_v);
result = CHANSVm_8144B62C(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, CHANSVmConvertToIntFromFloat, CHANSVmConvertToIntFromStr, CHANSVmConvertToIntFromArray, CHANSVmConvertObjectTypeError},
{CHANSVmConvertToFloatFromUndefined, CHANSVmConvertToFloatFromInt, vmNull, CHANSVmConvertToFloatFromStr, CHANSVmConvertObjectTypeError, CHANSVmConvertObjectTypeError},
{CHANSVmConvertToStrFromUndefined, CHANSVmConvertToStrFromInt, CHANSVmConvertToStrFromFloat, vmNull, CHANSVmConvertToStrFromArray, 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, 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 = CHANSVmFloatToWString((vmWString)((u8*)(*obj->value.ptr_v) + offset), 0x80, chunk->elements[countInChunk].value.float_v);
elemLen = CHANSVm_8144B62C((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* CHANSVmFormatString(CHANSVm* vm, CHANSVmObjHdr* obj, u32 arg) {
CHANSVmObjHdr* CHANSVm_8145049C(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)CHANSVmFormatString(VmInst, VmReturnObj, 0);
result = (u32)CHANSVm_8145049C(VmInst, VmReturnObj, 0);
return result != 0;
}
return 0;
@@ -3775,10 +3775,10 @@ int VmGetIntFromObjHdr(CHANSVmObjHdr* object) {
return 0;
}
u32 CHANSVmBlobGetCount(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit);
BOOL CHANSVmBlobHasSpace(BlobHeader* blob, s64 size);
u32 CHANSVm_81451314(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit);
BOOL CHANSVm_81451348(BlobHeader* blob, s64 size);
CHANSVmObjHdr* CHANSVmNewBlobObject(CHANSVm* VmInst, CHANSVmObjHdr* obj, u32 size, void* src, u32 count);
static u64 CHANSVmMakeU64(u32 upper, u32 lower);
static u64 CHANSVm_814540E0(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 CHANSVmBlobResolveOffset(BlobHeader* blob, s64 val, u32* out) {
BOOL CHANSVm_81450D14(BlobHeader* blob, s64 val, u32* out) {
s64 pos;
if (blob == vmNull) {
@@ -3901,7 +3901,7 @@ VmMethodDefine(Blob, Seek) {
return 0;
}
if (CHANSVmBlobResolveOffset(blob, val->value.int_v, &tmp)) {
if (CHANSVm_81450D14(blob, val->value.int_v, &tmp)) {
blob->offset = tmp;
} else {
return 0;
@@ -3988,9 +3988,9 @@ VmMethodDefine(Blob, Fill) {
return 0;
}
count = blob != vmNull ? CHANSVmBlobGetCount(blob, fill, blob->offset) : 0;
count = blob != vmNull ? CHANSVm_81451314(blob, fill, blob->offset) : 0;
if (CHANSVmBlobHasSpace(blob, count)) {
if (CHANSVm_81451348(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 CHANSVmBlobGetCount(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit) {
u32 CHANSVm_81451314(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit) {
if (ptr != vmNull) {
return *(u32*)((u8*)ptr + 4);
}
@@ -4013,7 +4013,7 @@ u32 CHANSVmBlobGetCount(BlobHeader* blob, CHANSVmObjHdr* ptr, u32 limit) {
return 0;
}
BOOL CHANSVmBlobHasSpace(BlobHeader* blob, s64 size) {
BOOL CHANSVm_81451348(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 (CHANSVmBlobHasSpace(blob, size)) {
if (CHANSVm_81451348(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 (CHANSVmBlobHasSpace(blob, size)) {
if (CHANSVm_81451348(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 (CHANSVmBlobHasSpace(blob, VM_STR_LENGTH(arg->value.int_v))) {
if (CHANSVm_81451348(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 (CHANSVmBlobHasSpace(blob, size)) {
if (CHANSVm_81451348(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 (CHANSVmBlobResolveOffset(destBlob, destOffObj->value.int_v, &destOff) != 0 && CHANSVmBlobResolveOffset(srcBlob, srcOffObj->value.int_v, &srcOff) != 0) {
count = CHANSVmBlobGetCount(srcBlob, countObj, srcOff);
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);
{
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 ? CHANSVmBlobGetCount(blob, arg, blob->offset) : 0;
count = blob != vmNull ? CHANSVm_81451314(blob, arg, blob->offset) : 0;
if (CHANSVmBlobHasSpace(blob, count)) {
if (CHANSVm_81451348(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 (CHANSVmBlobHasSpace(destBlob, logicalSize)) {
if (CHANSVm_81451348(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 ? CHANSVmBlobGetCount(blob, arg, blob->offset) : 0;
count = blob != vmNull ? CHANSVm_81451314(blob, arg, blob->offset) : 0;
if (CHANSVmBlobHasSpace(blob, count) && CHANSVmNewObject(VmInst, vmFalse, VmReturnObj, CHANS_VM_OBJ_TYPE_STRING, count * 4) != vmNull) {
if (CHANSVm_81451348(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 (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
{
u32 off = offset;
@@ -4417,8 +4417,8 @@ VmMethodDefine(Blob, CalcRangeMD5Digest) {
return 0;
}
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
{
u32 off = offset;
@@ -4464,8 +4464,8 @@ VmMethodDefine(Blob, CalcRangeCRC16) {
return 0;
}
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(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 (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(blob, arg1, offset);
{
u32 off = offset;
@@ -4573,8 +4573,8 @@ VmMethodDefine(Blob, CalcRangeHMAC) {
return 0;
}
if (CHANSVmBlobResolveOffset(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVmBlobGetCount(blob, arg1, offset);
if (CHANSVm_81450D14(blob, arg0->value.int_v, &offset) != 0) {
size = CHANSVm_81451314(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 || !CHANSVmBlobHasSpace(parentBlob, copySize)) {
if (copySize < 0 || !CHANSVm_81451348(parentBlob, copySize)) {
goto error;
}
@@ -5220,7 +5220,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
break;
}
case 5: {
if (paramValue < 0 || !CHANSVmBlobHasSpace(parentBlob, paramValue)) {
if (paramValue < 0 || !CHANSVm_81451348(parentBlob, paramValue)) {
goto error;
}
if (paramValue > 0) {
@@ -5247,7 +5247,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
goto error;
}
if (!CHANSVmBlobHasSpace(parentBlob, elemSize * count)) {
if (!CHANSVm_81451348(parentBlob, elemSize * count)) {
goto error;
}
@@ -5342,7 +5342,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
break;
}
case 8: {
*(u64*)packBuf = CHANSVmMakeU64(packBuf[0], packBuf[1]);
*(u64*)packBuf = CHANSVm_814540E0(packBuf[0], packBuf[1]);
break;
}
}
@@ -5379,7 +5379,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
goto error;
}
if (!CHANSVmBlobHasSpace(parentBlob, elemSize * count)) {
if (!CHANSVm_81451348(parentBlob, elemSize * count)) {
goto error;
}
@@ -5424,7 +5424,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
}
bufSize = (count + 1) / 2;
if (!CHANSVmBlobHasSpace(parentBlob, bufSize)) {
if (!CHANSVm_81451348(parentBlob, bufSize)) {
goto error;
}
@@ -5472,7 +5472,7 @@ error:
return vmFalse;
}
static u64 CHANSVmMakeU64(u32 upper, u32 lower) {
static u64 CHANSVm_814540E0(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 || !CHANSVmBlobHasSpace(srcBlob, count)) {
if (count < 0 || !CHANSVm_81451348(srcBlob, count)) {
goto error;
}
@@ -5663,7 +5663,7 @@ VmMethodDefine(Blob, Unpack) {
break;
}
case 5: {
if (outVal < 0 || !CHANSVmBlobHasSpace(srcBlob, outVal)) {
if (outVal < 0 || !CHANSVm_81451348(srcBlob, outVal)) {
goto error;
}
@@ -5682,7 +5682,7 @@ VmMethodDefine(Blob, Unpack) {
} else {
count = outVal;
}
if (count < 0 || !CHANSVmBlobHasSpace(srcBlob, outSize * count)) {
if (count < 0 || !CHANSVm_81451348(srcBlob, outSize * count)) {
goto error;
}
@@ -5710,7 +5710,7 @@ VmMethodDefine(Blob, Unpack) {
break;
}
case 8: {
unpackBuf.value = CHANSVmMakeU64(unpackBuf.words[0], unpackBuf.words[1]);
unpackBuf.value = CHANSVm_814540E0(unpackBuf.words[0], unpackBuf.words[1]);
break;
}
}
@@ -5794,7 +5794,7 @@ VmMethodDefine(Blob, Unpack) {
}
count = (srcBlob->size - srcBlob->offset) / outSize;
}
if ((s32)count < 0 || !CHANSVmBlobHasSpace(srcBlob, outSize * count)) {
if ((s32)count < 0 || !CHANSVm_81451348(srcBlob, outSize * count)) {
goto error;
}
@@ -5845,7 +5845,7 @@ VmMethodDefine(Blob, Unpack) {
}
bufSize = (s32)(count + 1) / 2;
if (!CHANSVmBlobHasSpace(srcBlob, bufSize)) {
if (!CHANSVm_81451348(srcBlob, bufSize)) {
goto error;
}
@@ -6466,7 +6466,7 @@ void CHANSConvertModuleOfsToPtr(CHANSVmModule* ptr) {
VmOffsU32ToPtr((void**)&ptr->pLineTbl, ptr);
}
static CHANSVmObjHdr* CHANSVmLookupScopedObject(CHANSVm* vm, s32 id) {
static CHANSVmObjHdr* CHANSVm_81455654(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, CHANSVmLookupScopedObject(vm, i)) != CHANS_VM_OK) {
if (CHANSVmDeleteObject(vm, CHANSVm_81455654(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 = CHANSVmLookupScopedObject(vm, idx), obj == vmNull) {
} else if (obj = CHANSVm_81455654(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)(CHANSVmFloatSign(pAcc->value.float_v) * floor(fabs(pAcc->value.float_v)));
invertedVal = (s64)(CHANSVm_8144B1D8(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 = CHANSVmLookupScopedObject(vm, imm16Val);
foundObj = CHANSVm_81455654(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 = CHANSVmLookupScopedObject(vm, (VM_READ_BE_U16(operandBuf, 0)) & 0x1FFF);
foundObj = CHANSVm_81455654(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 = CHANSVmLookupScopedObject(vm, imm16Val);
foundObj = CHANSVm_81455654(vm, imm16Val);
result = VmStore(vm, &pVm->accumulator, foundObj);
break;
}
case CHANS_VM_OP_SYMBOL_STORE: {
foundObj = CHANSVmLookupScopedObject(vm, imm16Val);
foundObj = CHANSVm_81455654(vm, imm16Val);
result = VmStore(vm, foundObj, &pVm->accumulator);
break;
}

View File

@@ -23,7 +23,7 @@ namespace memo {
class EventHandler : public inputform::EventHandler {
public:
EventHandler(InputForm* form) : inputform::EventHandler(form), mpMemoForm(form) {}
virtual ~EventHandler();
virtual ~EventHandler() {}
virtual void onTiEvent(gui::PaneComponent*, u32, Input*);
private:
InputForm* mpMemoForm;
@@ -48,14 +48,14 @@ protected:
class WholePane : public AnmPane {
public:
WholePane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = 0; }
virtual ~WholePane();
virtual ~WholePane() {}
virtual void onAnmEvent(AnmPaneEvent event);
};
class NigaoePane : public AnmPane {
public:
NigaoePane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : AnmPane(pane, observer) { meKeyType = 1; }
virtual ~NigaoePane();
virtual ~NigaoePane() {}
virtual void onAnmEvent(AnmPaneEvent event);
};
@@ -81,7 +81,7 @@ private:
class SimpleAnmPane : public nw4rmanager::AnmPane {
public:
SimpleAnmPane(nw4r::lyt::Pane* pane, nw4rmanager::AnmObserver* observer) : nw4rmanager::AnmPane(pane, observer) {}
virtual ~SimpleAnmPane();
virtual ~SimpleAnmPane() {}
virtual void init();
virtual void changeAnimation(u32 id);
};
@@ -792,12 +792,8 @@ void AnmPane::changeAnimation(u32 id) {
}
u32 AnmPane::getKeyType() const { return meKeyType; }
void AnmPane::init() { meState = 0; }
NigaoePane::~NigaoePane() {}
void NigaoePane::onAnmEvent(AnmPaneEvent) {}
WholePane::~WholePane() {}
bool InputForm::isInScroll() { return mExScrollAnm.isActive(); }
EventHandler::~EventHandler() {}
SimpleAnmPane::~SimpleAnmPane() {}
}
}

View File

@@ -5,6 +5,13 @@
#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

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

View File

@@ -5,14 +5,245 @@
#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 {
HWKeyboard::HWKeyboard(Manager* manager) : mpManager(manager), field_0x14(0), field_0x15(0), field_0x16(0) {
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
}
struct NavigationCommand { u32 command; u32 modifiers; };
@@ -26,78 +257,6 @@ 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;
@@ -416,12 +575,50 @@ 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};
@@ -440,47 +637,183 @@ const u8 controlKeys[] = {
0x06, 0x05, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
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 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
}
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]);
}
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
}
} // 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 scN_KOR[];
extern "C" const char scN_CHN[];
extern "C" const char lbl_816973A4[];
extern "C" const char lbl_816973AC[];
#pragma pop
extern "C" const f32 scInputFormZeroF;
extern "C" void _savegpr_20();
@@ -391,7 +391,7 @@ extern "C" const f32 scInputForm640F = 640.0f;
extern "C" const f64 scInputFormF32ConvertMagic = 4503601774854144.0;
extern "C" const f32 scInputFormOneF = 1.0f;
extern "C" const f32 scInputFormHalfF = 0.5f;
extern "C" const f32 scInputFormDegToFIdxF = 0.7111111f;
extern "C" const f32 scInputForm0_7111111F = 0.7111111f;
extern "C" const f32 scInputForm150F = 150.0f;
extern "C" const f32 scInputForm30F = 30.0f;
extern "C" const f32 scInputForm50F = 50.0f;

View File

@@ -1499,18 +1499,14 @@ namespace textinput {
return mKeyState.getWCCode(paneName);
}
inline u32 FindControlKey(const Base::KeyState& state, char* paneName) {
u32 Base::getControlKey(char* paneName) {
for (u16 i = 0; i < 23; i++) {
if (util::strcmp(state.data->controls[i].paneName, paneName))
return state.data->controls[i].key;
if (util::strcmp(mKeyState.data->controls[i].paneName, paneName))
return mKeyState.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:
@@ -2114,12 +2110,7 @@ namespace textinput {
void LayoutByNW4R::onPressedShift(bool sound) {
u32 flags = mKeyState.getABCFlag();
flags |= 128;
if ((mKeyState.abcFlags & ~15) != flags) {
Base* keyboard = mKeyState.owner;
mKeyState.abcFlags = (mKeyState.abcFlags & 15) | (flags & ~15);
if (keyboard != NULL)
keyboard->refreshState();
}
mKeyState.setABCFlag(flags);
mShiftButton.SetState(true, 5);
if (sound)
mpEventObserver->onSE(static_cast<sound::SE>(13));
@@ -2128,13 +2119,7 @@ namespace textinput {
void LayoutByNW4R::onReleasedShift() {
u32 flags = mKeyState.getABCFlag();
flags &= ~128;
u32 currentFlags = mKeyState.abcFlags;
if ((currentFlags & ~15) != flags) {
Base* keyboard = mKeyState.owner;
mKeyState.abcFlags = (currentFlags & 15) | (flags & ~15);
if (keyboard != NULL)
keyboard->refreshState();
}
mKeyState.setABCFlag(flags);
if (mShiftButton.mbOn) {
mShiftButton.mbOn = false;
mShiftButton.mpAnimation->onAnmEvent(static_cast<AnmPane::AnmPaneEvent>(5));
@@ -2524,24 +2509,8 @@ namespace textinput {
} else {
gather.setPressedShiftB(false);
input::HKBManager::getInstance().SetForceModifierState(0, 0);
if (wasShift && !gather.isHoldingShift()) {
u32 flags;
u32 currentFlags;
Base* keyboard;
flags = mKeyState.getABCFlag();
flags &= ~128;
currentFlags = mKeyState.abcFlags;
if ((currentFlags & ~15) != flags) {
keyboard = mKeyState.owner;
mKeyState.abcFlags = (currentFlags & 15) | (flags & ~15);
if (keyboard != NULL)
keyboard->refreshState();
}
if (mShiftButton.mbOn) {
mShiftButton.mbOn = false;
mShiftButton.mpAnimation->onAnmEvent(static_cast<AnmPane::AnmPaneEvent>(5));
}
}
if (wasShift && !gather.isHoldingShift())
onReleasedShift();
}
return handled;
}
@@ -2570,14 +2539,11 @@ namespace textinput {
u32 koreanCode = code;
if (caps)
koreanCode = util::reverseLetterCaseW(koreanCode);
u16 mapped;
if (koreanCode >= L'a' && koreanCode <= L'z')
mapped = KOREAN_LOWER[static_cast<u16>(koreanCode) - L'a'];
koreanCode = KOREAN_LOWER[static_cast<u16>(koreanCode) - L'a'];
else if (koreanCode >= L'A' && koreanCode <= L'Z')
mapped = KOREAN_UPPER[static_cast<u16>(koreanCode) - L'A'];
else
mapped = koreanCode;
code = mapped;
koreanCode = KOREAN_UPPER[static_cast<u16>(koreanCode) - L'A'];
code = koreanCode;
}
}
animation = searchAnmPane(code);

View File

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

View File

@@ -485,16 +485,16 @@ namespace ipl {
}
void BoardObject::stt_stand() {
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);
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);
math::VEC2 standPos;
__ct__Q33ipl4math4VEC2Fff(&standPos, sinF * 160.0f, cosF * 160.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.mStep)) + (standPos * mStandData.mStep)) / 10.0f);
__ct__Q33ipl4math4VEC2Fff(&standPos, dVar3 * 160.0f, dVar2 * 160.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.unk_0x08)) + (standPos * mStandData.unk_0x08)) / 10.0f);
if ((mStandData.mStep += 1) > 10) {
if ((mStandData.unk_0x08 += 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), mAnimWait(0), mOptOutBtn(), mSdMenuBtn(), mbNewMailAnm(false), mbSuppressNewMailAnm(false), mReservedCmd() {
Button::Button(EGG::Heap* heap) : Base(heap), unk_0x54(0), mOptOutBtn(), mSdMenuBtn(), unk_0x104(false), unk_0x105(false), mReservedCmd() {
for (int i = 0; i < ARROW_BTN_MAX; i++) {
mbArrowVisible[i] = true;
}
@@ -293,7 +293,7 @@ namespace ipl {
}
void Button::calc() {
switch (mAnimWait) {
switch (unk_0x54) {
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()) {
mAnimWait = 0;
unk_0x54 = 0;
}
break;
}
@@ -335,7 +335,7 @@ namespace ipl {
mpBalloons[i]->calc();
}
if (mbNewMailAnm && !mbSuppressNewMailAnm && mTimer()) {
if (unk_0x104 && !unk_0x105 && mTimer()) {
startNewMailAnm_();
}
}
@@ -457,7 +457,7 @@ namespace ipl {
bool Button::isActive() const {
bool result = false;
if (isSceneCreated() && mAnimWait != 1) {
if (isSceneCreated() && unk_0x54 != 1) {
result = true;
}
return result;
@@ -668,7 +668,7 @@ namespace ipl {
}
}
mAnimWait = 1;
unk_0x54 = 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);
mbNewMailAnm = true;
if (!mbSuppressNewMailAnm) {
unk_0x104 = true;
if (!unk_0x105) {
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();
mbNewMailAnm = false;
unk_0x104 = 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), mbSearchTaskRunning(FALSE), mbTaskCanceled(FALSE),
mpGroupAnim(NULL), mpInitAnim(NULL), mpBoardDate(NULL), mpSelectDate(NULL), mbScrolling(false), unk_0xA0(FALSE), mbTaskCanceled(FALSE),
mbBackToBoardAlt(FALSE) {
nw4r::ut::List_Init(&mDateList, offsetof(Date, mNode1));
nw4r::ut::List_Init(&mDrawList, offsetof(Date, mNode2));
nw4r::ut::List_Init(&unk_0x90, 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(&mDrawList, date);
nw4r::ut::List_Append(&unk_0x90, 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(&mDrawList, i))->draw(false);
((Date*)nw4r::ut::List_GetNth(&unk_0x90, i))->draw(false);
}
for (u32 i = 0; i < DATE_COUNT; i++) {
((Date*)nw4r::ut::List_GetNth(&mDrawList, i))->draw(true);
((Date*)nw4r::ut::List_GetNth(&unk_0x90, i))->draw(true);
}
}
}
@@ -425,8 +425,8 @@ namespace ipl {
}
void Calendar::onPointDate(Date* date) {
nw4r::ut::List_Remove(&mDrawList, date);
nw4r::ut::List_Append(&mDrawList, date);
nw4r::ut::List_Remove(&unk_0x90, date);
nw4r::ut::List_Append(&unk_0x90, date);
}
void Calendar::onTrigDate(Date* date) {
@@ -503,7 +503,7 @@ namespace ipl {
}
void Calendar::on_wait_task() {
if (mbSearchTaskRunning == FALSE) {
if (unk_0xA0 == FALSE) {
switch (mPrevState) {
case STATE_SCROLL_RIGHT: {
do_scroll_r();
@@ -535,7 +535,7 @@ namespace ipl {
mPrevState = mState;
mState = STATE_SCROLL_RIGHT;
if (mbSearchTaskRunning == TRUE) {
if (unk_0xA0 == TRUE) {
mbTaskCanceled = TRUE;
mPrevState = STATE_SCROLL_RIGHT;
mState = STATE_WAIT_TASK;
@@ -577,7 +577,7 @@ namespace ipl {
mPrevState = mState;
mState = STATE_SCROLL_LEFT;
if (mbSearchTaskRunning) {
if (unk_0xA0) {
mbTaskCanceled = TRUE;
mPrevState = STATE_SCROLL_LEFT;
mState = STATE_WAIT_TASK;
@@ -616,7 +616,7 @@ namespace ipl {
mPrevState = mState;
mState = STATE_DONE;
if (mbSearchTaskRunning == TRUE) {
if (unk_0xA0 == TRUE) {
OSReport("検索タスク終了要求\n"); // "Search task termination requested"
mbTaskCanceled = TRUE;
mPrevState = mState;
@@ -863,14 +863,14 @@ namespace ipl {
OSReport("タスク終了\n"); // Task end
calendar->mbSearchTaskRunning = FALSE;
calendar->unk_0xA0 = FALSE;
calendar->mbTaskCanceled = FALSE;
}
}
void Calendar::exec_search_task() {
OSReport("検索開始\n"); // Start search
mbSearchTaskRunning = TRUE;
unk_0xA0 = 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), mFocusState(0), mPendingFocusCmd(0), mpLayout(NULL), mpCurrentPaneAnim(0), mPointCount(0) {
: ::gui::EventHandler(), mbAppearMsg(0), unk_0x10(0), unk_0x14(0), mpLayout(NULL), mpCurrentPaneAnim(0), unk_0x3C(0) {
// Layout
mpLayout = new layout::Object(heap, file, layoutFolder, layoutFileName);
@@ -103,16 +103,16 @@ namespace ipl {
onCmdRecv(3);
}
onCmdRecv(mPendingFocusCmd);
onCmdRecv(unk_0x14);
}
void Date::draw(bool unk) {
if (unk) {
if (mPointCount != 0) {
if (unk_0x3C != 0) {
mpLayout->draw();
}
} else {
if (mPointCount == 0) {
if (unk_0x3C == 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 (mPointCount == 0) {
if (unk_0x3C == 0) {
static_cast<Calendar*>(System::getScene(SCENE_CALENDAR))->onPointDate(this);
onCmdRecv(1);
@@ -221,16 +221,16 @@ namespace ipl {
}
}
}
mPointCount++;
unk_0x3C++;
}
}
void Date::start_left_event(const char* paneName) {
if (strcmp(paneName, scB_Cal) == 0) {
if (mPointCount == 1) {
if (unk_0x3C == 1) {
onCmdRecv(2);
}
mPointCount--;
unk_0x3C--;
}
}
@@ -268,35 +268,35 @@ namespace ipl {
void Date::onCmdRecv(int cmd) {
if (cmd == 1 || cmd == 2) {
mPendingFocusCmd = cmd;
unk_0x14 = cmd;
}
switch (mFocusState) {
switch (unk_0x10) {
case 0: {
if (cmd == 1) {
mpCurrentPaneAnim = doAnim(IDANIM_FOCUS_IN);
mFocusState = 1;
unk_0x10 = 1;
} else if (cmd == 2) {
mpCurrentPaneAnim = doAnim(IDANIM_FOCUS_OUT);
mFocusState = 2;
unk_0x10 = 2;
}
break;
}
case 1: {
if (cmd == 3) {
if (mPendingFocusCmd == 1) {
mPendingFocusCmd = 0;
if (unk_0x14 == 1) {
unk_0x14 = 0;
}
mFocusState = 0;
unk_0x10 = 0;
}
break;
}
case 2: {
if (cmd == 3) {
if (mPendingFocusCmd == 2) {
mPendingFocusCmd = 0;
if (unk_0x14 == 2) {
unk_0x14 = 0;
}
mFocusState = 0;
unk_0x10 = 0;
}
break;
}
@@ -306,13 +306,14 @@ namespace ipl {
void Date::initEvent() {
mpGui->init();
mpPaneAnims[ANIM_PANE_BTN_HOVER]->initAnmFrame(0.0f);
mPointCount = 0;
unk_0x3C = 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* cardThreadMain();
extern "C" void* CardSequence_813D2C8C();
static char sCardSlotName[3] = "AB";
FileInfo* getCardDirState() {
@@ -68,7 +68,7 @@ long getCardLastCMDFCmdResult() {
return sThread->completionResult;
}
extern "C" s32 sendCardUnmountCmd(u8 slot) {
extern "C" s32 CardSequence_813D205C(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 {
sendCardUnmountCmd(0);
sendCardUnmountCmd(1);
CardSequence_813D205C(0);
CardSequence_813D205C(1);
OSSendMessage(&sThread->requests, (OSMessage)0xB, 0);
}
extern "C" void pollCardSlot(u8 slot) {
extern "C" void CardSequence_813D222C(u8 slot) {
s32 result;
if (sThread->valid == 1) {
@@ -139,7 +139,7 @@ extern "C" void pollCardSlot(u8 slot) {
}
}
if (result == 0) {
if (sThread->slots[slot].state > 2 && sendCardUnmountCmd(slot)) {
if (sThread->slots[slot].state > 2 && CardSequence_813D205C(slot)) {
sThread->slots[slot].changed = 0;
}
}
@@ -148,7 +148,7 @@ done:
return;
}
extern "C" s32 mapCardErrorCode(s32 result) {
extern "C" s32 CardSequence_813D233C(s32 result) {
switch (result) {
case 0:
return 0;
@@ -186,8 +186,8 @@ extern "C" s32 mapCardErrorCode(s32 result) {
void probeCard() {
OSMessage message;
pollCardSlot(0);
pollCardSlot(1);
CardSequence_813D222C(0);
CardSequence_813D222C(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 = mapCardErrorCode((s8)(((u32)message << 16) >> 24));
sThread->lastResult = CardSequence_813D233C((s8)(((u32)message << 16) >> 24));
if ((s8)(u8)(u32)message != 0 && (s8)(u8)(u32)message != 9) {
sThread->completionResult = mapCardErrorCode((s8)(((u32)message << 16) >> 24));
sThread->completionResult = CardSequence_813D233C((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*))cardThreadMain, 0,
OSCreateThread(&sThread->thread, (void* (*)(void*))CardSequence_813D2C8C, 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 clearCardFileEntry(s32 slot, s32 index) {
extern "C" void CardSequence_813D2A74(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 clearCardFileEntry(s32 slot, s32 index) {
OSRestoreInterrupts(interrupts);
}
extern "C" void refreshCardSlotInfo(s32 slot) {
extern "C" void CardSequence_813D2B40(s32 slot) {
u16 memSize;
u32 sectorSize;
s32 freeBytes;
@@ -391,12 +391,12 @@ extern "C" void refreshCardSlotInfo(s32 slot) {
}
}
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);
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);
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* cardThreadMain() {
extern "C" void* CardSequence_813D2C8C() {
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 = handleCardMountResult(slot, result);
result = CardSequence_813D320C(slot, result);
if (result != 0) {
goto mountContinue;
}
@@ -467,11 +467,11 @@ loopStart:
}
mountContinue:
clearAllCardFileEntries(slot);
CardSequence_813D33D8(slot);
for (file = 0; file < 0x7F; ++file) {
result = __CARDGetStatusEx(slot, (s16)file, &local.mountDir);
if (result < 0) {
result = handleCardMountResult(slot, result);
result = CardSequence_813D320C(slot, result);
if (result != 0) {
continue;
}
@@ -496,16 +496,16 @@ loopStart:
goto mountError;
}
} else {
result = loadCardFileIcons(slot, (s16)file, &local.mountDir);
result = CardSequence_813D3424(slot, (s16)file, &local.mountDir);
if (result < 0) {
goto mountError;
}
}
}
}
refreshCardSlotInfo(slot);
CardSequence_813D2B40(slot);
sThread->mounted[command / 4] = 1;
sendCardSlotState(slot, 0, 0);
CardSequence_813D3380(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");
reportCardThreadError(slot, 0, result);
CardSequence_813D32A8(slot, 0, result);
break;
}
case 9:
reportCardThreadError((local.message >> 16) & 1, 9, -3);
CardSequence_813D32A8((local.message >> 16) & 1, 9, -3);
break;
case 1: {
slot = (local.message >> 16) & 1;
result = CARDFormat(slot);
if (result < 0) {
reportCardThreadError(slot, 1, result);
CardSequence_813D32A8(slot, 1, result);
} else {
sThread->mounted[slot] = 1;
refreshCardSlotInfo(slot);
sendCardSlotState(slot, 1, 0);
CardSequence_813D2B40(slot);
CardSequence_813D3380(slot, 1, 0);
}
break;
}
case 2:
runCardMoveOrCopy((local.message >> 16) & 1,
CardSequence_813D3D14((local.message >> 16) & 1,
(s16)(u8)(local.message >> 24), (s8)command);
break;
case 3:
runCardMoveOrCopy((local.message >> 16) & 1,
CardSequence_813D3D14((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) {
reportCardThreadError(slot, 4, result);
CardSequence_813D32A8(slot, 4, result);
} else {
clearCardFileEntry(slot, fileNo);
refreshCardSlotInfo(slot);
sendCardSlotState(slot, 4, (u8)fileNo);
CardSequence_813D2A74(slot, fileNo);
CardSequence_813D2B40(slot);
CardSequence_813D3380(slot, 4, (u8)fileNo);
}
break;
}
@@ -581,7 +581,7 @@ loopStart:
++outerSlot;
} while (outerSlot < 2);
sendCardSlotState(0, 0xC, 0);
CardSequence_813D3380(0, 0xC, 0);
break;
default:
break;
@@ -593,9 +593,9 @@ loopCheck:
return 0;
}
extern "C" s32 checkCardFileDuplicate(s32 slot, s16 fileNo);
extern "C" s32 CardSequence_813D3C38(s32 slot, s16 fileNo);
extern "C" void markAllCardFilesDirty() {
extern "C" void CardSequence_813D3140() {
u32 slot = 0;
s32 fileNo;
@@ -607,7 +607,7 @@ extern "C" void markAllCardFilesDirty() {
sThread->files[slot][fileNo].unk_0x06 = 0;
if (sThread->mounted[slot] != 0 &&
sThread->mounted[slot ^ 1] != 0 &&
checkCardFileDuplicate((u8)slot, (s16)fileNo) < 0) {
CardSequence_813D3C38((u8)slot, (s16)fileNo) < 0) {
sThread->files[slot][fileNo].unk_0x06 = flagValue;
}
++fileNo;
@@ -618,7 +618,7 @@ extern "C" void markAllCardFilesDirty() {
} while ((s32)slot < 2);
}
extern "C" s32 handleCardMountResult(s32 slot, s32 result) {
extern "C" s32 CardSequence_813D320C(s32 slot, s32 result) {
if (result == -5) {
goto reportError;
}
@@ -640,32 +640,32 @@ repairedCard:
{
result = CARDCheck(slot);
if (result < 0) {
return reportCardThreadError(slot, 0, result);
return CardSequence_813D32A8(slot, 0, result);
}
OSReport("CardThread:Broken Card Repaired\n");
return 1;
}
reportError:
return reportCardThreadError(slot, 0, result);
return CardSequence_813D32A8(slot, 0, result);
}
extern "C" s32 reportCardThreadError(s32 slot, s32 state, s32 result) {
extern "C" s32 CardSequence_813D32A8(s32 slot, s32 state, s32 result) {
if (result != -7 && result != -27 && result != -8 && result != -9 &&
(clearAllCardFileEntries(slot), result != -6) && result != -13) {
(CardSequence_813D33D8(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);
markAllCardFilesDirty();
CardSequence_813D3140();
OSSendMessage(&sThread->responses,
(OSMessage)(((slot & 1) << 16) | ((result & 0xFF) << 8) | (state & 0xFF)), 1);
return 0;
}
extern "C" void sendCardSlotState(s32 slot, s32 state, s32 fileNo) {
markAllCardFilesDirty();
extern "C" void CardSequence_813D3380(s32 slot, s32 state, s32 fileNo) {
CardSequence_813D3140();
OSMessageQueue* queue = &sThread->responses;
union CardThreadMessage {
u32 value;
@@ -683,15 +683,15 @@ extern "C" void sendCardSlotState(s32 slot, s32 state, s32 fileNo) {
OSSendMessage(queue, (OSMessage)message.value, 1);
}
extern "C" void clearAllCardFileEntries(s32 slot) {
extern "C" void CardSequence_813D33D8(s32 slot) {
s32 file = 0;
do {
clearCardFileEntry(slot, (s16)file);
CardSequence_813D2A74(slot, (s16)file);
file = file + 1;
} while (file < 0x7F);
}
extern "C" s32 loadCardFileIcons(s32 slot, s32 fileNo, CARDDir* dir) {
extern "C" s32 CardSequence_813D3424(s32 slot, s32 fileNo, CARDDir* dir) {
struct CardSequenceFileData {
s32 commentSectorSize;
s32 sectorSize;
@@ -922,11 +922,11 @@ closeFileSuccess:
return 0;
}
extern "C" void clearCardWritePending(s32, s32) {
extern "C" void CardSequence_813D3C24(s32, s32) {
sThread->writePending = 0;
}
extern "C" s32 checkCardFileDuplicate(s32 slot, s16 fileNo) {
extern "C" s32 CardSequence_813D3C38(s32 slot, s16 fileNo) {
CARDDir sourceDir;
CARDDir otherDir;
s32 result = __CARDGetStatusEx(slot, fileNo, &sourceDir);
@@ -950,7 +950,7 @@ extern "C" s32 checkCardFileDuplicate(s32 slot, s16 fileNo) {
return 0;
}
extern "C" void runCardMoveOrCopy(s32 slot, s16 fileNo, s32 command) {
extern "C" void CardSequence_813D3D14(s32 slot, s16 fileNo, s32 command) {
CARDDir createStatus;
CARDDir checkedStatus;
CARDDir ioStatus;
@@ -970,10 +970,10 @@ extern "C" void runCardMoveOrCopy(s32 slot, s16 fileNo, s32 command) {
s32 statusResult;
s32 stage;
result = checkCardFileDuplicate(slot, fileNo);
result = CardSequence_813D3C38(slot, fileNo);
if (result < 0) {
reportCardThreadError(slot, command, result);
CardSequence_813D32A8(slot, command, result);
goto finish;
}
@@ -999,7 +999,7 @@ sectorSizeCheck:
goto sectorSizeDone;
}
sectorSizeError:
reportCardThreadError(slot, command, sectorError);
CardSequence_813D32A8(slot, command, sectorError);
goto finish;
sectorSizeDone:
;
@@ -1023,7 +1023,7 @@ sectorSizeDone:
result = CARDGetResultCode(slot);
}
if (result < 0) {
reportCardThreadError(slot, command, result);
CardSequence_813D32A8(slot, command, result);
goto finish;
}
@@ -1056,7 +1056,7 @@ createDone:
;
}
if (destinationFileNo < 0) {
reportCardThreadError(destinationSlot, command, destinationFileNo);
CardSequence_813D32A8(destinationSlot, command, destinationFileNo);
goto finish;
}
@@ -1099,7 +1099,7 @@ createDone:
sThread->writePending = 1;
ioResult = CARDWriteAsync(&sThread->destinationFile,
sThread->transferBuffer, size, offset,
clearCardWritePending);
CardSequence_813D3C24);
if (ioResult < 0) {
goto copyIoFailure;
}
@@ -1176,7 +1176,7 @@ copyIoDone:
}
} else {
metadataCopied = TRUE;
result = loadCardFileIcons(destinationSlot, destinationFileNo,
result = CardSequence_813D3424(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);
clearCardFileEntry(slot, fileNo);
CardSequence_813D2A74(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) {
clearCardFileEntry(slot, fileNo);
CardSequence_813D2A74(slot, fileNo);
stage = 4;
result = __CARDGetStatusEx(destinationSlot,
destinationFileNo, &moveStatus);
if (result >= 0) {
stage = 5;
if ((result = loadCardFileIcons(
if ((result = CardSequence_813D3424(
destinationSlot, destinationFileNo, &moveStatus)) < 0) {
goto moveStatusError;
}
@@ -1270,10 +1270,10 @@ moveStatusDone:
}
if (result >= 0) {
refreshCardSlotInfo(slot);
refreshCardSlotInfo(destinationSlot);
sendCardSlotState(slot, 0, fileNo & 0xFF);
sendCardSlotState(destinationSlot, command, destinationFileNo & 0xFF);
CardSequence_813D2B40(slot);
CardSequence_813D2B40(destinationSlot);
CardSequence_813D3380(slot, 0, fileNo & 0xFF);
CardSequence_813D3380(destinationSlot, command, destinationFileNo & 0xFF);
goto finish;
}
@@ -1281,7 +1281,7 @@ cleanup:
destinationSlot = slot ^ 1;
result = CARDGetResultCode(destinationSlot);
if (result < 0) {
reportCardThreadError(destinationSlot, command, result);
CardSequence_813D32A8(destinationSlot, command, result);
} else {
if (temporaryCreated && !metadataCopied) {
CARDFastDelete(destinationSlot, destinationFileNo);
@@ -1289,18 +1289,18 @@ cleanup:
if (metadataCopied) {
if (__CARDGetStatusEx(destinationSlot, destinationFileNo,
&createStatus) == 0) {
loadCardFileIcons(destinationSlot, destinationFileNo, &createStatus);
CardSequence_813D3424(destinationSlot, destinationFileNo, &createStatus);
}
}
refreshCardSlotInfo(destinationSlot);
sendCardSlotState(destinationSlot, 0, fileNo & 0xFF);
CardSequence_813D2B40(destinationSlot);
CardSequence_813D3380(destinationSlot, 0, fileNo & 0xFF);
}
result = CARDGetResultCode(slot);
if (result < 0) {
reportCardThreadError(slot, command, result);
CardSequence_813D32A8(slot, command, result);
} else {
refreshCardSlotInfo(slot);
sendCardSlotState(slot, 0, fileNo & 0xFF);
CardSequence_813D2B40(slot);
CardSequence_813D3380(slot, 0, fileNo & 0xFF);
}
finish:

View File

@@ -92,7 +92,7 @@ namespace ipl {
extern "C" void List_GetNth__Q24nw4r2utFPCQ34nw4r2ut4ListUs();
extern "C" void getChannelBasePane__Q33ipl5scene13ChannelSelectFi();
extern "C" void initPane__Q33ipl3gui11PaneManagerFPQ34nw4r3lyt4Pane();
extern "C" void* updateDiskState_jumptable[];
extern "C" void* jumptable_8164DE80[];
extern "C" void getCurrentChannel__Q33ipl7channel7ManagerFPiPi();
extern "C" void calcNormalRestart__Q33ipl5scene13ChannelSelectFv();
extern "C" void _savegpr_28();
@@ -857,7 +857,7 @@ namespace ipl {
extern "C" char scPaneName_N_GCIcon[] = "N_GCIcon";
extern "C" char scPaneName_N_DiscUpdateIcon[] = "N_DiscUpdateIcon";
extern "C" void* updateDiskState_jumptable[7] = {
extern "C" void* jumptable_8164DE80[7] = {
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x4C),
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x21C),
(void*)((const char*)updateDiskState__Q33ipl5scene13ChannelSelectFv + 0x284),
@@ -1346,18 +1346,18 @@ namespace ipl {
lwz r4, 0xa8(r28)
cmplwi r0, 0x6
lwz r27, 0x4(r4)
bgt updateDiskState_done
lis r4, updateDiskState_jumptable@ha
bgt updateDiskState_813AD2C8
lis r4, jumptable_8164DE80@ha
slwi r0, r0, 2
addi r4, r4, updateDiskState_jumptable@l
addi r4, r4, jumptable_8164DE80@l
lwzx r4, r4, r0
mtctr r4
bctr
updateDiskState_case0:
updateDiskState_813ACF94:
lwz r4, 0xa4(r3)
lwz r0, 0x14(r4)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
lwz r3, 0x94(r3)
lis r29, scPaneName_N_GCIcon@ha
addi r4, r29, scPaneName_N_GCIcon@l
@@ -1381,7 +1381,7 @@ namespace ipl {
li r4, 0x0
bl SetVisible__Q34nw4r3lyt4PaneFb
cmpwi r27, 0x5
bne updateDiskState_case0_diskState3
bne updateDiskState_813AD078
lwz r4, 0xc0(r31)
lwz r3, 0x84(r28)
subi r4, r4, 0xf
@@ -1391,32 +1391,32 @@ namespace ipl {
lwz r0, 0xc0(r31)
mr r27, r3
cmpwi r0, 0xf
bne updateDiskState_case0_afterThumb
bne updateDiskState_813AD03C
lwz r3, 0xa8(r28)
addi r4, r31, 0xf8
addi r5, r31, 0xfc
bl getDiskInfo__Q33ipl3bs27ManagerFPPcPPc
updateDiskState_case0_afterThumb:
updateDiskState_813AD03C:
cmpwi r27, 0x0
beq updateDiskState_case0_afterLayout
beq updateDiskState_813AD050
lwz r3, 0x90(r31)
mr r4, r27
bl createDiskLayout__Q33ipl5scene10ChannelObjFPv
updateDiskState_case0_afterLayout:
updateDiskState_813AD050:
lbz r0, 0xf4(r31)
cmpwi r0, 0x0
bne updateDiskState_case0_afterDiskIn
bne updateDiskState_813AD064
mr r3, r31
bl startDiskInEvent__Q33ipl5scene13ChannelSelectFv
updateDiskState_case0_afterDiskIn:
updateDiskState_813AD064:
li r3, 0x0
li r0, 0x1
stb r3, 0xf4(r31)
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case0_diskState3:
b updateDiskState_813AD2C8
updateDiskState_813AD078:
cmpwi r27, 0x3
bne updateDiskState_case0_diskState6
bne updateDiskState_813AD134
lwz r3, 0x84(r28)
li r0, 0x0
addi r4, r29, scPaneName_N_GCIcon@l
@@ -1444,7 +1444,7 @@ namespace ipl {
bl setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object
lwz r3, 0x98(r31)
cmpwi r3, 0x0
beq updateDiskState_case0_state3_afterAnim
beq updateDiskState_813AD10C
li r0, 0x2
stw r0, 0x18(r3)
lwz r28, 0x98(r31)
@@ -1452,45 +1452,45 @@ namespace ipl {
bl initFrame__Q33ipl7utility15FrameControllerFv
li r0, 0x1
stw r0, 0x14(r28)
updateDiskState_case0_state3_afterAnim:
updateDiskState_813AD10C:
lbz r0, 0xf4(r31)
cmpwi r0, 0x0
bne updateDiskState_case0_state3_afterDiskIn
bne updateDiskState_813AD120
mr r3, r31
bl startDiskInEvent__Q33ipl5scene13ChannelSelectFv
updateDiskState_case0_state3_afterDiskIn:
updateDiskState_813AD120:
li r3, 0x0
li r0, 0x1
stb r3, 0xf4(r31)
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case0_diskState6:
b updateDiskState_813AD2C8
updateDiskState_813AD134:
cmpwi r27, 0x6
bne updateDiskState_done
bne updateDiskState_813AD2C8
lbz r0, 0xf4(r31)
cmpwi r0, 0x0
bne updateDiskState_case0_state6_afterDiskIn
bne updateDiskState_813AD150
mr r3, r31
bl startDiskInEvent__Q33ipl5scene13ChannelSelectFv
updateDiskState_case0_state6_afterDiskIn:
updateDiskState_813AD150:
li r3, 0x0
li r0, 0x4
stb r3, 0xf4(r31)
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case1:
b updateDiskState_813AD2C8
updateDiskState_813AD164:
lwz r4, 0x8c(r3)
lwz r0, 0x14(r4)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
lwz r3, 0x90(r3)
bl resetDiskTitleName__Q33ipl5scene10ChannelObjFv
cmpwi r27, 0x5
bne updateDiskState_case1_setState3
bne updateDiskState_813AD1C0
lwz r3, 0x90(r31)
lwz r3, 0x34(r3)
cmpwi r3, 0x0
beq updateDiskState_case1_setState2
beq updateDiskState_813AD1B4
li r0, 0x2
stw r0, 0x18(r3)
lwz r3, 0x90(r31)
@@ -1499,85 +1499,85 @@ namespace ipl {
bl initFrame__Q33ipl7utility15FrameControllerFv
li r0, 0x1
stw r0, 0x14(r27)
updateDiskState_case1_setState2:
updateDiskState_813AD1B4:
li r0, 0x2
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case1_setState3:
b updateDiskState_813AD2C8
updateDiskState_813AD1C0:
li r0, 0x3
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case2:
b updateDiskState_813AD2C8
updateDiskState_813AD1CC:
cmpwi r27, 0x5
bne updateDiskState_case2_doOut
bne updateDiskState_813AD1E4
lwz r4, 0x84(r28)
lbz r0, 0x1b81(r4)
cmpwi r0, 0x0
beq updateDiskState_done
updateDiskState_case2_doOut:
beq updateDiskState_813AD2C8
updateDiskState_813AD1E4:
lwz r3, 0xa0(r3)
lwz r0, 0x14(r3)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
mr r3, r31
bl startDiskOutEvent__Q33ipl5scene13ChannelSelectFv
lwz r3, 0x90(r31)
bl changeDisk__Q33ipl5scene10ChannelObjFv
li r0, 0x6
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case3:
b updateDiskState_813AD2C8
updateDiskState_813AD210:
cmpwi r27, 0x3
bne updateDiskState_case3_doOut
bne updateDiskState_813AD228
lwz r4, 0x84(r28)
lbz r0, 0x1b81(r4)
cmpwi r0, 0x0
beq updateDiskState_done
updateDiskState_case3_doOut:
beq updateDiskState_813AD2C8
updateDiskState_813AD228:
lwz r3, 0xa0(r3)
lwz r0, 0x14(r3)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
mr r3, r31
bl startDiskOutEvent__Q33ipl5scene13ChannelSelectFv
lwz r3, 0x90(r31)
bl changeDisk__Q33ipl5scene10ChannelObjFv
li r0, 0x6
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case4:
b updateDiskState_813AD2C8
updateDiskState_813AD254:
lwz r4, 0x8c(r3)
lwz r0, 0x14(r4)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
li r0, 0x5
stw r0, 0xf0(r3)
b updateDiskState_done
updateDiskState_case5:
b updateDiskState_813AD2C8
updateDiskState_813AD270:
cmpwi r27, 0x6
beq updateDiskState_done
beq updateDiskState_813AD2C8
lwz r4, 0xa0(r3)
lwz r0, 0x14(r4)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
bl startDiskOutEvent__Q33ipl5scene13ChannelSelectFv
lwz r3, 0x90(r31)
bl changeDisk__Q33ipl5scene10ChannelObjFv
li r0, 0x6
stw r0, 0xf0(r31)
b updateDiskState_done
updateDiskState_case6:
b updateDiskState_813AD2C8
updateDiskState_813AD2A0:
lwz r4, 0x8c(r3)
lwz r0, 0x14(r4)
cmpwi r0, 0x1
beq updateDiskState_done
beq updateDiskState_813AD2C8
lwz r3, 0x90(r3)
bl destroyDiskLayout__Q33ipl5scene10ChannelObjFv
lwz r3, 0x90(r31)
bl resetDiskTitleName__Q33ipl5scene10ChannelObjFv
li r0, 0x0
stw r0, 0xf0(r31)
updateDiskState_done:
updateDiskState_813AD2C8:
addi r11, r1, 0x20
bl _restgpr_27
lwz r0, 0x24(r1)
@@ -1734,13 +1734,11 @@ namespace ipl {
}
}
extern "C" char scSE_WSD_SELECT[] = "WSD_SELECT";
void ChannelSelect::preparePageScrolling(int nextState) {
mbModuleSceneChange = true;
mState = nextState;
unk_0x185 = false;
snd::getSystem()->startSE(scSE_WSD_SELECT);
snd::getSystem()->startSE("WSD_SELECT");
}
void ChannelSelect::startPageScroll(int nextState) {
@@ -2089,6 +2087,7 @@ namespace ipl {
mpMoveLytDrop->getAnim()->initAnmFrame();
}
extern "C" char scSE_WSD_SELECT[] = "WSD_SELECT";
extern "C" char scSE_WIPL_SE_CH_TARGETTING[] = "WIPL_SE_CH_TARGETTING";
extern "C" char scSE_WIPL_SE_CH_HOLD[] = "WIPL_SE_CH_HOLD";
extern "C" char scSE_WIPL_SE_CH_SET[] = "WIPL_SE_CH_SET";

View File

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

View File

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

View File

@@ -1,4 +1,3 @@
#define IPL_MEMORY_CARD_MANAGER_CPP
#include "scene/memoryCard/iplMemoryCardManager.h"
#include "utility/iplCharacterCode.h"
#include <revolution/sc.h>
@@ -12,7 +11,7 @@ struct MemoryCardSortEntry {
s64 key;
};
extern "C" int compareMemoryCardSortEntries(const void* first, const void* second) {
extern "C" int iplMemoryCardManager_813CD034(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;
@@ -93,7 +92,7 @@ void MemoryCardManager::sort_file_array(u8 slot) {
mFile[slot][file].unk_0x08 = 0;
}
}
qsort(mFile[slot], 0x7f, sizeof(MCFile), compareMemoryCardSortEntries);
qsort(mFile[slot], 0x7f, sizeof(MCFile), iplMemoryCardManager_813CD034);
}
void MemoryCardManager::sendCardCmdMove(u8 slot, s16 index) {
@@ -253,9 +252,7 @@ void MemoryCardManager::update_icon_anm() {
u32 file = mFile[slot][index].fileNo;
if (file < 0x7f && dirs[slot][file].fileNo != 0) {
memorycard::IconState* icon = icons[slot] + file;
s8 delta = icon->anmDelta;
s16 currentFrame = mFileCell[slot][file].iconAnmCounter;
s32 frame = currentFrame + delta;
s32 frame = mFileCell[slot][file].iconAnmCounter + icon->anmDelta;
mFileCell[slot][file].iconAnmCounter = frame;
if ((s16)frame >= icons[slot][file].anmMax) {
if (icon->anmType == 4) {

View File

@@ -60,7 +60,7 @@ namespace ipl {
"A", "B", "B_BtnA",
};
static const char* sTitlePaneNames[] = {"A", "B", "C", "D", "B_BtnA"};
static const char* sTitlePaneNames[] = {"A", "B", "B_BtnA", "C", "D"};
static const char* sAdditionalTitlePaneNames[] = {"B_00", "C_00", "D_00", "B_BtnA"};
static const char* sDialogPaneNames[] = {"B_ArwR", "B_ArwL", "B_CalExit", "B_CalExit_00"};
@@ -934,7 +934,7 @@ namespace ipl {
}
}
extern "C" bool iplSDMemory_containsTitleId(const SDMemory* memory,
extern "C" bool iplSDMemory_813EE358(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_containsTitleId(this, titleId,
if (iplSDMemory_813EE358(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_containsTitleId(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) ||
iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) {
if (iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) ||
iplSDMemory_813EE358(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_containsTitleId(this, nextTitleId,
if (iplSDMemory_813EE358(this, nextTitleId,
mNandTitleIds, mNandTitleCount)) {
mDialogState = 17;
} else {

View File

@@ -107,6 +107,11 @@ namespace ipl {
extern "C" bool iplSDChannelSelect_813DD240(
SDChannelSelect* scene, const s32* requiredBytes, const s32* requiredBlocks,
ESTitleId* titleIds, char* titleNames, u32* titleCount);
extern "C" void iplSDChannelObj_resetDialogAnim(SDChannelObj* channel, int enabled);

View File

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

View File

@@ -268,10 +268,7 @@ static char s_manufacturer[] = "MELCO";
static s32 s_operationState = -1;
static const u8 s_messageId[8] = { 9, 8, 0, 0, 0, 0, 0, 0 };
static u8 s_responseTypeByState[8] = { 9, 8, 0, 0, 0, 0, 0, 0 };
__declspec(section ".sdata2") u16 s_defaultConnection = 0xffff;
__declspec(section ".sdata2") u16 s_defaultOptions = 0xffff;
const u16 s_defaultResponseA = 0;
const u16 s_defaultResponseB = 0;
static const u16 s_defaultOptions[4] = { 0xffff, 0xffff, 0, 0 };
static void* s_responseBuffer;
static s32 s_socketStarted;
@@ -293,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 AOSSValidateInitConfig(AOSSInitInput* input);
int AOSS_813FFD68(AOSSInitInput* input);
int AOSS_CheckAP(AOSSAccessPointRecord* list);
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 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 AOSSi_Init(AOSSInitInput* input) {
int result;
@@ -441,8 +438,8 @@ int AOSS_Init_old(AOSSInitInput* input)
u32 networkAddresses[5];
AOSSPollDescriptor pollArguments[2];
defaultConnection = s_defaultConnection;
defaultResponse = s_defaultOptions;
defaultConnection = s_defaultOptions[0];
defaultResponse = s_defaultOptions[1];
waitIntervals.defaults.connection = defaultConnection;
waitIntervals.defaults.response = defaultResponse;
waitSettings.value = 0;
@@ -655,7 +652,7 @@ int AOSS_Init_old(AOSSInitInput* input)
}
goto finish_initialization;
wait_for_initial_link:
state = AOSSConnectAndAwaitHost(&settings,s_accessPointConfig);
state = AOSS_814020CC(&settings,s_accessPointConfig);
if (state == -1) {
input->status = 0xf;
if (s_accessPointConfig) {
@@ -863,7 +860,7 @@ request_socket_cleanup_complete:
memset(s_accessPointConfig,0,0x58);
initialWait = waitIntervals.limits.connection;
for (waitAttempt = 0; waitAttempt < (short)initialWait; waitAttempt++) {
requestResult = AOSSConnectAndAwaitHost(&settings,s_accessPointConfig);
requestResult = AOSS_814020CC(&settings,s_accessPointConfig);
if (requestResult == -1) {
input->status = 0xf;
if (s_accessPointConfig) {
@@ -953,14 +950,14 @@ request_socket_cleanup_complete:
s_operationState = 2;
AOSSi_Status(2);
}
requestResult = AOSSSendDiscoveryRequest(networkAddresses,&requestRecords,requestResult);
requestResult = AOSS_81401574(networkAddresses,&requestRecords,requestResult);
break;
case 1:
if (s_operationState != 3) {
s_operationState = 3;
AOSSi_Status(3);
}
requestResult = AOSSSendHelloRequest(networkAddresses,&requestRecords,requestResult);
requestResult = AOSS_81401778(networkAddresses,&requestRecords,requestResult);
break;
case 2:
@@ -972,7 +969,7 @@ request_socket_cleanup_complete:
memset(s_responseBuffer,0,0x5dc);
memcpy(messageIdentity,&requestRecords.records[2],8);
manufacturerLength = strlen(s_manufacturer);
AOSSXorBufferWithKey(messageIdentity,8,s_manufacturer,manufacturerLength);
AOSS_81401E80(messageIdentity,8,s_manufacturer,manufacturerLength);
receivedLength = SOHtoNs(1);
packetWords->initialLength = receivedLength;
packetWords->initialType = 0;
@@ -1031,12 +1028,10 @@ request_socket_cleanup_complete:
if (0 < requestResult) goto process_received_packet;
receivedPackets = receivedPackets + 1;
if (receivedPackets > attemptCount) {
if (protocolState == 0) {
s_errorCode = 0xf;
} else if (protocolState == 1) {
s_errorCode = 0x10;
} else {
s_errorCode = 0x11;
switch (protocolState) {
case 0: s_errorCode = 0xf; break;
case 1: s_errorCode = 0x10; break;
default: s_errorCode = 0x11; break;
}
protocolResult = -1;
goto close_protocol_socket;
@@ -1094,7 +1089,7 @@ process_received_packet:
packetBuffer->socket = s_socket;
retryWait = SONtoHs(receivedLength);
packetBuffer->length = retryWait & 0xffff;
requestResult = AOSSDispatchReceiveState(protocolState,packetBuffer,&receivedPackets,&requestRecords,s_socket);
requestResult = AOSS_814001B4(protocolState,packetBuffer,&receivedPackets,&requestRecords,s_socket);
if (requestResult == 100) {
protocolResult = 0;
}
@@ -1211,7 +1206,7 @@ wait_for_packet:
memset(s_accessPointConfig,0,0x58);
initialWait = waitIntervals.limits.connection;
for (waitAttempt = 0; waitAttempt < (short)initialWait; waitAttempt++) {
state = AOSSConnectAndAwaitHost(&settings,s_accessPointConfig);
state = AOSS_814020CC(&settings,s_accessPointConfig);
if (state == -1) {
input->status = 0xf;
if (s_accessPointConfig) {
@@ -1304,12 +1299,10 @@ wait_for_packet:
}
protocolState = requestResult;
if (receivedPackets > waitSettings.halfwords.high) {
if (requestResult == 0) {
s_errorCode = 0xf;
} else if (requestResult == 1) {
s_errorCode = 0x10;
} else {
s_errorCode = 0x11;
switch (requestResult) {
case 0: s_errorCode = 0xf; break;
case 1: s_errorCode = 0x10; break;
default: s_errorCode = 0x11; break;
}
protocolResult = -1;
goto close_protocol_socket;
@@ -1398,7 +1391,7 @@ protocol_socket_cleanup_complete:
resultCode = 0xffffffff;
goto finish_initialization;
} else {
protocolResult = AOSSValidateInitConfig(input);
protocolResult = AOSS_813FFD68(input);
if (protocolResult == 0) goto configuration_success;
{
input->status = 6;
@@ -1421,7 +1414,7 @@ finish_initialization:
return (int)resultCode;
}
int AOSSValidateInitConfig(AOSSInitInput* input) {
int AOSS_813FFD68(AOSSInitInput* input) {
AOSSConfigRecord* config;
u8* output;
u8* cursor;
@@ -1606,7 +1599,7 @@ int AOSS_CheckAP(AOSSAccessPointRecord* list) {
return result;
}
int AOSSDispatchReceiveState(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request, int socket) {
int AOSS_814001B4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request, int socket) {
u16 messageLength = SONtoHs(packet->message.messageLength);
u16 opcode;
@@ -1618,26 +1611,26 @@ int AOSSDispatchReceiveState(int state, AOSSReceiveBuffer* packet, int* count, A
(*count)++;
return state;
}
if (AOSSDecryptMessage((AOSSDecryptionMessage*)&packet->message) > 0) {
if (AOSS_81400830((AOSSDecryptionMessage*)&packet->message) > 0) {
(*count)++;
return state;
}
opcode = SONtoHs(packet->message.opcode);
switch (opcode) {
case 0x1010:
state = AOSSHandleDiscoverReply(state, packet, count, request);
state = AOSS_814002F0(state, packet, count, request);
break;
case 0x2010:
state = AOSSHandleAuthReply(state, packet, count, request);
state = AOSS_814004D0(state, packet, count, request);
break;
case 0x3010:
state = AOSSHandleFinalReply(state, packet, count, request);
state = AOSS_814006A4(state, packet, count, request);
break;
}
return state;
}
int AOSSHandleDiscoverReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int AOSS_814002F0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
AOSSReplyPayload* reply;
AOSSRequestRecord* requestRecord;
size_t manufacturerLength;
@@ -1659,7 +1652,7 @@ int AOSSHandleDiscoverReply(int state, AOSSReceiveBuffer* packet, int* count, AO
manufacturerLength = strlen(s_manufacturer);
reply = &packet->message.payload.reply;
requestRecord = &request->records[0];
AOSSXorBufferWithKey(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
AOSS_81401E80(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
compareResult = memcmp(requestRecord->address, packet->message.payload.manufacturerAddress, 6);
if (compareResult != 0) {
validationResult = -1;
@@ -1693,7 +1686,7 @@ int AOSSHandleDiscoverReply(int state, AOSSReceiveBuffer* packet, int* count, AO
(*count)++;
return state;
}
parserResult = AOSSParseNetworkSettings(&reply->data.optionRecord, s_networkBuffer);
parserResult = AOSS_81400E0C(&reply->data.optionRecord, s_networkBuffer);
if (parserResult < 0) {
if (parserResult == -2) {
s_errorCode = 0x16;
@@ -1712,7 +1705,7 @@ int AOSSHandleDiscoverReply(int state, AOSSReceiveBuffer* packet, int* count, AO
return 1;
}
int AOSSHandleAuthReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int AOSS_814004D0(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
size_t manufacturerLength;
int compareResult;
u16 packetSequence;
@@ -1731,7 +1724,7 @@ int AOSSHandleAuthReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRe
operationResult = 0;
reply = &packet->message.payload.reply;
manufacturerLength = strlen(s_manufacturer);
AOSSXorBufferWithKey(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
AOSS_81401E80(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
compareResult = memcmp(request->records[1].address,
packet->message.payload.manufacturerAddress, 6);
if (compareResult != 0) {
@@ -1763,7 +1756,7 @@ int AOSSHandleAuthReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRe
} else {
memset(&s_configData, 0, sizeof(s_configData));
authType = SONtoHs(packet->message.authType);
operationResult = AOSSApplyAuthOptions(0, (const AOSSReplyOption*)reply, authType, &s_configData,
operationResult = AOSS_814013AC(0, (const AOSSReplyOption*)reply, authType, &s_configData,
s_networkBuffer);
if (operationResult < 0) {
*count = *count + 1;
@@ -1779,7 +1772,7 @@ int AOSSHandleAuthReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRe
return state;
}
int AOSSHandleFinalReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int AOSS_814006A4(int state, AOSSReceiveBuffer* packet, int* count, AOSSRequestRecords* request) {
int result = state;
size_t manufacturerLength;
int compareResult;
@@ -1795,7 +1788,7 @@ int AOSSHandleFinalReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSR
errorCode = 0;
manufacturerLength = strlen(s_manufacturer);
AOSSXorBufferWithKey(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
AOSS_81401E80(&packet->message.payload.manufacturerAddress, 8, s_manufacturer, manufacturerLength);
compareResult = memcmp(request->records[2].address,
packet->message.payload.manufacturerAddress, 6);
if (compareResult != 0) {
@@ -1835,7 +1828,7 @@ int AOSSHandleFinalReply(int state, AOSSReceiveBuffer* packet, int* count, AOSSR
return result;
}
int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
int AOSS_81400830(AOSSDecryptionMessage* message) {
u32 checksum;
u8 manufacturerAddress[8];
AOSSKeySchedule schedule;
@@ -1857,14 +1850,14 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
int result;
memcpy(manufacturerAddress, message->manufacturerAddress, sizeof(manufacturerAddress));
result = AOSSXorBufferWithKey(manufacturerAddress, sizeof(manufacturerAddress), s_manufacturer,
result = AOSS_81401E80(manufacturerAddress, sizeof(manufacturerAddress), s_manufacturer,
strlen(s_manufacturer));
if (result == -1) {
s_errorCode = 2;
return -100;
}
result = AOSSCheckAccessPointName(SONtoHs(message->command), manufacturerAddress);
result = AOSS_81400D34(SONtoHs(message->command), manufacturerAddress);
if (result != 0) {
return result;
}
@@ -1893,7 +1886,7 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
} else {
memcpy(s_packetState.keyNonce, &encrypted->keyNonce, sizeof(encrypted->keyNonce));
memcpy(s_packetState.keyAddress, s_accessPointName, sizeof(s_accessPointName));
AOSSInitKeySchedule(&schedule, s_packetState.keyNonce,
AOSS_81401C9C(&schedule, s_packetState.keyNonce,
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), dataLength);
outputCursor = decryptedData;
@@ -1913,7 +1906,7 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
}
crc = 0xffffffff;
AOSSInitCrc32Table(0, s_crcTable);
AOSS_81401DC0(0, s_crcTable);
for (crcIndex = 0; crcIndex < (s32)dataLength; crcIndex++) {
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[crcIndex]) & 0xff];
}
@@ -1938,7 +1931,7 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
return 0;
}
int AOSSCheckAccessPointName(u16 command, const u8* manufacturerAddress) {
int AOSS_81400D34(u16 command, const u8* manufacturerAddress) {
u8* storedAddress = s_accessPointName;
int result = 0;
int hasAddress = 0;
@@ -1968,7 +1961,7 @@ int AOSSCheckAccessPointName(u16 command, const u8* manufacturerAddress) {
return result;
}
int AOSSParseNetworkSettings(const AOSSOptionRecord* packet, u8* settings) {
int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings) {
const u8* packetBytes = (const u8*)packet;
const AOSSOptionRecord* record;
s32 length;
@@ -2034,7 +2027,7 @@ int AOSSParseNetworkSettings(const AOSSOptionRecord* packet, u8* settings) {
return 0;
}
int AOSSParseWepConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
int AOSS_81401104(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
const u8* packetBytes = (const u8*)packet;
const AOSSOptionRecord* record = (const AOSSOptionRecord*)(packetBytes + 6);
u32 length;
@@ -2106,7 +2099,7 @@ int AOSSParseWepConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config)
return 0;
}
int AOSSParsePskConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
int AOSS_81401284(const AOSSOptionRecord* packet, AOSSStoredConfig* config) {
const u8* packetBytes = (const u8*)packet;
const AOSSOptionRecord* record = (const AOSSOptionRecord*)(packetBytes + 6);
u32 length;
@@ -2153,7 +2146,7 @@ int AOSSParsePskConfig(const AOSSOptionRecord* packet, AOSSStoredConfig* config)
return 0;
}
int AOSSApplyAuthOptions(int state, const AOSSReplyOption* response, int responseLength, void* config, void* networkData) {
int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength, void* config, void* networkData) {
u32 flags = 0;
const AOSSReplyOption* responseRecord;
AOSSConfigRecord* configRecord;
@@ -2197,19 +2190,19 @@ int AOSSApplyAuthOptions(int state, const AOSSReplyOption* response, int respons
do {
switch (option->fields.type) {
case 3:
result = AOSSParseWepConfig((const AOSSOptionRecord*)option, wep40Config);
result = AOSS_81401104((const AOSSOptionRecord*)option, wep40Config);
flags |= 1;
break;
case 4:
result = AOSSParseWepConfig((const AOSSOptionRecord*)option, wep104Config);
result = AOSS_81401104((const AOSSOptionRecord*)option, wep104Config);
flags |= 2;
break;
case 5:
result = AOSSParsePskConfig((const AOSSOptionRecord*)option, tkipConfig);
result = AOSS_81401284((const AOSSOptionRecord*)option, tkipConfig);
flags |= 4;
break;
case 6:
result = AOSSParsePskConfig((const AOSSOptionRecord*)option, aesConfig);
result = AOSS_81401284((const AOSSOptionRecord*)option, aesConfig);
flags |= 8;
break;
case 10:
@@ -2241,7 +2234,7 @@ int AOSSApplyAuthOptions(int state, const AOSSReplyOption* response, int respons
return 0;
}
int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int socket) {
int AOSS_81401574(void* packet, AOSSRequestRecords* request, int socket) {
u8* responsePayload;
u8 accessPointName[8];
AOSSSocketAddress destination;
@@ -2264,7 +2257,7 @@ int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int sock
responsePayload = response->payload;
memcpy(s_accessPointName, &request->records[0], 8);
memcpy(accessPointName, s_accessPointName, 8);
recordLength = AOSSBuildInterfaceOption(&requestRecord->record);
recordLength = AOSS_81401BBC(&requestRecord->record);
if (recordLength < 0) {
s_errorCode = 3;
if (requestRecord != 0) {
@@ -2276,7 +2269,7 @@ int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int sock
requestRecord->length = SOHtoNs(recordLength);
requestLength = recordLength + 4;
memcpy(responsePayload, requestRecord, requestLength);
encryptionResult = AOSSXorBufferWithKey(accessPointName, 8, s_manufacturer, 6);
encryptionResult = AOSS_81401E80(accessPointName, 8, s_manufacturer, 6);
if (encryptionResult != 0) {
s_errorCode = 2;
if (requestRecord != 0) {
@@ -2309,7 +2302,7 @@ int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int sock
return result;
}
int AOSSSendHelloRequest(void* packet, void* request, int socket) {
int AOSS_81401778(void* packet, void* request, int socket) {
AOSSHelloPacket* response = (AOSSHelloPacket*)s_responseBuffer;
AOSSHelloPayload* payload;
AOSSRequestRecords* requestRecords = (AOSSRequestRecords*)request;
@@ -2350,7 +2343,7 @@ int AOSSSendHelloRequest(void* packet, void* request, int socket) {
const u32* crcTable;
sequence = 1;
checksum = 0xffffffff;
AOSSInitCrc32Table(0, s_crcTable);
AOSS_81401DC0(0, s_crcTable);
crcTable = s_crcTable;
{
u32 part;
@@ -2368,7 +2361,7 @@ int AOSSSendHelloRequest(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);
AOSSInitKeySchedule(&construction.schedule, s_packetState.keyNonce,
AOSS_81401C9C(&construction.schedule, s_packetState.keyNonce,
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), 8);
for (index = 0; index < 8; index++) {
state = construction.schedule.bytes;
@@ -2393,7 +2386,7 @@ int AOSSSendHelloRequest(void* packet, void* request, int socket) {
}
memcpy(construction.accessPointName, &requestRecords->records[1], 8);
encryptionResult = AOSSXorBufferWithKey(construction.accessPointName, 8, s_manufacturer, 6);
encryptionResult = AOSS_81401E80(construction.accessPointName, 8, s_manufacturer, 6);
if (encryptionResult != 0) {
s_errorCode = 2;
return -1;
@@ -2422,7 +2415,7 @@ int AOSSSendHelloRequest(void* packet, void* request, int socket) {
return 0;
}
s16 AOSSBuildInterfaceOption(void* buffer) {
s16 AOSS_81401BBC(void* buffer) {
AOSSOptionRecord* record = (AOSSOptionRecord*)buffer;
u32 optionValue;
s16 dataLength;
@@ -2446,7 +2439,7 @@ s16 AOSSBuildInterfaceOption(void* buffer) {
return (s16)(dataLength + 10);
}
void AOSSInitKeySchedule(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32 stateLength) {
void AOSS_81401C9C(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32 stateLength) {
u32 index = 0;
u32 keyIndex;
u32 swapIndex;
@@ -2478,7 +2471,7 @@ void AOSSInitKeySchedule(AOSSKeySchedule* schedule, const u8* key, u32 keyLength
}
}
void AOSSInitCrc32Table(u32 seed, u32* table) {
void AOSS_81401DC0(u32 seed, u32* table) {
u32 index;
u32 value;
@@ -2495,7 +2488,7 @@ void AOSSInitCrc32Table(u32 seed, u32* table) {
}
}
int AOSSXorBufferWithKey(void* packet, s32 length, char* key, int keyLength) {
int AOSS_81401E80(void* packet, s32 length, char* key, int keyLength) {
u8* temporaryHalf;
s32 halfLength = length / 2;
u8* packetHalf;
@@ -2549,7 +2542,7 @@ int AOSSXorBufferWithKey(void* packet, s32 length, char* key, int keyLength) {
return result;
}
int AOSSConnectAndAwaitHost(void* settings, void* config) {
int AOSS_814020CC(void* settings, void* config) {
s32 connectionAttempts = 0;
u32 ticksPerMillisecond;

View File

@@ -3,17 +3,17 @@
#include <private/wd.h>
#include <string.h>
s32 AOSSi_cancel_flag = 0;
static u8 ipAddress[4] = {0};
static u8 ipNetmask[4] = {0};
static u8 ipGateway[4] = {0};
static u8 primaryDns[4] = {0};
static u8 secondaryDns[4] = {0};
static void* (*allocateMemory)(u32, s32) = NULL;
static void (*releaseMemory)(u32, void*, s32) = NULL;
static void (*statusCallback)(void) = NULL;
static NCDIfConfig AOSSi_NcdIfConfig;
static NCDIpConfig AOSSi_NcdIpConfig;
s32 AOSSi_cancel_flag;
static u8 ipAddress[4];
static u8 ipNetmask[4];
static u8 ipGateway[4];
static u8 primaryDns[4];
static u8 secondaryDns[4];
static void* (*allocateMemory)(u32, s32);
static void (*releaseMemory)(u32, void*, s32);
static void (*statusCallback)(void);
static NCDIfConfig AOSS_810BD4A8;
static NCDIpConfig AOSS_810BD608;
struct AOSSRate {
u16 mask;
@@ -34,7 +34,7 @@ struct AOSSAccessPoint {
u8 bssid[6];
u16 capabilities;
u32 rateCount;
u8 rates[16];
u8 rates[12];
u32 beaconPeriod;
u32 mode;
};
@@ -60,11 +60,11 @@ void AOSSi_Cancel(void) {
AOSSi_cancel_flag = 1;
}
void AOSSi_SleepAlarmHandler(OSAlarm* alarm, OSContext* context) {
void AOSS_813FD17C(OSAlarm* alarm, OSContext* context) {
OSSendMessage((OSMessageQueue*)alarm->tag, NULL, 0);
}
void AOSSi_SleepMs(u32 milliseconds) {
void AOSS_813FD18C(u32 milliseconds) {
OSMessage storage;
OSMessage message;
OSMessageQueue queue;
@@ -72,7 +72,7 @@ void AOSSi_SleepMs(u32 milliseconds) {
OSInitMessageQueue(&queue, &storage, 1);
OSCreateAlarm(&alarm);
OSSetAlarmTag(&alarm, (u32)&queue);
OSSetAlarm(&alarm, (u32)(milliseconds * (OS_TIMER_CLOCK / 1000)), AOSSi_SleepAlarmHandler);
OSSetAlarm(&alarm, (u32)(milliseconds * (OS_TIMER_CLOCK / 1000)), AOSS_813FD17C);
OSReceiveMessage(&queue, &message, 1);
}
@@ -84,12 +84,12 @@ void* AOSSi_Alloc(u32 size) {
}
void AOSSi_Free(void* block) {
if (releaseMemory) {
if (releaseMemory != NULL) {
releaseMemory(0, block, 0);
}
}
void AOSSi_StoreIpv4Octets(u8* destination, u32 address) {
void AOSS_813FD25C(u8* destination, u32 address) {
int index;
for (index = 0; index < 4; ++index) {
*destination++ = address >> ((3 - index) * 8);
@@ -97,11 +97,11 @@ void AOSSi_StoreIpv4Octets(u8* destination, u32 address) {
}
int AOSSi_SetNCDIPAddr(u32 address, u32 netmask, u32 gateway, u32 dns1, u32 dns2) {
AOSSi_StoreIpv4Octets(ipAddress, address);
AOSSi_StoreIpv4Octets(ipNetmask, netmask);
AOSSi_StoreIpv4Octets(ipGateway, gateway);
AOSSi_StoreIpv4Octets(primaryDns, dns1);
AOSSi_StoreIpv4Octets(secondaryDns, dns2);
AOSS_813FD25C(ipAddress, address);
AOSS_813FD25C(ipNetmask, netmask);
AOSS_813FD25C(ipGateway, gateway);
AOSS_813FD25C(primaryDns, dns1);
AOSS_813FD25C(secondaryDns, dns2);
return 0;
}
@@ -128,17 +128,16 @@ int AOSSi_EndLocal(void) {
int AOSSi_WLANGetBSSList(struct AOSSAccessPointList** output) {
int result = -1;
int startupRetries = 0;
int scanRetries = 0;
int cleanupRetries = 0;
int unlockRetries = 0;
int driver;
u8* buffer;
u8 macAddress[6];
WDScanParam scan ATTRIBUTE_ALIGN(32);
WD_Info info ATTRIBUTE_ALIGN(32);
int startupRetries = 0;
int unlockRetries = 0;
int cleanupRetries = 0;
int scanRetries = 0;
if (!allocateMemory || !releaseMemory) {
WDScanParam scan;
u8 macAddress[6];
if (allocateMemory == NULL || releaseMemory == NULL) {
return -1;
}
driver = NCDLockWirelessDriver();
@@ -151,14 +150,14 @@ startup:
goto unlock;
}
++startupRetries;
AOSSi_SleepMs(10);
AOSS_813FD18C(10);
goto startup;
}
if (WD_GetInfo(&info) == 0) {
memcpy(macAddress, info.MAC, 6);
}
buffer = AOSSi_Alloc(0x3200);
if (buffer) {
if (buffer != NULL) {
memset(buffer, 0, 0x3200);
scan.channelBit = info.enableChannel;
scan.maxChannelTime = 40;
@@ -168,47 +167,48 @@ startup:
memset(scan.ssid, 0, 32);
memset(scan.ssidMask, 255, 32);
while (1) {
int count = WD_Scan(&scan, buffer, 0x3200);
int scanResult = WD_Scan(&scan, buffer, 0x3200);
int count;
struct AOSSAccessPointList* list;
WDBssDesc* descriptor;
int index;
if (count != 0 && count != WD_INTERNAL_ERR_4) {
if (scanResult != 0 && scanResult != WD_INTERNAL_ERR_4) {
break;
}
count = *(u16*)buffer;
if (count != 0) {
list = AOSSi_Alloc(sizeof(*list) + (count - 1) * sizeof(struct AOSSAccessPoint));
if (!list) {
if (list == NULL) {
result = -1;
break;
}
list->count = count;
descriptor = (WDBssDesc*)&buffer[2];
for (index = 0; index < count; ++index) {
struct AOSSAccessPoint* accessPoint = &list->accessPoints[index];
int rate;
int rateCount;
list->accessPoints[index].ssidLength = descriptor->ssidLength;
memcpy(list->accessPoints[index].ssid, descriptor->ssid, 32);
list->accessPoints[index].channel = descriptor->channel;
memcpy(list->accessPoints[index].bssid, descriptor->bssid, 6);
rateCount = 0;
int rateCount = 0;
accessPoint->ssidLength = descriptor->ssidLength;
memcpy(accessPoint->ssid, descriptor->ssid, 32);
accessPoint->channel = descriptor->channel;
memcpy(accessPoint->bssid, descriptor->bssid, 6);
for (rate = 0; rate < 12; ++rate) {
if (descriptor->rateSet.support & supportedRates[rate].mask) {
list->accessPoints[index].rates[rateCount] = supportedRates[rate].value;
accessPoint->rates[rateCount] = supportedRates[rate].value;
if (descriptor->rateSet.basic & supportedRates[rate].mask) {
list->accessPoints[index].rates[rateCount] |= 128;
accessPoint->rates[rateCount] |= 128;
}
++rateCount;
}
}
list->accessPoints[index].rateCount = rateCount;
list->accessPoints[index].beaconPeriod = descriptor->beaconPeriod;
accessPoint->rateCount = rateCount;
accessPoint->beaconPeriod = descriptor->beaconPeriod;
if ((descriptor->capabilities & 3) == 1) {
list->accessPoints[index].mode = 1;
accessPoint->mode = 1;
} else if ((descriptor->capabilities & 3) == 2) {
list->accessPoints[index].mode = 2;
accessPoint->mode = 2;
} else {
list->accessPoints[index].mode = 0;
accessPoint->mode = 0;
}
descriptor = (WDBssDesc*)((u16*)descriptor + descriptor->length);
}
@@ -222,7 +222,7 @@ startup:
}
if (++scanRetries > 10) {
list = AOSSi_Alloc(sizeof(*list));
if (!list) {
if (list == NULL) {
result = -1;
break;
}
@@ -231,34 +231,38 @@ startup:
*output = list;
break;
}
AOSSi_SleepMs(100);
AOSS_813FD18C(100);
}
AOSSi_Free(buffer);
}
while (WD_Cleanup() != 0) {
cleanup:
if (WD_Cleanup() != 0) {
if (cleanupRetries > 10) {
result = -1;
goto unlock;
}
++cleanupRetries;
AOSSi_SleepMs(10);
AOSS_813FD18C(10);
goto cleanup;
}
unlock:
while (NCDUnlockWirelessDriver(driver) != 0) {
if (NCDUnlockWirelessDriver(driver) != 0) {
if (unlockRetries > 10) {
result = -1;
return -1;
}
++unlockRetries;
AOSSi_SleepMs(10);
AOSS_813FD18C(10);
goto unlock;
}
return result;
}
int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionStatus* status) {
int retries = 0;
int result = 0;
WD_Info info ATTRIBUTE_ALIGN(32);
NCDIfConfig* interfaceConfig = &AOSSi_NcdIfConfig;
NCDIfConfig* interfaceConfig = &AOSS_810BD4A8;
NCDIpConfig* ipConfig;
memset(interfaceConfig, 0, sizeof(*interfaceConfig));
interfaceConfig->selectedMedia = 1;
@@ -284,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 = &AOSSi_NcdIpConfig;
ipConfig = &AOSS_810BD608;
memset(ipConfig, 0, sizeof(*ipConfig));
ipConfig->adjust.maxTransferUnit = 1300;
ipConfig->adjust.tcpRetransTimeout = 100;
@@ -299,11 +303,10 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
if (NCDSetIpConfig(ipConfig) != 0) {
result = -1;
}
if (result == 0 && NCDSetIfConfig(&AOSSi_NcdIfConfig) != 0) {
if (result == 0 && NCDSetIfConfig(&AOSS_810BD4A8) != 0) {
result = -1;
}
if (result == 0) {
int retries = 0;
while (!NCDIsInterfaceDecided()) {
if (AOSSi_cancel_flag == 1) {
result = -1;
@@ -314,7 +317,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
break;
}
++retries;
AOSSi_SleepMs(10);
AOSS_813FD18C(10);
}
}
if (result == 0) {
@@ -322,11 +325,9 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
if (WD_GetInfo(&info) == 0) {
status->channel = info.channel;
}
{
u16 ssidLength = interfaceConfig->netif.wireless.config.manual.ssidLength;
status->ssidLength = ssidLength;
memcpy(status->ssid, interfaceConfig->netif.wireless.config.manual.ssid, ssidLength);
}
status->ssidLength = interfaceConfig->netif.wireless.config.manual.ssidLength;
memcpy(status->ssid, interfaceConfig->netif.wireless.config.manual.ssid,
interfaceConfig->netif.wireless.config.manual.ssidLength);
} else {
status->connected = 0;
}
@@ -334,7 +335,7 @@ int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionSt
}
void AOSSi_Sleep(u32 milliseconds) {
AOSSi_SleepMs(milliseconds);
AOSS_813FD18C(milliseconds);
}
int AOSSi_Status(void) {

View File

@@ -505,13 +505,11 @@ typedef void* (*AtermAllocateCallback)(u32);
typedef void (*AtermFreeCallback)(void*);
AtermNetworkSettings gNetworkSettings;
AtermThreadBuffer gAtermResponseBuffer;
static OSThread AtermThread;
char gAccessPointName[0x24];
AtermScanSettings gScanSettings;
AtermConfigurationResult gAtermConfigurationResult;
u8* gAtermRequestOptions = gAtermResponseBuffer.data;
AtermThreadBuffer gAtermResponseBuffer;
static OSThread sAtermThread;
u32 gAtermDeadline = 0xFFFFFFFF;
u32 gAtermScanLimit = 0x40;
u32 gAtermScanBufferSize = 0x800;
@@ -524,7 +522,7 @@ char gAtermAossSsid[7] = "******";
extern u32 gAtermUseSharedAddress;
extern char gAtermProductName[5];
u32 gAtermCancelRequested;
u8 gAtermSelectedBssid[8];
u8 gAtermSelectedBssid[6];
u32 gAtermProtocolState;
u8 gAtermAddressBuffer[8];
u32 gAtermResponseMode;
@@ -539,57 +537,23 @@ void* gAtermAllocation;
AtermFreeCallback gAtermRelease;
AtermAllocateCallback gAtermAllocate;
AtermProgressCallback gAtermProgressCallback;
typedef struct {
u8 challenge[8];
u8 digest[16];
} AtermAuthenticationData;
typedef struct {
union {
u8 payload[0x800];
AtermDecodedPayload decoded;
};
union {
AtermAuthenticationData data;
u8 keyMaterial[24];
};
} AtermAuthentication;
typedef struct {
char ssid[32];
u32 setupMode;
u32 securityMode;
u8 reserved028[0x80];
u8 keyMaterial[0x40];
u8 connectionPrefix[0x10];
u8 packetBuffer[0x800];
AtermAuthentication authentication;
} AtermGlobalsConfiguration;
typedef struct {
AtermNetworkSettings networkSettings;
char accessPointName[0x24];
AtermScanSettings scanSettings;
AtermGlobalsConfiguration configuration;
} AtermGlobals;
u32 gAtermResult;
s32 gAtermState;
void ATERMAlarmWakeQueue(OSAlarm* alarm, OSContext* context);
s32 ATERMRunConfigProtocol(void);
void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length);
void ATERM_8140684C(OSAlarm* alarm, OSContext* context);
s32 ATERM_814038C8(void);
void ATERM_81405ACC(AtermMd5Context* context, void* input, u32 length);
extern u8 gAtermDigestFill[64];
extern u8* gAtermRequestOptions;
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_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 ATERMStartNetworkStack(void) {
int ATERM_814021BC(void) {
int status;
int waitCount = 0;
u32 convertedHost;
@@ -641,7 +605,7 @@ int ATERMStartNetworkStack(void) {
OSCreateAlarm(&interfaceAlarm);
OSSetAlarmTag(&interfaceAlarm, (u32)&interfaceQueue);
timeoutTicks = (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10;
OSSetAlarm(&interfaceAlarm, timeoutTicks, ATERMAlarmWakeQueue);
OSSetAlarm(&interfaceAlarm, timeoutTicks, ATERM_8140684C);
OSReceiveMessage(&interfaceQueue, &interfaceMessage, 1);
}
@@ -657,7 +621,7 @@ int ATERMStartNetworkStack(void) {
OSCreateAlarm(&hostAlarm);
OSSetAlarmTag(&hostAlarm, (u32)&hostQueue);
timeoutTicks = (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10;
OSSetAlarm(&hostAlarm, timeoutTicks, ATERMAlarmWakeQueue);
OSSetAlarm(&hostAlarm, timeoutTicks, ATERM_8140684C);
OSReceiveMessage(&hostQueue, &hostMessage, 1);
}
} else {
@@ -667,7 +631,7 @@ int ATERMStartNetworkStack(void) {
return waitCount;
}
int ATERMScanAccessPoints(u16* resultBuffer, u32 resultBufferLength) {
int ATERM_81402424(u16* resultBuffer, u32 resultBufferLength) {
int lockId;
int result = -2;
u16* scanBuffer = resultBuffer;
@@ -714,7 +678,7 @@ int ATERMScanAccessPoints(u16* resultBuffer, u32 resultBufferLength) {
OSCreateAlarm(&startupAlarm);
OSSetAlarmTag(&startupAlarm, (u32)&startupQueue);
OSSetAlarm(&startupAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&startupQueue, &startupMessage, 1);
} while (1);
@@ -755,7 +719,7 @@ int ATERMScanAccessPoints(u16* resultBuffer, u32 resultBufferLength) {
OSCreateAlarm(&scanAlarm);
OSSetAlarmTag(&scanAlarm, (u32)&scanQueue);
OSSetAlarm(&scanAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&scanQueue, &scanMessage, 1);
}
@@ -773,7 +737,7 @@ cleanup_driver:
OSCreateAlarm(&cleanupAlarm);
OSSetAlarmTag(&cleanupAlarm, (u32)&cleanupQueue);
OSSetAlarm(&cleanupAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&cleanupQueue, &cleanupMessage, 1);
}
@@ -788,7 +752,7 @@ unlock_driver:
OSCreateAlarm(&unlockAlarm);
OSSetAlarmTag(&unlockAlarm, (u32)&unlockQueue);
OSSetAlarm(&unlockAlarm, (__mulhwu(0x10624DD3, *(u32*)0x800000F8 >> 2) >> 6) * 10,
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&unlockQueue, &unlockMessage, 1);
}
}
@@ -796,7 +760,7 @@ unlock_driver:
return result;
}
int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet* previousRecords,
int ATERM_8140276C(AtermApRecordSet* currentRecords, AtermApRecordSet* previousRecords,
u32* changedIndex) {
u32 previousIndex;
u32 currentIndex = 0;
@@ -905,7 +869,7 @@ int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet*
return result;
}
int ATERMDiscoverAccessPoints(void) {
int ATERM_81402A24(void) {
s32 result = -1;
u32 scanBufferBytes;
u32 recordIndex;
@@ -948,7 +912,7 @@ int ATERMDiscoverAccessPoints(void) {
break;
}
result = ATERMScanAccessPoints((u16*)scanBuffer, scanBufferBytes);
result = ATERM_81402424((u16*)scanBuffer, scanBufferBytes);
if (result < 0) {
goto cleanup;
}
@@ -990,7 +954,7 @@ int ATERMDiscoverAccessPoints(void) {
currentRecords->count = result;
if (gAtermState != 1 &&
ATERMFindChangedApRecord(currentRecords, previousRecords, (u32*)&progressInfo[0])) {
ATERM_8140276C(currentRecords, previousRecords, (u32*)&progressInfo[0])) {
AtermApRecord* selectedRecord;
gAtermSelectedRecordIndex = progressInfo[0];
selectedRecord = &currentRecords->entries[progressInfo[0]];
@@ -1072,7 +1036,7 @@ cleanup:
return result;
}
int ATERMBuildEncryptedMessage(u16* messageBuffer, u32 sequence, u16* payload, size_t payloadLength,
int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloadLength,
void* encryptionKey) {
u8* end;
u8* cursor;
@@ -1081,7 +1045,7 @@ int ATERMBuildEncryptedMessage(u16* messageBuffer, u32 sequence, u16* payload, s
memset(payload, 0, 8);
payload[0] = SOHtoNs((payloadLength - 8) & 0xFFFF);
if (encryptionKey != NULL) {
ATERMAesKeyWrap(messageBuffer + 3, payload, payloadLength, encryptionKey, 0x10);
ATERM_81404844(messageBuffer + 3, payload, payloadLength, encryptionKey, 0x10);
payloadLength += 8;
} else {
memcpy(messageBuffer + 3, payload, payloadLength);
@@ -1100,7 +1064,7 @@ int ATERMBuildEncryptedMessage(u16* messageBuffer, u32 sequence, u16* payload, s
return (int)(end + sizeof(u16) - (u8*)messageBuffer);
}
int ATERMParsePacket(AtermPacket* packet, u32* setupType) {
int ATERM_81402FC0(AtermPacket* packet, u32* setupType) {
u8* cursor;
u8* end;
u8* payload;
@@ -1178,7 +1142,7 @@ int ATERMParsePacket(AtermPacket* packet, u32* setupType) {
return 0;
}
int ATERMBuildAssociationRequest(AtermAssociationRequest* request) {
int ATERM_814031DC(AtermAssociationRequest* request) {
u8 scanAddress[8];
u8 interfaceMacAddress[8];
char interfaceMacText[32];
@@ -1263,7 +1227,7 @@ int ATERMBuildAssociationRequest(AtermAssociationRequest* request) {
return 1;
}
int ATERMParseAssociationResponse(u16* response) {
int ATERM_814033F0(u16* response) {
u16* optionCursor = response + 4;
u8* optionValue;
u16* responseEnd;
@@ -1353,7 +1317,7 @@ int ATERMParseAssociationResponse(u16* response) {
return result;
}
int ATERMParseHexBytes(u8* destination, const char* source, s32 length) {
int ATERM_81403614(u8* destination, const char* source, s32 length) {
s32 value = 0;
s32 characterIndex = 0;
@@ -1385,7 +1349,7 @@ int ATERMParseHexBytes(u8* destination, const char* source, s32 length) {
return 1;
}
int ATERMApplyScanSecuritySettings(void) {
int ATERM_814036D8(void) {
s32 result = 1;
char* sourceKey;
char* outputKey;
@@ -1425,7 +1389,7 @@ int ATERMApplyScanSecuritySettings(void) {
break;
case 10:
gAtermConfigurationResult.setupMode = 1;
ATERMParseHexBytes((u8*)outputKey, keyString, 10);
ATERM_81403614((u8*)outputKey, keyString, 10);
break;
case 13:
gAtermConfigurationResult.setupMode = 2;
@@ -1433,7 +1397,7 @@ int ATERMApplyScanSecuritySettings(void) {
break;
case 26:
gAtermConfigurationResult.setupMode = 2;
ATERMParseHexBytes((u8*)outputKey, keyString, 0x1A);
ATERM_81403614((u8*)outputKey, keyString, 0x1A);
break;
case 16:
gAtermConfigurationResult.setupMode = 3;
@@ -1441,7 +1405,7 @@ int ATERMApplyScanSecuritySettings(void) {
break;
case 32:
gAtermConfigurationResult.setupMode = 3;
ATERMParseHexBytes((u8*)outputKey, keyString, 0x20);
ATERM_81403614((u8*)outputKey, keyString, 0x20);
break;
default:
result = -7;
@@ -1468,17 +1432,15 @@ int ATERMApplyScanSecuritySettings(void) {
return result;
}
s32 ATERMRunConfigProtocol(void) {
s32 ATERM_814038C8(void) {
OSMessageQueue waitQueue;
OSMessage waitBuffer[1];
OSMessage waitMessage;
OSAlarm waitAlarm;
AtermSocketAddress socketBindAddress;
AtermSocketAddress peerAddress;
AtermGlobals* globals = (AtermGlobals*)&gNetworkSettings;
void* sessionKey = globals->configuration.authentication.keyMaterial;
AtermAuthenticationData* authData = &globals->configuration.authentication.data;
u32 messageLength;
AtermThreadBuffer* response = (AtermThreadBuffer*)&gAtermConfigurationResult.responseLength;
void* sessionKey = gAtermResponseBuffer.session.keyMaterial;
AtermMd5Context digestContext;
u8 digestLength[8];
s32 socket = 0;
@@ -1497,7 +1459,7 @@ s32 ATERMRunConfigProtocol(void) {
OSSetAlarmTag(&waitAlarm, (u32)&waitQueue);
OSSetAlarm(&waitAlarm,
(__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6) * 500,
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&waitQueue, &waitMessage, 1);
switch (gAtermProtocolState) {
case 0:
@@ -1505,7 +1467,7 @@ s32 ATERMRunConfigProtocol(void) {
case 1:
{
AtermProgress progress;
result = ATERMDiscoverAccessPoints();
result = ATERM_81402A24();
if (result != 1) {
failed = 1;
break;
@@ -1523,7 +1485,7 @@ s32 ATERMRunConfigProtocol(void) {
break;
}
case 2:
result = ATERMStartNetworkStack();
result = ATERM_814021BC();
if (result != 1) {
failed = 1;
break;
@@ -1563,11 +1525,11 @@ s32 ATERMRunConfigProtocol(void) {
break;
}
peerAddress.length = 8;
ATERMBuildAssociationRequest((AtermAssociationRequest*)globals->configuration.connectionPrefix);
receivedLength = SORecvFrom(socket, globals->configuration.packetBuffer,
sizeof(globals->configuration.packetBuffer), 4, &peerAddress);
ATERM_814031DC((AtermAssociationRequest*)gAtermConfigurationResult.connectionPrefix);
receivedLength = SORecvFrom(socket, gAtermConfigurationResult.packetBuffer,
sizeof(gAtermConfigurationResult.packetBuffer), 4, &peerAddress);
if (receivedLength > 0 &&
ATERMParsePacket((AtermPacket*)globals->configuration.packetBuffer, &gAtermResponseMode)) {
ATERM_81402FC0((AtermPacket*)gAtermConfigurationResult.packetBuffer, &gAtermResponseMode)) {
AtermProgress progress;
gAtermDeadline = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6)) + 30000;
gAtermProtocolState = 5;
@@ -1584,29 +1546,30 @@ s32 ATERMRunConfigProtocol(void) {
break;
case 5:
{
u8 optionIds[7] = "\006\000\001\002\003\004\005";
u8 optionIds[7] = {6, 0, 1, 2, 3, 4, 5};
AtermRequestOption8* shortOption = (AtermRequestOption8*)gAtermRequestOptions;
AtermRequestOption16* longOption;
u16 enabled = SOHtoNs(1);
AtermSocketAddress sendAddress;
u8* optionEnd;
memset(&shortOption[0], 0, 4);
shortOption[0].type = SOHtoNs(1);
shortOption[0].length = SOHtoNs(2);
memset(shortOption[0].value, 0, sizeof(shortOption[0].value));
memcpy(shortOption[0].value, &enabled, sizeof(enabled));
memset(&shortOption[1], 0, 4);
shortOption[1].type = SOHtoNs(2);
shortOption[1].length = SOHtoNs(2);
memset(shortOption[1].value, 0, sizeof(shortOption[1].value));
memcpy(shortOption[1].value, &enabled, sizeof(enabled));
memset(shortOption, 0, 4);
shortOption->type = SOHtoNs(1);
shortOption->length = SOHtoNs(2);
memset(shortOption->value, 0, sizeof(shortOption->value));
memcpy(shortOption->value, &enabled, sizeof(enabled));
shortOption++;
memset(shortOption, 0, 4);
shortOption->type = SOHtoNs(2);
shortOption->length = SOHtoNs(2);
memset(shortOption->value, 0, sizeof(shortOption->value));
memcpy(shortOption->value, &enabled, sizeof(enabled));
shortOption++;
if (gAtermResponseMode != 0) {
memset(&shortOption[1], 0, 4);
shortOption[1].type = SOHtoNs(5);
shortOption[1].length = SOHtoNs(2);
memset(shortOption[1].value, 0, sizeof(shortOption[1].value));
memcpy(shortOption[1].value, &enabled, sizeof(enabled));
memset(shortOption, 0, 4);
shortOption->type = SOHtoNs(5);
shortOption->length = SOHtoNs(2);
memset(shortOption->value, 0, sizeof(shortOption->value));
memcpy(shortOption->value, &enabled, sizeof(enabled));
shortOption++;
}
longOption = (AtermRequestOption16*)shortOption;
@@ -1625,14 +1588,13 @@ s32 ATERMRunConfigProtocol(void) {
longOption++;
}
optionEnd = (u8*)longOption;
messageLength = ATERMBuildEncryptedMessage((u16*)globals->configuration.packetBuffer, 2,
(u16*)globals->configuration.authentication.decoded.options, optionEnd - gAtermRequestOptions + 8, NULL);
gAtermMessageLength = ATERM_81402E40((u16*)gAtermConfigurationResult.packetBuffer, 2,
(u16*)response->data, optionEnd - gAtermRequestOptions + 8, NULL);
sendAddress.length = 8;
sendAddress.family = 2;
sendAddress.address = 0xFFFFFFFF;
sendAddress.port = SOHtoNs(0xE601);
gAtermMessageLength = messageLength;
SOSendTo(socket, globals->configuration.packetBuffer, messageLength, 0, &sendAddress);
SOSendTo(socket, gAtermConfigurationResult.packetBuffer, gAtermMessageLength, 0, &sendAddress);
lastSendTime = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
gAtermProtocolState = 6;
break;
@@ -1645,14 +1607,14 @@ s32 ATERMRunConfigProtocol(void) {
failed = 1;
break;
}
receivedLength = SORecvFrom(socket, globals->configuration.packetBuffer,
sizeof(globals->configuration.packetBuffer), 4, &peerAddress);
receivedLength = SORecvFrom(socket, gAtermConfigurationResult.packetBuffer,
sizeof(gAtermConfigurationResult.packetBuffer), 4, &peerAddress);
if (receivedLength > 0) {
AtermPacket* packet = (AtermPacket*)globals->configuration.packetBuffer;
AtermPacket* packet = (AtermPacket*)gAtermConfigurationResult.packetBuffer;
s32 sequence = SONtoHs(packet->sequence);
s32 payloadLength = SONtoHs(packet->length);
u32 checksum = 0;
u8* cursor = globals->configuration.packetBuffer;
u8* cursor = gAtermConfigurationResult.packetBuffer;
u8* packetEnd = packet->payload + payloadLength;
u8* payload = packet->payload;
for (; cursor < packetEnd; cursor++) {
@@ -1665,16 +1627,16 @@ s32 ATERMRunConfigProtocol(void) {
payloadLength = 0;
} else if (sequence != 3) {
payloadLength = 0;
} else if (globals->configuration.connectionPrefix != NULL) {
ATERMAesKeyUnwrap((u16*)globals->configuration.authentication.payload, (u16*)payload,
payloadLength, globals->configuration.connectionPrefix, 16);
} else if (gAtermConfigurationResult.connectionPrefix != NULL) {
ATERM_81404A18((u16*)response->authentication.payload, (u16*)payload,
payloadLength, gAtermConfigurationResult.connectionPrefix, 16);
payloadLength -= 8;
} else {
memcpy(globals->configuration.authentication.payload, payload, payloadLength);
memcpy(response->authentication.payload, payload, payloadLength);
}
if (payloadLength != 0) {
AtermPacketOption* option = (AtermPacketOption*)globals->configuration.authentication.decoded.options;
u8* optionEnd = (u8*)option + SONtoHs(globals->configuration.authentication.decoded.length);
AtermPacketOption* option = (AtermPacketOption*)response->authentication.decoded.options;
u8* optionEnd = (u8*)option + SONtoHs(response->authentication.decoded.length);
s32 optionType;
u8* optionValue;
if ((u8*)option >= optionEnd) {
@@ -1690,7 +1652,7 @@ s32 ATERMRunConfigProtocol(void) {
(__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
u32 index;
u32 digestBytes;
memcpy(authData->challenge,
memcpy(response->authentication.challenge,
optionValue, 8);
digestContext.bitCountHigh = 0;
digestContext.bitCountLow = 0;
@@ -1698,7 +1660,7 @@ s32 ATERMRunConfigProtocol(void) {
digestContext.state[1] = 0xEFCDAB89;
digestContext.state[2] = 0x98BADCFE;
digestContext.state[3] = 0x10325476;
ATERMMd5Update(&digestContext, &authenticationTime, sizeof(authenticationTime));
ATERM_81405ACC(&digestContext, &authenticationTime, sizeof(authenticationTime));
digestLength[0] = digestContext.bitCountLow;
digestLength[1] = digestContext.bitCountLow >> 8;
digestLength[2] = digestContext.bitCountLow >> 16;
@@ -1708,32 +1670,25 @@ s32 ATERMRunConfigProtocol(void) {
digestLength[6] = digestContext.bitCountHigh >> 16;
digestLength[7] = digestContext.bitCountHigh >> 24;
digestBytes = (digestContext.bitCountLow >> 3) & 0x3F;
ATERMMd5Update(&digestContext, gAtermDigestFill,
ATERM_81405ACC(&digestContext, gAtermDigestFill,
digestBytes < 56 ? 56 - digestBytes : 120 - digestBytes);
ATERMMd5Update(&digestContext, digestLength, sizeof(digestLength));
{
u8* digest = authData->digest;
u32 state = digestContext.state[0];
digest[0] = state;
digest[1] = state >> 8;
digest[2] = state >> 16;
digest[3] = state >> 24;
state = digestContext.state[1];
digest[4] = state;
digest[5] = state >> 8;
digest[6] = state >> 16;
digest[7] = state >> 24;
state = digestContext.state[2];
digest[8] = state;
digest[9] = state >> 8;
digest[10] = state >> 16;
digest[11] = state >> 24;
state = digestContext.state[3];
digest[12] = state;
digest[13] = state >> 8;
digest[14] = state >> 16;
digest[15] = state >> 24;
}
ATERM_81405ACC(&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;
response->authentication.digest[3] = digestContext.state[0] >> 24;
response->authentication.digest[4] = digestContext.state[1];
response->authentication.digest[5] = digestContext.state[1] >> 8;
response->authentication.digest[6] = digestContext.state[1] >> 16;
response->authentication.digest[7] = digestContext.state[1] >> 24;
response->authentication.digest[8] = digestContext.state[2];
response->authentication.digest[9] = digestContext.state[2] >> 8;
response->authentication.digest[10] = digestContext.state[2] >> 16;
response->authentication.digest[11] = digestContext.state[2] >> 24;
response->authentication.digest[12] = digestContext.state[3];
response->authentication.digest[13] = digestContext.state[3] >> 8;
response->authentication.digest[14] = digestContext.state[3] >> 16;
response->authentication.digest[15] = digestContext.state[3] >> 24;
{
u8* contextByte = (u8*)&digestContext;
for (index = 0; index < sizeof(digestContext); index++) {
@@ -1759,38 +1714,37 @@ s32 ATERMRunConfigProtocol(void) {
break;
case 7:
{
AtermRequestOption16* option = (AtermRequestOption16*)globals->configuration.authentication.decoded.options;
AtermRequestOption16* option = (AtermRequestOption16*)response->authentication.decoded.options;
AtermSocketAddress sendAddress;
memset(&globals->configuration.authentication, 0, 8);
memset(response->data, 0, 8);
memset(option, 0, 4);
option->type = SOHtoNs(0x102);
option->length = SOHtoNs(8);
memset(option->value, 0, sizeof(option->value));
memcpy(option->value, authData->digest, 8);
gAtermReplyLength = (u8*)(option + 1) - globals->configuration.authentication.decoded.options;
globals->configuration.authentication.decoded.length = gAtermReplyLength - 8;
messageLength = ATERMBuildEncryptedMessage((u16*)globals->configuration.packetBuffer, 4,
(u16*)globals->configuration.authentication.decoded.options, gAtermReplyLength, globals->configuration.connectionPrefix);
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,
(u16*)response->data, gAtermReplyLength, gAtermConfigurationResult.connectionPrefix);
sendAddress.length = 8;
sendAddress.family = 2;
sendAddress.address = 0xFFFFFFFF;
sendAddress.port = SOHtoNs(0xE601);
gAtermMessageLength = messageLength;
SOSendTo(socket, globals->configuration.packetBuffer, messageLength, 0, &sendAddress);
SOSendTo(socket, gAtermConfigurationResult.packetBuffer, gAtermMessageLength, 0, &sendAddress);
lastSendTime = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
memset(&globals->scanSettings, 0, 0x254);
memset(&gScanSettings, 0, 0x254);
gAtermProtocolState = 8;
break;
}
case 8:
receivedLength = SORecvFrom(socket, globals->configuration.packetBuffer,
sizeof(globals->configuration.packetBuffer), 4, &peerAddress);
receivedLength = SORecvFrom(socket, gAtermConfigurationResult.packetBuffer,
sizeof(gAtermConfigurationResult.packetBuffer), 4, &peerAddress);
if (receivedLength > 0) {
AtermPacket* packet = (AtermPacket*)globals->configuration.packetBuffer;
AtermPacket* packet = (AtermPacket*)gAtermConfigurationResult.packetBuffer;
s32 sequence = SONtoHs(packet->sequence);
s32 payloadLength = SONtoHs(packet->length);
u32 checksum = 0;
u8* cursor = globals->configuration.packetBuffer;
u8* cursor = gAtermConfigurationResult.packetBuffer;
u8* packetEnd = packet->payload + payloadLength;
u8* payload = packet->payload;
for (; cursor < packetEnd; cursor++) {
@@ -1804,17 +1758,17 @@ s32 ATERMRunConfigProtocol(void) {
} else if (sequence != 5) {
payloadLength = 0;
} else if (sessionKey != NULL) {
ATERMAesKeyUnwrap((u16*)globals->configuration.authentication.payload, (u16*)payload,
ATERM_81404A18((u16*)response->authentication.payload, (u16*)payload,
payloadLength, sessionKey, 16);
payloadLength -= 8;
} else {
memcpy(globals->configuration.authentication.payload, payload, payloadLength);
memcpy(response->authentication.payload, payload, payloadLength);
}
gAtermReplyLength = payloadLength;
if (payloadLength != 0 && ATERMParseAssociationResponse((u16*)globals->configuration.authentication.decoded.options)) {
if (payloadLength != 0 && ATERM_814033F0((u16*)response->data)) {
gAtermProtocolState = 9;
retries = 0;
gAtermMode = globals->scanSettings.ssid[0] != 0;
gAtermMode = gScanSettings.ssid[0] != 0;
break;
}
}
@@ -1831,18 +1785,18 @@ s32 ATERMRunConfigProtocol(void) {
break;
case 9:
{
AtermRequestOption8* option = (AtermRequestOption8*)globals->configuration.authentication.decoded.options;
AtermRequestOption8* option = (AtermRequestOption8*)response->authentication.decoded.options;
AtermSocketAddress sendAddress;
memset(&globals->configuration.authentication, 0, 8);
memset(response->data, 0, 8);
memset(option, 0, 4);
option->type = SOHtoNs(0x301);
option->length = SOHtoNs(1);
memset(option->value, 0, sizeof(option->value));
memcpy(option->value, &gAtermMode, 1);
gAtermReplyLength = (u8*)(option + 1) - globals->configuration.authentication.decoded.options;
globals->configuration.authentication.decoded.length = gAtermReplyLength - 8;
messageLength = ATERMBuildEncryptedMessage((u16*)globals->configuration.packetBuffer, 6,
(u16*)globals->configuration.authentication.decoded.options, gAtermReplyLength, sessionKey);
gAtermReplyLength = (u8*)(option + 1) - response->data;
response->authentication.decoded.length = gAtermReplyLength - 8;
gAtermMessageLength = ATERM_81402E40((u16*)gAtermConfigurationResult.packetBuffer, 6,
(u16*)response->data, gAtermReplyLength, sessionKey);
if (NCDGetLinkStatus() != 5) {
lastSendTime = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6)) + 1000;
retries = 10;
@@ -1853,8 +1807,7 @@ s32 ATERMRunConfigProtocol(void) {
sendAddress.family = 2;
sendAddress.address = 0xFFFFFFFF;
sendAddress.port = SOHtoNs(0xE601);
gAtermMessageLength = messageLength;
SOSendTo(socket, globals->configuration.packetBuffer, messageLength, 0, &sendAddress);
SOSendTo(socket, gAtermConfigurationResult.packetBuffer, gAtermMessageLength, 0, &sendAddress);
lastSendTime = (u32)(OSGetTime() / (__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
gAtermProtocolState = 10;
break;
@@ -1864,7 +1817,7 @@ s32 ATERMRunConfigProtocol(void) {
if (now >= lastSendTime + 1000) {
if (++retries >= 10) {
failed = 1;
result = ATERMApplyScanSecuritySettings();
result = ATERM_814036D8();
} else {
gAtermProtocolState = 9;
}
@@ -1887,7 +1840,7 @@ s32 ATERMRunConfigProtocol(void) {
u8 gAtermDigestFill[64] = { 0x80 };
s32 ATERMi_AutoConfigThread(void) {
s32 result = ATERMRunConfigProtocol();
s32 result = ATERM_814038C8();
AtermProgress progress;
u32 equalityMask;
s32 completedState;
@@ -1911,7 +1864,7 @@ s32 ATERMi_AutoConfigThread(void) {
return 0;
}
int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength) {
int ATERM_81404844(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;
@@ -1936,7 +1889,7 @@ int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 ke
return 0;
}
rounds = ATERMAesExpandEncryptKey(expandedKey, key, keyLength << 3);
rounds = ATERM_81404BFC(expandedKey, key, keyLength << 3);
destinationBytes = (u8*)destination;
sourceBytes = (const u8*)source;
memcpy(destinationBytes + 8, sourceBytes, length);
@@ -1948,7 +1901,7 @@ int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 ke
outputBlock = destinationBytes + blockOffset;
memcpy(stateBytes + 8, outputBlock, 8);
ATERMAesEncryptBlock(expandedKey, rounds, stateBytes, stateBytes);
ATERM_81405254(expandedKey, rounds, stateBytes, stateBytes);
counter.value = (u64)(s64)blockIndex + passBase;
stateBytes[0] ^= counter.bytes[0];
stateBytes[1] ^= counter.bytes[1];
@@ -1965,7 +1918,7 @@ int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 ke
return 1;
}
int ATERMAesKeyUnwrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength) {
int ATERM_81404A18(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;
@@ -1989,7 +1942,7 @@ int ATERMAesKeyUnwrap(u16* destination, u16* source, u32 length, void* key, u32
return 0;
}
rounds = ATERMAesExpandDecryptKey(expandedKey, key, keyLength << 3);
rounds = ATERM_8140502C(expandedKey, key, keyLength << 3);
destinationBytes = (u8*)destination;
sourceBytes = (const u8*)source;
memcpy(block.words, sourceBytes, 8);
@@ -2010,7 +1963,7 @@ int ATERMAesKeyUnwrap(u16* destination, u16* source, u32 length, void* key, u32
stateBytes[6] ^= counter.bytes[6];
stateBytes[7] ^= counter.bytes[7];
memcpy(stateBytes + 8, outputBlock, 8);
ATERMAesDecryptBlock(expandedKey, rounds, stateBytes, stateBytes);
ATERM_81405690(expandedKey, rounds, stateBytes, stateBytes);
memcpy(outputBlock, stateBytes + 8, 8);
}
}
@@ -2033,7 +1986,7 @@ int ATERMAesKeyUnwrap(u16* destination, u16* source, u32 length, void* key, u32
((u32)keyBytes[(index) * 4 + 2] << 8) ^ \
keyBytes[(index) * 4 + 3])
int ATERMAesExpandEncryptKey(u32* expandedKey, const void* key, u32 keyBits) {
int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
const u8* keyBytes = (const u8*)key;
u32* roundKey = expandedKey;
@@ -2143,8 +2096,8 @@ int ATERMAesExpandEncryptKey(u32* expandedKey, const void* key, u32 keyBits) {
(inverseTable0[byte0] ^ inverseTable1[byte1]); \
}
int ATERMAesExpandDecryptKey(u32* expandedKey, const void* key, u32 keyBits) {
int rounds = ATERMAesExpandEncryptKey(expandedKey, key, keyBits);
int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits) {
int rounds = ATERM_81404BFC(expandedKey, key, keyBits);
u32* roundKey;
s32 roundCount;
s32 firstIndex;
@@ -2192,7 +2145,7 @@ int ATERMAesExpandDecryptKey(u32* expandedKey, const void* key, u32 keyBits) {
#undef ATERM_AES_TRANSFORM_KEY
void ATERMAesEncryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
u32 state0, state1, state2, state3;
u32 next0, next1, next2, next3;
s32 roundPairs;
@@ -2279,7 +2232,7 @@ void ATERMAesEncryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u
output[15] = state3;
}
void ATERMAesDecryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
u32 state0, state1, state2, state3;
u32 next0, next1, next2, next3;
s32 roundPairs;
@@ -2366,9 +2319,9 @@ void ATERMAesDecryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u
output[15] = state3;
}
void ATERMMd5Transform(u32 state[4], const u8 block[64]);
void ATERM_81405D0C(u32 state[4], const u8 block[64]);
void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length) {
void ATERM_81405ACC(AtermMd5Context* context, void* input, u32 length) {
u8* data = (u8*)input;
u32 bufferIndex = (context->bitCountLow >> 3) & 0x3F;
u32 bytesToFill;
@@ -2385,9 +2338,9 @@ void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length) {
for (copiedBytes = 0; copiedBytes < bytesToFill; copiedBytes++) {
context->buffer8[bufferIndex + copiedBytes] = data[copiedBytes];
}
ATERMMd5Transform(context->state, context->buffer8);
ATERM_81405D0C(context->state, context->buffer8);
for (copiedBytes = bytesToFill; copiedBytes + 63 < length; copiedBytes += 64) {
ATERMMd5Transform(context->state, data + copiedBytes);
ATERM_81405D0C(context->state, data + copiedBytes);
}
bufferIndex = 0;
} else {
@@ -2405,7 +2358,7 @@ void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length) {
(A) += (B); \
} while (0)
void ATERMMd5Transform(u32 state[4], const u8 block[64]) {
void ATERM_81405D0C(u32 state[4], const u8 block[64]) {
u32 byteIndex;
u32 index;
const u8* inputWord;
@@ -2499,7 +2452,7 @@ void ATERMMd5Transform(u32 state[4], const u8 block[64]) {
}
#undef ATERM_MD5_STEP
void ATERMAlarmWakeQueue(OSAlarm* alarm, OSContext* context) {
void ATERM_8140684C(OSAlarm* alarm, OSContext* context) {
OSMessageQueue* queue = (OSMessageQueue*)alarm->tag;
OSSendMessage(queue, NULL, 0);
}
@@ -2526,7 +2479,7 @@ int ATERMi_ApConfigStart(OSPriority priority, u32 scanLimit,
return -1;
}
OSCreateThread(&AtermThread, (void* (*)(void*))ATERMi_AutoConfigThread, NULL,
OSCreateThread(&sAtermThread, (void* (*)(void*))ATERMi_AutoConfigThread, NULL,
(u8*)gAtermAllocation + (gAtermScanBufferSize & ~7), gAtermScanBufferSize, priority, 1);
gAtermState = 1;
{
@@ -2546,7 +2499,7 @@ int ATERMi_ApConfigStart(OSPriority priority, u32 scanLimit,
}
progress.result = gAtermResult;
gAtermProgressCallback(&progress);
OSResumeThread(&AtermThread);
OSResumeThread(&sAtermThread);
gAtermThreadStarted = 1;
return 1;
}
@@ -2572,7 +2525,7 @@ int ATERMi_ApConfigEnd(void) {
OSSetAlarmTag(&cancelAlarm, (u32)&cancelQueue);
OSSetAlarm(&cancelAlarm,
OSMillisecondsToTicks(100),
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&cancelQueue, &cancelMessage, 1);
}
@@ -2581,10 +2534,10 @@ int ATERMi_ApConfigEnd(void) {
OSSetAlarmTag(&joinAlarm, (u32)&joinQueue);
OSSetAlarm(&joinAlarm,
OSMillisecondsToTicks(500),
ATERMAlarmWakeQueue);
ATERM_8140684C);
OSReceiveMessage(&joinQueue, &joinMessage, 1);
while (OSIsThreadTerminated(&AtermThread) == 0) {
OSJoinThread(&AtermThread, NULL);
while (OSIsThreadTerminated(&sAtermThread) == 0) {
OSJoinThread(&sAtermThread, NULL);
}
if (gAtermAllocation != NULL) {
@@ -2631,6 +2584,7 @@ int ATERMi_ApConfigGetVersion(void) {
return 0x106;
}
u8* gAtermRequestOptions = gAtermResponseBuffer.data;
u32 gAtermUseSharedAddress = 1;
char gAtermProductName[5] = "WARP";

View File

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

View File

@@ -28,35 +28,26 @@ int ATERMi_ApConfigEnd();
namespace ipl {
namespace scene {
extern "C" MEMAllocator sRakuAllocator;
MEMAllocator sRakuAllocator;
extern "C" MEMAllocator RakuRakuThread_810BDDD0;
MEMAllocator RakuRakuThread_810BDDD0;
struct RakuStatus {
RakuProgress progress;
RakuConfiguration configuration;
};
extern "C" RakuStatus sRakuStatus;
RakuStatus sRakuStatus;
extern "C" OSMessageQueue sRakuMsgQueue;
OSMessageQueue sRakuMsgQueue;
extern "C" void syncRakuProgress__Q33ipl5scene14RakuRakuThreadFv();
struct RakuThreadGlobals {
MEMAllocator allocator[1];
RakuStatus status[1];
OSMessageQueue queue;
};
static u32 startTimeHigh = 0;
static u32 startTimeLow = 0;
static bool active = false;
static OSMessage messageSlot = NULL;
extern "C" RakuStatus RakuRakuThread_810BDDE0;
RakuStatus RakuRakuThread_810BDDE0;
extern "C" OSMessageQueue RakuRakuThread_810BDED4;
OSMessageQueue RakuRakuThread_810BDED4;
static OSTime startTime;
static bool active;
static OSMessage messageSlot;
static int displayState = 1;
extern "C" {
static void* RakuSocketAlloc(u32, s32 size);
static void RakuSocketFree(u32, void* block, s32);
static void* RakuAtermAlloc(u32 size);
static void RakuAtermFree(void* block);
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);
}
struct RakuStack {
@@ -69,7 +60,7 @@ public:
virtual ~RakuRakuThread();
virtual void* Run();
virtual void unk_0x2C() = 0;
void syncRakuProgress();
void RakuRakuThread_813FDA04();
static void progressCallback(RakuProgress* progress);
void destroy();
int start();
@@ -87,17 +78,15 @@ private:
MEMHeapHandle mHeap;
};
void RakuRakuThread::syncRakuProgress() {
void RakuRakuThread::RakuRakuThread_813FDA04() {
BOOL interrupts = OSDisableInterrupts();
sRakuStatus.progress = *(RakuProgress*)this;
OSTime time = OSGetTime();
startTimeHigh = time >> 32;
startTimeLow = time;
RakuRakuThread_810BDDE0.progress = *(RakuProgress*)this;
startTime = OSGetTime();
OSRestoreInterrupts(interrupts);
}
void RakuRakuThread::progressCallback(RakuProgress* progress) {
((RakuRakuThread*)progress)->syncRakuProgress();
((RakuRakuThread*)progress)->RakuRakuThread_813FDA04();
}
RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
@@ -112,12 +101,12 @@ RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
active = false;
mFinished = 0;
mRunning = 0;
OSInitMessageQueue(&sRakuMsgQueue, &messageSlot, 1);
OSInitMessageQueue(&RakuRakuThread_810BDED4, &messageSlot, 1);
}
RakuRakuThread::~RakuRakuThread() {
if (mRunning) {
OSJamMessage(&sRakuMsgQueue, (OSMessage)2, 1);
OSJamMessage(&RakuRakuThread_810BDED4, (OSMessage)2, 1);
WaitForThreadExit();
}
destroy();
@@ -125,7 +114,7 @@ RakuRakuThread::~RakuRakuThread() {
void RakuRakuThread::destroy() {
if (active) {
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
u32 start = OSGetTick();
while ((u32)(OSGetTick() - start) / (OS_TIMER_CLOCK / 1000) < 2000) {
RakuProgress progress;
@@ -138,34 +127,31 @@ void RakuRakuThread::destroy() {
}
if (mHeap != NULL) {
MEMDestroyExpHeap(mHeap);
memset(&sRakuAllocator, 0, sizeof(MEMAllocator));
memset(&RakuRakuThread_810BDDD0, 0, sizeof(MEMAllocator));
mHeap = NULL;
}
}
int RakuRakuThread::start() {
RakuThreadGlobals* shared = (RakuThreadGlobals*)&sRakuAllocator;
if (active || mHeapBuffer == NULL) {
return 0;
}
BOOL interrupts = OSDisableInterrupts();
OSTime time = OSGetTime();
startTimeLow = (u32)time;
startTimeHigh = (u32)(time >> 32);
startTime = OSGetTime();
mHeap = MEMCreateExpHeapEx(mHeapBuffer, 0x40000, 2);
MEMInitAllocatorForExpHeap(&shared->allocator[0], mHeap, 32);
MEMInitAllocatorForExpHeap(&RakuRakuThread_810BDDD0, mHeap, 32);
mPriority = OSGetThreadPriority(OSGetCurrentThread()) - 1;
active = true;
mFinished = 0;
memset(&shared->status[0].configuration, 0, sizeof(RakuConfiguration));
memset(&shared->status[0].progress, 0, sizeof(RakuProgress));
memset(&RakuRakuThread_810BDDE0.configuration, 0, sizeof(RakuConfiguration));
memset(&RakuRakuThread_810BDDE0.progress, 0, sizeof(RakuProgress));
SOLibraryConfig socketConfig;
socketConfig.alloc = RakuSocketAlloc;
socketConfig.free = RakuSocketFree;
socketConfig.alloc = RakuRakuThread_813FDEF0;
socketConfig.free = RakuRakuThread_813FDEFC;
SOInit(&socketConfig);
ATERMi_ApConfigStart(mPriority, 200,
(void (*)(RakuProgress*))&syncRakuProgress__Q33ipl5scene14RakuRakuThreadFv,
RakuAtermAlloc, RakuAtermFree, 4096);
progressCallback,
RakuRakuThread_813FDF08, RakuRakuThread_813FDF18, 4096);
if (!mRunning) {
mRunning = 1;
memset(mStack, 0, 4);
@@ -179,12 +165,12 @@ int RakuRakuThread::start() {
void* RakuRakuThread::Run() {
OSMessage message;
while (true) {
while (OSReceiveMessage(&sRakuMsgQueue, &message, 0)) {
while (OSReceiveMessage(&RakuRakuThread_810BDED4, &message, 0)) {
if ((s32)message == 2) {
return this;
}
}
OSReceiveMessage(&sRakuMsgQueue, &message, 1);
OSReceiveMessage(&RakuRakuThread_810BDED4, &message, 1);
if ((s32)message == 2) {
break;
}
@@ -198,17 +184,17 @@ void* RakuRakuThread::Run() {
return this;
}
static void* RakuSocketAlloc(u32, s32 size) {
return MEMAllocFromAllocator(&sRakuAllocator, size);
static void* RakuRakuThread_813FDEF0(u32, s32 size) {
return MEMAllocFromAllocator(&RakuRakuThread_810BDDD0, size);
}
static void RakuSocketFree(u32, void* block, s32) {
MEMFreeToAllocator(&sRakuAllocator, block);
static void RakuRakuThread_813FDEFC(u32, void* block, s32) {
MEMFreeToAllocator(&RakuRakuThread_810BDDD0, block);
}
static void* RakuAtermAlloc(u32 size) {
return MEMAllocFromAllocator(&sRakuAllocator, size);
static void* RakuRakuThread_813FDF08(u32 size) {
return MEMAllocFromAllocator(&RakuRakuThread_810BDDD0, size);
}
static void RakuAtermFree(void* block) {
MEMFreeToAllocator(&sRakuAllocator, block);
static void RakuRakuThread_813FDF18(void* block) {
MEMFreeToAllocator(&RakuRakuThread_810BDDD0, block);
}
int RakuRakuThread::getState() {
@@ -216,7 +202,7 @@ int RakuRakuThread::getState() {
return 0;
}
BOOL interrupts = OSDisableInterrupts();
switch (sRakuStatus.progress.state) {
switch (RakuRakuThread_810BDDE0.progress.state) {
case 1: displayState = 1; break;
case 2: displayState = 2; break;
case 3: displayState = 2; break;
@@ -227,56 +213,53 @@ int RakuRakuThread::getState() {
default: displayState = 1; break;
}
if (displayState != 6 && displayState != 7 &&
((u32)OSGetTime() - startTimeLow) / (OS_TIMER_CLOCK / 1000) >= 90000) {
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
((u32)OSGetTime() - (u32)startTime) / (OS_TIMER_CLOCK / 1000) >= 90000) {
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
}
OSRestoreInterrupts(interrupts);
return displayState;
}
int RakuRakuThread::cancel() {
return OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
return OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
}
int RakuRakuThread::finish(NCDApConfig* config, int* result) {
RakuThreadGlobals* shared = (RakuThreadGlobals*)&sRakuAllocator;
if (!active) {
if (result != NULL) {
*result = -99;
}
return 1;
}
s32 state = shared->status[0].progress.state;
if ((u32)(state - 6) <= 1) {
if (!mFinished) {
if (state == 6) {
ATERMi_ApConfigGetResult(&shared->status[0].configuration);
printInfo();
}
OSSendMessage(&shared->queue, (OSMessage)1, 0);
return 0;
}
SOFinish();
active = false;
destroy();
} else {
s32 state = RakuRakuThread_810BDDE0.progress.state;
if ((u32)(state - 6) > 1) {
return 0;
}
if (!mFinished) {
if (state == 6) {
ATERMi_ApConfigGetResult(&RakuRakuThread_810BDDE0.configuration);
printInfo();
}
OSSendMessage(&RakuRakuThread_810BDED4, (OSMessage)1, 0);
return 0;
}
SOFinish();
active = false;
destroy();
if (config != NULL) {
memcpy(config->ssid, shared->status[0].configuration.ssid, 32);
config->ssidLength = strlen(shared->status[0].configuration.ssid);
RakuConfiguration* settings = &shared->status[0].configuration;
int index;
RakuConfiguration* settings = &RakuRakuThread_810BDDE0.configuration;
memcpy(config->ssid, settings->ssid, 32);
config->ssidLength = strlen(settings->ssid);
if (settings->security == 1) {
config->privacy.mode = 1;
config->privacy.wep40.keyId = settings->keyId;
for (index = 0; index < 4; ++index) {
for (int index = 0; index < 4; ++index) {
memcpy(config->privacy.wep40.key[index], settings->wepKeys[index], 5);
}
} else if (settings->security == 2) {
config->privacy.mode = 2;
config->privacy.wep104.keyId = settings->keyId;
for (index = 0; index < 4; ++index) {
for (int index = 0; index < 4; ++index) {
memcpy(config->privacy.wep104.key[index], settings->wepKeys[index], 13);
}
} else if (settings->security == 4) {
@@ -290,7 +273,7 @@ int RakuRakuThread::finish(NCDApConfig* config, int* result) {
}
}
if (result != NULL) {
*result = shared->status[0].progress.result;
*result = RakuRakuThread_810BDDE0.progress.result;
}
return 1;
}

View File

@@ -1,7 +1,3 @@
#define IPL_CONTROLLER_TRIVIAL_RECT_DTOR
#include <nw4r/ut/Rect.h>
#undef IPL_CONTROLLER_TRIVIAL_RECT_DTOR
#include "system/iplSystem.h"
#include "system/iplNand.h"
#include "utility/iplGraphics.h"
@@ -17,16 +13,8 @@ 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;
@@ -55,9 +43,8 @@ void SensitivityDrawing::draw(nand::File* texture) {
GXInitTexObjWrapMode(&image, GX_MIRROR, GX_MIRROR);
f32 width = projection.GetWidth();
f32 height = projection.GetHeight();
f32 horizontalScale = SensitivityDrawing::horizontalScale(width);
f32 verticalScale;
SensitivityDrawing::verticalScale(height, verticalScale);
f32 horizontalScale = (0.5f * width) / 1024.0f;
f32 verticalScale = (0.5f * height) / 768.0f;
int sample = WPADGetLatestIndexInBuf(controller->getChannel());
DPDObject* object;
DPDObject* first;
@@ -85,7 +72,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 = projectY(object->y, verticalScale);
f32 y = (object->y - 384) * verticalScale;
GXColor foreground = {255, 255, 255, 255};
nw4r::ut::Rect rectangle(x - radius, -y + radius - -45.0f,
x + radius, -y - radius - -45.0f);

View File

@@ -36,6 +36,12 @@ extern "C" int abs(int value);
extern "C" void __VISetAdjustingValues(s32 horizontal, s32 vertical);
namespace ipl {
namespace scene {
static s32 browserScrollDirection;
}
}
namespace ipl {
class SensitivityDrawing {
public:
@@ -143,7 +149,6 @@ namespace ipl {
void* Setting::mem1Buffer_;
void* Setting::mem2Buffer_;
static s32 browserScrollDirection;
Setting::Setting(EGG::Heap* heap, int arg) : FaderSceneBase(heap) {
unk_0x5C = 0;
@@ -412,7 +417,7 @@ namespace ipl {
"Setup/ScreenSave.html", "Setup/ScreenSave.html",
"Setup/ScreenSave.html", "Setup/ScreenSave.html",
"Setup/ScreenSave.html", "Setup/ScreenSave.html",
"Setup/ScreenSave.html", "Setup/ScreenSave.html"};
"Setup/ScreenSave.html", "Calendar"};
char basePath[100];
char browserPath[100];
@@ -438,8 +443,8 @@ namespace ipl {
snprintf(browserPath, sizeof(browserPath), basePath, regionCodes[regionIndex],
languageCodes[System::getLanguage()], regionPages[regionIndex]);
} else if (mInitialArgument == ARG_UNK_6) {
const char* pageNames[] = {"Calendar", "Display", "Sound", "Parental_Control", "Internet",
"Wiiconnect24", "Update"};
const char* pageNames[] = {"Display", "Sound", "Parental_Control", "Internet",
"Wiiconnect24", "Update", "Update"};
int directPage;
for (directPage = 0; directPage < 7; directPage++) {
if (strstr(mpStringBuffer->netSettingArg, pageNames[directPage]) != NULL) {
@@ -462,6 +467,7 @@ namespace ipl {
directPagePath = "index03.html";
break;
case 7:
default:
directPagePath = "index01.html";
break;
}
@@ -1369,7 +1375,7 @@ namespace ipl {
if (!mBrowserCreated) {
utility::Graphics::setOrtho(0);
nw4r::ut::Rect background(-1000.0f, -1000.0f, 1000.0f, 1000.0f);
static const GXColor color = {0, 0, 0, 0xFF};
GXColor color = {0, 0, 0, 0xFF};
utility::Graphics::drawPolygon(background, color);
return;
}
@@ -1389,7 +1395,7 @@ namespace ipl {
ext_ead::www::BrowserWindow* browserWindow =
static_cast<ext_ead::www::BrowserWindow*>(browser->mpBrowserWindows[0]);
if ((browserWindow == NULL ? 0 : browserWindow->unk_0x2C4[3]) != 0) {
if ((browserWindow != NULL ? browserWindow->unk_0x2C4[3] : 0) != 0) {
unk_0x91C[2] = 1;
mState = 0;
browserWindow = static_cast<ext_ead::www::BrowserWindow*>(browser->mpBrowserWindows[0]);
@@ -1397,13 +1403,9 @@ namespace ipl {
browserWindow->unk_0x2C4[3] = 0;
}
www::trasition::ScrollState scrollState = www::trasition::GetScrollState();
if (scrollState == www::trasition::SCROLL_LEFT) {
browserScrollDirection = 1;
} else if (scrollState == www::trasition::SCROLL_RIGHT) {
browserScrollDirection = -1;
} else {
browserScrollDirection = 0;
}
browserScrollDirection = scrollState == www::trasition::SCROLL_LEFT
? 1
: (scrollState == www::trasition::SCROLL_RIGHT ? -1 : 0);
www::trasition::ResetScrollState();
void* changedWideBuffer = browser->GetTextureBuffer(1, NULL);
void* changedStandardBuffer = browser->GetTextureBuffer(0, NULL);
@@ -1411,16 +1413,16 @@ namespace ipl {
ext_ead::www::Heap::reportLeaHeap();
}
if (!(mpSecondAnimation->isPlaying() || mpFirstAnimation->isPlaying())) {
if (!mpSecondAnimation->isPlaying() && !mpFirstAnimation->isPlaying()) {
mpChangeLayout->FindPaneByName("N_Tra0")->SetVisible(false);
} else {
mpChangeLayout->FindPaneByName("N_Tra0")->SetVisible(true);
}
WWWRect* wideRect;
WWWRect* standardRect;
void* standardBuffer = browser->GetTextureBuffer(0, &standardRect);
WWWRect* wideRect;
void* wideBuffer = browser->GetTextureBuffer(1, &wideRect);
void* standardBuffer = browser->GetTextureBuffer(0, &standardRect);
nw4r::ut::Rect projection4x3;
System::getProjectionRect4x3(&projection4x3);
int screenWidth = abs(static_cast<int>(projection4x3.GetWidth()));
@@ -1446,15 +1448,14 @@ namespace ipl {
System::getProjectionRect16x9(&projection16x9);
int wideWidth = abs(static_cast<int>(projection16x9.GetWidth()));
int wideHeight = abs(static_cast<int>(projection16x9.GetHeight()));
f32 negHalfWideWidth = -wideWidth / 2;
f32 posHalfWideWidth = wideWidth / 2;
f32 posHalfWideHeight = wideHeight / 2;
nw4r::ut::Rect leftSide(negHalfWideWidth, posHalfWideHeight,
negHalfWideWidth + sideDescriptor->textureHeader->width,
posHalfWideHeight - sideDescriptor->textureHeader->height);
nw4r::ut::Rect rightSide(posHalfWideWidth - sideDescriptor->textureHeader->width,
posHalfWideHeight, posHalfWideWidth,
posHalfWideHeight - sideDescriptor->textureHeader->height);
f32 wideLeft = -wideWidth / 2;
f32 wideTop = wideHeight / 2;
f32 wideRight = wideWidth / 2;
nw4r::ut::Rect leftSide(wideLeft, wideTop,
wideLeft + sideDescriptor->textureHeader->width,
wideTop - sideDescriptor->textureHeader->height);
nw4r::ut::Rect rightSide(wideRight - sideDescriptor->textureHeader->width,
wideTop, wideRight, wideTop - sideDescriptor->textureHeader->height);
if (browserScrollDirection != 0) {
nw4r::lyt::Material* wideMaterial =
@@ -1514,8 +1515,7 @@ namespace ipl {
}
if (mpWiiSettingFlag->smthMsgData >= 2 && mpWiiSettingFlag->smthMsgData <= 7) {
GXRenderModeObj renderMode;
renderMode = *System::getRenderModeObj();
GXRenderModeObj renderMode = *System::getRenderModeObj();
u32 left;
u32 top;
u32 width;
@@ -1611,10 +1611,10 @@ namespace ipl {
OSReport("initKeyboard formId:%d\n", mpWiiSettingData->data[0x11]);
memset(unk_0x938, 0, sizeof(unk_0x938));
int stringLimit;
keyboard::Manager::KeyboardType keyboardType = keyboard::Manager::LETTER;
int rowLimit;
int invalidInput = 0;
keyboard::Manager::KeyboardType keyboardType = keyboard::Manager::LETTER;
int rowLimit = 0;
int stringLimit = 0;
int productArea = static_cast<s8>(SCGetProductArea());
switch (mpWiiSettingData->data[0x11]) {
@@ -1716,16 +1716,14 @@ namespace ipl {
}
if (productArea == 11) {
void* sysDic = System::getKeyboard()->getZiSystemDic();
void* oemDic = System::getKeyboard()->getZiOemDic();
System::getKeyboard()->memoFrm()->setZiDictionary(oemDic, sysDic);
System::getKeyboard()->memoFrm()->setZiDictionary(System::getKeyboard()->getZiOemDic(), System::getKeyboard()->getZiSystemDic());
}
keyboard::Manager::KeyboardSetting setting;
setting.rowLimit = rowLimit;
setting.type = keyboardType;
setting.wcString = reinterpret_cast<const wchar_t*>(unk_0x938);
setting.stringLimit = stringLimit;
setting.type = keyboardType;
setting.rowLimit = rowLimit;
System::getKeyboard()->start(0, setting);
if (invalidInput != 0) {
@@ -1745,6 +1743,7 @@ namespace ipl {
if (mKeyboardState.pressOK) {
onTextInputOK();
u8 formId = mpWiiSettingData->data[0x11];
formText = NULL;
switch (formId) {
case 1:
formText = mpStringBuffer->nickname;
@@ -1815,8 +1814,7 @@ namespace ipl {
memcpy(mpStringBuffer->asterisks, mpStringBuffer->securityKey, sizeof(mpStringBuffer->securityKey));
mpStringBuffer->asterisks[0x41] = 0;
while (mpStringBuffer->asterisks[index] != 0) {
mpStringBuffer->asterisks[index] = '*';
index++;
mpStringBuffer->asterisks[index++] = '*';
}
if (index > 0x20) {
mpStringBuffer->asterisks[0x20] = '\n';
@@ -1828,6 +1826,7 @@ namespace ipl {
}
} else {
u8 formId = mpWiiSettingData->data[0x11];
formText = NULL;
switch (formId) {
case 1:
formText = mpStringBuffer->nickname;
@@ -2168,8 +2167,8 @@ namespace ipl {
const char* versionSuffix[12] = {"J", "U", "E", "", "", "J", "K", "", "", "", "", "C"};
u32 versionData[24] = {
0x00010008, 0x48414B4A, 0x00010008, 0x48414B45, 0x00010008, 0x48414B50,
0, 0, 0, 0, 0x00010008, 0x48414B4A, 0x00010008, 0x48414B4B,
0, 0, 0, 0, 0, 0, 0, 0, 0x00010008, 0x48414B43,
0, 0, 0, 0, 0, 0, 0x00010008, 0x48414B4A, 0x00010008, 0x48414B4B,
0, 0, 0, 0, 0, 0, 0x00010008, 0x48414B43,
};
u32 region = System::getRegion();
sprintf(mpStringBuffer->version, "Ver. %d.%d%s", 4, 3, versionSuffix[region]);
@@ -2722,34 +2721,34 @@ namespace ipl {
case 6: {
int animationIndex = unk_0x918;
unk_0xB9C = 1;
if (!(mpMainLayout->getAnim(animationIndex)->isPlaying() & 0x07FFFFFF)) {
unk_0x78 = 5;
setAPDraw();
if (unk_0x91C[0] != 0) {
mpMainLayout->getAnim(0xa)->initAnmFrame();
} else {
mpMainLayout->getAnim(0xb)->initAnmFrame();
}
if (unk_0x914 == 0) {
mpMainLayout->FindPaneByName("N_AP1")->SetVisible(false);
} else if (unk_0x914 == 1) {
mpMainLayout->FindPaneByName("N_AP1")->SetVisible(true);
}
if (mAPScanList.count == unk_0x914 + 4) {
mpMainLayout->FindPaneByName("N_AP6")->SetVisible(false);
} else if (mAPScanList.count == unk_0x914 + 5) {
mpMainLayout->FindPaneByName("N_AP6")->SetVisible(true);
}
mpMainLayout->FindPaneByName("N_AP0")->SetVisible(true);
mpMainLayout->FindPaneByName("N_AP7")->SetVisible(true);
if (!mpMainLayout->getAnim(animationIndex)->isPlaying()) {
unk_0x78 = 5;
setAPDraw();
if (unk_0x91C[0] != 0) {
mpMainLayout->getAnim(0xa)->initAnmFrame();
} else {
mpMainLayout->getAnim(0xb)->initAnmFrame();
}
if (unk_0x914 == 0) {
mpMainLayout->FindPaneByName("N_AP1")->SetVisible(false);
} else if (unk_0x914 == 1) {
mpMainLayout->FindPaneByName("N_AP1")->SetVisible(true);
}
if (mAPScanList.count == unk_0x914 + 4) {
mpMainLayout->FindPaneByName("N_AP6")->SetVisible(false);
} else if (mAPScanList.count == unk_0x914 + 5) {
mpMainLayout->FindPaneByName("N_AP6")->SetVisible(true);
}
mpMainLayout->FindPaneByName("N_AP0")->SetVisible(true);
mpMainLayout->FindPaneByName("N_AP7")->SetVisible(true);
}
break;
}
case 7:
unk_0xB9C = 1;
if (!(mpMainLayout->getAnim(unk_0x918)->isPlaying() & 0x07FFFFFF)) {
updateScroll();
unk_0x78 = 6;
if (!mpMainLayout->getAnim(unk_0x918)->isPlaying()) {
updateScroll();
unk_0x78 = 6;
}
break;
case 8:
@@ -2757,13 +2756,13 @@ namespace ipl {
unk_0x91C[2] = 0;
break;
case 9:
if (!(mpMainLayout->getAnim(unk_0x918)->isPlaying() & 0x07FFFFFF)) {
resetFuncMsgQ();
unk_0x78 = 1;
unk_0x918 = -1;
mpPaneManager->init();
mpMainLayout->getAnim(0x14)->initFrame();
mpMainLayout->calc();
if (!mpMainLayout->getAnim(unk_0x918)->isPlaying()) {
resetFuncMsgQ();
unk_0x78 = 1;
unk_0x918 = -1;
mpPaneManager->init();
mpMainLayout->getAnim(0x14)->initFrame();
mpMainLayout->calc();
}
break;
}
@@ -3583,17 +3582,15 @@ namespace ipl {
}
}
break;
case 2: {
volatile u8* result = &unk_0x91C[1];
if (*result != 0) {
www::wiisetting::setFuncResult(*result);
case 2:
if (HasUSBAPResult(&unk_0x91C[1])) {
www::wiisetting::setFuncResult(unk_0x91C[1]);
unk_0x84 = 1;
*result = 0;
unk_0x91C[1] = 0;
resetFuncMsgQ();
}
break;
}
}
}
void Setting::cancelUSBAP() {
@@ -3748,13 +3745,13 @@ namespace ipl {
layout::Animator* animation = mpWaitLayout->getAnim(0);
animation->initFrame();
animation->restart();
mpWaitLayout->FindPaneByName("N_Wait")->SetVisible(true);
mpWaitLayout->FindPaneByName("G_Wait")->SetVisible(true);
snd::getSystem()->startSE("WIPL_SE_COPYING");
}
void Setting::waitFinish() {
mpWaitLayout->getAnim(0)->stop();
mpWaitLayout->FindPaneByName("N_Wait")->SetVisible(false);
mpWaitLayout->FindPaneByName("G_Wait")->SetVisible(false);
snd::getSystem()->startSE("WIPL_SE_COPY_FINISH");
}
@@ -3852,12 +3849,5 @@ namespace ipl {
return mIsResetAcceptable;
}
extern const wchar_t scNumber[10] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'
};
extern const wchar_t scNumber2[10] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'
};
} // namespace scene
} // namespace ipl

View File

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

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& initialPos,
f32 margin16x9, f32 margin4x3)
: mbWaitingFadeIn(FALSE), mpText(NULL), mTextLen(0), mBalloonPos(initialPos), mHAlign(0), mbUse16x9X(1), mMargin16x9(margin16x9), mMargin4x3(margin4x3),
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),
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 (mbWaitingFadeIn) {
switch (unk_0x08) {
case TRUE: {
break;
}
@@ -73,7 +73,7 @@ namespace ipl {
balloonPane->SetVisible(false);
mbWaitingFadeIn = FALSE;
unk_0x08 = FALSE;
}
void TextBalloon::fadein() {
@@ -81,7 +81,7 @@ namespace ipl {
mpLayout->FindPaneByName("N_Balloon")->SetVisible(false);
mWaitUntilFadeIn = 0;
mbWaitingFadeIn = TRUE;
unk_0x08 = TRUE;
set_textbox(mpText);
set_translate(mBalloonPos);
@@ -91,17 +91,17 @@ namespace ipl {
void TextBalloon::fadeinNoSetTextbox() {
if (mpText != NULL) {
mWaitUntilFadeIn = 0;
mbWaitingFadeIn = TRUE;
unk_0x08 = TRUE;
set_translate(mBalloonPos);
}
}
void TextBalloon::setPos(const math::VEC3& pos, bool use16x9X, int hAlign) {
void TextBalloon::setPos(const math::VEC3& pos, bool unk0, int unk1) {
mBalloonPos = pos;
mHAlign = hAlign;
mbUse16x9X = use16x9X;
unk_0x28 = unk1;
unk_0x2C = unk0;
nw4r::ut::Rect proj16x9;
nw4r::ut::Rect proj4x3;
@@ -109,7 +109,7 @@ namespace ipl {
System::getProjectionRect(&proj16x9);
System::getProjectionRect4x3(&proj4x3);
if (mbUse16x9X == 0) {
if (unk_0x2C == 0) {
mBalloonPos.x *= proj4x3.GetWidth() / proj16x9.GetWidth();
}
}
@@ -122,7 +122,7 @@ namespace ipl {
System::getProjectionRect(&proj16x9);
System::getProjectionRect4x3(&proj4x3);
if (mbUse16x9X == 0) {
if (unk_0x2C == 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");
mbWaitingFadeIn = FALSE;
unk_0x08 = FALSE;
}
}
void TextBalloon::fadeout() {
if (!mbWaitingFadeIn) {
if (!unk_0x08) {
mpLayout->setAnmType(ANIM_TYPE_BACKWARD);
mpLayout->start();
}
mbWaitingFadeIn = FALSE;
unk_0x08 = FALSE;
}
void TextBalloon::fadeoutForce() {
if (!mbWaitingFadeIn) {
if (!unk_0x08) {
if (mpLayout->getAnim()->getAnmType() == ANIM_TYPE_FORWARD) {
mpLayout->getAnim()->setAnmType(ANIM_TYPE_BACKWARD);
mpLayout->getAnim()->restart();
}
} else if (mbWaitingFadeIn == TRUE) {
} else if (unk_0x08 == TRUE) {
mWaitUntilFadeIn = 0;
mbWaitingFadeIn = FALSE;
unk_0x08 = FALSE;
}
}
@@ -167,9 +167,9 @@ namespace ipl {
f32 temp0;
if (SCGetAspectRatio() == SC_ASPECT_RATIO_16x9) {
temp0 = mMargin16x9;
temp0 = unk_0x30;
} else {
temp0 = mMargin4x3;
temp0 = unk_0x34;
}
nw4r::lyt::Pane* balloonPane = mpLayout->FindPaneByName("N_Balloon");
@@ -181,7 +181,7 @@ namespace ipl {
System::getProjectionRect(&proj16x9);
System::getProjectionRect4x3(&proj4x3);
switch (mHAlign) {
switch (unk_0x28) {
case 1: {
temp1 = get_size("W_Base")->width / 2;
break;
@@ -192,7 +192,7 @@ namespace ipl {
}
}
if (mbUse16x9X == 0) {
if (unk_0x2C == 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), mbResetAcceptable(true),
: FaderSceneBase(heap), mState(STATE_NORMAL), mSelectedFaceId(-1), mpNigaoe(NULL), mbClosing(false), unk_0x7D(true),
mNwc24ErrCountdown(0) {
setSceneParentFlags(SCN_PARENTFLAG_DRAW | SCN_PARENTFLAG_CALC);
}
@@ -87,7 +87,7 @@ namespace ipl {
mSelectedFaceId = -1;
mpNigaoe = NULL;
mbClosing = false;
mbResetAcceptable = true;
unk_0x7D = true;
mNwc24ErrCountdown = 0;
// Text balloon for Mii face
@@ -398,7 +398,7 @@ namespace ipl {
snd::getSystem()->startSE("WIPL_SE_DECIDE");
mbResetAcceptable = false;
unk_0x7D = false;
// Copy memo contents
wmemcpy(mWCString, getMemoInputForm()->getSendString()->getWCString(), WC_STRING_LENGTH);
@@ -412,7 +412,7 @@ namespace ipl {
closeNWC24();
mbResetAcceptable = true;
unk_0x7D = true;
// Receive sent memo
System::receiveImmediately();

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