Compare commits

...

22 Commits

Author SHA1 Message Date
coah
379c84d5f6 fix(TMC_JPEG): use consistent two-dimensional sampling tables 2026-10-05 09:32:25 -05:00
coah
bf65a26b5e build(eZiText): compile zi8clib with GC/3.0a5 like the original middleware; link five more units (rx35 astra max) (worker 1c1f2f35) (#1221) 2026-10-05 09:21:23 -05:00
coah
e174f2c2be refactor(TMC_JPEG): typed work-structure layouts instead of raw offsets (rx48) (worker dc2dd450) (#1220) 2026-10-05 09:01:37 -05:00
coah
044ab57149 refactor: named constants and descriptive names in address, keyboard, FA, AES, HTTP and BS2 files (rx43) (worker 217e90ad) (#1219) 2026-10-05 08:37:16 -05:00
coah
7c64b0a1f9 decomp(os,TMC_JPEG): write OSInit arena setup and parse_sof in C (rx41 astra max) (worker 42ac90a1) (#1218) 2026-10-05 08:33:55 -05:00
coah
f0722e8397 refactor(scene,system): named constants and cast cleanup in memory card, SD memory and system files (rx40) (worker 7ff7f6b8) (#1217) 2026-10-05 08:17:56 -05:00
coah
92f6177e64 refactor(libs): named constants and descriptive names in EGG, RFL, MSL, runtime, homebutton and SDK leftovers (rx39) (worker d7795368) (#1216) 2026-10-05 08:14:12 -05:00
coah
8899a8300c refactor(TMC_JPEG): name JPEG markers and EXIF tags, replace raw offsets (rx38) (worker c693132e) (#1215) 2026-10-05 08:01:41 -05:00
coah
46618a101c refactor(channelScript): use VM type and result constants, drop redundant casts (rx37) (worker 395bc9dc) (#1214) 2026-10-05 07:57:40 -05:00
coah
fef6f996d7 decomp(TMC_JPEG): match the YUV411 RGB565 converter (rx13 astra max) (worker 3c1dcd73) (#1213) 2026-10-05 07:51:24 -05:00
coah
78bfceef9f docs: inventory every assembly body and add a placeholder checker (rx36) (worker e3e4dedf) (#1212) 2026-10-05 07:47:05 -05:00
coah
d220c7accb refactor(keyboard,www,utility,sound,nw4r): named constants and cast cleanup (rx34) (worker 924a779f) (#1211) 2026-10-05 07:42:29 -05:00
coah
e8911343c6 refactor(sdk): use SDK result codes and flags, drop redundant casts (rx33) (worker 75928f09) (#1210) 2026-10-05 07:37:14 -05:00
coah
5a2113c1b1 refactor: give generic tmp/arg locals descriptive names (rx31) (worker 603061bb) (#1209) 2026-10-05 07:27:33 -05:00
coah
85a25256ce refactor(scene,system): use named constants, drop redundant casts and comparisons (rx32) (worker a3860f5f) (#1208) 2026-10-05 07:24:34 -05:00
coah
ad5100a50c decomp(wad): match WADBackupEx and link wad (rx10 astra max) (worker 8fbecf21) (#1207) 2026-10-05 07:18:48 -05:00
coah
38ade13d6f refactor(CHANSVm): name VM placeholder locals and fields (rx29) (worker 455a3ecf) (#1206) 2026-10-05 06:54:59 -05:00
coah
901fe02868 refactor: name remaining placeholder fields and locals across 148 files (rx22) (worker 45545207) (#1205) 2026-10-05 06:51:22 -05:00
coah
41023c51a6 refactor(kpad,cdb): name KPAD state fields after the SDK and CDB system fields (rx27) (worker 30325cf4) (#1204) 2026-10-05 06:39:33 -05:00
coah
42a2dffe46 decomp(TMC_JPEG): match nine RGBA8 converters (rx13 astra max) (worker bb3d578e) (#1203) 2026-10-05 06:35:57 -05:00
coah
cacc62a709 refactor(eZiText): name placeholder fields and locals (rx26) (worker 6171f898) (#1202) 2026-10-05 06:28:24 -05:00
coah
efa1859f6c decomp(memoryCard): match create_banner with banner texture helpers (rx7 astra max) (worker e78a3a35) (#1201) 2026-10-05 06:13:44 -05:00
397 changed files with 17504 additions and 6277 deletions

View File

@@ -44,6 +44,18 @@ block_relocations:
- source: .data:0x8165E19C
add_relocations:
- source: .text:0x8152C08C
type: ha
target: __ArenaLo
- source: .text:0x8152C090
type: l
target: __ArenaLo
- source: .text:0x8152C134
type: ha
target: __ArenaLo
- source: .text:0x8152C138
type: l
target: __ArenaLo
- source: .data:0x8165E15C
type: abs
target: csAninationFile__Q29textinput7toolbar

View File

@@ -455,7 +455,7 @@ def IPLSection(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
def ZI8Lib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
return {
"lib": lib_name,
"mw_version": config.linker_version,
"mw_version": "GC/3.0a5",
"cflags": cflags_zi8,
"progress_category": "rvlmwm",
"objects": objects,
@@ -991,11 +991,11 @@ config.libs = [
Object(Matching, "clib/zi8copy.c"),
Object(Matching, "clib/zi8dawg.c"),
Object(Matching, "clib/zi8getc.c"),
Object(NonMatching, "clib/zi8getc2.c"),
Object(Matching, "clib/zi8getc2.c"),
Object(Matching, "clib/zi8getSW.c"),
Object(Matching, "clib/zi8initd.c"),
Object(Matching, "clib/zi8is.c"),
Object(NonMatching, "clib/zi8match.c"),
Object(Matching, "clib/zi8match.c"),
Object(Matching, "clib/zi8misc.c"),
Object(Matching, "clib/zi8pud2.c"),
Object(Matching, "clib/Zi8punct.c"),
@@ -1003,13 +1003,13 @@ config.libs = [
Object(NonMatching, "clib/zi8uwd.c"),
Object(Matching, "clib/zi8ver.c"),
Object(Matching, "clib/zi8ZHuwd.c"),
Object(NonMatching, "clib/zidawg1.c"),
Object(Matching, "clib/zidawg1.c"),
Object(Matching, "clib/zikorean.c"),
Object(Matching, "clib/ziswordw.c"),
Object(NonMatching, "clib/zkokeyp.c"),
Object(Matching, "clib/zierror.c"),
Object(NonMatching, "clib/zmtkey.c"),
Object(NonMatching, "clib/zoemdata.c"),
Object(Matching, "clib/zmtkey.c"),
Object(Matching, "clib/zoemdata.c"),
Object(NonMatching, "clib/zprepare.c"),
]
),
@@ -1674,7 +1674,7 @@ config.libs = [
),
RVLSDKLib("wad", [
Object(Matching, "wad/certs.c"),
Object(NonMatching, "wad/wad.c"),
Object(Matching, "wad/wad.c"),
]
),
RVLSDKLib("cnt", [

211
docs/asm-inventory.md Normal file
View File

@@ -0,0 +1,211 @@
# Assembly inventory
4.3U, 2026-10-05. 173 functions contain 175 assembly
bodies/blocks: 162 ORIGINAL functions and 11 PLACEHOLDER functions.
Run `python3 tools/check_asm_inventory.py`. Completion requires exit 0, complete
coverage and zero placeholders. The checker also rejects stale/duplicate rows,
invalid classifications and syntax it cannot inspect. This audit supersedes the
historical inventory in `tools/decomp-assist/asm-inventory.md`.
Scope: C/C++ sources and headers in `src/` and `libs/`, including inactive
platform branches, plus standalone assembly there or referenced by
`configure.py`. There are currently no standalone assembly files in that scope.
One row covers all blocks in a function; runtime save/restore entry labels belong
to their enclosing assembly body. Names use their source spelling. Declarations,
comments and string contents do not count.
ORIGINAL requires hardware, startup, runtime or original SDK assembly evidence.
An SDK path, `nofralloc` alone or an exact assembled object proves no C conversion.
The rvl_dec family follows the original decoder convention specified for this
audit; ASH/ASR also show unsigned `lis @h`/`ori @l` address construction and
hand-built `stmw` frames. C scores below are recorded rejected trials, not fresh
measurements or scores of the retained assembly. Unrecorded means no C score was
found. Historical logs absent from this branch have commit IDs and excerpts in
[the audit log](../tools/decomp-assist/rx36.attempts.md).
| File | Function | Classification | Evidence |
| --- | --- | --- | --- |
| `libs/MetroTRK/src/Export/targsupp.c` | `TRKAccessFile` | ORIGINAL | twi 31,r0,0 is the debugger file-service trap, with debugger-controlled return registers. |
| `libs/MetroTRK/src/Export/targsupp.c` | `TRKOpenFile` | ORIGINAL | twi 31,r0,0 is the debugger file-service trap, with debugger-controlled return registers. |
| `libs/MetroTRK/src/Export/targsupp.c` | `TRKCloseFile` | ORIGINAL | twi 31,r0,0 is the debugger file-service trap, with debugger-controlled return registers. |
| `libs/MetroTRK/src/Export/targsupp.c` | `TRKPositionFile` | ORIGINAL | twi 31,r0,0 is the debugger file-service trap, with debugger-controlled return registers. |
| `libs/NW4R/include/nw4r/math/arithmetic.h` | `FSelect` | ORIGINAL | fsel inline assembly matches the public [NW4R arithmetic header][arithmetic-h]. |
| `libs/NW4R/include/nw4r/math/arithmetic.h` | `FAbs` | ORIGINAL | fabs inline assembly matches the public [NW4R arithmetic header][arithmetic-h]. |
| `libs/NW4R/include/nw4r/math/types.h` | `VEC3Add` | ORIGINAL | psq_l/ps_add/psq_st implements paired-single vector/matrix operations. |
| `libs/NW4R/include/nw4r/math/types.h` | `VEC3Sub` | ORIGINAL | psq_l/ps_sub/psq_st implements paired-single vector/matrix operations. |
| `libs/NW4R/include/nw4r/math/types.h` | `VEC3Scale` | ORIGINAL | psq_l/ps_muls0/psq_st implements paired-single vector/matrix operations. |
| `libs/NW4R/src/math/math_arithmetic.cpp` | `FrSqrt` | ORIGINAL | frsqrte plus fixed refinement matches the public [NW4R arithmetic assembly][arithmetic-cpp]. |
| `libs/NW4R/src/math/math_types.cpp` | `MTX44Identity` | ORIGINAL | psq_st/ps_merge01/ps_merge10 implements paired-single vector/matrix operations. |
| `libs/RVLMiddleware/TMC_JPEG/src/jpegdec/jdec_main.c` | `TMCJPEGDEC_err_restart` | PLACEHOLDER | JPEG marker scan; best C 95.73913%, 114/115 instructions, folded exit branch, [rx19](../tools/decomp-assist/rx19.attempts.md), [rx24][rx24]. |
| `libs/RVL_SDK/include/revolution/os/OSFastCast.h` | `OSInitFastCast` | ORIGINAL | mtspr programs the GQR quantization registers. |
| `libs/RVL_SDK/include/revolution/os/OSFastCast.h` | `__OSu16tof32` | ORIGINAL | psq_l uses a GQR integer conversion format for the fast cast. |
| `libs/RVL_SDK/include/revolution/os/OSFastCast.h` | `__OSf32tou8` | ORIGINAL | psq_st uses a GQR integer conversion format for the fast cast. |
| `libs/RVL_SDK/include/revolution/os/OSFastCast.h` | `__OSf32tou16` | ORIGINAL | psq_st uses a GQR integer conversion format for the fast cast. |
| `libs/RVL_SDK/include/revolution/os/OSFastCast.h` | `__OSs16tof32` | ORIGINAL | psq_l uses a GQR integer conversion format for the fast cast. |
| `libs/RVL_SDK/include/revolution/os/OSFastCast.h` | `__OSf32tos16` | ORIGINAL | psq_st uses a GQR integer conversion format for the fast cast. |
| `libs/RVL_SDK/src/ai/ai.c` | `__AICallbackStackSwitch` | ORIGINAL | Saves r1 to __OldStack, installs __CallbackStack, calls through LR, then restores r1. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfmsr` | ORIGINAL | Special-register or synchronization operation: `mfmsr r3`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtmsr` | ORIGINAL | Special-register or synchronization operation: `mtmsr newMSR`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCOrMsr` | ORIGINAL | Special-register or synchronization operation: `mfmsr r4`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCAndMsr` | ORIGINAL | Special-register or synchronization operation: `mfmsr r4`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCAndCMsr` | ORIGINAL | Special-register or synchronization operation: `mfmsr r4`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfhid0` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, HID0`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMthid0` | ORIGINAL | Special-register or synchronization operation: `mtspr HID0, newHID0`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfhid1` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, HID1`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfl2cr` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, L2CR`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtl2cr` | ORIGINAL | Special-register or synchronization operation: `mtspr L2CR, newL2cr`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtdec` | ORIGINAL | Special-register or synchronization operation: `mtdec newDec`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfdec` | ORIGINAL | Special-register or synchronization operation: `mfdec r3`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCSync` | ORIGINAL | Special-register or synchronization operation: `sc`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCEieio` | ORIGINAL | Special-register or synchronization operation: `mfmsr r5`, `mtmsr r6`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCHalt` | ORIGINAL | Special-register or synchronization operation: `sync`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfmmcr0` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, MMCR0`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtmmcr0` | ORIGINAL | Special-register or synchronization operation: `mtspr MMCR0, newMmcr0`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfmmcr1` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, MMCR1`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtmmcr1` | ORIGINAL | Special-register or synchronization operation: `mtspr MMCR1, newMmcr1`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfpmc1` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, PMC1`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtpmc1` | ORIGINAL | Special-register or synchronization operation: `mtspr PMC1, newPmc1`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfpmc2` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, PMC2`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtpmc2` | ORIGINAL | Special-register or synchronization operation: `mtspr PMC2, newPmc2`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfpmc3` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, PMC3`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtpmc3` | ORIGINAL | Special-register or synchronization operation: `mtspr PMC3, newPmc3`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfpmc4` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, PMC4`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtpmc4` | ORIGINAL | Special-register or synchronization operation: `mtspr PMC4, newPmc4`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMffpscr` | ORIGINAL | Special-register or synchronization operation: `mffs fp31`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfsia` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, SIA`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtsia` | ORIGINAL | Special-register or synchronization operation: `mtspr SIA, newSia`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtfpscr` | ORIGINAL | Special-register or synchronization operation: `mtfsf 0xff, fp31`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfhid2` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, HID2`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMthid2` | ORIGINAL | Special-register or synchronization operation: `mtspr HID2, newhid2`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfwpar` | ORIGINAL | Special-register or synchronization operation: `sync`, `mfspr r3, WPAR`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtwpar` | ORIGINAL | Special-register or synchronization operation: `mtspr WPAR, newwpar`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfdmaU` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, DMA_U`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfdmaL` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, DMA_L`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtdmaU` | ORIGINAL | Special-register or synchronization operation: `mtspr DMA_U, newdmau`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMtdmaL` | ORIGINAL | Special-register or synchronization operation: `mtspr DMA_L, newdmal`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMfpvr` | ORIGINAL | Special-register or synchronization operation: `mfspr r3, PVR`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCSetFpIEEEMode` | ORIGINAL | Special-register or synchronization operation: `mtfsb0 FPSCR_NI_BIT`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCSetFpNonIEEEMode` | ORIGINAL | Special-register or synchronization operation: `mtfsb1 FPSCR_NI_BIT`. |
| `libs/RVL_SDK/src/base/PPCArch.c` | `PPCMthid4` | ORIGINAL | Both branches write HID4 with mtspr; the fallback preserves the Broadway H4A bit. |
| `libs/RVL_SDK/src/cntcache/cntcache.c` | `CNTCACHEClear` | PLACEHOLDER | NAND/token logic; best C 93.364235%, 147/151 instructions, four missing pool literals, [rx30][rx30]. |
| `libs/RVL_SDK/src/cntcache/cntcache.c` | `_CNTCACHEIsTitleRemovable` | PLACEHOLDER | NAND/TMD checks; best diagnostic C 93.70731%, 82/82 instructions, status-register interference, [rx18][rx18]. |
| `libs/RVL_SDK/src/cntcache/cntcache.c` | `_CNTCACHEDeleteContent` | PLACEHOLDER | Token parsing and ES deletion; best C 95.793106%, 143/145 instructions, missing reload/copy, [rx18][rx18]. |
| `libs/RVL_SDK/src/db/db.c` | `__DBExceptionDestination` | ORIGINAL | mfmsr/mtmsr enable address translation before the exception-handler tail branch. |
| `libs/RVL_SDK/src/gx/GXLight.c` | `PushLight` | ORIGINAL | psq_l/psq_st transfers paired-single values for the GX command stream. |
| `libs/RVL_SDK/src/gx/GXTransform.c` | `WriteProjPS` | ORIGINAL | psq_l/psq_st transfers paired-single values for the GX command stream. |
| `libs/RVL_SDK/src/gx/GXTransform.c` | `Copy6Floats` | ORIGINAL | psq_l/psq_st copies three pairs of floats. |
| `libs/RVL_SDK/src/gx/GXTransform.c` | `WriteMTXPS4x3` | ORIGINAL | psq_l/psq_st transfers paired-single values for the GX command stream. |
| `libs/RVL_SDK/src/gx/GXTransform.c` | `WriteMTXPS3x3from3x4` | ORIGINAL | psq_l/psq_st transfers paired-single values for the GX command stream. |
| `libs/RVL_SDK/src/gx/GXTransform.c` | `WriteMTXPS4x2` | ORIGINAL | psq_l/psq_st transfers paired-single values for the GX command stream. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXIdentity` | ORIGINAL | psq_st/ps_merge01/ps_merge10 implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXCopy` | ORIGINAL | psq_l/psq_st implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXConcat` | ORIGINAL | psq_l/ps_muls0/ps_madds1/ps_madds0 implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXInverse` | ORIGINAL | psq_l/ps_merge10/ps_mul/ps_msub implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXInvXpose` | ORIGINAL | psq_l/ps_merge10/ps_mul/ps_msub implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXRotTrig` | ORIGINAL | Two blocks use frsp, ps_neg, ps_merge00 and psq_st to construct a paired-single rotation. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXTrans` | ORIGINAL | psq_st implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXTransApply` | ORIGINAL | psq_l/psq_st/ps_sum1 implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXScale` | ORIGINAL | psq_st implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtx.c` | `PSMTXScaleApply` | ORIGINAL | psq_l/ps_muls0/psq_st implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/mtxvec.c` | `PSMTXMultVec` | ORIGINAL | psq_l/ps_mul/ps_madd/ps_sum0 implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/vec.c` | `PSVECNormalize` | ORIGINAL | psq_l/ps_mul/ps_madd/ps_sum0 implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/mtx/vec.c` | `PSVECCrossProduct` | ORIGINAL | psq_l/ps_merge10/ps_mul/ps_muls0 implements paired-single vector/matrix operations. |
| `libs/RVL_SDK/src/os/OS.c` | `__OSFPRInit` | ORIGINAL | mfmsr/mtmsr enable the FPU; psq_l initializes paired registers and mtfsf initializes FPSCR. |
| `libs/RVL_SDK/src/os/OS.c` | `__OSDBIntegrator` | ORIGINAL | nofralloc debug-vector fragment changes MSR and transfers through the saved hook LR. |
| `libs/RVL_SDK/src/os/OS.c` | `__OSDBJump` | ORIGINAL | Single absolute bla __OSDBJumpTarget between entry labels copied into exception vectors. |
| `libs/RVL_SDK/src/os/OS.c` | `OSExceptionVector` | ORIGINAL | Saves interrupted state, sets SRR0/SRR1 and executes rfi into the exception handler. |
| `libs/RVL_SDK/src/os/OS.c` | `OSDefaultExceptionHandler` | ORIGINAL | Captures GQR1..7 with mfspr and interrupted r13..31 with stmw before dispatch. |
| `libs/RVL_SDK/src/os/OS.c` | `__OSPSInit` | ORIGINAL | mtspr initializes GQR0..7 for paired-single quantization. |
| `libs/RVL_SDK/src/os/OSAlarm.c` | `DecrementerExceptionHandler` | ORIGINAL | Saves interrupted GPRs and GQR1..7 via stmw/mfspr before the C callback. |
| `libs/RVL_SDK/src/os/OSCache.c` | `DCEnable` | ORIGINAL | sync and HID0 mfspr/mtspr enable the data cache. |
| `libs/RVL_SDK/src/os/OSCache.c` | `DCInvalidateRange` | ORIGINAL | dcbi invalidates each cache line. |
| `libs/RVL_SDK/src/os/OSCache.c` | `DCFlushRange` | ORIGINAL | dcbf flushes cache lines; sc invokes the synchronization vector. |
| `libs/RVL_SDK/src/os/OSCache.c` | `DCStoreRange` | ORIGINAL | dcbst writes cache lines; sc invokes the synchronization vector. |
| `libs/RVL_SDK/src/os/OSCache.c` | `DCFlushRangeNoSync` | ORIGINAL | dcbf flushes cache lines without the synchronization call. |
| `libs/RVL_SDK/src/os/OSCache.c` | `DCZeroRange` | ORIGINAL | dcbz zeroes each cache line. |
| `libs/RVL_SDK/src/os/OSCache.c` | `ICInvalidateRange` | ORIGINAL | icbi invalidates instructions, followed by sync/isync. |
| `libs/RVL_SDK/src/os/OSCache.c` | `ICFlashInvalidate` | ORIGINAL | HID0 mfspr/mtspr triggers instruction-cache flash invalidation. |
| `libs/RVL_SDK/src/os/OSCache.c` | `ICEnable` | ORIGINAL | isync and HID0 mfspr/mtspr enable the instruction cache. |
| `libs/RVL_SDK/src/os/OSCache.c` | `LCDisable` | ORIGINAL | dcbi clears locked-cache lines; HID2 mfspr/mtspr disables the locked cache. |
| `libs/RVL_SDK/src/os/OSContext.c` | `__OSLoadFPUContext` | ORIGINAL | Restores caller FPRs, FPSCR and paired-single halves using mtfsf/psq_l. |
| `libs/RVL_SDK/src/os/OSContext.c` | `__OSSaveFPUContext` | ORIGINAL | Captures caller FPSCR/FPRs and paired-single halves using mffs/psq_st. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSLoadFPUContext` | ORIGINAL | Moves context to r4 and tail-branches to __OSLoadFPUContext, which replaces caller FPRs. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSaveFPUContext` | ORIGINAL | Moves context to r5 and tail-branches to __OSSaveFPUContext before caller FPRs change. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSetCurrentContext` | ORIGINAL | mfmsr/mtmsr/isync change the FPU-enable bit while installing context pointers. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSaveContext` | ORIGINAL | Captures caller r1/r2, GPRs, GQR1..7, CR, LR, XER and MSR for a later nonlocal return. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSLoadContext` | ORIGINAL | Restores GPRs and GQR1..7, sets SRR0/SRR1 and resumes interrupted execution with rfi. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSGetStackPointer` | ORIGINAL | nofralloc leaf returns the caller stack pointer directly with mr r3,r1. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSwitchStack` | ORIGINAL | Returns the old r1 and installs the supplied stack pointer directly. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSwitchFiber` | ORIGINAL | Installs another r1 and calls the supplied PC through LR; restores the old stack afterward. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSwitchFiberEx` | ORIGINAL | Preserves r3..r6 arguments while switching r1 and calling the supplied PC through LR. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSInitContext` | ORIGINAL | Copies live ABI registers r2/r13 directly and seeds SRR state for a new execution context. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSSwitchFPUContext` | ORIGINAL | mfmsr/mtmsr/isync enable the FPU; the exception path restores SRR state and uses rfi. |
| `libs/RVL_SDK/src/os/OSContext.c` | `OSFillFPUContext` | ORIGINAL | mfmsr/mtmsr/isync enable the FPU before mffs and paired-single register saves. |
| `libs/RVL_SDK/src/os/OSInterrupt.c` | `OSDisableInterrupts` | ORIGINAL | mfmsr/mtmsr read and clear MSR_EE atomically within the restartable sequence. |
| `libs/RVL_SDK/src/os/OSInterrupt.c` | `OSEnableInterrupts` | ORIGINAL | mfmsr/mtmsr read and set MSR_EE. |
| `libs/RVL_SDK/src/os/OSInterrupt.c` | `OSRestoreInterrupts` | ORIGINAL | mfmsr/mtmsr replace MSR_EE with the saved interrupt state. |
| `libs/RVL_SDK/src/os/OSInterrupt.c` | `ExternalInterruptHandler` | ORIGINAL | Captures interrupted GPRs and GQR1..7 with stmw/mfspr before C interrupt dispatch. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM1_24MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM1_48MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM2_52MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM2_56MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM2_64MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM2_112MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM2_128MB` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `ConfigMEM_ES1_0` | ORIGINAL | isync and mtspr program IBAT/DBAT mappings; SRR0/SRR1 and rfi return with translation enabled. |
| `libs/RVL_SDK/src/os/OSMemory.c` | `RealMode` | ORIGINAL | Writes SRR0/SRR1 and executes rfi with address translation disabled. |
| `libs/RVL_SDK/src/os/OSSync.c` | `SystemCallVector` | ORIGINAL | Changes HID0 with mfspr/mtspr around sync/isync, then returns with rfi. |
| `libs/RVL_SDK/src/os/OSTime.c` | `OSGetTime` | ORIGINAL | mftbu/mftb/mftbu retries until the upper time-base word is stable. |
| `libs/RVL_SDK/src/os/OSTime.c` | `OSGetTick` | ORIGINAL | mftb reads the hardware time-base register. |
| `libs/RVL_SDK/src/os/OSTime.c` | `__SetTime` | ORIGINAL | mttbl/mttbu/mttbl updates the hardware time base in a fixed sequence. |
| `libs/RVL_SDK/src/os/__ppc_eabi_init.cpp` | `__init_hardware` | ORIGINAL | Before normal C startup, mfmsr/mtmsr enables the FPU and r31 holds LR across init calls. |
| `libs/RVL_SDK/src/os/__ppc_eabi_init.cpp` | `__flush_cache` | ORIGINAL | dcbst/sync/icbi/isync make freshly initialized code visible to instruction fetch. |
| `libs/RVL_SDK/src/os/__ppc_eabi_init.cpp` | `__init_user` | ORIGINAL | fralloc/bl __init_cpp/frfree/blr matches the public [SDK startup assembly][sdk-init]. |
| `libs/RevoEX/src/nwc24/NWC24UserId.c` | `getUnScrambleId` | PLACEHOLDER | Integer byte permutation; best C 76.27329%, 161/161 instructions, 97 register/scheduling differences, [rx30][rx30]. |
| `libs/Runtime/src/Gecko_setjmp.c` | `__setjmp` | ORIGINAL | Saves or restores caller GPRs/FPRs, LR, CR, and stack state across nonlocal returns. |
| `libs/Runtime/src/Gecko_setjmp.c` | `longjmp` | ORIGINAL | Saves or restores caller GPRs/FPRs, LR, CR, and stack state across nonlocal returns. |
| `libs/Runtime/src/__init_cpp_exceptions.cpp` | `__exception_info_constants` | ORIGINAL | Reads the caller ABI TOC register r2 directly for exception registration. |
| `libs/Runtime/src/ptmf.c` | `__ptmf_scall` | ORIGINAL | Special compiler ABI takes the member-function descriptor in r12 and tail-dispatches through CTR. |
| `libs/Runtime/src/runtime.c` | `__cvt_fp2unsigned` | ORIGINAL | Unsigned conversion runtime helper with explicit CR0/CR6/CR7 tests; [public runtime assembly][runtime]. |
| `libs/Runtime/src/runtime.c` | `__save_fpr` | ORIGINAL | Entry labels _savefpr_14..31 store caller FPRs relative to r11 without an ABI call frame. |
| `libs/Runtime/src/runtime.c` | `__restore_fpr` | ORIGINAL | Entry labels _restfpr_14..31 reload caller FPRs relative to r11 without an ABI call frame. |
| `libs/Runtime/src/runtime.c` | `__save_gpr` | ORIGINAL | Entry labels _savegpr_14..31 store caller GPRs relative to r11 without an ABI call frame. |
| `libs/Runtime/src/runtime.c` | `__restore_gpr` | ORIGINAL | Entry labels _restgpr_14..31 reload caller GPRs relative to r11 without an ABI call frame. |
| `libs/Runtime/src/runtime.c` | `__div2u` | ORIGINAL | 64-bit compiler division helper uses r3:r4/r5:r6 and carry chains; [public assembly][runtime]. |
| `libs/Runtime/src/runtime.c` | `__div2i` | ORIGINAL | Signed 64-bit compiler division helper manages register-pair signs/carry; [public assembly][runtime]. |
| `libs/Runtime/src/runtime.c` | `__mod2u` | ORIGINAL | 64-bit compiler remainder helper uses register-pair restoring division; [public assembly][runtime]. |
| `libs/Runtime/src/runtime.c` | `__mod2i` | ORIGINAL | Signed 64-bit compiler remainder helper manages register-pair signs/carry; [public assembly][runtime]. |
| `libs/Runtime/src/runtime.c` | `__shl2i` | ORIGINAL | Compiler helper shifts r3:r4 by r5 without recursively calling the 64-bit shift helper. |
| `libs/Runtime/src/runtime.c` | `__shr2u` | ORIGINAL | Compiler helper shifts unsigned r3:r4 by r5 across the word boundary. |
| `libs/Runtime/src/runtime.c` | `__shr2i` | ORIGINAL | Compiler helper shifts signed r3:r4 by r5, explicitly propagating the sign. |
| `libs/Runtime/src/runtime.c` | `__cvt_sll_dbl` | ORIGINAL | Compiler conversion ABI uses r3:r4 input and f1 result with explicit carry/rounding. |
| `libs/Runtime/src/runtime.c` | `__cvt_ull_dbl` | ORIGINAL | Compiler conversion ABI uses r3:r4 input and f1 result with explicit carry/rounding. |
| `libs/Runtime/src/runtime.c` | `__cvt_ull_flt` | ORIGINAL | Compiler conversion ABI uses r3:r4 input and f1 result with explicit single-precision rounding. |
| `libs/Runtime/src/runtime.c` | `__cvt_dbl_usll` | ORIGINAL | Compiler conversion ABI uses f1 input and r3:r4 result without a recursive conversion call. |
| `libs/Runtime/src/runtime.c` | `__cvt_dbl_ull` | ORIGINAL | Compiler conversion helper decodes f1 into r3:r4; [public runtime assembly][runtime]. |
| `src/BS2/BS2Init.c` | `ClearOtherBATs` | ORIGINAL | isync and direct IBAT/DBAT register writes. |
| `src/BS2/BS2Mach.c` | `Run` | ORIGINAL | Clears ABI registers, replaces r1, uses dcbz/dcbf, and jumps via LR. |
| `src/BS2/BS2Start.c` | `__start` | ORIGINAL | Runs before the C stack and ABI registers exist; constructs the initial stack. |
| `src/BS2/BS2Start.c` | `__init_registers` | ORIGINAL | Initializes GPRs, r1, r2, and r13 for the C runtime. |
| `src/scene/nakamuraTest/gamespy/common/gsPlatformUtil.c` | `GetTicks` | ORIGINAL | Inactive PS2 branch reads the CP0 Count register with mfc0 $9. |
| `src/system/TVRC.cpp` | `TVRCSendStartAsync` | PLACEHOLDER | IR command setup; best recorded C 99.77273%, 198/198 instructions, seven differences, [rx2](../tools/decomp-assist/rx2.attempts.md); newer [rx17][rx17] 99.747475%. |
| `src/system/iplChannelManager.cpp` | `getTitleName__Q33ipl7channel7ManagerCFiii` | PLACEHOLDER | Channel-name copying; best C 99.57746%, 71/71 instructions, four address-order differences, [rx17][rx17]. |
| `src/system/iplSaveDataManager.cpp` | `Manager::hasChannel` | PLACEHOLDER | Title-slot search; best C 98.87324%, 71/71 instructions, 14 mask/base register differences, [rx30][rx30]. |
| `src/system/iplSaveDataManager.cpp` | `Manager::makePriorTitleIDList` | PLACEHOLDER | Title filtering; best recorded C 80.22556%, 124/133 instructions, address CSE, [da1](../tools/decomp-assist/da1.attempts.md); newer [rx17][rx17] 79.827065%. |
| `src/system/iplSaveDataManager.cpp` | `Manager::doUpdateChanInfos` | PLACEHOLDER | Channel metadata updates; best C 93.35821%, 68/67 instructions, extra memset base, [rx17][rx17]. |
| `src/system/iplSystem.cpp` | `System::warning_run` | PLACEHOLDER | Scene/render calls; best C 98.66477%, 176/176 instructions, 47 saved-register differences, [rx17][rx17]. |
| `src/system/rvl_dec.c` | `Rvl_decode` | ORIGINAL | Direct beq decoder entries preserve r3/r4 and LR; lis/ori builds the format signatures. |
| `src/system/rvl_dec.c` | `Rvl_decode_szs` | ORIGINAL | Original SZS decoder convention: nofralloc, r0 retains output length, fixed r3..r10/CTR byte-copy pipeline. |
| `src/system/rvl_dec.c` | `Rvl_decode_ash` | ORIGINAL | nofralloc hand-built 0x40 frame saves r21..31 with stmw; work address uses lis @h/ori @l. |
| `src/system/rvl_dec.c` | `Rvl_decode_asr` | ORIGINAL | nofralloc hand-built 0x40 frame saves r21..31 with stmw; work address uses lis @h/ori @l. |
[rx17]: ../tools/decomp-assist/rx36.attempts.md#rx17
[rx18]: ../tools/decomp-assist/rx36.attempts.md#rx18
[rx24]: ../tools/decomp-assist/rx36.attempts.md#rx24
[rx30]: ../tools/decomp-assist/rx36.attempts.md#rx30
[rx36-osinit]: ../tools/decomp-assist/rx36.attempts.md#osinit
[sdk-init]: https://github.com/doldecomp/ogws/blob/master/src/revolution/OS/__ppc_eabi_init.c
[runtime]: https://github.com/doldecomp/ogws/blob/master/src/runtime/runtime.c
[arithmetic-h]: https://github.com/doldecomp/ogws/blob/master/include/nw4r/math/math_arithmetic.h
[arithmetic-cpp]: https://github.com/doldecomp/ogws/blob/master/src/nw4r/math/math_arithmetic.cpp

View File

@@ -38,7 +38,7 @@ private:
private:
SetupParam mSetupParam; // 0x9C
bool unk_0xB0; // 0xB0
bool mReserved; // 0xB0
bool mIsSetData; // 0xB1
bool mIsPlaying; // 0xB2
bool mIsSetBuf; // 0xB3

View File

@@ -24,7 +24,7 @@ public:
virtual void setDataCur(u32 sampleOffset) = 0;
private:
undefined4 unk_0x04; // 0x04
undefined4 mReserved; // 0x04
};
class WaveFileAiff : public WaveFile {

View File

@@ -15,12 +15,12 @@ public:
AXVPB* getAXVPB() { return mpVPB; }
u32 getState() { return mState; }
u32 getUnk_0x08() { return unk_0x08; }
u32 getUnk_0x08() { return mStopResetState; }
int getUpdateFlag() { return mUpdateFlag; }
void setAXVPB(AXVPB* newVal) { mpVPB = newVal; }
void setState(u32 newVal) { mState = newVal; }
void setUnk_0x08(u32 newVal) { unk_0x08 = newVal; }
void setUnk_0x08(u32 newVal) { mStopResetState = newVal; }
void setUpdateFlag(u32 newVal) { mUpdateFlag = newVal; }
AXPBMIX* getMix() { return &mMix; }
@@ -30,7 +30,7 @@ public:
private:
AXVPB* mpVPB; // 0x00
u32 mState; // 0x04
u32 unk_0x08; // 0x08
u32 mStopResetState; // 0x08
int mUpdateFlag; // 0x0c
AXPBMIX mMix; // 0x10
};

View File

@@ -64,7 +64,7 @@ private:
SimpleWavePlayer mWavePlayer; // 0x18
AxAdpcmSimplePlayer mAdpcmPlayer; // 0x500
AxAdpcmHandle mAdpcmHandle; // 0x508
u8 unk_0x510; // 0x510
u8 mReserved; // 0x510
f32 mMasterVolume; // 0x514
};

View File

@@ -72,7 +72,7 @@ typedef struct CHANSVmObjHdr CHANSVmObjHdr;
typedef struct CHANSVmNativeClass CHANSVmNativeClass;
typedef struct {
vmU8 unk_0x00; // 0x00
vmU8 reserved; // 0x00
vmS32 val; // 0x01
} vmInt32ObjVal;
@@ -168,7 +168,7 @@ typedef struct CHANSVmNativeMethod {
u8 hasStar; // 0x06
u8 pad_0x07; // 0x07
CHANSVmFunction func; // 0x08
undefined unk_0x0C[0x14]; // 0x0C
undefined reserved[0x14]; // 0x0C
} CHANSVmNativeMethod;
typedef struct CHANSVmPropertyList {
@@ -184,7 +184,7 @@ typedef struct CHANSVmNativeProperty {
u8 pad_0x07; // 0x07
CHANSVmFunction getter; // 0x08
CHANSVmFunction setter; // 0x0C
undefined unk_0x10[0x10]; // 0x10
undefined reserved[0x10]; // 0x10
} CHANSVmNativeProperty;
struct CHANSVmNativeClass {
@@ -200,7 +200,7 @@ struct CHANSVmNativeClass {
vmSize nameLength; // 0x18
char sName[4]; // 0x1C
undefined unk_0x20[0x1C];
undefined classNameStorage[0x1C];
};
#ifdef __cplusplus

View File

@@ -131,7 +131,7 @@ typedef struct CHANSVmPrivate {
vmU32 exeStart; // 0x08
vmU32 exeSize; // 0x0C
vmS32 depth; // 0x10
vmU8 unk_0x14[4]; // 0x14
vmU8 reserved[4]; // 0x14
CHANSVmExecutionCtx* pContextListHead; // 0x18
vmU32 minFreeHeapSize; // 0x1C
vmU8* pHeapStart; // 0x20

View File

@@ -15,11 +15,11 @@ namespace ipl {
} FileInfo; // 0x0C
typedef struct CardState {
vu8 unk_0x00; // 0x00
vu8 reservedState; // 0x00
vu8 changed; // 0x01
vs16 state; // 0x02
vu16 unk_0x04; // 0x04
vu16 unk_0x06; // 0x06
vu16 reservedSlot; // 0x04
vu16 reservedCommand; // 0x06
vu32 key; // 0x08
vu16 unk_0x0C; // 0x0C
vu16 unk_0x0E; // 0x0E

View File

@@ -70,7 +70,7 @@ namespace ext_ead {
u32 mWidth; // 0x04
u32 mHeight; // 0x08
u32 unk_0x0C; // 0x0C
u32 mReserved; // 0x0C
OSMutex mMutex; // 0x10
BrowserThread* mpBrowserThread; // 0x28

View File

@@ -38,7 +38,7 @@ namespace textinput {
InputForm(textinput::Manager* manager, nw4r::lyt::MultiArcResourceAccessor* multiArc,
const char* layoutName, EventObserver* event, const char* fontName)
: textinput::InputForm(manager, multiArc, layoutName, event, fontName),
unk_0x308(NULL), unk_0x30C(NULL), unk_0x310(NULL), unk_0x314(NULL),
mpMemoPane(NULL), mpMemoRootPane(NULL), mpBoundPane(NULL), mpDrawPane(NULL),
mfScroll(0.0f), mfScrollFrom(0.0f), mfScrollTo(0.0f), mnLine(0),
mDrawRect(), mDefaultDrawSize(), mDefaultBoundSize(), mExScrollAnm(),
mpNigaoeObserver(NULL), mpDefaultNigaoe(NULL), mpSendString(NULL),
@@ -159,11 +159,11 @@ namespace textinput {
nw4r::lyt::Pane* mpDrawPane;
#else
#ifdef MYTIMANAGER_IMPLEMENTATION
undefined4* unk_0x308;
undefined4* mpMemoPane;
#endif
undefined4* unk_0x30C;
undefined4* unk_0x310;
undefined4* unk_0x314;
undefined4* mpMemoRootPane;
undefined4* mpBoundPane;
undefined4* mpDrawPane;
#endif
f32 mfScroll; // 0x318
f32 mfScrollFrom; // 0x31C

View File

@@ -20,7 +20,7 @@ namespace textinput {
InputForm(textinput::Manager* manager, nw4r::lyt::MultiArcResourceAccessor* multiArc,
const char* layoutName, EventObserver* event, const char* fontName)
: textinput::MemoInputForm(manager, multiArc, layoutName, event, fontName),
unk_0x400(0), mbPhotoDraw(false), meType(T_MailAddressSel) {}
mbPhotoScaledUp(0), mbPhotoDraw(false), meType(T_MailAddressSel) {}
#endif
#ifdef MYTILETTERFORM_IMPLEMENTATION
@@ -50,7 +50,7 @@ namespace textinput {
#ifdef MYTILETTERFORM_IMPLEMENTATION
bool mbPhotoScaledUp;
#else
u8 unk_0x400;
u8 mbPhotoScaledUp;
#endif
bool mbPhotoDraw; // 0x401
Type meType; // 0x404

View File

@@ -241,7 +241,7 @@ namespace textinput {
#endif
#endif
private:
u8 unk_0x00[0xFC];
u8 mKeyboardStateStorage[0xFC];
static HKBManager sInstance;
};

View File

@@ -414,9 +414,9 @@ namespace textinput {
#else
private:
#ifdef MYTIMANAGER_IMPLEMENTATION
u8 unk_0x2C0[0x48];
u8 mInputStateStorage[0x48];
#else
u8 unk_0x2C0[0x4C];
u8 mInputStateStorage[0x4C];
#endif
#endif
};

View File

@@ -24,10 +24,10 @@ namespace textinput {
u8 remaining[8];
#else
// todo
u32 field_0x00; // 0x00
u32 controller; // 0x00
u8 dummy[8];
u32 field_0x0C; // 0x0C
u32 field_0x10; // 0x10
u32 trigger; // 0x0C
u32 hold; // 0x10
u8 dummy2[12];
#endif
} Input;

View File

@@ -72,7 +72,7 @@ namespace textinput {
wchar_t mOutput[5];
#else
private:
u8 field_0x00[0x24];
u8 mKanaStateStorage[0x24];
#endif
};
@@ -81,7 +81,7 @@ namespace textinput {
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
Decolated(u16 maxLen) : StringBase(maxLen), mCursorStart(0), mCursorEnd(0), mbSustain(false), mTranslateMode(0) { initKanaConverter(); }
#else
Decolated(u16 maxLen) : StringBase(maxLen), field_0x18(0), field_0x1C(0), field_0x20(0), field_0x24(0) { initKanaConverter(); }
Decolated(u16 maxLen) : StringBase(maxLen), mCursorStart(0), mCursorEnd(0), mbSustain(0), mTranslateMode(0) { initKanaConverter(); }
#endif
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TISTRING_IMPLEMENTATION) || defined(TIZISTRING_IMPLEMENTATION)
@@ -181,10 +181,10 @@ namespace textinput {
u32 mTranslateMode;
#endif
#else
u32 field_0x18; // 0x18
u32 field_0x1C; // 0x1C
u8 field_0x20; // 0x20
u32 field_0x24; // 0x24
u32 mCursorStart; // 0x18
u32 mCursorEnd; // 0x1C
u8 mbSustain; // 0x20
u32 mTranslateMode; // 0x24
#endif
KanaStream mKanaStream; // 0x28
};

View File

@@ -38,7 +38,7 @@ namespace textinput {
nw4r::ut::Rect rect;
wchar_t character;
#else
u8 unk_0x00[32];
u8 rectangleAndCharacterStorage[32];
#endif
} DrawInfo;
@@ -177,7 +177,7 @@ namespace textinput {
u32 muDrawCacheStartPos;
#else
private:
u8 unk_0x50[0x78];
u8 mDrawStateStorage[0x78];
#endif
bool mbSecretMode; // 0xC8
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TITEXTDRAWER_IMPLEMENTATION) || defined(MYTILETTERFORM_IMPLEMENTATION)
@@ -202,7 +202,7 @@ namespace textinput {
f32 mfDrawScrollY;
u8 mDrawCacheState[0x14];
#else
u8 unk_0xCC[0x3C];
u8 mCacheStateStorage[0x3C];
#endif
#endif
};

View File

@@ -41,7 +41,7 @@ namespace ipl {
}
private:
u32 unk_0x28;
u32 mReserved;
EGG::Heap* mpHeap;
bool mbDisableCon; // 0x30

View File

@@ -159,7 +159,7 @@ namespace ipl {
int mButton; // 0x10
int mNextCount; // 0x14
int mPrevCount; // 0x18
int unk_0x1C; // 0x1C
int mResetState; // 0x1C
bool mbDragging; // 0x20
};
@@ -234,7 +234,7 @@ namespace ipl {
DragInfo mDrag; // 0x64
int mMode; // 0x88
layout::Object* mpLayout; // 0x8C
int unk_0x90; // 0x90
int mReserved; // 0x90
AddressEvent* mpEvent; // 0x94
gui::PaneManager* mpGui; // 0x98
layout::Object* mpBackLayout; // 0x9C

View File

@@ -369,8 +369,8 @@ namespace ipl {
BoardSD mBoardSD; // 0xFAC
bool mbExitRequest; // 0xFB4
int unk_0xFB8;
u8 unk_0xFBC[4];
int mNewMailAnimationPending;
u8 mReserved[4];
};
} // namespace scene
} // namespace ipl

View File

@@ -139,7 +139,7 @@ namespace ipl {
math::LinearIntp<math::VEC2> mMoveAnim; // 0x44
CDBId mCDBId; // 0x74
u8 unk_0x7C[4];
u8 mReservedBeforeRecordKey[4];
CDBRecordKey mCDBRecordKey; // 0x80
u32 mCDBGameCode; // 0xB0
@@ -179,7 +179,7 @@ namespace ipl {
int mState; // 0x12C
math::VEC2 mConPos; // 0x130
int mConChan; // 0x138
u8 unk_0x13C[4];
u8 mReserved[4];
static const char* mAnimNames[TYPE_MAX][1 + ANIM_MAX];

View File

@@ -75,9 +75,9 @@ namespace ipl {
void set_textbox_day();
void set_textbox_month();
void set_textbox_month(const char* paneName, const utility::Date& date);
void set_textbox_date(int unk, const utility::Date& date);
void set_textbox_date(int calendarIndex, const utility::Date& date);
void set_date_pos(int unk);
void set_date_pos(int calendarIndex);
void exec_search_task();

View File

@@ -35,7 +35,7 @@ namespace ipl {
Date(EGG::Heap* heap, nand::LayoutFile* file, const char* layoutFolder, const char* layoutFileName);
void calc();
void draw(bool unk);
void draw(bool focusedPass);
layout::PaneAnimator* doAnim(int animId);

View File

@@ -225,7 +225,7 @@ namespace ipl {
nw4r::ut::List mNandListingList; // 0x1C
nw4r::ut::List mSDListingList; // 0x28
undefined4 unk_0x34; // 0x34
undefined4 mReserved; // 0x34
Thumbnail mThumbnails[15]; // 0x38
WiiBannerFileInfo mBanners[15]; // 0x5C90
@@ -243,7 +243,7 @@ namespace ipl {
bool mbDisableThumbFetch; // 0xE8790
ESTitleId mTmpTitleId; // 0xE8798
bool unk_0xE87A0; // 0xE87a0
bool mbDeleteSDAppAfterRestore; // 0xE87a0
};
} // namespace scene
} // namespace ipl

View File

@@ -57,8 +57,8 @@ namespace ipl {
kitayama::NandSDWorker_AutoTest* mpAutoTest; // 0x64
void* mpWorkerBuf; // 0x68
void* mpWorkerCacheBuf; // 0x6C
u32 unk_0x70; // 0x70 (unused)
u32 unk_0x74; // 0x74 (unused)
u32 mReservedWorkerState; // 0x70 (unused)
u32 mReservedCacheState; // 0x74 (unused)
};
} // namespace scene
} // namespace ipl

View File

@@ -74,13 +74,13 @@ namespace ipl {
s32 mState; // 0x88
s32 mPrevState; // 0x8C
u8 mSlot; // 0x90
u8 unk_0x91[3]; // 0x91
u8 mReservedSlot[3]; // 0x91
s32 mSlotState[2]; // 0x94
s16 mIconIndex; // 0x9C
s16 mIconCount; // 0x9E
u8 mShowArwR; // 0xA0
u8 mShowArwL; // 0xA1
u8 unk_0xA2[2]; // 0xA2
u8 mReservedArrows[2]; // 0xA2
MemoryCardManager* mpManager; // 0xA4
MemoryBaseEvent* mpEvent; // 0xA8
nw4r::ut::List mSaveDataList; // 0xAC

View File

@@ -52,10 +52,10 @@ namespace ipl {
class Button {
public:
Button(nw4r::lyt::Pane* pane) : unk_0x04(0), mPane(pane) {}
Button(nw4r::lyt::Pane* pane) : mHoverCount(0), mPane(pane) {}
virtual ~Button();
u32 unk_0x04; // 0x04
u32 mHoverCount; // 0x04
nw4r::lyt::Pane* mPane; // 0x08
nw4r::ut::Link mLink; // 0x0C
};
@@ -63,8 +63,8 @@ namespace ipl {
class AnmButton {
public:
AnmButton(const char* name, Anm* anm1, Anm* anm2, Anm* anm3)
: unk_0x04(0), mName(name), mCurrentAnm(NULL), mAnm1(anm1), mAnm2(anm2), mAnm3(anm3),
unk_0x24(0), mLastCmd(0), mpBalloon(NULL) {}
: mHoverCount(0), mName(name), mCurrentAnm(NULL), mAnm1(anm1), mAnm2(anm2), mAnm3(anm3),
mAnimationState(0), mLastCmd(0), mpBalloon(NULL) {}
virtual ~AnmButton();
void calc();
@@ -72,14 +72,14 @@ namespace ipl {
void setBalloon(TextBalloon* balloon);
int unk_0x04; // 0x04
int mHoverCount; // 0x04
const char* mName; // 0x08
Anm* mCurrentAnm; // 0x0C
Anm* mAnm1; // 0x10
Anm* mAnm2; // 0x14
Anm* mAnm3; // 0x18
nw4r::ut::Link mLink; // 0x1C
u32 unk_0x24; // 0x24
u32 mAnimationState; // 0x24
int mLastCmd; // 0x28
TextBalloon* mpBalloon; // 0x2C
};
@@ -92,7 +92,7 @@ namespace ipl {
#ifdef IPL_MEMORYCARD_BASE_CTOR_OUT_OF_LINE
MemoryBase();
#else
MemoryBase() : mpLayout(NULL), unk_0x08(NULL) {
MemoryBase() : mpLayout(NULL), mpLayoutFile(NULL) {
nw4r::ut::List_Init(&mAnmList, offsetof(Anm, mLink));
nw4r::ut::List_Init(&mButtonList, offsetof(Button, mLink));
nw4r::ut::List_Init(&mAnmButtonList, offsetof(AnmButton, mLink));
@@ -136,7 +136,7 @@ namespace ipl {
protected:
layout::Object* mpLayout; // 0x04
nand::LayoutFile* unk_0x08; // 0x08
nand::LayoutFile* mpLayoutFile; // 0x08
gui::PaneManager* mpPaneManager; // 0x0C
nw4r::ut::List mAnmList; // 0x10
nw4r::ut::List mButtonList; // 0x1C

View File

@@ -71,15 +71,15 @@ namespace ipl {
typedef struct MCFile {
u32 fileNo; // 0x00
u32 unk_0x04; // 0x04
u32 unk_0x08; // 0x08
u32 reserved; // 0x04
u32 sortKeyHigh; // 0x08
s32 sortKey; // 0x0C
} MCFile; // 0x10
typedef struct MCFileCell {
wchar_t comment[2][0x40]; // 0x000
s16 iconAnmCounter; // 0x100
u16 unk_0x102; // 0x102
u16 reserved; // 0x102
GXTexObj icon; // 0x104
GXTexObj banner; // 0x124
GXTlutObj iconTlut; // 0x144
@@ -99,8 +99,8 @@ namespace ipl {
mLastCmd = 0;
__CARDSetDiskID(NULL);
memorycard::initCardThread();
sort_file_array(0);
sort_file_array(1);
sort_file_array(CARD_CHAN_0);
sort_file_array(CARD_CHAN_1);
}
virtual ~MemoryCardManager();
@@ -187,12 +187,28 @@ namespace ipl {
}
private:
u32 unk_0x04; // 0x00004
MCFile mFile[2][0x7F]; // 0x00008
MCFileCell mFileCell[2][0x7F]; // 0x00FE8
GXTexObj* initBannerTexture(u8 slot, s32 file, void* data) {
GXInitTexObj(&mFileCell[slot][file].banner, data, CARD_BANNER_WIDTH, CARD_BANNER_HEIGHT,
GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE);
return &mFileCell[slot][file].banner;
}
void initBannerTextureCI(u8 slot, s32 file, void* data) {
GXInitTexObjCI(&mFileCell[slot][file].banner, data, CARD_BANNER_WIDTH, CARD_BANNER_HEIGHT,
GX_TF_C8, GX_CLAMP, GX_CLAMP, GX_FALSE, GX_TLUT0);
}
GXTlutObj* initBannerPalette(u8 slot, s32 file, void* data) {
GXInitTlutObj(&mFileCell[slot][file].bannerTlut, data, GX_TL_RGB5A3, 0x100);
return &mFileCell[slot][file].bannerTlut;
}
u32 reserved; // 0x00004
MCFile mFile[2][CARD_MAX_FILE]; // 0x00008
MCFileCell mFileCell[2][CARD_MAX_FILE]; // 0x00FE8
s32 mLastResult; // 0x16930
s32 mLastCmd; // 0x16934
u32 unk_0x16938; // 0x16938
u32 mReservedResult; // 0x16938
MemCardEventListener* mpEventHandler; // 0x1693C
};
} // namespace scene

View File

@@ -54,9 +54,9 @@ namespace ipl {
u64 mAmtTotal; // 0x2B70
u16 mCurrVersion; // 0x2B78
void* mpNUPInstance; // 0x2B7C
u32 unk_0x2B80; // 0x2B80
u32 unk_0x2B84; // 0x2B84
u32 unk_0x2B88; // 0x2B88
u32 mReserved0; // 0x2B80
u32 mReserved1; // 0x2B84
u32 mReserved2; // 0x2B88
static EGG::Heap* spHeap;
static BOOL sNHTTPFinished;

View File

@@ -15,7 +15,7 @@ namespace ipl {
NET_SETUP_REQUESTED_STARTUP,
NET_SETUP_RUNNING,
NET_SETUP_SUCCESS,
NET_SETUP_UNK_4,
NET_SETUP_ALTERNATE_ERROR,
NET_SETUP_ERROR,
};

View File

@@ -48,8 +48,8 @@ namespace ipl {
void set_size(const char* paneName, const nw4r::lyt::Size& size);
const nw4r::lyt::Size* get_size(const char* paneName);
undefined4 unk_0x00;
undefined4 unk_0x04;
undefined4 mReserved;
undefined4 mReservedState;
BOOL mbWaitingFadeIn; // 0x08
layout::Object* mpLayout; // 0x0C

View File

@@ -39,13 +39,13 @@ namespace ipl {
int holdSEwithPosDis(const char* sndName, f32 x, f32 y);
#ifdef IPL_SOUND_MATCHING
void stopBGM(int unk = 0);
void stopBGM(int fadeFrames = 0);
#else
int stopBGM(int unk = 0);
int stopBGM(int fadeFrames = 0);
#endif
int stopBGM(nw4r::snd::SoundHandle* handle, int unk = 0);
void stopSE(nw4r::snd::SoundHandle* handle, int unk = 0);
void stopAllSound(int unk = 0);
int stopBGM(nw4r::snd::SoundHandle* handle, int fadeFrames = 0);
void stopSE(nw4r::snd::SoundHandle* handle, int fadeFrames = 0);
void stopAllSound(int fadeFrames = 0);
int resetAllSound();
@@ -92,14 +92,14 @@ namespace ipl {
tagSSeInfo* getFreeSEBlock(bool force);
BOOL startBannerSound(void*, u32, bool ignoreSize = false);
void stopBannerSound(int unk = 0);
void stopBannerSound(int fadeFrames = 0);
BOOL checkTmpSoundFile(void*, u32);
long clipGELT_S32(long value, long lo, long hi);
private:
u32 unk_0x620[3];
u32 mSoundWork[3];
};
// use getSystem() and getBannerPlayer() instead

View File

@@ -209,9 +209,9 @@
#define MESG_DATA_SD_CARD_LOCKED 62
#define MESG_DATA_SD_PROCESS_FAILED 151
#define MESG_DATA_FILE_CANT_BE_MOVED 205
#define MESG_DATA_MOVE_UNK_ERROR 215
#define MESG_DATA_COPY_UNK_ERROR 227
#define MESG_DATA_DEL_UNK_ERROR 229
#define MESG_DATA_MOVE_FAILED 215
#define MESG_DATA_COPY_FAILED 227
#define MESG_DATA_DELETE_FAILED 229
#define MESG_DATA_ERASE_DIALOG 247
#define MESG_DATA_ERASED 248
#define MESG_DATA_ERASING 251

View File

@@ -63,7 +63,7 @@ typedef union RBRRecordFlags {
u32 data;
struct {
u8 optOut; // 0x00
u8 unk_0x01[2];
u8 reserved[2];
u8 type; // 0x03
};
} RBRRecordFlags;

View File

@@ -52,7 +52,7 @@ namespace ipl {
BOOL isUnderFlow() const;
BOOL findByKey(CDBRecord* record, CDBRecordKey* recordKey);
BOOL search(const CDBDate& begin, const CDBDate& end, CDBSearchDirection searchDirection, CDBRecordLocation recordLocation, int unk2,
BOOL search(const CDBDate& begin, const CDBDate& end, CDBSearchDirection searchDirection, CDBRecordLocation recordLocation, int openRecord,
CDBSearchRecordCB searchRecordCB, void* searchRecordWork);
BOOL getDataSize(CDBRecord* record, u32* recordDataSize);
@@ -113,8 +113,8 @@ namespace ipl {
u8* mpSDVFWork; // 0x1C
OSMutex mMutex; // 0x20
u8 unk_0x38;
u8 unk_0x39;
u8 mReserved0;
u8 mReserved1;
};
class auto_closer {

View File

@@ -127,22 +127,22 @@ namespace ipl {
u32 bannerRSOIdx : 4; // 0x00:00001111000000000000000000000000
u32 iconCSIdx : 4; // 0x01:00000000111100000000000000000000
u32 bannerCSIdx : 4; // 0x01:00000000000011110000000000000000
u32 unk_15 : 1; // 0x02:00000000000000001000000000000000
u32 reservedBit15 : 1; // 0x02:00000000000000001000000000000000
u32 useAltSound : 1; // 0x02:00000000000000000100000000000000
u32 unk_13 : 1; // 0x02:00000000000000000010000000000000
u32 unk_12 : 1; // 0x02:00000000000000000001000000000000
u32 unk_11 : 1; // 0x02:00000000000000000000100000000000
u32 unk_10 : 1; // 0x02:00000000000000000000010000000000
u32 unk_09 : 1; // 0x02:00000000000000000000001000000000
u32 reservedBit13 : 1; // 0x02:00000000000000000010000000000000
u32 reservedBit12 : 1; // 0x02:00000000000000000001000000000000
u32 reservedBit11 : 1; // 0x02:00000000000000000000100000000000
u32 reservedBit10 : 1; // 0x02:00000000000000000000010000000000
u32 reservedBit09 : 1; // 0x02:00000000000000000000001000000000
u32 netSetting : 1; // 0x02:00000000000000000000000100000000
u32 unk_07 : 1; // 0x03:00000000000000000000000010000000
u32 unk_06 : 1; // 0x03:00000000000000000000000001000000
u32 unk_05 : 1; // 0x03:00000000000000000000000000100000
u32 unk_04 : 1; // 0x03:00000000000000000000000000010000
u32 unk_03 : 1; // 0x03:00000000000000000000000000001000
u32 unk_02 : 1; // 0x03:00000000000000000000000000000100
u32 unk_01 : 1; // 0x03:00000000000000000000000000000010
u32 unk_00 : 1; // 0x03:00000000000000000000000000000001
u32 reservedBit07 : 1; // 0x03:00000000000000000000000010000000
u32 reservedBit06 : 1; // 0x03:00000000000000000000000001000000
u32 reservedBit05 : 1; // 0x03:00000000000000000000000000100000
u32 reservedBit04 : 1; // 0x03:00000000000000000000000000010000
u32 reservedBit03 : 1; // 0x03:00000000000000000000000000001000
u32 reservedBit02 : 1; // 0x03:00000000000000000000000000000100
u32 reservedBit01 : 1; // 0x03:00000000000000000000000000000010
u32 isDisk : 1; // 0x03:00000000000000000000000000000001
};
}; // 0x18
} SMetaBlockHeader;
@@ -226,9 +226,9 @@ namespace ipl {
BOOL setupUrlJump(const char* url);
BOOL setupChannelJump(ESTitleId titleId, const char* data);
void* getDiskThumbnail(bool unk);
void* getDiskBanner(bool unk);
void* getDiskSound(bool unk);
void* getDiskThumbnail(bool invalidateReady);
void* getDiskBanner(bool invalidateReady);
void* getDiskSound(bool invalidateReady);
nand::MetaFile* loadThumbnailAsync(EGG::Heap* heap, int page, int index);
nand::MetaFile* loadBannerAsync(EGG::Heap* heap, int page, int index);
@@ -322,7 +322,7 @@ namespace ipl {
int updateWaitSCFlush();
void updateDiskState();
void* getDiskBannerData(int index, bool unk);
void* getDiskBannerData(int index, bool invalidateReady);
int searchMetaHeader(const u8* buffer);

View File

@@ -64,19 +64,19 @@ namespace ipl {
private:
enum {
CHANS_VM_STATE_UNK0 = 0,
CHANS_VM_STATE_UNK1,
CHANS_VM_STATE_UNK2,
CHANS_VM_STATE_UNK3,
CHANS_VM_STATE_UNK4,
CHANS_VM_STATE_IDLE = 0,
CHANS_VM_STATE_STARTING,
CHANS_VM_STATE_WAIT_BEGIN_RENDER,
CHANS_VM_STATE_RUNNING,
CHANS_VM_STATE_EXITING,
};
enum {
CHANS_VM_MSG_STATE_UNK0 = 0,
CHANS_VM_MSG_STATE_UNK1,
CHANS_VM_MSG_STATE_UNK2,
CHANS_VM_MSG_STATE_UNK3,
CHANS_VM_MSG_STATE_UNK4,
CHANS_VM_MSG_STATE_NONE = 0,
CHANS_VM_MSG_STATE_BEGIN_RENDER,
CHANS_VM_MSG_STATE_WAIT_RETRACE,
CHANS_VM_MSG_STATE_RESERVED,
CHANS_VM_MSG_STATE_EXIT,
};
u8* mpChansWork; // 0x00

View File

@@ -144,7 +144,7 @@ namespace ipl {
u32 mCurrentConChan; // 0x20
Vec2 projCenter; // 0x24
bool mbActivated; // 0x2C
u8 unk_0x2D;
u8 mReserved;
textinput::extend::savedata::MemoSetting mSaveData; // 0x2E
nand::File* mpSaveFile; // 0x38
};

View File

@@ -45,7 +45,7 @@ namespace ipl {
typedef struct MESGInfoBlock {
u32 offset; // 0x00
u32 flags; // 0x04
u32 unk_0x08; // 0x08
u32 reserved; // 0x08
} MESGInfoBlock;
typedef struct MESGDataHeader {

View File

@@ -47,13 +47,13 @@ namespace ipl {
RESULT_BROKEN_MEDIA = -9,
RESULT_ILLEGAL_MEDIA = -10,
RESULT_WRITE_PROTECTED = -11,
RESULT_UNK_N12 = -12,
RESULT_FILENAME_CONFLICT = -12,
RESULT_NOCOPY = -13,
RESULT_ES_ERROR = -14,
RESULT_NOT_TRANSFERRABLE = -15,
RESULT_VERSION_ERR = -16,
RESULT_SD_APP_LOC_NOT_FOUND = -17,
RESULT_UNK_18 = -18,
RESULT_CANCELLED = -18,
};
typedef struct SDAppMetaEntry {
@@ -211,8 +211,8 @@ namespace ipl {
MEMHeapHandle mainHeap; // 0x1E690
MEMHeapHandle saveCacheHeap; // 0x1E694
MEMHeapHandle appCacheHeap; // 0x1E698
MEMHeapHandle unkHeap; // 0x1E69C
MEMAllocator unkAllocator; // 0x1E6A0
MEMHeapHandle scratchHeap; // 0x1E69C
MEMAllocator scratchAllocator; // 0x1E6A0
u8 threadStack[STACK_SIZE]; // 0x1E6B0
OSThread thread; // 0x3e6B0
OSMutex mutex; // 0x3e9C8
@@ -240,7 +240,7 @@ namespace ipl {
nw4r::ut::Link link; // 0x10
u8 thumbnail[100 * 1024]; // 0x18
channel::SChanMgrMetaHeader metaHdr; // 0x19018
u8 unk_0x19018[8]; // 0x19618
u8 reserved[8]; // 0x19618
} AppCacheEntry;
typedef struct SaveCacheEntry {
@@ -248,7 +248,7 @@ namespace ipl {
ESTitleId titleId; // 0xF0A0
s32 size; // 0xF0A8
nw4r::ut::Link link; // 0xF0AC
u8 unk_0xf0b4[12]; // 0xF0B4
u8 reserved[12]; // 0xF0B4
} SaveCacheEntry;
typedef struct SDSaveBanner {
@@ -265,8 +265,8 @@ namespace ipl {
u32 thumbSize; // 0x08
NETMD5Sum headerMD5; // 0x0C
NETMD5Sum iconMD5; // 0x1C
u64 unk_0x30;
u64 unk_0x38;
u64 reservedBeforeMeta;
u64 reservedBeforeMetaEnd;
channel::SChanMgrMetaHeader metaHdr; // 0x40
} SDAppBanner;
@@ -332,7 +332,7 @@ namespace ipl {
MESSAGE_CHECK_BACKUP_FITS,
MESSAGE_COPY_SD_APP_TO_NAND,
MESSAGE_DEL_NAND_APP_HIDDEN,
MESSAGE_UNK_49,
MESSAGE_CHECK_SD_APP_TITLES,
MESSAGE_CHANGE_NAND_APP_COUNT,
MESSAGE_CHECK_SD_TITLE_RESTORABLE
} WorkMessage;

View File

@@ -133,7 +133,7 @@ namespace ipl {
void addDlTask();
BOOL getNewTitleTbl(u32* titleTbl) const;
BOOL isNewMessageThere(u32 unk) const;
BOOL isNewMessageThere(u32 appId) const;
int getErrCode();

View File

@@ -83,7 +83,7 @@ namespace ipl {
enum {
TYPE_POINT = 0,
TYPE_GRAB,
TYPE_UNK2,
TYPE_RESERVED,
TYPE_MAX, /* ??? */
};

View File

@@ -12,7 +12,7 @@ namespace ipl {
namespace postman {
class Manager : public utility::ut_thread {
public:
enum { STATE_NONE = 0, STATE_RUN_RECEIVE, STATE_STOP_RUN, STATE_USBETHER_MAC, STATE_DL_TASK, STATE_UNKNOWN };
enum { STATE_NONE = 0, STATE_RUN_RECEIVE, STATE_STOP_RUN, STATE_USBETHER_MAC, STATE_DL_TASK, STATE_INITIALIZING };
Manager(EGG::Heap* heap);
virtual ~Manager() {}
@@ -28,7 +28,7 @@ namespace ipl {
virtual void* Run();
int Get_CurrentState() const { return mState; }
BOOL IsUnknown() { return mState != STATE_UNKNOWN; }
BOOL IsUnknown() { return mState != STATE_INITIALIZING; }
BOOL NotRunning() { return mState == STATE_STOP_RUN; }
void Start_RegistTask(EGG::TaskThread* task) { task->request(register_nwc24, NULL, NULL); }

View File

@@ -21,8 +21,8 @@ namespace ipl {
static bool checkLANMacAddrAvailable();
private:
static void* allocfunc(u32 unk, s32 size);
static void freefunc(u32 unk, void* buffer, s32 size);
static void* allocfunc(u32 allocationName, s32 size);
static void freefunc(u32 allocationName, void* buffer, s32 size);
static char mMac[64];

View File

@@ -210,7 +210,7 @@ namespace ipl {
u32 mBS2BootType; // 0x21C
u32 mBS2LaunchCode; // 0x220
u32 unk_0x224;
u32 mReservedSceneState;
char* mspNetSettingArg; // 0x228
char* mspDataManageArg; // 0x22C
char msBS2FirstArgv[128]; // 0x230
@@ -241,7 +241,7 @@ namespace ipl {
vs32 mRegistState; // 0x2C0
vs32 mRegistErrCode; // 0x2C4
volatile bool mbGoingToDataManager; // 0x2C8
u8 unk_0x2CC[0x2D0 - 0x2CC];
u8 mReserved[0x2D0 - 0x2CC];
ESTitleId mBS2LaunchTitle; // 0x2B0
friend class System;

View File

@@ -18,7 +18,7 @@
#define TITLE_TYPE_DISC_CHANNEL ((TITLE_HITYPE_USER << 16) | 0x0004) /* 0x00010004 */
#define TITLE_TYPE_SHARED ((TITLE_HITYPE_USER << 16) | 0x0005) /* 0x00010005 */
#define TITLE_TYPE_UNK6 ((TITLE_HITYPE_USER << 16) | 0x0006) /* 0x00010006 */
#define TITLE_TYPE_UNK7 ((TITLE_HITYPE_USER << 16) | 0x0007) /* 0x00010007 */
#define TITLE_TYPE_USER_APP7 ((TITLE_HITYPE_USER << 16) | 0x0007) /* 0x00010007 */
#define TITLE_TYPE_HIDDEN_CHANNEL ((TITLE_HITYPE_USER << 16) | 0x0008) /* 0x00010008 */
#define TITLE_REGION_ALL 'A'

View File

@@ -6,9 +6,9 @@
namespace ipl {
namespace utility {
typedef struct CSFlagsData {
u8 unk_0x00[0x04 - 0x00];
u8 reservedHeader[0x04 - 0x00];
u32 flags; // 0x04
u8 unk_0x08[0x20 - 0x08];
u8 reserved[0x20 - 0x08];
enum {
FLAG_SYSCONF_EULA = 0,

View File

@@ -27,7 +27,7 @@ namespace ipl {
private:
OSMessage mMessages[count]; // 0x24
u32 unk_0x00; // (sizeof(mMessages) * count) + 0x00
u32 mReserved; // (sizeof(mMessages) * count) + 0x00
};
} // namespace utility
} // namespace ipl

View File

@@ -13,7 +13,7 @@ namespace EGG {
public:
struct Arg {
Heap* pHeap; // 0x00
undefined4 unk_0x04;
undefined4 reserved;
s32 soundThreadPrio; // 0x08
s32 dvdThreadPrio; // 0x0C
@@ -31,7 +31,7 @@ namespace EGG {
static const u32 DEFAULT_SOUND_HEAP_SIZE = 0x8CA000;
u32 soundHeapSize; // 0x10
u32 unk_0x14;
u32 reservedSoundHeap;
SimpleAudioMgrArg();
};

View File

@@ -44,7 +44,7 @@ namespace EGG {
u16 mFadeFrame; // 0x0A
u16 mFrame; // 0x0C
u8 unk_0x0E[2];
u8 mReserved[2];
nw4r::ut::Color mColor; // 0x10
nw4r::ut::Rect mSpace; // 0x14

View File

@@ -202,7 +202,7 @@ namespace EGG {
return false;
}
return mSoundArchivePlayer.LoadGroup((int)id, pHeap, 0);
return mSoundArchivePlayer.LoadGroup(id, pHeap, 0);
}
bool ArcPlayer::loadGroup(const char* pName, nw4r::snd::SoundHeap* pHeap) {

View File

@@ -15,14 +15,14 @@ namespace EGG {
AudioFxMgr::AudioFxMgrArg unused1;
}
void SimpleAudioMgrWithFx::initialize(IAudioMgr::Arg* arg) {
SimpleAudioMgr::initialize(arg);
void SimpleAudioMgrWithFx::initialize(IAudioMgr::Arg* audioArgs) {
SimpleAudioMgr::initialize(audioArgs);
if (arg != NULL) {
arg = (IAudioMgr::Arg*)&((ArgWithFx*)arg)->fxArg;
if (audioArgs != NULL) {
audioArgs = (IAudioMgr::Arg*)&((ArgWithFx*)audioArgs)->fxArg;
}
initializeFx(&mHeap, (AudioFxMgrArg*)arg);
initializeFx(&mHeap, (AudioFxMgrArg*)audioArgs);
setFxReverbHi(nw4r::snd::AUX_A, AudioFxMgr::getDefaultFxReverbHi());
setFxChorus(nw4r::snd::AUX_B, AudioFxMgr::getDefaultFxChorus());

View File

@@ -13,7 +13,7 @@ namespace EGG {
soundThreadPrio = nw4r::snd::SoundSystem::DEFAULT_SOUND_THREAD_PRIORITY;
dvdThreadPrio = nw4r::snd::SoundSystem::DEFAULT_DVD_THREAD_PRIORITY;
unk_0x04 = 0;
reserved = 0;
}
SimpleAudioMgr::SimpleAudioMgrArg::SimpleAudioMgrArg() {

View File

@@ -103,7 +103,7 @@ namespace EGG {
}
namespace {
void free_all_visitor(void* ptr, MEMiHeapHead* heapHandle, u32 unk) {
void free_all_visitor(void* ptr, MEMiHeapHead* heapHandle, u32 userData) {
MEMFreeToExpHeap(heapHandle, ptr);
}
} // namespace

View File

@@ -37,7 +37,7 @@ namespace EGG {
mpOSThread = static_cast<OSThread*>(Heap::alloc(sizeof(OSThread), 32, mpContainHeap));
OSCreateThread(mpOSThread, Thread::start, this, reinterpret_cast<u8*>(mpStackMemory) + mStackSize, mStackSize, priority,
OSCreateThread(mpOSThread, Thread::start, this, static_cast<u8*>(mpStackMemory) + mStackSize, mStackSize, priority,
OS_THREAD_ATTR_DETACH);
setCommonMesgQueue(capacity, mpContainHeap);

View File

@@ -9,12 +9,12 @@ extern "C" {
#define SIGNAL_ACTION_IGNORE ((__signal_func_ptr)1)
#define SIGNAL_ABORT 1
#define SIGNAL_UNK2 2
#define SIGNAL_UNK3 3
#define SIGNAL_UNK4 4
#define SIGNAL_UNK5 5
#define SIGNAL_UNK6 6
#define SIGNAL_UNK7 7
#define SIGNAL_HANDLER_2 2
#define SIGNAL_HANDLER_3 3
#define SIGNAL_HANDLER_4 4
#define SIGNAL_HANDLER_5 5
#define SIGNAL_HANDLER_6 6
#define SIGNAL_HANDLER_7 7
typedef void (*__signal_func_ptr)(int);

View File

@@ -54,7 +54,7 @@ typedef struct {
int precision;
} print_format;
static const char* parse_format(const char* format_string, va_list* arg, print_format* format) {
static const char* parse_format(const char* format_string, va_list* args, print_format* format) {
print_format f;
const char* s = format_string;
int c;
@@ -109,7 +109,7 @@ static const char* parse_format(const char* format_string, va_list* arg, print_f
}
if (c == '*') {
if ((f.field_width = va_arg(*arg, int)) < 0) {
if ((f.field_width = va_arg(*args, int)) < 0) {
f.justification_options = left_justification;
f.field_width = -f.field_width;
}
@@ -132,7 +132,7 @@ static const char* parse_format(const char* format_string, va_list* arg, print_f
f.precision_specified = 1;
if ((c = *++s) == '*') {
if ((f.precision = va_arg(*arg, int)) < 0) {
if ((f.precision = va_arg(*args, int)) < 0) {
f.precision_specified = 0;
}
@@ -960,7 +960,7 @@ static char* float2str(long double num, char* buff, print_format format) {
}
int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProcArg,
const char* format_str, va_list arg
const char* format_str, va_list args
)
{
@@ -1000,27 +1000,27 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
}
format_ptr = curr_format;
format_ptr = parse_format(format_ptr, (va_list*)arg, &format);
format_ptr = parse_format(format_ptr, (va_list*)args, &format);
switch (format.conversion_char) {
case 'd':
case 'i':
if (format.argument_options == long_argument) {
long_num = va_arg(arg, signed long);
long_num = va_arg(args, signed long);
} else if (format.argument_options == long_long_argument) {
long_long_num = va_arg(arg, signed long long);
long_long_num = va_arg(args, signed long long);
}
else if (format.argument_options == intmax_argument) {
long_long_num = va_arg(arg, intmax_t);
long_long_num = va_arg(args, intmax_t);
}
else if (format.argument_options == size_t_argument) {
long_num = va_arg(arg, size_t);
long_num = va_arg(args, size_t);
}
else if (format.argument_options == ptrdiff_argument) {
long_num = va_arg(arg, ptrdiff_t);
long_num = va_arg(args, ptrdiff_t);
}
else {
long_num = va_arg(arg, int);
long_num = va_arg(args, int);
}
if (format.argument_options == short_argument) {
@@ -1052,21 +1052,21 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'x':
case 'X':
if (format.argument_options == long_argument) {
long_num = va_arg(arg, unsigned long);
long_num = va_arg(args, unsigned long);
} else if (format.argument_options == long_long_argument) {
long_long_num = va_arg(arg, signed long long);
long_long_num = va_arg(args, signed long long);
}
else if (format.argument_options == intmax_argument) {
long_long_num = va_arg(arg, intmax_t);
long_long_num = va_arg(args, intmax_t);
}
else if (format.argument_options == size_t_argument) {
long_num = va_arg(arg, size_t);
long_num = va_arg(args, size_t);
}
else if (format.argument_options == ptrdiff_argument) {
long_num = va_arg(arg, ptrdiff_t);
long_num = va_arg(args, ptrdiff_t);
}
else {
long_num = va_arg(arg, unsigned int);
long_num = va_arg(args, unsigned int);
}
if (format.argument_options == short_argument) {
@@ -1100,9 +1100,9 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'g':
case 'G':
if (format.argument_options == long_double_argument) {
long_double_num = va_arg(arg, long double);
long_double_num = va_arg(args, long double);
} else {
long_double_num = va_arg(arg, double);
long_double_num = va_arg(args, double);
}
if (!(buff_ptr = float2str(long_double_num, buff + 512, *fmt_ptr))) {
@@ -1115,9 +1115,9 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'a':
case 'A':
if (format.argument_options == long_double_argument) {
long_double_num = va_arg(arg, long double);
long_double_num = va_arg(args, long double);
} else {
long_double_num = va_arg(arg, double);
long_double_num = va_arg(args, double);
}
if (!(buff_ptr = double2hex(long_double_num, buff + 512, *fmt_ptr))) {
@@ -1129,7 +1129,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 's':
if (format.argument_options == wchar_argument) {
wchar_t* wcs_ptr = va_arg(arg, wchar_t*);
wchar_t* wcs_ptr = va_arg(args, wchar_t*);
if (wcs_ptr == NULL) {
wcs_ptr = L"";
@@ -1141,7 +1141,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
buff_ptr = &buff[0];
} else {
buff_ptr = va_arg(arg, char*);
buff_ptr = va_arg(args, char*);
}
if (buff_ptr == NULL) {
@@ -1167,7 +1167,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
break;
case 'n':
buff_ptr = va_arg(arg, char*);
buff_ptr = va_arg(args, char*);
switch (format.argument_options) {
case normal_argument:
@@ -1197,7 +1197,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'c':
buff_ptr = buff;
*buff_ptr = va_arg(arg, int);
*buff_ptr = va_arg(args, int);
num_chars = 1;
break;
@@ -1294,7 +1294,7 @@ int printf(const char* format, ...) {
{
va_list args;
va_start(args, format);
res = __pformatter(&__FileWrite, (void*)stdout, format, args);
res = __pformatter(&__FileWrite, stdout, format, args);
}
return res;
}
@@ -1308,18 +1308,18 @@ int fprintf(FILE* file, const char* format, ...) {
{
va_list args;
va_start(args, format);
res = __pformatter(&__FileWrite, (void*)file, format, args);
res = __pformatter(&__FileWrite, file, format, args);
}
return res;
}
int vprintf(const char* format, va_list arg) {
int vprintf(const char* format, va_list args) {
int ret;
if (fwide(stdout, -1) >= 0) {
return -1;
}
ret = __pformatter(&__FileWrite, (void*)stdout, format, arg);
ret = __pformatter(&__FileWrite, stdout, format, args);
return ret;
}
@@ -1345,8 +1345,8 @@ int vsnprintf(char* s, size_t n, const char* fmt, va_list args) {
return end;
}
int vsprintf(char *s, const char *format, va_list arg) {
return vsnprintf(s, 0xFFFFFFFF, format, arg);
int vsprintf(char *s, const char *format, va_list args) {
return vsnprintf(s, 0xFFFFFFFF, format, args);
}
int snprintf(char* s, size_t n, const char* format, ...) {

View File

@@ -5,11 +5,11 @@
char* p; \
char* q; \
size_t n = cnt; \
unsigned long tmp; \
unsigned long savedWord; \
for (p = (char*)src - 1, q = (char*)dst - 1, n++; --n;) { \
tmp = *++q; \
savedWord = *++q; \
*q = *++p; \
*p = tmp; \
*p = savedWord; \
} \
} while (0)

View File

@@ -257,7 +257,7 @@ static const char* parse_format(const char* format_string, scan_format* format)
return s + 1;
}
int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char* format_str, va_list arg,
int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char* format_str, va_list args,
int is_secure) {
int num_chars, chars_read, items_assigned, conversions;
int base, negative, overflow;
@@ -319,7 +319,7 @@ int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char
format_ptr = parse_format(format_ptr, &format);
if (!format.suppress_assignment && format.conversion_char != '%') {
arg_ptr = va_arg(arg, char*);
arg_ptr = va_arg(args, char*);
} else {
arg_ptr = 0;
}
@@ -552,7 +552,7 @@ int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char
if (arg_ptr) {
if (is_secure) {
elem_valid = 1;
elem_maxsize = va_arg(arg, size_t);
elem_maxsize = va_arg(args, size_t);
}
num_chars = 0;
@@ -648,7 +648,7 @@ int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char
if (arg_ptr) {
if (is_secure) {
elem_valid = 1;
elem_maxsize = va_arg(arg, size_t) - 1;
elem_maxsize = va_arg(args, size_t) - 1;
}
num_chars = 0;
@@ -797,7 +797,7 @@ int __StringRead(void* pPtr, int ch, int act) {
return 0;
}
inline int vsscanf(const char* s, const char* format, va_list arg) {
inline int vsscanf(const char* s, const char* format, va_list args) {
__InStrCtrl isc;
isc.NextChar = (char*)s;
@@ -806,7 +806,7 @@ inline int vsscanf(const char* s, const char* format, va_list arg) {
}
isc.NullCharDetected = 0;
return __sformatter(&__StringRead, (void*)&isc, format, arg, 0);
return __sformatter(&__StringRead, (void*)&isc, format, args, 0);
}
int sscanf(const char* s, const char* pFormat, ...) {

View File

@@ -7,7 +7,7 @@ __signal_func_ptr signal_funcs[8];
int raise(int sig) {
__signal_func_ptr signal_func;
if (sig < SIGNAL_ABORT || sig > SIGNAL_UNK7) {
if (sig < SIGNAL_ABORT || sig > SIGNAL_HANDLER_7) {
return -1;
}

View File

@@ -55,7 +55,7 @@ typedef struct {
static const wchar_t* parse_format(const wchar_t* format_string, va_list* arg, print_format* format) {
static const wchar_t* parse_format(const wchar_t* format_string, va_list* args, print_format* format) {
print_format f;
const wchar_t* s = format_string;
wchar_t c;
@@ -110,14 +110,14 @@ static const wchar_t* parse_format(const wchar_t* format_string, va_list* arg, p
}
if (c == '*') {
if ((f.field_width = va_arg(*arg, int)) < 0) {
if ((f.field_width = va_arg(*args, int)) < 0) {
f.justification_options = left_justification;
f.field_width = -f.field_width;
}
c = *++s;
} else {
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x8) != 0) {
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISDIGIT_MAP) != 0) {
f.field_width = f.field_width * 10 + (c - '0');
c = *++s;
}
@@ -133,13 +133,13 @@ static const wchar_t* parse_format(const wchar_t* format_string, va_list* arg, p
f.precision_specified = 1;
if ((c = *++s) == '*') {
if ((f.precision = va_arg(*arg, int)) < 0) {
if ((f.precision = va_arg(*args, int)) < 0) {
f.precision_specified = 0;
}
c = *++s;
} else {
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x8) != 0)
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISDIGIT_MAP) != 0)
{
f.precision = f.precision * 10 + (c - '0');
c = *++s;
@@ -769,7 +769,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
c = format.conversion_char;
p = buff - 5;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"-INF");
} else {
wcscpy(p, L"-inf");
@@ -777,7 +777,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
} else {
c = format.conversion_char;
p = buff - 4;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"INF");
} else {
wcscpy(p, L"inf");
@@ -790,7 +790,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
if (dec.sign) {
c = format.conversion_char;
p = buff - 5;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"-NAN");
} else {
wcscpy(p, L"-nan");
@@ -798,7 +798,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
} else {
c = format.conversion_char;
p = buff - 4;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"NAN");
} else {
wcscpy(p, L"nan");
@@ -958,8 +958,8 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
break;
}
p = buff - strlen((char*)p2) - 1;
mbstowcs(p, p2, strlen((char*)p2));
p = buff - strlen(p2) - 1;
mbstowcs(p, p2, strlen(p2));
return p;
}
@@ -1290,7 +1290,7 @@ void* __wStringWrite(void* wosc, const wchar_t* buffer, size_t numchars) {
void* res;
__wOutStrCtrl* wOscp = (__wOutStrCtrl*)wosc;
tobewritten = ((wOscp->CharsWritten + numchars) <= wOscp->MaxCharCount) ? numchars : wOscp->MaxCharCount - wOscp->CharsWritten;
res = (void*)wmemcpy(wOscp->wCharStr + wOscp->CharsWritten, buffer, tobewritten);
res = wmemcpy(wOscp->wCharStr + wOscp->CharsWritten, buffer, tobewritten);
wOscp->CharsWritten += tobewritten;
return res;
}

View File

@@ -1,3 +1,3 @@
#include <math.h>
double nan(const char* arg) {}
double nan(const char* tag) {}

View File

@@ -68,10 +68,10 @@ static void __dorounddecup(decimal* d, int digits) {
static void __rounddec(decimal* d, int digits) {
if (digits > 0 && digits < d->sig.length) {
int unkBool = __must_round(d, digits);
int roundDirection = __must_round(d, digits);
d->sig.length = digits;
if (unkBool >= 0) {
if (roundDirection >= 0) {
__dorounddecup(d, digits);
}
}

View File

@@ -37,14 +37,14 @@ inline DSIOResult __access_file(unsigned int handle, unsigned char* buffer, int*
}
DSIOResult __read_console(unsigned int handle, unsigned char* buffer, int* count, void* ref_con) {
if (GetUseSerialIO() == FALSE) {
if (!GetUseSerialIO()) {
return DS_IOError;
}
return __read_file(DS_Stdin, buffer, count, ref_con);
}
DSIOResult __TRK_write_console(unsigned int handle, unsigned char* buffer, int* count, void* ref_con) {
if (GetUseSerialIO() == 0) {
if (!GetUseSerialIO()) {
return DS_IOError;
}
return __write_file(DS_Stdout, buffer, count, ref_con);

View File

@@ -100,7 +100,7 @@ namespace nw4r {
u8* pCachedBase; // 0x0C
u8* pCachedStart; // 0x10
u8* pCachedEnd; // 0x14
u32 unk_0x18; // 0x18
u32 cacheWorkspaceOffset; // 0x18
};
class ConstructContext {

View File

@@ -79,7 +79,7 @@ namespace nw4r {
sException.frameMemory = NULL;
sException.exceptionRenderObj = NULL;
OSCreateThread(&sException.thread, RunThread_, NULL, sThreadBuffer + 0x4000, 0x4000, 0, 1);
OSCreateThread(&sException.thread, RunThread_, NULL, sThreadBuffer + 0x4000, 0x4000, 0, OS_THREAD_ATTR_DETACH);
OSInitMessageQueue(&sException.queue, sMessageBuffer, 1);
OSResumeThread(&sException.thread);
@@ -98,7 +98,7 @@ namespace nw4r {
sException.FPCSR_COPY = context->fpscr;
OSFillFPUContext(context);
OSSetErrorHandler(error, NULL);
if (error == 0xf) {
if (error == OS_EXCEPTION_MEMORY_PROTECTION) {
OSProtectRange(0, 0, 0, 3);
OSProtectRange(1, 0, 0, 3);
OSProtectRange(2, 0, 0, 3);
@@ -111,7 +111,7 @@ namespace nw4r {
param.dsisr = dsisr;
param.dar = dar;
OSSendMessage(&sException.queue, &param, 1);
OSSendMessage(&sException.queue, &param, OS_MESSAGE_BLOCK);
OSEnableScheduler();
OSYieldThread();
@@ -138,7 +138,7 @@ namespace nw4r {
u32 msr = PPCMfmsr();
PPCMtmsr(msr & ~(MSR_FE0 | MSR_FE1));
OSReceiveMessage(&sException.queue, &message, 1);
OSReceiveMessage(&sException.queue, &message, OS_MESSAGE_BLOCK);
OSDisableInterrupts();
VISetPreRetraceCallback(NULL);
@@ -303,46 +303,46 @@ namespace nw4r {
if (error == OS_EXCEPTION_FLOATING_POINT_EXCEPTION) {
u32 fpcsr = sException.FPCSR_COPY;
fpcsr &= (((fpcsr & 0xf8) << 0x16) | 0x01f80700);
if ((fpcsr & 0x20000000) != 0) {
if ((fpcsr & FPSCR_VX) != 0) {
Exception_Printf_(" FPE: Invalid operation\n");
if ((sException.FPCSR_COPY & 0x1000000) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXSNAN) != 0) {
Exception_Printf_(" SNaN\n");
}
if ((sException.FPCSR_COPY & 0x800000) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXISI) != 0) {
Exception_Printf_(" Infinity - Infinity\n");
}
if ((sException.FPCSR_COPY & 0x400000) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXIDI) != 0) {
Exception_Printf_(" Infinity / Infinity\n");
}
if ((sException.FPCSR_COPY & 0x200000) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXZDZ) != 0) {
Exception_Printf_(" 0 / 0\n");
}
if ((sException.FPCSR_COPY & 0x100000) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXIMZ) != 0) {
Exception_Printf_(" Infinity * 0\n");
}
if ((sException.FPCSR_COPY & 0x80000) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXVC) != 0) {
Exception_Printf_(" Invalid compare\n");
}
if ((sException.FPCSR_COPY & 0x400) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXSOFT) != 0) {
Exception_Printf_(" Software request\n");
}
if ((sException.FPCSR_COPY & 0x200) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXSQRT) != 0) {
Exception_Printf_(" Invalid square root\n");
}
if ((sException.FPCSR_COPY & 0x100) != 0) {
if ((sException.FPCSR_COPY & FPSCR_VXCVI) != 0) {
Exception_Printf_(" Invalid integer convert\n");
}
}
if ((fpcsr & 0x10000000) != 0) {
if ((fpcsr & FPSCR_OX) != 0) {
Exception_Printf_(" FPE: Overflow\n");
}
if ((fpcsr & 0x8000000) != 0) {
if ((fpcsr & FPSCR_UX) != 0) {
Exception_Printf_(" FPE: Underflow\n");
}
if ((fpcsr & 0x4000000) != 0) {
if ((fpcsr & FPSCR_ZX) != 0) {
Exception_Printf_(" FPE: Zero division\n");
}
if ((fpcsr & 0x2000000) != 0) {
if ((fpcsr & FPSCR_XX) != 0) {
Exception_Printf_(" FPE: Inexact result\n");
}
}

View File

@@ -135,12 +135,12 @@ namespace nw4r {
for (int i = 0; i < texCoordNum; i++) {
GXSetVtxDesc(static_cast<GXAttr>(GX_VA_TEX0 + i), GX_DIRECT);
}
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0);
if (bModulate) {
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
}
for (int i = 0; i < texCoordNum; i++) {
GXSetVtxAttrFmt(GX_VTXFMT0, static_cast<GXAttr>(GX_VA_TEX0 + i), GX_CLR_RGBA, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, static_cast<GXAttr>(GX_VA_TEX0 + i), GX_TEX_ST, GX_F32, 0);
}
}

View File

@@ -968,8 +968,8 @@ namespace nw4r {
for (u8 id = 0; id < tevStageNum; id++) {
GXTevStageID tevStage = static_cast<GXTevStageID>(id);
GXSetTevColorOp(tevStage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(tevStage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(tevStage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(tevStage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevDirect(tevStage);
GXSetTevSwapMode(tevStage, GX_TEV_SWAP0, GX_TEV_SWAP0);

View File

@@ -411,8 +411,8 @@ namespace nw4r {
mtxPtr = mGlbMtx;
}
GXLoadPosMtxImm(mtxPtr, 0);
GXSetCurrentMtx(0);
GXLoadPosMtxImm(mtxPtr, GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
}
math::VEC2 Pane::GetVtxPos() const {

View File

@@ -13,7 +13,7 @@ extern "C" char scLytFatalMsg[] = "Error#004\nAn error has occurred.\nThe system
GXColor front = {*((volatile const u8*)&::scLytFatalColorR), *((volatile const u8*)&::scLytFatalColorG), \
*((volatile const u8*)&::scLytFatalColorB), *((volatile const u8*)&::scLytFatalColorA)}; \
GXColor back = {0, 0, 0, 0}; \
OSFatal((GXColor)front, (GXColor)back, ::scLytFatalMsg); \
OSFatal(front, back, ::scLytFatalMsg); \
} \
}
@@ -22,7 +22,7 @@ extern "C" char scLytFatalMsg[] = "Error#004\nAn error has occurred.\nThe system
if (!(x)) { \
GXColor front = {255, 255, 255, 0}; \
GXColor back = {0, 0, 0, 0}; \
OSFatal((GXColor)front, (GXColor)back, ::scLytFatalMsg); \
OSFatal(front, back, ::scLytFatalMsg); \
} \
}

View File

@@ -25,16 +25,16 @@ namespace nw4r {
}
VEC4* VEC4Transform(VEC4* pOut, const MTX44* pM, const VEC4* pV) {
VEC4 tmp;
tmp.x = pM->_00 * pV->x + pM->_01 * pV->y + pM->_02 * pV->z + pM->_03 * pV->w;
tmp.y = pM->_10 * pV->x + pM->_11 * pV->y + pM->_12 * pV->z + pM->_13 * pV->w;
tmp.z = pM->_20 * pV->x + pM->_21 * pV->y + pM->_22 * pV->z + pM->_23 * pV->w;
tmp.w = pM->_30 * pV->x + pM->_31 * pV->y + pM->_32 * pV->z + pM->_33 * pV->w;
VEC4 transformed;
transformed.x = pM->_00 * pV->x + pM->_01 * pV->y + pM->_02 * pV->z + pM->_03 * pV->w;
transformed.y = pM->_10 * pV->x + pM->_11 * pV->y + pM->_12 * pV->z + pM->_13 * pV->w;
transformed.z = pM->_20 * pV->x + pM->_21 * pV->y + pM->_22 * pV->z + pM->_23 * pV->w;
transformed.w = pM->_30 * pV->x + pM->_31 * pV->y + pM->_32 * pV->z + pM->_33 * pV->w;
pOut->x = tmp.x;
pOut->y = tmp.y;
pOut->z = tmp.z;
pOut->w = tmp.w;
pOut->x = transformed.x;
pOut->y = transformed.y;
pOut->z = transformed.z;
pOut->w = transformed.w;
return pOut;
}
} // namespace math

View File

@@ -808,7 +808,7 @@ namespace nw4r {
} else {
u16 a0, b0;
if (mVpb[0][0]->pb.lpf.on == TRUE) {
if (mVpb[0][0]->pb.lpf.on == AX_PB_LPF_ON) {
AXGetLpfCoefs(freq, &a0, &b0);
for (int j = 0; j < mChannelCount; j++) {
@@ -817,7 +817,7 @@ namespace nw4r {
} else {
AXPBLPF lpf;
lpf.on = TRUE;
lpf.on = AX_PB_LPF_ON;
lpf.yn1 = 0;
AXGetLpfCoefs(freq, &lpf.a0, &lpf.b0);

View File

@@ -148,7 +148,7 @@ namespace nw4r {
return NULL;
}
pSub = reinterpret_cast<const BankFile::DataRegion*>(pIndexTable->ref + (splitKey - pIndexTable->min));
pSub = pIndexTable->ref + (splitKey - pIndexTable->min);
break;
}
}

View File

@@ -61,9 +61,9 @@ namespace nw4r {
if (mPlayFlag) {
if (playFlag) {
wencMode = 1;
wencMode = WENC_FLAG_USER_INFO;
} else {
wencMode = 1;
wencMode = WENC_FLAG_USER_INFO;
lastFlag = true;
}
} else {
@@ -71,7 +71,7 @@ namespace nw4r {
if (mFirstEncodeFlag) {
wencMode = 0;
} else {
wencMode = 1;
wencMode = WENC_FLAG_USER_INFO;
}
mFirstEncodeFlag = false;

View File

@@ -58,7 +58,7 @@ namespace nw4r {
OSMessage message;
while (true) {
OSReceiveMessage(&mMsgQueue, &message, 1);
OSReceiveMessage(&mMsgQueue, &message, OS_MESSAGE_BLOCK);
if (reinterpret_cast<u32>(message) == MSG_AX_CALLBACK) {
ut::AutoMutexLock autoMutex(mMutex);

View File

@@ -52,7 +52,7 @@ namespace nw4r {
u8 mask = 1 << 0;
for (int j = 0; j < 8; j++, mask <<= 1) {
for (int j = 0; j < BITS_PER_BYTE; j++, mask <<= 1) {
// Block represented by this bit is in use
if (flag & mask) {
continue;

View File

@@ -718,7 +718,7 @@ namespace nw4r {
}
void StrmPlayer::NotifyStrmHeaderAsyncEndCallback(bool result, const StrmHeader* header, void* userData) {
StrmPlayer* player = reinterpret_cast<StrmPlayer*>(userData);
StrmPlayer* player = static_cast<StrmPlayer*>(userData);
if (result) {
player->Setup(header);
} else {

View File

@@ -33,7 +33,7 @@ namespace nw4r {
void* TaskThread::ThreadFunc(void* arg) {
TaskThread* thread = static_cast<TaskThread*>(arg);
OSInitMessageQueue(&thread->mMsgQueue, thread->mMsgBuffer, 8);
OSInitMessageQueue(&thread->mMsgQueue, thread->mMsgBuffer, MSG_QUEUE_CAPACITY);
thread->ThreadProc();
@@ -44,7 +44,7 @@ namespace nw4r {
OSMessage msg;
while (true) {
OSReceiveMessage(&mMsgQueue, &msg, 1);
OSReceiveMessage(&mMsgQueue, &msg, OS_MESSAGE_BLOCK);
if (reinterpret_cast<u32>(msg) == MSG_EXECUTE) {
TaskManager::GetInstance().Execute();

View File

@@ -160,7 +160,7 @@ namespace nw4r {
void WavePlayer::Pause(bool flag) {
ut::AutoInterruptLock lock;
if (mStartFlag == false) {
if (!mStartFlag) {
return;
}
@@ -224,7 +224,7 @@ namespace nw4r {
}
void WavePlayer::VoiceCallbackFunc(detail::AxVoice* voice, detail::AxVoice::CallbackStatus status, void* arg) {
WavePlayer* wavePlayer = reinterpret_cast<WavePlayer*>(arg);
WavePlayer* wavePlayer = static_cast<WavePlayer*>(arg);
switch (status) {
case detail::AxVoice::CALLBACK_STATUS_FINISH_WAVE:
case detail::AxVoice::CALLBACK_STATUS_INVALIDATE_WAVE: {

View File

@@ -250,7 +250,7 @@ namespace nw4r {
}
if (!mPauseFlag && !mSkipFlag) {
if (mHomeButtonMenuFlag || !AxManager::GetInstance().IsHomeButtonMenu()) {
if (ParseNextTick(true) != 0) {
if (ParseNextTick(true)) {
FinishPlayer();
return;
}

View File

@@ -632,7 +632,7 @@ namespace nw4r {
pCachedStart = NULL;
pCachedEnd = NULL;
unk_0x18 = 0;
cacheWorkspaceOffset = 0;
}
void ArchiveFontBase::CachedStreamReader::Attach(const void* data, u32 dataLen) {
@@ -653,7 +653,7 @@ namespace nw4r {
pCachedBase = NULL;
pCachedStart = NULL;
pCachedEnd = NULL;
unk_0x18 = 0;
cacheWorkspaceOffset = 0;
} else {
if (ctx->remWorkSpace() < (offset << 1)) {
return false;
@@ -675,7 +675,7 @@ namespace nw4r {
pCachedBase = dst;
pCachedStart = dst;
pCachedEnd = dst + available;
unk_0x18 = offset;
cacheWorkspaceOffset = offset;
}
return true;
}

View File

@@ -109,7 +109,7 @@ namespace nw4r {
}
Color CharWriter::GetTextColor() const {
return *reinterpret_cast<const Color*>(&mTextColor);
return mTextColor.start;
}
void CharWriter::SetScale(f32 hScale, f32 vScale) {
@@ -274,8 +274,8 @@ namespace nw4r {
if (loadInfo != mLoadingTexture) {
GXTexObj tobj;
GXInitTexObj(&tobj, glyph.pTexture, glyph.texWidth, glyph.texHeight, glyph.texFormat, GX_CLAMP, GX_CLAMP, 0);
GXInitTexObjLOD(&tobj, mFilter.atSmall, mFilter.atLarge, 0.0f, 0.0f, 0.0f, false, false, GX_ANISO_1);
GXInitTexObj(&tobj, glyph.pTexture, glyph.texWidth, glyph.texHeight, glyph.texFormat, GX_CLAMP, GX_CLAMP, GX_FALSE);
GXInitTexObjLOD(&tobj, mFilter.atSmall, mFilter.atLarge, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
GXLoadTexObj(&tobj, slot);
mLoadingTexture = loadInfo;
@@ -333,14 +333,14 @@ namespace nw4r {
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C0, GX_CC_C1, GX_CC_TEXC, GX_CC_ZERO);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_A0, GX_CA_A1, GX_CA_TEXA, GX_CA_ZERO);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_CPREV, GX_CC_RASC, GX_CC_ZERO);
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_APREV, GX_CA_RASA, GX_CA_ZERO);
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
SetupVertexFormat();
}
@@ -354,8 +354,8 @@ namespace nw4r {
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
SetupVertexFormat();
}

View File

@@ -200,10 +200,10 @@ namespace nw4r {
glyph->pTexture = pSheet;
glyph->widths = GetCharWidthsFromIndex(index);
glyph->height = static_cast<u8>(tg.cellHeight);
glyph->height = tg.cellHeight;
glyph->texFormat = static_cast<GXTexFmt>(tg.sheetFormat);
glyph->texWidth = static_cast<u16>(tg.sheetWidth);
glyph->texHeight = static_cast<u16>(tg.sheetHeight);
glyph->texWidth = tg.sheetWidth;
glyph->texHeight = tg.sheetHeight;
glyph->cellX = cellPixelX + 1;
glyph->cellY = cellPixelY + 1;
}

View File

@@ -31,11 +31,11 @@ typedef int (*WWWSurfaceInitFn)(int w, int h, u32 rowSize, int, void* rasterBuf)
typedef int (*WWWSurfaceSetFlushCallbackFn)(void (*FlushCallback)(WWWRect*, int), int);
typedef void (*WWWSurfaceAddFontFn)(const char*);
typedef void (*WWWSurfaceUpdateScreenFn)(u32);
typedef void (*WWWSurfaceKeyboardEvtFn)(WWWKeyBtnCmd cmd, WWWKeySym sym, u32 unk);
typedef void (*WWWSurfaceMouseEvtFn)(WWWMouseCmd cmd, int x, int y, WWWMouseAttrib attrib, u32 unkA, u32 unkB);
typedef void (*WWWSurfaceKeyboardEvtFn)(WWWKeyBtnCmd cmd, WWWKeySym sym, u32 keyboardOptions);
typedef void (*WWWSurfaceMouseEvtFn)(WWWMouseCmd cmd, int x, int y, WWWMouseAttrib attrib, u32 button, u32 mouseOptions);
typedef void (*WWWCommitImeFn)(int imeID, const char* str);
typedef void (*WWWUpdateImeFn)(int imeID, const char* str, u32 unk);
typedef void (*WWWUpdateImeFn)(int imeID, const char* str, u32 updateOptions);
typedef BOOL (*WWWNotifyCallbackFn)(WWWHandle* wwwBrowser, WWWHandlewindow* wwwWindow, WWWEvent event, WWWHandleEventData* eventData);
typedef void (*WWWCreateBrowserFn)(WWWHandle** browser, WWWNotifyCallbackFn notifyCallback, const char** fonts, const char* arc);

View File

@@ -590,7 +590,7 @@ static void replacebuffer_(s32 chan, RFLiCtrlBuffer* buffer, u8 count) {
offset = (count * sizeof(RFLiCtrlBuffer)) + OFFSET;
write = WPADWriteFaceData(chan, ((u8*)walker + OFFSET), 4, WPAD_FACE_ADDR + offset, replacecallback_);
write = WPADWriteFaceData(chan, (walker + OFFSET), 4, WPAD_FACE_ADDR + offset, replacecallback_);
if (write != WPAD_ERR_OK) {
RFLiEndWorkingReason(RFLErrcode_Controllerfail, write);
}

View File

@@ -98,7 +98,7 @@ void loadopencallback_() {
}
}
RFLErrcode RFLiLoadHiddenDataAsync(RFLiHiddenCharData* data, u16 index, RFLSimpleCBArg cb, u32 arg) {
RFLErrcode RFLiLoadHiddenDataAsync(RFLiHiddenCharData* data, u16 index, RFLSimpleCBArg cb, u32 callbackArg) {
RFLiHiddenDBManager* manager = NULL;
RFLi_ASSERTLINE_RANGE(index, 0, RFL_MAX_HIDDEN_DB, 203);
@@ -126,7 +126,7 @@ RFLErrcode RFLiLoadHiddenDataAsync(RFLiHiddenCharData* data, u16 index, RFLSimpl
manager->loadDst = data;
manager->loadIndex = index;
manager->loadCallback = cb;
manager->loadArg = arg;
manager->loadArg = callbackArg;
return RFLiOpenAsync(RFLiFileType_Database, NAND_ACCESS_READ, loadopencallback_);
}

View File

@@ -35,7 +35,7 @@ void RFLiSetupCopyTex(GXTexFmt texFmt, u16 width, u16 height, void* buf, GXColor
GXSetPixelFmt(GX_PF_RGBA6_Z24, GX_ZC_LINEAR);
GXSetCopyFilter(GX_FALSE, NULL, GX_FALSE, NULL);
GXSetCopyClamp(GX_CLAMP_TOP + GX_CLAMP_BOTTOM);
GXSetCopyClamp(GX_CLAMP_TOP | GX_CLAMP_BOTTOM);
GXSetTexCopySrc(0, 0, width, height);
GXSetTexCopyDst(width, height, texFmt, GX_FALSE);
@@ -541,8 +541,8 @@ void RFLiSetTev4Mole() {
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevColor(GX_TEVREG0, RFLi_MOLE_COLOR0);
}
@@ -556,22 +556,22 @@ void RFLiSetTev4Mouth(u32 mouthColor) {
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevSwapMode(GX_TEVSTAGE1, GX_TEV_SWAP3, GX_TEV_SWAP2);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_C1, GX_CC_TEXC, GX_CC_CPREV);
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevSwapMode(GX_TEVSTAGE2, GX_TEV_SWAP2, GX_TEV_SWAP3);
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_ZERO, GX_CC_ONE, GX_CC_TEXC, GX_CC_CPREV);
GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
color0 = RFLi_MOUTH_COLOR0[mouthColor];
color1 = RFLi_MOUTH_COLOR1[mouthColor];

View File

@@ -103,15 +103,15 @@ static BOOL checkHiddenData_(RFLiHiddenCharData* data) {
RFLiConvertHRaw2Info(data, &info);
if (RFLiCheckValidInfo(&info) == FALSE) {
if (!RFLiCheckValidInfo(&info)) {
return FALSE;
}
return TRUE;
}
static void updateHDBcallback_(u32 arg) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)arg;
static void updateHDBcallback_(u32 databaseAddr) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)databaseAddr;
RFL_NEW_OLD_PARAM* param = (RFL_NEW_OLD_PARAM*)&db->userdata1;
if (RFLGetAsyncStatus() == RFLErrcode_Success || RFLGetAsyncStatus() == RFLErrcode_Broken) {
@@ -299,8 +299,8 @@ static void loadHiddenRandomSync_(RFLiMiddleDatabase* db) {
RFLiGetManager()->mLastErrcode = db->storedSize < db->size ? RFLErrcode_DBNodata : RFLErrcode_Success;
}
static void updateHDBRandcallback_(u32 arg) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)arg;
static void updateHDBRandcallback_(u32 databaseAddr) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)databaseAddr;
RFL_HIDDEN_RANDOM_PARAM* param = (RFL_HIDDEN_RANDOM_PARAM*)&db->userdata1;
if (RFLGetAsyncStatus() == RFLErrcode_Success || RFLGetAsyncStatus() == RFLErrcode_Broken) {
@@ -387,7 +387,7 @@ static void updateHiddenRandom_(RFLiMiddleDatabase* db, BOOL use_cache) {
RFLi_ASSERTLINE(aidx == count, 514);
for (i = 0; i < (count - 1); i++) {
u16 tmp;
u16 shuffledIndex;
u16 target;
target = (((rand >> 0x10) + rand) & 0xFFFF) % (count - 1);
@@ -395,9 +395,9 @@ static void updateHiddenRandom_(RFLiMiddleDatabase* db, BOOL use_cache) {
target++;
}
tmp = array[target];
shuffledIndex = array[target];
array[target] = array[i];
array[i] = tmp;
array[i] = shuffledIndex;
rand = 0x04F8BB63 * (rand + 0x046AC055);
}
@@ -586,12 +586,12 @@ RFLMiddleDBType RFLGetMiddleDBType(const RFLMiddleDatabase* db) {
u16 RFLGetMiddleDBSize(const RFLMiddleDatabase* db) {
RFLi_ASSERTLINE_NULL(db, 772);
return (u16)((RFLiMiddleDatabase*)db)->size;
return ((RFLiMiddleDatabase*)db)->size;
}
u16 RFLGetMiddleDBStoredSize(const RFLMiddleDatabase* db) {
RFLi_ASSERTLINE_NULL(db, 789);
return (u16)((RFLiMiddleDatabase*)db)->storedSize;
return ((RFLiMiddleDatabase*)db)->storedSize;
}
BOOL RFLiGetCharInfoMiddleDB(RFLiCharInfo* info, const RFLMiddleDatabase* db, u16 index) {

View File

@@ -607,123 +607,123 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
// Init faceline shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Faceline;
arg.index = info->faceline.type;
arg.vtxPosBuf = charModelRes->vtxPosFaceline;
arg.vtxNrmBuf = charModelRes->vtxNrmFaceline;
arg.vtxTxcBuf = charModelRes->vtxTxcFaceline;
arg.dlBuf = charModelRes->dlFaceline;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosFaceline));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmFaceline));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcFaceline));
arg.dlBufSize = sizeof(charModelRes->dlFaceline);
arg.noseTrans = &noseTrans;
arg.beardTrans = &beardTrans;
arg.hairTrans = &hairTrans;
arg.flipX = FALSE;
arg.transform = FALSE;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Faceline;
shapeRes.index = info->faceline.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosFaceline;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmFaceline;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcFaceline;
shapeRes.dlBuf = charModelRes->dlFaceline;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosFaceline));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmFaceline));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcFaceline));
shapeRes.dlBufSize = sizeof(charModelRes->dlFaceline);
shapeRes.noseTrans = &noseTrans;
shapeRes.beardTrans = &beardTrans;
shapeRes.hairTrans = &hairTrans;
shapeRes.flipX = FALSE;
shapeRes.transform = FALSE;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeFaceline = arg.dlSize;
charModelRes->dlSizeFaceline = shapeRes.dlSize;
}
// Init cap shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Cap;
arg.index = info->hair.type;
arg.vtxPosBuf = charModelRes->vtxPosCap;
arg.vtxNrmBuf = charModelRes->vtxNrmCap;
arg.vtxTxcBuf = charModelRes->vtxTxcCap;
arg.dlBuf = charModelRes->dlCap;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmCap));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcCap));
arg.dlBufSize = sizeof(charModelRes->dlCap);
arg.flipX = info->hair.flip;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &hairTrans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Cap;
shapeRes.index = info->hair.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosCap;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmCap;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcCap;
shapeRes.dlBuf = charModelRes->dlCap;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmCap));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcCap));
shapeRes.dlBufSize = sizeof(charModelRes->dlCap);
shapeRes.flipX = info->hair.flip;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &hairTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeCap = arg.dlSize;
charModelRes->vtxPosHair = &charModelRes->vtxPosCap[arg.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmHair = &charModelRes->vtxNrmCap[arg.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlHair = charModelRes->dlNose + OSRoundUp32B(arg.dlSize) + offsetof(RFLiCharModelRes, dlCap);
charModelRes->dlSizeCap = shapeRes.dlSize;
charModelRes->vtxPosHair = &charModelRes->vtxPosCap[shapeRes.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmHair = &charModelRes->vtxNrmCap[shapeRes.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlHair = charModelRes->dlNose + OSRoundUp32B(shapeRes.dlSize) + offsetof(RFLiCharModelRes, dlCap);
}
// Init hair shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Hair;
arg.index = info->hair.type;
arg.vtxPosBuf = charModelRes->vtxPosHair;
arg.vtxNrmBuf = charModelRes->vtxNrmHair;
arg.dlBuf = charModelRes->dlHair;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
shapeRes.parts = RFLiPartsShp_Hair;
shapeRes.index = info->hair.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosHair;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmHair;
shapeRes.dlBuf = charModelRes->dlHair;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
(((u32)charModelRes->vtxPosHair - (u32)charModelRes->vtxPosCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_POS;
arg.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
shapeRes.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
(((u32)charModelRes->vtxNrmHair - (u32)charModelRes->vtxNrmCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_NRM;
arg.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlHair - (u32)charModelRes->dlCap);
arg.flipX = info->hair.flip;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &hairTrans;
RFLiInitShapeRes(&arg);
shapeRes.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlHair - (u32)charModelRes->dlCap);
shapeRes.flipX = info->hair.flip;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &hairTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeHair = arg.dlSize;
charModelRes->vtxPosForehead = &charModelRes->vtxPosHair[arg.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmForehead = &charModelRes->vtxNrmHair[arg.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlForehead = charModelRes->dlHair + OSRoundUp32B(arg.dlSize);
charModelRes->dlSizeHair = shapeRes.dlSize;
charModelRes->vtxPosForehead = &charModelRes->vtxPosHair[shapeRes.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmForehead = &charModelRes->vtxNrmHair[shapeRes.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlForehead = charModelRes->dlHair + OSRoundUp32B(shapeRes.dlSize);
charModelRes->flipHair = info->hair.flip;
}
// Init forehead shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Forehead;
arg.index = info->hair.type;
arg.vtxPosBuf = charModelRes->vtxPosForehead;
arg.vtxNrmBuf = charModelRes->vtxNrmForehead;
arg.dlBuf = charModelRes->dlForehead;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
shapeRes.parts = RFLiPartsShp_Forehead;
shapeRes.index = info->hair.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosForehead;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmForehead;
shapeRes.dlBuf = charModelRes->dlForehead;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
(((u32)charModelRes->vtxPosForehead - (u32)charModelRes->vtxPosCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_POS;
arg.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
shapeRes.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
(((u32)charModelRes->vtxNrmForehead - (u32)charModelRes->vtxNrmCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_NRM;
arg.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlForehead - (u32)charModelRes->dlCap);
arg.flipX = info->hair.flip;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &hairTrans;
RFLiInitShapeRes(&arg);
shapeRes.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlForehead - (u32)charModelRes->dlCap);
shapeRes.flipX = info->hair.flip;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &hairTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeForehead = arg.dlSize;
charModelRes->dlSizeForehead = shapeRes.dlSize;
}
// Init beard shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Beard;
arg.index = info->beard.type;
arg.vtxPosBuf = charModelRes->vtxPosBeard;
arg.vtxNrmBuf = charModelRes->vtxNrmBeard;
arg.dlBuf = charModelRes->dlBeard;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosBeard));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmBeard));
arg.dlBufSize = sizeof(charModelRes->dlBeard);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &beardTrans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Beard;
shapeRes.index = info->beard.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosBeard;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmBeard;
shapeRes.dlBuf = charModelRes->dlBeard;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosBeard));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmBeard));
shapeRes.dlBufSize = sizeof(charModelRes->dlBeard);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &beardTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeBeard = arg.dlSize;
charModelRes->dlSizeBeard = shapeRes.dlSize;
}
// Init nose shape
@@ -731,7 +731,7 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
f32 scale;
RFLiPositionData trans;
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
scale = 0.4f + 0.175f * info->nose.scale;
@@ -739,69 +739,69 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
trans.y = +noseTrans.y + -1.5f * (info->nose.y - 8);
trans.z = noseTrans.z;
arg.parts = RFLiPartsShp_Nose;
arg.index = info->nose.type;
arg.vtxPosBuf = charModelRes->vtxPosNose;
arg.vtxNrmBuf = charModelRes->vtxNrmNose;
arg.dlBuf = charModelRes->dlNose;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNose));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNose));
arg.dlBufSize = sizeof(charModelRes->dlNose);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = scale;
arg.posTrans = &trans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Nose;
shapeRes.index = info->nose.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosNose;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmNose;
shapeRes.dlBuf = charModelRes->dlNose;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNose));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNose));
shapeRes.dlBufSize = sizeof(charModelRes->dlNose);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = scale;
shapeRes.posTrans = &trans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeNose = arg.dlSize;
charModelRes->dlSizeNose = shapeRes.dlSize;
}
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Noseline;
arg.index = info->nose.type;
arg.vtxPosBuf = charModelRes->vtxPosNoseline;
arg.vtxNrmBuf = charModelRes->vtxNrmNoseline;
arg.vtxTxcBuf = charModelRes->vtxTxcNoseline;
arg.dlBuf = charModelRes->dlNoseline;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNoseline));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNoseline));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcNoseline));
arg.dlBufSize = sizeof(charModelRes->dlNoseline);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = scale;
arg.posTrans = &trans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Noseline;
shapeRes.index = info->nose.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosNoseline;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmNoseline;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcNoseline;
shapeRes.dlBuf = charModelRes->dlNoseline;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNoseline));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNoseline));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcNoseline));
shapeRes.dlBufSize = sizeof(charModelRes->dlNoseline);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = scale;
shapeRes.posTrans = &trans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeNoseline = arg.dlSize;
charModelRes->dlSizeNoseline = shapeRes.dlSize;
}
}
// Init mask shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Mask;
arg.index = info->faceline.type;
arg.vtxPosBuf = charModelRes->vtxPosMask;
arg.vtxNrmBuf = charModelRes->vtxNrmMask;
arg.vtxTxcBuf = charModelRes->vtxTxcMask;
arg.dlBuf = charModelRes->dlMask;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosMask));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmMask));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcMask));
arg.dlBufSize = sizeof(charModelRes->dlMask);
arg.flipX = FALSE;
arg.transform = FALSE;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Mask;
shapeRes.index = info->faceline.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosMask;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmMask;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcMask;
shapeRes.dlBuf = charModelRes->dlMask;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosMask));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmMask));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcMask));
shapeRes.dlBufSize = sizeof(charModelRes->dlMask);
shapeRes.flipX = FALSE;
shapeRes.transform = FALSE;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeMask = arg.dlSize;
charModelRes->dlSizeMask = shapeRes.dlSize;
}
// Init glass shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
f32 scale;
RFLiPositionData trans;
@@ -811,23 +811,23 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
trans.y = 5.0f + noseTrans.y + -1.5f * (info->glass.y - 11);
trans.z = 2.0f + noseTrans.z;
arg.parts = RFLiPartsShp_Glass;
arg.index = 0;
arg.vtxPosBuf = charModelRes->vtxPosGlass;
arg.vtxNrmBuf = charModelRes->vtxNrmGlass;
arg.vtxTxcBuf = charModelRes->vtxTxcGlass;
arg.dlBuf = charModelRes->dlGlass;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosGlass));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmGlass));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcGlass));
arg.dlBufSize = sizeof(charModelRes->dlGlass);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = scale;
arg.posTrans = &trans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Glass;
shapeRes.index = 0;
shapeRes.vtxPosBuf = charModelRes->vtxPosGlass;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmGlass;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcGlass;
shapeRes.dlBuf = charModelRes->dlGlass;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosGlass));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmGlass));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcGlass));
shapeRes.dlBufSize = sizeof(charModelRes->dlGlass);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = scale;
shapeRes.posTrans = &trans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeGlass = arg.dlSize;
charModelRes->dlSizeGlass = shapeRes.dlSize;
}
// Init faceline texture
@@ -856,38 +856,38 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
}
// DEBUG NON MATCH (https://decomp.me/scratch/mQdEd)
void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
void RFLiInitShapeRes(RFLiCharShapeRes* shapeRes /* r30 */) {
void* res; // r31+0xE8
u8* ptr8; // r29
BOOL skipTxc; // r31+0xE4
static const u32 csHeader[RFLiPartsShp_Max] = {'nose', 'frhd', 'face', 'hair', 'cap_', 'berd', 'nsln', 'mask', 'glas'};
RFLi_ASSERTLINE_NULL(arg, 1261);
RFLi_ASSERTLINE_NULL(arg->vtxPosBuf, 1262);
RFLi_ASSERTLINE_NULL(arg->vtxNrmBuf, 1263);
RFLi_ASSERTLINE_NULL(arg->dlBuf, 1264);
RFLi_ASSERTLINE_ALIGN(arg->dlBuf, 32, 1265);
RFLi_ASSERTLINE_NULL(shapeRes, 1261);
RFLi_ASSERTLINE_NULL(shapeRes->vtxPosBuf, 1262);
RFLi_ASSERTLINE_NULL(shapeRes->vtxNrmBuf, 1263);
RFLi_ASSERTLINE_NULL(shapeRes->dlBuf, 1264);
RFLi_ASSERTLINE_ALIGN(shapeRes->dlBuf, 32, 1265);
skipTxc =
arg->parts == RFLiPartsShp_Nose || arg->parts == RFLiPartsShp_Forehead || arg->parts == RFLiPartsShp_Hair || arg->parts == RFLiPartsShp_Beard;
shapeRes->parts == RFLiPartsShp_Nose || shapeRes->parts == RFLiPartsShp_Forehead || shapeRes->parts == RFLiPartsShp_Hair || shapeRes->parts == RFLiPartsShp_Beard;
if (!skipTxc) {
RFLi_ASSERTLINE_NULL(arg->vtxTxcBuf, 1273);
RFLi_ASSERTLINE_NULL(shapeRes->vtxTxcBuf, 1273);
}
if (arg->transform) {
RFLi_ASSERTLINE_NULL(arg->posTrans, 1277);
if (shapeRes->transform) {
RFLi_ASSERTLINE_NULL(shapeRes->posTrans, 1277);
}
{
u32 fileSize = RFLiGetShapeSize(arg->parts, arg->index); // r31+0xE0
u32 fileSize = RFLiGetShapeSize(shapeRes->parts, shapeRes->index); // r31+0xE0
res = RFLiAlloc32(fileSize);
RFLi_ASSERTLINE_NULL(res, 1287);
}
{
void* result = RFLiLoadShape(arg->parts, arg->index, res); // r31+0xDC
void* result = RFLiLoadShape(shapeRes->parts, shapeRes->index, res); // r31+0xDC
RFLi_ASSERTLINE_MSG(result, 1290, "ファイルの読み込みに失敗しました。"); // "Failed to read file."
}
@@ -896,61 +896,61 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
ptr8 = res;
header = *(u32*)ptr8; // r31+0xD8
RFLi_ASSERTLINE_MSG(header == csHeader[arg->parts], 1304, "ヘッダとpartsが一致しません"); // "Header and "parts" do not match"
RFLi_ASSERTLINE_MSG(header == csHeader[shapeRes->parts], 1304, "ヘッダとpartsが一致しません"); // "Header and "parts" do not match"
ptr8 += sizeof(header);
}
if (arg->parts == RFLiPartsShp_Faceline) {
RFLi_ASSERTLINE_NULL(arg->noseTrans, 1310);
RFLi_ASSERTLINE_NULL(arg->beardTrans, 1311);
if (shapeRes->parts == RFLiPartsShp_Faceline) {
RFLi_ASSERTLINE_NULL(shapeRes->noseTrans, 1310);
RFLi_ASSERTLINE_NULL(shapeRes->beardTrans, 1311);
// Missing assert for arg->hairTrans?
memcpy(arg->noseTrans, ptr8, sizeof(RFLiPositionData));
memcpy(shapeRes->noseTrans, ptr8, sizeof(RFLiPositionData));
ptr8 += sizeof(RFLiPositionData);
memcpy(arg->beardTrans, ptr8, sizeof(RFLiPositionData));
memcpy(shapeRes->beardTrans, ptr8, sizeof(RFLiPositionData));
ptr8 += sizeof(RFLiPositionData);
memcpy(arg->hairTrans, ptr8, sizeof(RFLiPositionData));
memcpy(shapeRes->hairTrans, ptr8, sizeof(RFLiPositionData));
ptr8 += sizeof(RFLiPositionData);
}
{
u16 size = *(u16*)ptr8; // r31+0xA
if (size == 0) {
arg->vtxPosSize = 0;
arg->vtxNrmSize = 0;
arg->vtxTxcSize = 0;
shapeRes->vtxPosSize = 0;
shapeRes->vtxNrmSize = 0;
shapeRes->vtxTxcSize = 0;
arg->dlSize = 0;
shapeRes->dlSize = 0;
RFLiFree(res);
return;
}
}
arg->vtxPosSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(arg->vtxPosSize <= arg->vtxPosBufSize, 1351, "vtxPosSize(%d) > vtxPosBufSize(%d) parts:%d index:%d", arg->vtxPosSize,
arg->vtxPosBufSize, arg->parts, arg->index);
ptr8 += sizeof(arg->vtxPosSize);
shapeRes->vtxPosSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(shapeRes->vtxPosSize <= shapeRes->vtxPosBufSize, 1351, "vtxPosSize(%d) > vtxPosBufSize(%d) parts:%d index:%d", shapeRes->vtxPosSize,
shapeRes->vtxPosBufSize, shapeRes->parts, shapeRes->index);
ptr8 += sizeof(shapeRes->vtxPosSize);
{
u32 byteSize; // r31+0xD4
s16* ptr16; // r31+0xD0
ptr16 = (s16*)ptr8;
byteSize = SIZE_VTX_POS(arg->vtxPosSize);
byteSize = SIZE_VTX_POS(shapeRes->vtxPosSize);
if (arg->transform) {
if (shapeRes->transform) {
int i; // r31+0xCC
s32 s = 256.0f * arg->posScale; // r31+0xC8
s32 tx = 256.0f * arg->posTrans->x; // r31+0xC4
s32 ty = 256.0f * arg->posTrans->y; // r31+0xC0
s32 tz = 256.0f * arg->posTrans->z; // r31+0xBC
s32 s = 256.0f * shapeRes->posScale; // r31+0xC8
s32 tx = 256.0f * shapeRes->posTrans->x; // r31+0xC4
s32 ty = 256.0f * shapeRes->posTrans->y; // r31+0xC0
s32 tz = 256.0f * shapeRes->posTrans->z; // r31+0xBC
for (i = 0; i < arg->vtxPosSize; i++) {
for (i = 0; i < shapeRes->vtxPosSize; i++) {
s16 temp[3]; // r31+0xFC
if (arg->flipX) {
if (shapeRes->flipX) {
temp[0] = tx + ((-ptr16[0] * s) >> 8);
} else {
temp[0] = tx + ((ptr16[0] * s) >> 8);
@@ -959,27 +959,27 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
temp[1] = ty + ((ptr16[1] * s) >> 8);
temp[2] = tz + ((ptr16[2] * s) >> 8);
RFLiTransformCoordinate(&arg->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
RFLiTransformCoordinate(&shapeRes->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
ptr16 += VTX_COORDS_IN_POS;
}
} else if (arg->flipX) {
} else if (shapeRes->flipX) {
int i; // r31+0xB8
for (i = 0; i < arg->vtxPosSize; i++) {
for (i = 0; i < shapeRes->vtxPosSize; i++) {
s16 temp[3]; // r31+0xF4
temp[0] = -ptr16[0];
temp[1] = ptr16[1];
temp[2] = ptr16[2];
RFLiTransformCoordinate(&arg->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
RFLiTransformCoordinate(&shapeRes->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
ptr16 += VTX_COORDS_IN_POS;
}
} else {
int i; // r31+0xB4
for (i = 0; i < arg->vtxPosSize; i++) {
RFLiTransformCoordinate(&arg->vtxPosBuf[i * VTX_COORDS_IN_POS], ptr16);
for (i = 0; i < shapeRes->vtxPosSize; i++) {
RFLiTransformCoordinate(&shapeRes->vtxPosBuf[i * VTX_COORDS_IN_POS], ptr16);
ptr16 += VTX_COORDS_IN_POS;
}
}
@@ -987,9 +987,9 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
ptr8 += byteSize;
}
arg->vtxNrmSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(arg->vtxNrmSize <= arg->vtxNrmBufSize, 1415, "vtxNrmSize(%d) > vtxNrmBufSize(%d) parts:%d index:%d", arg->vtxNrmSize,
arg->vtxNrmBufSize, arg->parts, arg->index);
shapeRes->vtxNrmSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(shapeRes->vtxNrmSize <= shapeRes->vtxNrmBufSize, 1415, "vtxNrmSize(%d) > vtxNrmBufSize(%d) parts:%d index:%d", shapeRes->vtxNrmSize,
shapeRes->vtxNrmBufSize, shapeRes->parts, shapeRes->index);
ptr8 += sizeof(u16);
{
@@ -997,25 +997,25 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
s16* ptr16; // r31+0xAC
ptr16 = (s16*)ptr8;
byteSize = SIZE_VTX_NRM(arg->vtxNrmSize);
byteSize = SIZE_VTX_NRM(shapeRes->vtxNrmSize);
if (arg->flipX) {
if (shapeRes->flipX) {
int i; // r31+0xA8
for (i = 0; i < arg->vtxNrmSize; i++) {
for (i = 0; i < shapeRes->vtxNrmSize; i++) {
s16 temp[3]; // r31+0xEC
temp[0] = -ptr16[0];
temp[1] = ptr16[1];
temp[2] = ptr16[2];
RFLiTransformCoordinate(&arg->vtxNrmBuf[i * VTX_COORDS_IN_NRM], temp);
RFLiTransformCoordinate(&shapeRes->vtxNrmBuf[i * VTX_COORDS_IN_NRM], temp);
ptr16 += VTX_COORDS_IN_NRM;
}
} else {
int i; // r31+0xA4
for (i = 0; i < arg->vtxNrmSize; i++) {
RFLiTransformCoordinate(&arg->vtxNrmBuf[i * VTX_COORDS_IN_NRM], ptr16);
for (i = 0; i < shapeRes->vtxNrmSize; i++) {
RFLiTransformCoordinate(&shapeRes->vtxNrmBuf[i * VTX_COORDS_IN_NRM], ptr16);
ptr16 += VTX_COORDS_IN_NRM;
}
}
@@ -1027,15 +1027,15 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
u32 byteSize; // r31+0xA0
if (skipTxc) {
arg->vtxTxcSize = 0;
shapeRes->vtxTxcSize = 0;
} else {
arg->vtxTxcSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(arg->vtxTxcSize <= arg->vtxTxcBufSize, 1460, "vtxTxcSize(%d) > vtxTxcBufSize(%d) parts:%d index:%d", arg->vtxTxcSize,
arg->vtxTxcBufSize, arg->parts, arg->index);
shapeRes->vtxTxcSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(shapeRes->vtxTxcSize <= shapeRes->vtxTxcBufSize, 1460, "vtxTxcSize(%d) > vtxTxcBufSize(%d) parts:%d index:%d", shapeRes->vtxTxcSize,
shapeRes->vtxTxcBufSize, shapeRes->parts, shapeRes->index);
ptr8 += sizeof(u16);
byteSize = SIZE_VTX_TXC(arg->vtxTxcSize);
memcpy(arg->vtxTxcBuf, ptr8, byteSize);
byteSize = SIZE_VTX_TXC(shapeRes->vtxTxcSize);
memcpy(shapeRes->vtxTxcBuf, ptr8, byteSize);
ptr8 += byteSize;
}
}
@@ -1044,8 +1044,8 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
int primitiveNum = *ptr8++; // r31+0x9C
int i, j; // r31+0x94
DCInvalidateRange(arg->dlBuf, arg->dlBufSize);
GXBeginDisplayList(arg->dlBuf, arg->dlBufSize);
DCInvalidateRange(shapeRes->dlBuf, shapeRes->dlBufSize);
GXBeginDisplayList(shapeRes->dlBuf, shapeRes->dlBufSize);
for (i = 0; i < primitiveNum; i++) {
u16 vtxNum = *ptr8++; // r31+0x8
@@ -1065,7 +1065,7 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
GXEnd();
}
arg->dlSize = GXEndDisplayList();
shapeRes->dlSize = GXEndDisplayList();
}
RFLiFree(res);

View File

@@ -408,7 +408,7 @@ RFLErrcode RFLiOpenAsync(RFLiFileType type, u8 openmode, RFLSimpleCB cb) {
strncpy(info->openinfo.filename, filename, NAND_MAX_PATH);
info->openinfo.filename[NAND_MAX_PATH] = 0;
info->openinfo.openmode = (u8)openmode;
info->openinfo.openmode = openmode;
info->openinfo.permission = scFilePermissions[type];
info->openinfo.attribute = scFileAttributes[type];
@@ -626,8 +626,8 @@ RFLErrcode RFLiReadAsync(RFLiFileType type, void* dst, u32 size, RFLSimpleCB cb,
static void writecallback_(s32 result, NANDCommandBlock* block);
static void retryWrite_(u32 arg) {
RFLiFileType type = (RFLiFileType)arg;
static void retryWrite_(u32 fileType) {
RFLiFileType type = (RFLiFileType)fileType;
RFLiNANDAccessInfo* info = RFLiGetAccInfo(type);
{
@@ -734,8 +734,8 @@ static s32 writestart_(RFLiFileType type) {
static void writeseekcallback_(s32 result, NANDCommandBlock* block);
static void retryWriteSeek_(u32 arg) {
RFLiFileType type = (RFLiFileType)arg;
static void retryWriteSeek_(u32 fileType) {
RFLiFileType type = (RFLiFileType)fileType;
RFLiNANDAccessInfo* info = RFLiGetAccInfo(type);
{

View File

@@ -349,7 +349,7 @@ RFLErrcode makeNWC24MsgforExchange_(NWC24MsgObj* obj, RFLCharData* sendTarget, B
RFLi_ASSERTLINE(aidx <= count, 407);
for (i = 0; i < aidx - 1; i++) {
u16 tmp;
u16 shuffledIndex;
u16 target;
target = (((rand >> 0x10) + rand) & 0xFFFF) % (aidx - 1);
@@ -357,9 +357,9 @@ RFLErrcode makeNWC24MsgforExchange_(NWC24MsgObj* obj, RFLCharData* sendTarget, B
target++;
}
tmp = array[target];
shuffledIndex = array[target];
array[target] = array[i];
array[i] = tmp;
array[i] = shuffledIndex;
rand = (rand + 0x02ED47B1) * 0x032ED8B7;
}
@@ -447,14 +447,14 @@ RFLErrcode makeNWC24MsgforExchange_(NWC24MsgObj* obj, RFLCharData* sendTarget, B
int k;
for (k = 0; k < friendsNum; k++) {
NWC24FriendInfo* tmp;
NWC24FriendInfo* shuffledFriend;
u32 l;
rand = (rand + 0x02ED47B1) * 0x032ED8B7;
l = rand % friendsNum;
tmp = lists[k];
shuffledFriend = lists[k];
lists[k] = lists[l];
lists[l] = tmp;
lists[l] = shuffledFriend;
}
for (i = 0; i < (int)GET_ARRAY_LENGTH(receiver); i++) {

View File

@@ -86,7 +86,7 @@ RFLErrcode RFLInitResAsync(void* workBuffer, void* resBuffer, u32 resSize, BOOL
} else {
size = (RFLi_WORK_SIZE - sizeof(RFLiSysManager));
}
RFLiGetManager()->mRootHeap = MEMCreateExpHeapEx(RFLiGetManager()->mWorkBuffer, size, 1);
RFLiGetManager()->mRootHeap = MEMCreateExpHeapEx(RFLiGetManager()->mWorkBuffer, size, MEM_HEAP_OPT_CLEAR_ALLOC);
RFLi_REPORT(" rootHeap : 0x%08x - 0x%08x (%6dByte)\n", (u8*)RFLiGetManager()->mWorkBuffer,
(size + (u32)RFLiGetManager()->mWorkBuffer), size);
}

View File

@@ -49,17 +49,17 @@ typedef struct {
u8 flashVer[4]; // 0x640
s8 flashPixVer[4]; // 0x644
u16 colorSpace; // 0x648
u8 unk_0x64A[0x02];
u8 colorSpacePadding[0x02];
u32 pixelXDim; // 0x64C
u32 pixelYDim; // 0x650
u16 compressionIfd1; // 0x654
u8 unk_0x656[0x02];
u8 compressionPadding[0x02];
u32 xResNumIfd1; // 0x658
u32 xResDenIfd1; // 0x65C
u32 planarConfigIfd1; // 0x660
u32 yResDenIfd1; // 0x664
u16 resUnitIfd1; // 0x668
u8 unk_0x66A[0x02];
u8 resolutionPadding[0x02];
u32 thumbnailOffset; // 0x66C
u32 thumbnailLength; // 0x670
u8* thumbnailData; // 0x674
@@ -67,19 +67,40 @@ typedef struct {
} TMCCJPEGDecExifData;
typedef struct {
u8 unk_0x00[0x04];
u16 posX;
u16 posY;
s32 position; // 0x04
u8 unk_0x08[0x04];
u32 state; // 0x0C
u8 unk_0x10[0x10];
u16 maxX;
u16 maxY;
u8 stepX;
u8 stepY;
u8 stepXExt;
u8 stepYExt;
u32 dataSizeX;
u32 dataSizeY;
u8 exifFlags; // 0x20
u8 thumbFlag; // 0x21
u8 unk_0x22[0x2A];
u8 componentCount;
u8 dimensionPadding;
u16 jpegWidth;
u16 jpegHeight;
u16 outputWidth;
u16 outputHeight;
u32 convWidth;
u32 convHeight;
u32 chromaWidth;
u32 chromaHeight;
u8* pLumaBuffer;
u8* pCbBuffer;
u8* pCrBuffer;
void* pTexBuffer;
TMCCJPEGDecExifData exifData; // 0x4C
TMCCJPEGDecWork* pWorkBuf; // 0x6C8
u8 unk_0x6CC[0x04];
s32 decodeResult;
u8 converterType; // 0x6D0
u8 unk_0x6D1[0x03];
u8 alignmentPadding[0x03];
} TMCCJPEGDecExifInfo;
typedef struct {

View File

@@ -5,6 +5,32 @@
#include <tmc_jpeg.h>
enum TMCCJPEGOutputFormat {
TMCC_JPEG_OUTPUT_RGB565 = 0,
TMCC_JPEG_OUTPUT_RGBA8 = 1,
TMCC_JPEG_OUTPUT_Y8U8V8 = 2
};
enum TMCJpegMarker {
TMC_JPEG_MARKER_SOF0 = 0xFFC0,
TMC_JPEG_MARKER_SOF2 = 0xFFC2,
TMC_JPEG_MARKER_DHT = 0xFFC4,
TMC_JPEG_MARKER_RST0 = 0xFFD0,
TMC_JPEG_MARKER_RST7 = 0xFFD7,
TMC_JPEG_MARKER_SOI = 0xFFD8,
TMC_JPEG_MARKER_EOI = 0xFFD9,
TMC_JPEG_MARKER_SOS = 0xFFDA,
TMC_JPEG_MARKER_DQT = 0xFFDB,
TMC_JPEG_MARKER_DNL = 0xFFDC,
TMC_JPEG_MARKER_DRI = 0xFFDD,
TMC_JPEG_MARKER_APP0 = 0xFFE0,
TMC_JPEG_MARKER_APP1 = 0xFFE1,
TMC_JPEG_MARKER_APP15 = 0xFFEF,
TMC_JPEG_MARKER_COM = 0xFFFE,
TMC_JPEG_MARKER_PREFIX = 0xFF00,
TMC_JPEG_MARKER_FILL = 0xFFFF,
};
typedef s32(TMCDecodeFunc)(s32* block, u8* conv_row_ptr, u32* dcPredictRowPtr, TMCCJPEGDecWork* work);
typedef void(TMCIdctFunc)(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigzag);
typedef void(TMCConverterFunc)(TMCCJPEGDecWork*, s32 x, s32 y);
@@ -13,44 +39,33 @@ typedef void(TMCConverterFunc)(TMCCJPEGDecWork*, s32 x, s32 y);
extern "C" {
#endif
// TODO: The following two structs are subsets of TMCCJPEGDecWork.
// Their members in TMCCJPEGDecWork should eventually be removed and replaced with these structs as a member.
// Some code accesses scaleFlag, frameWidth and convBuf as a pointer and uses them as a base to do further pointer arithmetic on,
// so they likely were nested structs.
typedef struct {
u8 scaleFlag; // 0x00
u8 unk_0x01[0x3E7];
u8* pDCACPtrs[6]; // 0x03E8-0x03FF
u8 zigzagData[64]; // 0x0400-0x043F
u16* pDCFast; // 0x0440
u32* pDCHuffTbl; // 0x0444
u8* pDCHuffSym; // 0x0448
u32 unk_0x4A4; // 0x044C
u16* pACFast; // 0x0450
u32* pACHuffTbl; // 0x0454
u8* pACHuffSym; // 0x0458
u32 unk_0x4C5;
u8 unk_0x460[0x1B4];
u32 thumbHuffSize[3]; // 0x0614
u8 unk_0x620[0x1E8];
u8 huffDecTblDC1[0x400]; // 0x0808-0x0C07
u8 huffDecTblAC0[0x400]; // 0x0C08-0x1007
u8 huffDecTblAC1[0x400]; // 0x1008-0x1407
u8 valPtrDC0[0x44]; // 0x1408-0x144B
u8 valPtrDC1[0x44]; // 0x144C-0x148F
u8 valPtrAC0[0x44]; // 0x1490-0x14D3
u8 valPtrAC1[0x44]; // 0x14D4-0x1517
u8 maxCodeDC0[0x10]; // 0x1518-0x1527
u8 maxCodeDC1[0x10]; // 0x1528-0x1537
u8 maxCodeAC0[0x100]; // 0x1538-0x1637
u8 maxCodeAC1[0x100]; // 0x1638-0x1737
u8 unk_0x1738[0x04];
u8 huffTblInitFlag[4]; // 0x173C
u8 unk_0x1740[0x50];
u8 quantTblFlag[4]; // 0x1790
u8 dcTblFlag[2]; // 0x1794
u8 acTblFlag[2]; // 0x1796
} TMCUnknownInfo;
u32 coefficients[4][64];
u8 zigzagData[64];
u16* pDCFast;
u32* pDCHuffTbl;
u8* pDCHuffSym;
u32 reservedDC;
u16* pACFast;
u32* pACHuffTbl;
u8* pACHuffSym;
u32 reservedAC;
u16 huffDecTblDC0[0x200];
u16 huffDecTblDC1[0x200];
u16 huffDecTblAC0[0x200];
u16 huffDecTblAC1[0x200];
u32 valPtrDC0[17];
u32 valPtrDC1[17];
u32 valPtrAC0[17];
u32 valPtrAC1[17];
u8 maxCodeDC0[0x10];
u8 maxCodeDC1[0x10];
u8 maxCodeAC0[0x100];
u8 maxCodeAC1[0x100];
u8 quantTblFlag[4];
u8 dcTblFlag[2];
u8 acTblFlag[2];
} TMCJpegTableInfo;
typedef struct {
u16 frameWidth; // 0x00
@@ -75,9 +90,18 @@ typedef struct {
u8 maxVSamp; // 0x29
u16 restartInterval; // 0x2A
u8 scanCount; // 0x2C
u8 unk_0x2D[0x03];
u8 alignmentPadding[0x03];
} TMCJpegFrameInfo;
typedef struct {
u8 map[4];
u32 dcPredict[4];
u8 id[4];
u8 quantTable[4];
u8 dcTable[4];
u8 acTable[4];
} TMCFrameComponents;
struct TMCCJPEGDecWork_t {
u32 bitBuf; // 0x00
s32 bitCount; // 0x04
@@ -90,47 +114,11 @@ struct TMCCJPEGDecWork_t {
s32 remaining; // 0x20
TMCCReadCallback* pCallback; // 0x24
void* pCbCtx; // 0x28
u8 compMap[4]; // 0x2C
u32 dcPredict[4]; // 0x30
u8 compId[4]; // 0x40
u8 compQTbl[4]; // 0x44
u8 copDCTbl[4]; // 0x48
u8 copACTbl[4]; // 0x4C
TMCFrameComponents components;
u16 restartCnt; // 0x50
u16 rstMarkerIdx; // 0x52
u32 mcuPos; // 0x54
// Section below is likely a nested struct
u8 scaleFlag; // 0x58
u8 unk_0x59[0x3E7];
u8* pDCACPtrs[6]; // 0x440
u8 zigzagData[64]; // 0x458
u16* pDCFast; // 0x498
u32* pDCHuffTbl; // 0x49C
u8* pDCHuffSym; // 0x4A0
u32 unk_0x4A4;
u16* pACFast; // 0x4A8
u32* pACHuffTbl; // 0x4AC
u8* pACHuffSym; // 0x4B0
u8 unk_0x4B4[0x1B8];
u32 thumbHuffSize[3]; // 0x66C
u8 unk_0x678[0x1E8];
u8 huffDecTblDC1[0x400]; // 0x860-0xC5F
u8 huffDecTblAC0[0x400]; // 0xC60-0x105F
u8 huffDecTblAC1[0x400]; // 0x1060-0x145F
u8 valPtrDC0[0x44]; // 0x1460-0x14A3
u8 valPtrDC1[0x44]; // 0x14A4-0x14E7
u8 valPtrAC0[0x44]; // 0x14E8-0x152B
u8 valPtrAC1[0x44]; // 0x152C-0x156F
u8 maxCodeDC0[0x10]; // 0x1570-0x157F
u8 maxCodeDC1[0x10]; // 0x1580-0x158F
u8 maxCodeAC0[0x100]; // 0x1590-0x168F
u8 maxCodeAC1[0x100]; // 0x1690-0x178F
u8 unk_0x1790[0x04];
u8 huffTblInitFlag[4]; // 0x1794
u8 unk_0x1798[0x50];
u8 quantTblFlag[4]; // 0x17E8
u8 dcTblFlag[2]; // 0x17EC
u8 acTblFlag[2]; // 0x17EE
TMCJpegTableInfo tables;
// Section below is likely a nested struct
u16 frameWidth; // 0x17F0
u16 frameHeight; // 0x17F2
@@ -154,7 +142,7 @@ struct TMCCJPEGDecWork_t {
u8 maxVSamp; // 0x1819
u16 restartInterval; // 0x181A
u8 scanCount; // 0x181C
u8 unk_0x181D[0x03];
u8 framePadding[0x03];
TMCIdctFunc* idctPtr; // 0x1820
TMCIdctFunc* idctLumiPtr; // 0x1824
TMCDecodeFunc* decodePtr; // 0x1828
@@ -165,10 +153,10 @@ struct TMCCJPEGDecWork_t {
u8* pConvRowPtrs[7]; // 0x183C
u8 convBuf[0x184]; // 0x1858
u8 idctMode; // 0x19DC
u8 unk_0x19DD;
u8 pitchPadding;
u16 pitch; // 0x19DE
u8 converterFlags; // 0x19E0
u8 unk_0x19E1[0x03];
u8 statePadding[0x03];
TMCCJPEGDecState* pState; // 0x19E4
};
@@ -187,13 +175,13 @@ s32 TMCJPEGDEC_rewind_ptr(TMCCJPEGDecWork* work);
typedef struct {
u32* huffTable; // 0x00
u8* valptr; // 0x04
u32* valptr; // 0x04
u32* maxCode; // 0x08
u8 count; // 0x0C
} TMCHuffParam;
s32 TMCJPEGDEC_make_huffdec(const u8* dht_spec, u8* tbl, TMCHuffParam* hp);
void TMCJPEGDEC_set_HuffmanTable(TMCHuffParam* tbl, s32 tblType, s32 tblID, TMCUnknownInfo* work);
void TMCJPEGDEC_set_HuffmanTable(TMCHuffParam* tbl, s32 tblType, s32 tblID, TMCJpegTableInfo* work);
s32 TMCJPEGDEC_decompmcu(u32 maxMCU, u32 mcuCount, TMCCJPEGDecWork* work, void* buf);
s32 TMCJPEGDEC_imagestart(TMCCJPEGDecWork* work);
@@ -202,7 +190,7 @@ s32 TMCJPEGDEC_scanstart(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_scan_varinit(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_restart_interval(TMCCJPEGDecWork* work, u32 maxMCU, u32 mcuCount);
s32 TMCJPEGDEC_err_restart(TMCCJPEGDecWork* work);
void TMCJPEGDEC_set_entropytbl(TMCCJPEGDecWork* work, s32 idx, u8 data);
void TMCJPEGDEC_set_entropytbl(TMCJpegTableInfo* work, s32 idx, u8 data);
s32 TMCJPEGDEC_Decompscan(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_Setsize(TMCCJPEGDecWork* work);
@@ -226,11 +214,15 @@ s32 TMCJPEGDEC_set_converterY8U8V8(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_set_converterRGB565(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_set_converterRGBA8(TMCCJPEGDecWork* work);
extern const u8 TMCJPEGDEC_SampleH_N[24];
extern const u8 TMCJPEGDEC_SampleV_N[24];
extern const u8 TMCJPEGDEC_SampleH_N[6][4];
extern const u8 TMCJPEGDEC_SampleV_N[6][4];
extern const u8 TMCJPEGDEC_Zigzag_data[64];
extern const u32 TMCJPEGDEC_Zigzag_loop[64];
#ifdef TMC_JPEG_FRAME_PARSER
extern const u8 TMCJPEGDEC_SampleComps[];
#else
extern const u8 TMCJPEGDEC_SampleComps[6];
#endif
#ifdef __cplusplus
}

View File

@@ -17,7 +17,8 @@ s32 TMCCJPEGDecInit(TMCCJPEGDecState* state, TMCCJPEGDecInitParam* param) {
if (param->unk_0x24 != 0) {
result = -1;
} else if (param->unk_0x2C != 0 && param->unk_0x2C != 1 && param->unk_0x2C != 2) {
} else if (param->unk_0x2C != TMCC_JPEG_OUTPUT_RGB565 && param->unk_0x2C != TMCC_JPEG_OUTPUT_RGBA8 &&
param->unk_0x2C != TMCC_JPEG_OUTPUT_Y8U8V8) {
result = -1;
} else {
state->unk_0x21 = param->unk_0x24;
@@ -58,19 +59,19 @@ s32 TMCCJPEGDecInit(TMCCJPEGDecState* state, TMCCJPEGDecInitParam* param) {
result = TMCJPEGDEC_Setsize(work);
if (result >= 0) {
switch (state->converterType) {
case 0:
case TMCC_JPEG_OUTPUT_RGB565:
result = TMCJPEGDEC_set_converterRGB565(work);
if (result < 0) {
goto error;
}
break;
case 1:
case TMCC_JPEG_OUTPUT_RGBA8:
result = TMCJPEGDEC_set_converterRGBA8(work);
if (result < 0) {
goto error;
}
break;
case 2:
case TMCC_JPEG_OUTPUT_Y8U8V8:
result = TMCJPEGDEC_set_converterY8U8V8(work);
if (result < 0) {
goto error;
@@ -104,7 +105,7 @@ s32 TMCCJPEGDecodeRGB565(TMCCJPEGDecState* state, s32 initResult, void* texBuffe
return -1;
}
if (state->converterType != 0) {
if (state->converterType != TMCC_JPEG_OUTPUT_RGB565) {
return -4;
}
@@ -173,19 +174,19 @@ s32 TMCCJPEGDecSetResolution(TMCCJPEGDecState* state, u32 scale) {
}
switch (state->converterType) {
case 0:
case TMCC_JPEG_OUTPUT_RGB565:
result = TMCJPEGDEC_set_converterRGB565(work);
if (result < 0) {
return result;
}
break;
case 1:
case TMCC_JPEG_OUTPUT_RGBA8:
result = TMCJPEGDEC_set_converterRGBA8(work);
if (result < 0) {
return result;
}
break;
case 2:
case TMCC_JPEG_OUTPUT_Y8U8V8:
result = TMCJPEGDEC_set_converterY8U8V8(work);
if (result < 0) {
return result;

View File

@@ -52,7 +52,7 @@ static inline s32 decodeLongHuffman(s32 bitCount, u32* huff_tbl, u8* symbols, TM
limit->bitLength = entry[0];
limit->symbol = entry[1];
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
if (code > decoded->bitLength) {
continue;
}
{
@@ -101,7 +101,7 @@ static inline s32 decodeACHuffman(s32 bitCount, u32* huff_tbl, u8* symbols, TMCC
limit->bitLength = entry[0];
limit->symbol = entry[1];
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
if (code > decoded->bitLength) {
continue;
}
{
@@ -140,7 +140,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
conv_row = (s32*)conv_row_ptr;
bit_pos = work->bitCount;
dc_fast = work->pDCFast;
dc_fast = work->tables.pDCFast;
if (bit_pos <= 8) {
r = TMCJPEGDEC_load_buff(work);
@@ -161,8 +161,8 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
work->bitCount = bit_pos - r;
r = extra;
} else {
huff_sym = work->pDCHuffSym;
huff_tbl = work->pDCHuffTbl;
huff_sym = work->tables.pDCHuffSym;
huff_tbl = work->tables.pDCHuffTbl;
r = decodeLongHuffman(bit_pos, huff_tbl, huff_sym, work, &dcLimit, &dcDecoded);
if (r < 0) {
return r;
@@ -173,7 +173,8 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
if (r != 0) {
if (work->bitCount <= r) {
s32 load_ret;
if (load_ret = TMCJPEGDEC_load_buff(work), load_ret < 0) {
load_ret = TMCJPEGDEC_load_buff(work);
if (load_ret < 0) {
return load_ret;
}
}
@@ -195,9 +196,9 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
u32* ac_huff_tbl;
u8* ac_huff_sym;
ac_fast = work->pACFast;
ac_huff_tbl = work->pACHuffTbl;
ac_huff_sym = work->pACHuffSym;
ac_fast = work->tables.pACFast;
ac_huff_tbl = work->tables.pACHuffTbl;
ac_huff_sym = work->tables.pACHuffSym;
memset(block + 1, 0, 0xFC);
@@ -278,8 +279,8 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
bit_data = work->bitBuf;
bit_pos = work->bitCount;
t = bit_pos - 8;
tmp = ((bit_data >> t) & 0xFF) << 2;
acEntry = readHuffmanEntry((const TMCHuffmanEntry*)ac_fast, tmp >> 2);
tmp = (bit_data >> t) & 0xFF;
acEntry = readHuffmanEntry((const TMCHuffmanEntry*)ac_fast, tmp);
idx += 16;
}

View File

@@ -1,3 +1,4 @@
#include <stddef.h>
#include <tmc_jpeg_internal.h>
static s32 refillJpegBufferAfterFF(TMCCJPEGDecWork* work);
@@ -9,23 +10,24 @@ s32 TMCJPEGDEC_init_ptr_buff(TMCCJPEGDecWork* work, void* param) {
u8* newEnd;
u8* bufOrg;
u32 newRemaining;
const TMCCJPEGDecInitParam* input = (const TMCCJPEGDecInitParam*)((u8*)param - offsetof(TMCCJPEGDecInitParam, pBuf2));
if (((u32*)param)[0] & 0x1F)
if ((u32)input->pBuf2 & (DEFAULT_ALIGN - 1))
return -1;
if (((u32*)param)[1] & 0x1F)
if (input->buf2Size & (DEFAULT_ALIGN - 1))
return -1;
if (((u32*)param)[2] == 0)
if (input->dataSize == 0)
return -1;
if (((u32*)param)[1] < 0x10040)
if (input->buf2Size < 0x10040)
return -1;
work->pBufOrg = (u8*)((u32*)param)[0];
work->pBufOrg = input->pBuf2;
dest = work->pBufOrg + 0x20;
work->bufLen = ((u32*)param)[1] - 0x20;
readSize = ((u32*)param)[2];
work->bufLen = input->buf2Size - 0x20;
readSize = input->dataSize;
work->remaining = readSize;
work->pCallback = (void*)((u32*)param)[3];
work->pCbCtx = (void*)((u32*)param)[4];
work->pCallback = input->pCallback;
work->pCbCtx = input->pContext;
if (work->bufLen - 0x20 < readSize) {
readSize = work->bufLen - 0x20;
}

View File

@@ -27,7 +27,7 @@ s32 TMCJPEGDEC_init_buff_thumbnail(TMCCJPEGDecWork* work, u8* dst, u8* src) {
endAddress = (u32)buffer->pBufCur + endAddress;
buffer->remaining = 0;
buffer->pBufEnd = (u8*)endAddress;
buffer->pBufMark = (u8*)((u32)endAddress - 0x22);
buffer->pBufMark = (u8*)endAddress - 0x22;
return 0;
}
@@ -48,8 +48,11 @@ s32 TMCJPEGDEC_rewind_ptr(TMCCJPEGDecWork* work) {
return r;
}
if ((u8)bitBuf == 0xFF && (r = TMCJPEGDEC_move_ptr(-1, work), r < 0)) {
return r;
if ((u8)bitBuf == 0xFF) {
r = TMCJPEGDEC_move_ptr(-1, work);
if (r < 0) {
return r;
}
}
bitBuf >>= 8;

View File

@@ -1,21 +1,27 @@
#include <string.h>
#include <tmc_jpeg_internal.h>
static s32 clampU8(s32 v) {
s32 ok;
ok = 0;
if (v < 256 && v > -1) {
ok = 1;
}
return ok ? v : (v < 0 ? 0 : 255);
}
static s32 clampS8(s32 v) {
s32 inRange = 0;
if (v < 128 && v > -129) {
static s32 clampU8(s32 value) {
s32 inRange;
inRange = 0;
if (value < 256 && value > -1) {
inRange = 1;
}
return inRange ? v : (v > 0) ? 127 : -128;
if (inRange) {
return value;
}
if (value < 0) {
return 0;
}
return 255;
}
static s32 clampS8(s32 value) {
s32 inRange = 0;
if (value < 128 && value > -129) {
inRange = 1;
}
return inRange ? value : (value > 0) ? 127 : -128;
}
static s32 scalingClampU8(s32 value) {
@@ -26,70 +32,70 @@ static s32 scalingClampU8(s32 value) {
}
void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigzag) {
s32 tmp[64];
s32* dst;
s32 d;
s32 t;
s32 i;
s32 y;
s32 b2;
s32 b1;
s32 b4;
s32 b5;
s32 b6;
s32 b7;
s32 n;
s32 workspace[64];
s32* workspaceCursor;
s32 evenBaseSum;
s32 evenRotation;
s32 column;
s32 evenOutput3;
s32 coefficient2;
s32 coefficient1;
s32 coefficient4;
s32 coefficient5;
s32 coefficient6;
s32 coefficient7;
s32 oddOutput0;
s32 m;
s32 a;
s32 done;
s32 evenBaseDifference;
s32 processedCoefficients;
s32 z;
s32 v;
s32 p;
s32 p_part;
s32 m_part;
s32 u;
s32 evenOutput1;
s32 oddOutput3;
s32 oddLowRotation;
s32 oddHighRotation;
s32 evenRotationSum;
s32 r;
s32 o;
s32 x;
s32 x_factor;
s32 z_factor;
s32 iter;
s32 q;
s32 w;
s32 e;
s32 b3;
s32 oddOutput1;
s32 oddSumRotation;
s32 oddSumDifference;
s32 oddDifferenceSum;
s32 columnsRemaining;
s32 oddOutput2;
s32 evenOutput0;
s32 evenOutput2;
s32 coefficient3;
r = (zigzag >> 4) * 8;
dst = tmp;
done = 0;
workspaceCursor = workspace;
processedCoefficients = 0;
{
for (; done < r; done += 8) {
u32 ac;
b4 = block[4];
b6 = block[6];
b2 = block[2];
b1 = block[1];
b7 = block[7];
b5 = block[5];
b3 = block[3];
for (; processedCoefficients < r; processedCoefficients += 8) {
u32 acBits;
coefficient4 = block[4];
coefficient6 = block[6];
coefficient2 = block[2];
coefficient1 = block[1];
coefficient7 = block[7];
coefficient5 = block[5];
coefficient3 = block[3];
ac = (u32)b4;
ac |= (u32)b6;
ac |= (u32)b2;
ac |= (u32)b1;
ac |= (u32)b7;
ac |= (u32)b5;
ac |= (u32)b3;
if (ac == 0) {
s32 val = block[0];
dst[7] = val;
dst[6] = val;
dst[5] = val;
dst[4] = val;
dst[3] = val;
dst[2] = val;
dst[1] = val;
dst[0] = val;
acBits = (u32)coefficient4;
acBits |= (u32)coefficient6;
acBits |= (u32)coefficient2;
acBits |= (u32)coefficient1;
acBits |= (u32)coefficient7;
acBits |= (u32)coefficient5;
acBits |= (u32)coefficient3;
if (acBits == 0) {
s32 sample = block[0];
workspaceCursor[7] = sample;
workspaceCursor[6] = sample;
workspaceCursor[5] = sample;
workspaceCursor[4] = sample;
workspaceCursor[3] = sample;
workspaceCursor[2] = sample;
workspaceCursor[1] = sample;
workspaceCursor[0] = sample;
} else {
s32 oddLowSum;
s32 oddHighSum;
@@ -97,242 +103,242 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
s32 oddHighDifference;
s32 dcValue;
t = b2 - b6;
oddLowSum = b5 + b3;
oddLowDifference = b5 - b3;
oddHighSum = b1 + b7;
oddHighDifference = b1 - b7;
u = b6 + b2;
t = t * 0xB5 >> 8;
x_factor = oddHighSum - oddLowSum;
z_factor = oddLowDifference + oddHighDifference;
evenRotation = coefficient2 - coefficient6;
oddLowSum = coefficient5 + coefficient3;
oddLowDifference = coefficient5 - coefficient3;
oddHighSum = coefficient1 + coefficient7;
oddHighDifference = coefficient1 - coefficient7;
evenRotationSum = coefficient6 + coefficient2;
evenRotation = evenRotation * 0xB5 >> 8;
oddSumDifference = oddHighSum - oddLowSum;
oddDifferenceSum = oddLowDifference + oddHighDifference;
dcValue = block[0];
a = dcValue - b4;
x = x_factor * 0xB5 >> 8;
d = dcValue + b4;
u = t + u;
v = a + t;
z = z_factor * 0x62 >> 8;
w = d + u;
y = d - u;
m_part = oddHighDifference * 0x14E >> 8;
e = a - t;
m = m_part - z;
evenBaseDifference = dcValue - coefficient4;
oddSumRotation = oddSumDifference * 0xB5 >> 8;
evenBaseSum = dcValue + coefficient4;
evenRotationSum = evenRotation + evenRotationSum;
evenOutput1 = evenBaseDifference + evenRotation;
z = oddDifferenceSum * 0x62 >> 8;
evenOutput0 = evenBaseSum + evenRotationSum;
evenOutput3 = evenBaseSum - evenRotationSum;
oddHighRotation = oddHighDifference * 0x14E >> 8;
evenOutput2 = evenBaseDifference - evenRotation;
m = oddHighRotation - z;
oddLowSum += m;
n = oddHighSum + oddLowSum;
o = x + m;
dst[0] = w + n;
p_part = oddLowDifference * 0x8B;
dst[7] = w - n;
p_part >>= 8;
dst[1] = v + o;
p = z + p_part;
q = p + x;
dst[6] = v - o;
dst[2] = e + q;
dst[5] = e - q;
dst[3] = y + p;
dst[4] = y - p;
oddOutput0 = oddHighSum + oddLowSum;
oddOutput1 = oddSumRotation + m;
workspaceCursor[0] = evenOutput0 + oddOutput0;
oddLowRotation = oddLowDifference * 0x8B;
workspaceCursor[7] = evenOutput0 - oddOutput0;
oddLowRotation >>= 8;
workspaceCursor[1] = evenOutput1 + oddOutput1;
oddOutput3 = z + oddLowRotation;
oddOutput2 = oddOutput3 + oddSumRotation;
workspaceCursor[6] = evenOutput1 - oddOutput1;
workspaceCursor[2] = evenOutput2 + oddOutput2;
workspaceCursor[5] = evenOutput2 - oddOutput2;
workspaceCursor[3] = evenOutput3 + oddOutput3;
workspaceCursor[4] = evenOutput3 - oddOutput3;
}
block += 8;
dst += 8;
workspaceCursor += 8;
}
}
dst = tmp + done;
for (; done <= 0x38; done += 8) {
memset(dst, 0, 0x20);
dst += 8;
workspaceCursor = workspace + processedCoefficients;
for (; processedCoefficients <= 0x38; processedCoefficients += 8) {
memset(workspaceCursor, 0, 0x20);
workspaceCursor += 8;
}
r = pitch * 8 - pitch;
z = pitch * 4;
m = pitch * 2;
dst = tmp + 7;
for (iter = 8, i = 7; iter > 0; iter--, i--) {
u32 ac;
u8* out;
workspaceCursor = workspace + 7;
for (columnsRemaining = 8, column = 7; columnsRemaining > 0; columnsRemaining--, column--) {
u32 acBits;
u8* output;
b4 = dst[0x20];
b6 = dst[0x30];
b2 = dst[0x10];
b1 = dst[8];
b7 = dst[0x38];
b5 = dst[0x28];
b3 = dst[0x18];
coefficient4 = workspaceCursor[0x20];
coefficient6 = workspaceCursor[0x30];
coefficient2 = workspaceCursor[0x10];
coefficient1 = workspaceCursor[8];
coefficient7 = workspaceCursor[0x38];
coefficient5 = workspaceCursor[0x28];
coefficient3 = workspaceCursor[0x18];
ac = (u32)b4;
ac |= (u32)b6;
ac |= (u32)b2;
ac |= (u32)b1;
ac |= (u32)b7;
ac |= (u32)b5;
ac |= (u32)b3;
out = conv_row_ptr + i;
if (ac == 0) {
u8 val = clampU8((*dst >> 11) + 0x80);
out[r] = val;
out[pitch * 6] = val;
out[z + pitch] = val;
out[z] = val;
out[z - pitch] = val;
out[m] = val;
out[pitch] = val;
out[0] = val;
acBits = (u32)coefficient4;
acBits |= (u32)coefficient6;
acBits |= (u32)coefficient2;
acBits |= (u32)coefficient1;
acBits |= (u32)coefficient7;
acBits |= (u32)coefficient5;
acBits |= (u32)coefficient3;
output = conv_row_ptr + column;
if (acBits == 0) {
u8 sample = clampU8((*workspaceCursor >> 11) + 0x80);
output[r] = sample;
output[pitch * 6] = sample;
output[z + pitch] = sample;
output[z] = sample;
output[z - pitch] = sample;
output[m] = sample;
output[pitch] = sample;
output[0] = sample;
} else {
s32 oddLowSum;
s32 oddHighSum;
s32 dcValue;
t = b2 - b6;
oddLowSum = b5 + b3;
b5 = b5 - b3;
oddHighSum = b1 + b7;
b1 = b1 - b7;
u = b6 + b2;
b2 = t * 0xB5 >> 8;
x_factor = oddHighSum - oddLowSum;
z_factor = b5 + b1;
dcValue = *dst + 0x40000;
a = dcValue - b4;
x = x_factor * 0xB5 >> 8;
d = dcValue + b4;
u = b2 + u;
v = a + b2;
z_factor = z_factor * 0x62 >> 8;
w = d + u;
y = d - u;
m_part = b1 * 0x14E >> 8;
e = a - b2;
m_part = m_part - z_factor;
oddLowSum += m_part;
n = oddHighSum + oddLowSum;
o = x + m_part;
p_part = b5 * 0x8B >> 8;
p = z_factor + p_part;
q = p + x;
out[0] = scalingClampU8(w + n);
out[r] = scalingClampU8(w - n);
out[pitch] = scalingClampU8(v + o);
out[pitch * 6] = scalingClampU8(v - o);
out[m] = scalingClampU8(e + q);
out[z + pitch] = scalingClampU8(e - q);
out[z - pitch] = scalingClampU8(y + p);
out[z] = scalingClampU8(y - p);
evenRotation = coefficient2 - coefficient6;
oddLowSum = coefficient5 + coefficient3;
coefficient5 = coefficient5 - coefficient3;
oddHighSum = coefficient1 + coefficient7;
coefficient1 = coefficient1 - coefficient7;
evenRotationSum = coefficient6 + coefficient2;
coefficient2 = evenRotation * 0xB5 >> 8;
oddSumDifference = oddHighSum - oddLowSum;
oddDifferenceSum = coefficient5 + coefficient1;
dcValue = *workspaceCursor + 0x40000;
evenBaseDifference = dcValue - coefficient4;
oddSumRotation = oddSumDifference * 0xB5 >> 8;
evenBaseSum = dcValue + coefficient4;
evenRotationSum = coefficient2 + evenRotationSum;
evenOutput1 = evenBaseDifference + coefficient2;
oddDifferenceSum = oddDifferenceSum * 0x62 >> 8;
evenOutput0 = evenBaseSum + evenRotationSum;
evenOutput3 = evenBaseSum - evenRotationSum;
oddHighRotation = coefficient1 * 0x14E >> 8;
evenOutput2 = evenBaseDifference - coefficient2;
oddHighRotation = oddHighRotation - oddDifferenceSum;
oddLowSum += oddHighRotation;
oddOutput0 = oddHighSum + oddLowSum;
oddOutput1 = oddSumRotation + oddHighRotation;
oddLowRotation = coefficient5 * 0x8B >> 8;
oddOutput3 = oddDifferenceSum + oddLowRotation;
oddOutput2 = oddOutput3 + oddSumRotation;
output[0] = scalingClampU8(evenOutput0 + oddOutput0);
output[r] = scalingClampU8(evenOutput0 - oddOutput0);
output[pitch] = scalingClampU8(evenOutput1 + oddOutput1);
output[pitch * 6] = scalingClampU8(evenOutput1 - oddOutput1);
output[m] = scalingClampU8(evenOutput2 + oddOutput2);
output[z + pitch] = scalingClampU8(evenOutput2 - oddOutput2);
output[z - pitch] = scalingClampU8(evenOutput3 + oddOutput3);
output[z] = scalingClampU8(evenOutput3 - oddOutput3);
}
dst--;
workspaceCursor--;
}
}
void TMCJPEGDEC_IdctBlock_Col(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigzag) {
s32 tmp[64];
s32* dst;
s32 a;
s32 iter;
s32 d;
s32 b1;
s32 b2;
s32 b3;
s32 b4;
s32 b5;
s32 b6;
s32 b7;
s32 workspace[64];
s32* workspaceCursor;
s32 evenBaseDifference;
s32 columnsRemaining;
s32 evenBaseSum;
s32 coefficient1;
s32 coefficient2;
s32 coefficient3;
s32 coefficient4;
s32 coefficient5;
s32 coefficient6;
s32 coefficient7;
s32 v;
s32 r;
s32 done;
s32 i;
s32 rowCoefficientCount;
s32 processedCoefficients;
s32 column;
s32 m;
s32 n;
s32 o;
s32 x;
s32 q;
s32 e;
s32 oddOutput1;
s32 oddSumRotation;
s32 oddOutput2;
s32 evenOutput2;
s32 u;
s32 w;
s32 p;
s32 t;
s32 evenOutput0;
s32 oddOutput3;
s32 rotation45;
s32 z;
s32 x_factor;
s32 z_factor;
s32 m_part;
s32 p_part;
s32 y;
s32 oddSumDifference;
s32 oddDifferenceSum;
s32 oddHighRotation;
s32 oddLowRotation;
s32 evenOutput3;
if (zigzag == 0x11) {
s32 val;
val = clampS8(block[0] >> 11);
memset(conv_row_ptr, (s8)val, 0x40);
s32 sample;
sample = clampS8(block[0] >> 11);
memset(conv_row_ptr, (s8)sample, 0x40);
return;
}
r = (zigzag >> 4) * 8;
rowCoefficientCount = (zigzag >> 4) * 8;
if ((zigzag & 0xF) > 2) {
goto mode_gt_2;
goto fullRowTransform;
}
dst = tmp;
done = 0;
for (; done < r; done += 8) {
workspaceCursor = workspace;
processedCoefficients = 0;
for (; processedCoefficients < rowCoefficientCount; processedCoefficients += 8) {
s32 dcValue;
s32 oddCoefficient;
oddCoefficient = block[1];
dcValue = block[0];
t = oddCoefficient * 0xB5 >> 8;
rotation45 = oddCoefficient * 0xB5 >> 8;
v = oddCoefficient * 0x62 >> 8;
u = v + t;
u = v + rotation45;
z = (oddCoefficient * 0x14E >> 8) - v;
m = oddCoefficient + z;
n = t + z;
dst[0] = dcValue + m;
dst[7] = dcValue - m;
dst[1] = dcValue + n;
dst[6] = dcValue - n;
dst[2] = dcValue + u;
dst[5] = dcValue - u;
dst[3] = dcValue + v;
dst[4] = dcValue - v;
dst += 8;
n = rotation45 + z;
workspaceCursor[0] = dcValue + m;
workspaceCursor[7] = dcValue - m;
workspaceCursor[1] = dcValue + n;
workspaceCursor[6] = dcValue - n;
workspaceCursor[2] = dcValue + u;
workspaceCursor[5] = dcValue - u;
workspaceCursor[3] = dcValue + v;
workspaceCursor[4] = dcValue - v;
workspaceCursor += 8;
block += 8;
}
dst = tmp + done;
for (; done <= 0x38; done += 8) {
memset(dst, 0, 0x20);
dst += 8;
workspaceCursor = workspace + processedCoefficients;
for (; processedCoefficients <= 0x38; processedCoefficients += 8) {
memset(workspaceCursor, 0, 0x20);
workspaceCursor += 8;
}
goto epilogue;
goto columnTransform;
mode_gt_2:
dst = tmp;
done = 0;
for (; done < r; done += 8) {
u32 ac;
b4 = block[4];
b6 = block[6];
b2 = block[2];
b1 = block[1];
b7 = block[7];
b5 = block[5];
b3 = block[3];
fullRowTransform:
workspaceCursor = workspace;
processedCoefficients = 0;
for (; processedCoefficients < rowCoefficientCount; processedCoefficients += 8) {
u32 acBits;
coefficient4 = block[4];
coefficient6 = block[6];
coefficient2 = block[2];
coefficient1 = block[1];
coefficient7 = block[7];
coefficient5 = block[5];
coefficient3 = block[3];
ac = (u32)b4;
ac |= (u32)b6;
ac |= (u32)b2;
ac |= (u32)b1;
ac |= (u32)b7;
ac |= (u32)b5;
ac |= (u32)b3;
if (ac == 0) {
s32 val;
val = block[0];
dst[7] = val;
dst[6] = val;
dst[5] = val;
dst[4] = val;
dst[3] = val;
dst[2] = val;
dst[1] = val;
dst[0] = val;
acBits = (u32)coefficient4;
acBits |= (u32)coefficient6;
acBits |= (u32)coefficient2;
acBits |= (u32)coefficient1;
acBits |= (u32)coefficient7;
acBits |= (u32)coefficient5;
acBits |= (u32)coefficient3;
if (acBits == 0) {
s32 sample;
sample = block[0];
workspaceCursor[7] = sample;
workspaceCursor[6] = sample;
workspaceCursor[5] = sample;
workspaceCursor[4] = sample;
workspaceCursor[3] = sample;
workspaceCursor[2] = sample;
workspaceCursor[1] = sample;
workspaceCursor[0] = sample;
} else {
s32 oddLowSum;
s32 oddLowDifference;
@@ -340,86 +346,86 @@ mode_gt_2:
s32 oddHighDifference;
s32 dcValue;
t = b2 - b6;
oddLowSum = b5 + b3;
oddLowDifference = b5 - b3;
oddHighSum = b1 + b7;
oddHighDifference = b1 - b7;
u = b6 + b2;
t = t * 0xB5 >> 8;
x_factor = oddHighSum - oddLowSum;
z_factor = oddLowDifference + oddHighDifference;
rotation45 = coefficient2 - coefficient6;
oddLowSum = coefficient5 + coefficient3;
oddLowDifference = coefficient5 - coefficient3;
oddHighSum = coefficient1 + coefficient7;
oddHighDifference = coefficient1 - coefficient7;
u = coefficient6 + coefficient2;
rotation45 = rotation45 * 0xB5 >> 8;
oddSumDifference = oddHighSum - oddLowSum;
oddDifferenceSum = oddLowDifference + oddHighDifference;
dcValue = block[0];
a = dcValue - b4;
x = x_factor * 0xB5 >> 8;
d = dcValue + b4;
u = t + u;
v = a + t;
z = z_factor * 0x62 >> 8;
w = d + u;
y = d - u;
m_part = oddHighDifference * 0x14E >> 8;
e = a - t;
m = m_part - z;
evenBaseDifference = dcValue - coefficient4;
oddSumRotation = oddSumDifference * 0xB5 >> 8;
evenBaseSum = dcValue + coefficient4;
u = rotation45 + u;
v = evenBaseDifference + rotation45;
z = oddDifferenceSum * 0x62 >> 8;
evenOutput0 = evenBaseSum + u;
evenOutput3 = evenBaseSum - u;
oddHighRotation = oddHighDifference * 0x14E >> 8;
evenOutput2 = evenBaseDifference - rotation45;
m = oddHighRotation - z;
oddLowSum += m;
n = oddHighSum + oddLowSum;
o = x + m;
dst[0] = w + n;
p_part = oddLowDifference * 0x8B;
dst[7] = w - n;
p_part >>= 8;
dst[1] = v + o;
p = z + p_part;
q = p + x;
dst[6] = v - o;
dst[2] = e + q;
dst[5] = e - q;
dst[3] = y + p;
dst[4] = y - p;
oddOutput1 = oddSumRotation + m;
workspaceCursor[0] = evenOutput0 + n;
oddLowRotation = oddLowDifference * 0x8B;
workspaceCursor[7] = evenOutput0 - n;
oddLowRotation >>= 8;
workspaceCursor[1] = v + oddOutput1;
oddOutput3 = z + oddLowRotation;
oddOutput2 = oddOutput3 + oddSumRotation;
workspaceCursor[6] = v - oddOutput1;
workspaceCursor[2] = evenOutput2 + oddOutput2;
workspaceCursor[5] = evenOutput2 - oddOutput2;
workspaceCursor[3] = evenOutput3 + oddOutput3;
workspaceCursor[4] = evenOutput3 - oddOutput3;
}
block += 8;
dst += 8;
workspaceCursor += 8;
}
dst = tmp + done;
for (; done <= 0x38; done += 8) {
memset(dst, 0, 0x20);
dst += 8;
workspaceCursor = workspace + processedCoefficients;
for (; processedCoefficients <= 0x38; processedCoefficients += 8) {
memset(workspaceCursor, 0, 0x20);
workspaceCursor += 8;
}
epilogue:
columnTransform:
dst = tmp + 7;
for (iter = 8, i = 7; iter > 0; iter--, i--) {
u32 ac;
workspaceCursor = workspace + 7;
for (columnsRemaining = 8, column = 7; columnsRemaining > 0; columnsRemaining--, column--) {
u32 acBits;
u8* output;
b4 = dst[0x20];
output = conv_row_ptr + i;
b6 = dst[0x30];
b2 = dst[0x10];
b1 = dst[8];
b7 = dst[0x38];
b5 = dst[0x28];
b3 = dst[0x18];
coefficient4 = workspaceCursor[0x20];
output = conv_row_ptr + column;
coefficient6 = workspaceCursor[0x30];
coefficient2 = workspaceCursor[0x10];
coefficient1 = workspaceCursor[8];
coefficient7 = workspaceCursor[0x38];
coefficient5 = workspaceCursor[0x28];
coefficient3 = workspaceCursor[0x18];
ac = (u32)b4;
ac |= (u32)b6;
ac |= (u32)b2;
ac |= (u32)b1;
ac |= (u32)b7;
ac |= (u32)b5;
ac |= (u32)b3;
if (ac == 0) {
s32 val;
val = clampS8(*dst >> 11);
output[56] = (u8)val;
output[48] = (u8)val;
output[40] = (u8)val;
output[32] = (u8)val;
output[24] = (u8)val;
output[16] = (u8)val;
output[8] = (u8)val;
output[0] = (u8)val;
acBits = (u32)coefficient4;
acBits |= (u32)coefficient6;
acBits |= (u32)coefficient2;
acBits |= (u32)coefficient1;
acBits |= (u32)coefficient7;
acBits |= (u32)coefficient5;
acBits |= (u32)coefficient3;
if (acBits == 0) {
s32 sample;
sample = clampS8(*workspaceCursor >> 11);
output[56] = (u8)sample;
output[48] = (u8)sample;
output[40] = (u8)sample;
output[32] = (u8)sample;
output[24] = (u8)sample;
output[16] = (u8)sample;
output[8] = (u8)sample;
output[0] = (u8)sample;
} else {
s32 oddLowSum;
s32 oddLowDifference;
@@ -427,42 +433,42 @@ epilogue:
s32 oddHighDifference;
s32 dcValue;
t = b2 - b6;
oddLowSum = b5 + b3;
oddLowDifference = b5 - b3;
oddHighSum = b1 + b7;
oddHighDifference = b1 - b7;
u = b6 + b2;
t = t * 0xB5 >> 8;
x_factor = oddHighSum - oddLowSum;
z_factor = oddLowDifference + oddHighDifference;
dcValue = *dst;
a = dcValue - b4;
x = x_factor * 0xB5 >> 8;
d = dcValue + b4;
u = t + u;
v = a + t;
z = z_factor * 0x62 >> 8;
w = d + u;
y = d - u;
m_part = oddHighDifference * 0x14E >> 8;
e = a - t;
m = m_part - z;
rotation45 = coefficient2 - coefficient6;
oddLowSum = coefficient5 + coefficient3;
oddLowDifference = coefficient5 - coefficient3;
oddHighSum = coefficient1 + coefficient7;
oddHighDifference = coefficient1 - coefficient7;
u = coefficient6 + coefficient2;
rotation45 = rotation45 * 0xB5 >> 8;
oddSumDifference = oddHighSum - oddLowSum;
oddDifferenceSum = oddLowDifference + oddHighDifference;
dcValue = *workspaceCursor;
evenBaseDifference = dcValue - coefficient4;
oddSumRotation = oddSumDifference * 0xB5 >> 8;
evenBaseSum = dcValue + coefficient4;
u = rotation45 + u;
v = evenBaseDifference + rotation45;
z = oddDifferenceSum * 0x62 >> 8;
evenOutput0 = evenBaseSum + u;
evenOutput3 = evenBaseSum - u;
oddHighRotation = oddHighDifference * 0x14E >> 8;
evenOutput2 = evenBaseDifference - rotation45;
m = oddHighRotation - z;
oddLowSum += m;
n = oddHighSum + oddLowSum;
o = x + m;
p_part = oddLowDifference * 0x8B >> 8;
p = z + p_part;
q = p + x;
output[0] = (u8)clampS8((w + n) >> 11);
output[56] = (u8)clampS8((w - n) >> 11);
output[8] = (u8)clampS8((v + o) >> 11);
output[48] = (u8)clampS8((v - o) >> 11);
output[16] = (u8)clampS8((e + q) >> 11);
output[40] = (u8)clampS8((e - q) >> 11);
output[24] = (u8)clampS8((y + p) >> 11);
output[32] = (u8)clampS8((y - p) >> 11);
oddOutput1 = oddSumRotation + m;
oddLowRotation = oddLowDifference * 0x8B >> 8;
oddOutput3 = z + oddLowRotation;
oddOutput2 = oddOutput3 + oddSumRotation;
output[0] = (u8)clampS8((evenOutput0 + n) >> 11);
output[56] = (u8)clampS8((evenOutput0 - n) >> 11);
output[8] = (u8)clampS8((v + oddOutput1) >> 11);
output[48] = (u8)clampS8((v - oddOutput1) >> 11);
output[16] = (u8)clampS8((evenOutput2 + oddOutput2) >> 11);
output[40] = (u8)clampS8((evenOutput2 - oddOutput2) >> 11);
output[24] = (u8)clampS8((evenOutput3 + oddOutput3) >> 11);
output[32] = (u8)clampS8((evenOutput3 - oddOutput3) >> 11);
}
dst--;
workspaceCursor--;
}
}

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