Compare commits

..

24 Commits

Author SHA1 Message Date
Devin AI
3d9d17a475 pf_volume: attach_mount goto/two-var decode (176-diffs -> ~6, beq+mr+b edge, shared ClearMount)
Orig: result-bound check with error=result on the error edge (mr r0,r3),
shared ClearMount block for success+mounted paths, li r0,0 remat at join.
Residual: phi-coalescing tie (r3 vs r0).

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 12:31:13 +00:00
Devin AI
77ffcfa537 pf_path: decode 3-pair sig-global layout (sdata2 scalar pairs + export'd const-zero pads)
Orig .sdata2 holds three anonymous-padded byte pairs: declspec'd s8 scalars
at 0,1 (CheckExtShortName) and 4,5 (GetExtShortNameIndex) with 00 00 pads
at 2,3 and 6,7. const pf_u16=0 objects emit the pads but mwld dead-strips
unreferenced consts at link; __declspec(export) keeps them -> DOL sha1 green.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 12:15:20 +00:00
Devin AI
6b989cb795 sd_drv: init accumulator tail decode (branchless NOR-select -> branchy, 31d -> SIZE-2)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 11:33:33 +00:00
Devin AI
f72d58b058 pf_volume: attach_mount eq0-guard decode (SIZE-2 -> 176=176, 21 reg diffs)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:30:42 +00:00
Devin AI
eb2f4c2107 pf_volume: restore declspec sdata2 mark (static const folds to li, regresses p_rmvvol 4d)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:27 +00:00
Devin AI
7583182e68 sd_drv: finalize explicit-RMW expr (6->4d); pf_fat12: err decl last (46->23d)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:14 +00:00
Devin AI
425d6c8238 pf_dir: yoda-order sfds compares, u16-widened LFN*32 mask (p_rename 51->50, p_move 44->42)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:09 +00:00
Devin AI
e8ebf0d917 pf_dir: p_rename tail returns updateEntry result directly (52->51 diffs)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:09 +00:00
Devin AI
7f762c49f9 pf_dir: decode .sdata/.sdata2 global-object layout (named string globals + sdata2 markers, empty-string literal)
Orig used named file-scope non-static pf_s8 globals (not string literals):
backslash/slash at file top; volume-sep/wildcard/parent/current-name
declared after the path-check helpers so the '' literal emits between
them (dtk merges literal+pad into the 4B zero object at .sdata+8).
.sdata2: two __declspec 1B pf_u8 0xE5 marker objects feeding the
p_rename/p_move deleted_marker copies. Data now 100%; 35/38 fns.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:09 +00:00
Devin AI
6b2d4aa950 pf_dir: p_rename nested-if guards GetVolumeFromPath speculation (+2 SIZE gone)
The compound && let MWCC speculate the GetVolumeFromPath(new_path) call at
function entry where its result died unused. Nested if keeps it in position.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:09 +00:00
Devin AI
eadb3bf2d7 sd_drv: finalize flags as &= ~1 (6d->4d)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:09 +00:00
Devin AI
c8f35f1395 pf_volume: match PFVOL_regctx via decl reorder + inlined stat compare
context_index decl before free_context_index flips the r7/r8 web binding;
inlining stat&1 into both compares removes the temp web.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:09 +00:00
Devin AI
68f20340d8 pf_dir: arg-first volume compare in current_directory_is_open (operand order)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
6344d60e8c pf_fat: block-2 flush decl reorder (FreeChain 17->14 diffs)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
6b44d50777 pf_dir: decl-order web-priority fix for counter bindings (p_rename 65->52, p_move 71->44)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
ecf4718d92 pf_fat: FreeChain join-side phi materialization via entryError temp
Routing the WriteFATEntryWithBuf switch results through a scoped
s32 entryError then assigning to error after the switch reproduces
base's single join mr (producers stay in r3, one copy at the phi)
instead of per-producer mr copies — SIZE 254=254, diffs 30->17.
Remaining diffs are the register-permutation family (flush-loop
web coloring).

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
bf12ec00b4 pf_dir: decode .sdata2 deleted_marker objects + all structural diffs
- PFENT_findEntry extern decls corrected to 6-param signature (removes
  phantom li r9,0 at 4 call sites)
- current_directory_is_open: state from volumes[index].p_vol (lwzu)
- p_rename: check-then-goto tail duplicates the error check at join
- deleted_marker: dead [4] init-array emits 4B .sdata2 objects while
  marker[0] = init[0] produces the 1-byte lbz+stb stack copy (data
  .sdata/.sdata2 now byte-identical)

p_move/p_rename now exact insn counts (631/625); residuals are
register-permutation diffs only

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
38fb242b2c pfrest: pdm_partition is_master_boot_sector — second loop to index form (25->21 diffs)
Pointer-walk replaced by start[index]/count[index] access matches base's
pointer binding; residual is byte-load interleave scheduling (A,C,D,B vs
A,B,D,C leaf emission) — documented scheduling tie.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
f318abd6f5 fa: post-rebase data decode — pf_dir sdata pads, pf_fat flat rodata table, pf_volume label, puh_msc_blk sbss
- pf_dir: deleted_marker[4] emits .sdata2 tail; ".\0x6" literal fills .sdata tail (byte-identical)
- pf_fat: fat_special_values as flat u32[FAT_MAX*5+1] — byte-identical .rodata incl +4 tail; flat indexing also clears ~10 reg-diff fns
- pf_volume: default_volume_label[16] emits the 4B .data tail
- puh_msc_blk: uhg_msc_blk_msg_id (unreferenced global) emits .sbss+4 — reverse decl order matches base

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:21:03 +00:00
Devin AI
216b18a1ef pfrest: pf_path .sdata2 decode — non-const sig globals force lbz loads (CheckExtShortName byte-identical, .sdata2 8B match)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:20:52 +00:00
Devin AI
3611bc0764 pfrest: pf_path .sdata decode — file-scope pf_s8 sig byte globals + \x20\0\0 literal (48B byte-identical)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:20:52 +00:00
Devin AI
3013d33b86 pfrest: sd_drv .bss/.sbss globals decode (write_protected tail member, 7 unreferenced u32s before/after g_event)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:20:52 +00:00
Devin AI
f0b1b028df pfrest: sd_drv explicit-nul literal pads .data to 2576B
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:20:27 +00:00
Devin AI
6f39d3c485 pfrest: adopt fapark3 states for pdm_partition, pf_entry_iterator, pf_fat12, pf_file
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 10:19:55 +00:00
54 changed files with 759 additions and 21685 deletions

View File

@@ -2,8 +2,6 @@ name: README progress
# runs on the self-hosted runner on cole's server so it doesn't use hosted minutes.
# only push/schedule/manual triggers, never pull_request, so fork PRs can't reach this machine.
# README progress is written inside each landing commit by the orchestrator, so this job never commits;
# it only rebuilds and publishes the current numbers to the job summary.
on:
push:
branches: [main]
@@ -17,7 +15,7 @@ concurrency:
cancel-in-progress: true
permissions:
contents: read
contents: write
jobs:
progress:
@@ -50,8 +48,15 @@ jobs:
- name: Report
run: build/tools/objdiff-cli report generate -p . -o build/43U/report.json -f json
- name: Summary
- name: Update README
run: python3 tools/update_readme_progress.py build/43U/report.json README.md "$GITHUB_SHA"
- name: Commit
run: |
python3 tools/update_readme_progress.py build/43U/report.json README.md "$GITHUB_SHA"
sed -n '/progress:start/,/progress:end/p' README.md >> "$GITHUB_STEP_SUMMARY"
git checkout -- README.md
if git diff --quiet README.md; then exit 0; fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "docs: update progress [skip ci]"
git pull --rebase origin main || { git rebase --abort; echo "main moved, next run will update"; exit 0; }
git push origin HEAD:main

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.55% | 90.33% | 69.37% | 99.37% |
| 99.52% | 89.16% | 66.24% | 99.37% |
units 950/1027 complete, functions 12343/12563 matched.
units 940/1027 complete, functions 12301/12563 matched.
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
<!-- progress:end -->

View File

@@ -44,7 +44,7 @@ UpdateDiskID = .bss:0x810ADF60; // type:object size:0x20 align:32 data:4byte
TicketViewsBuf = .bss:0x810ADF80; // type:object size:0x3600 scope:local align:32
Flags0 = .bss:0x810B1580; // type:object size:0x800 scope:local
Flags1 = .bss:0x810B1D80; // type:object size:0x800 scope:local
Thread = .bss:0x810B2580; // type:object size:0x318 scope:local
Thread = .bss:0x810B2580; // type:object size:0x1318 scope:local
UpdateHeader0 = .bss:0x810B38A0; // type:object size:0x20 scope:local
UpdateHeader1 = .bss:0x810B38C0; // type:object size:0x20 scope:local
viewsBuf = .bss:0x810B38E0; // type:object size:0x3600 scope:local
@@ -4576,9 +4576,9 @@ enqueueNotice__Q33ipl5scene15SDChannelSelectFUlUlUl = .text:0x813DB254; // type:
enqueueLoadNotice__Q33ipl5scene15SDChannelSelectFv = .text:0x813DB308; // type:function size:0x5C
enqueuePageNotice__Q33ipl5scene15SDChannelSelectFv = .text:0x813DB364; // type:function size:0x5C
enqueueResultNotice__Q33ipl5scene15SDChannelSelectFUl = .text:0x813DB3C0; // type:function size:0x5C
enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUxUl = .text:0x813DB41C; // type:function size:0x5C
enqueueChannelNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl = .text:0x813DB41C; // type:function size:0x5C
enqueueMoveNotice__Q33ipl5scene15SDChannelSelectFUlUlUl = .text:0x813DB478; // type:function size:0x5C
enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUxUl = .text:0x813DB4D4; // type:function size:0x5C
enqueueStateNotice__Q33ipl5scene15SDChannelSelectFUlUlUlUl = .text:0x813DB4D4; // type:function size:0x5C
enqueueErrorNotice__Q33ipl5scene15SDChannelSelectFUlUl = .text:0x813DB530; // type:function size:0x5C
enqueueCommandNotice__Q33ipl5scene15SDChannelSelectFUlUlUl = .text:0x813DB58C; // type:function size:0x60
enqueueDeleteNotice__Q33ipl5scene15SDChannelSelectFUlUlUl = .text:0x813DB5EC; // type:function size:0x60
@@ -4814,7 +4814,7 @@ reset_gui__Q33ipl5scene8SDButtonFv = .text:0x813E9BC0; // type:function size:0x1
startPointEvent__Q33ipl5scene8SDButtonFPCcPQ33ipl10controller9Interface = .text:0x813E9D08; // type:function size:0x258
startLeftEvent__Q33ipl5scene8SDButtonFPCc = .text:0x813E9F60; // type:function size:0x220
isActive__Q33ipl5scene8SDButtonCFv = .text:0x813EA180; // type:function size:0xC
setEventHandler__Q33ipl5scene8SDButtonFPQ23gui12EventHandler = .text:0x813EA18C; // type:function size:0x14
setEventHandler__Q33ipl5scene8SDButtonFPQ23gui12EventHandlerPQ23gui12EventHandler = .text:0x813EA18C; // type:function size:0x14
setText__Q33ipl5scene8SDButtonFPCcPCw = .text:0x813EA1A0; // type:function size:0xB4
animation__Q33ipl5scene8SDButtonFi = .text:0x813EA254; // type:function size:0x1C4
initArrowAppearance__Q33ipl5scene8SDButtonFib = .text:0x813EA418; // type:function size:0xD0
@@ -21493,7 +21493,7 @@ lbl_81695998 = .sdata2:0x81695998; // type:object size:0x1 data:byte
lbl_81695999 = .sdata2:0x81695999; // type:object size:0x1 data:byte
lbl_8169599C = .sdata2:0x8169599C; // type:object size:0x1 data:byte
lbl_8169599D = .sdata2:0x8169599D; // type:object size:0x1 data:byte
lbl_816959A0 = .sdata2:0x816959A0; // type:object size:0x1 data:byte
lbl_816959A0 = .sdata2:0x816959A0; // type:object size:0x8 data:byte
@3654 = .sdata2:0x816959A8; // type:object size:0x4 scope:local align:4 data:float
@3714 = .sdata2:0x816959AC; // type:object size:0x4 scope:local align:4 data:float
lbl_816959B0 = .sdata2:0x816959B0; // type:object size:0x8 align:8 data:double

View File

@@ -742,7 +742,7 @@ config.libs = [
Object(Matching, "scene/board/iplBoardObject.cpp"),
Object(Matching, "scene/board/iplBoardSD.cpp"),
Object(Matching, "scene/board/iplUrlProcessor.cpp"),
Object(Matching, "scene/board/iplFocusObject.cpp"),
Object(Equivalent, "scene/board/iplFocusObject.cpp"),
]
),
IPLSection("button", [
@@ -850,7 +850,7 @@ config.libs = [
),
IPLSection("sdChannelSelect", [
Object(NonMatching, "scene/sdChannelSelect/iplSDChannelSelect.cpp"),
Object(Matching, "scene/sdChannelSelect/iplSDChannelObj.cpp"),
Object(NonMatching, "scene/sdChannelSelect/iplSDChannelObj.cpp"),
]
),
IPLSection("sdChannelTitle", [
@@ -989,7 +989,7 @@ config.libs = [
Object(NonMatching, "clib/zi8cgetc.c"),
Object(Matching, "clib/zi8cinfo.c"),
Object(Matching, "clib/zi8copy.c"),
Object(Matching, "clib/zi8dawg.c"),
Object(NonMatching, "clib/zi8dawg.c"),
Object(Matching, "clib/zi8getc.c"),
Object(NonMatching, "clib/zi8getc2.c"),
Object(Matching, "clib/zi8getSW.c"),
@@ -1062,7 +1062,7 @@ config.libs = [
Object(Matching, "nhttp/NHTTP_response.c"),
Object(Matching, "nhttp/NHTTP_socket_RVL.c"),
Object(NonMatching, "nhttp/NHTTP_stdlib_RVL.c"),
Object(Matching, "nhttp/NHTTP_thread.c"),
Object(NonMatching, "nhttp/NHTTP_thread.c"),
Object(Matching, "nhttp/d_nhttp_private.c"),
Object(Matching, "nhttp/d_nhttp.c"),
Object(Matching, "nhttp/d_nhttp_common.c"),
@@ -1080,7 +1080,7 @@ config.libs = [
Object(Matching, "nwc24/NWC24Stream.c"),
Object(Matching, "nwc24/NWC24Parser.c"),
Object(NonMatching, "nwc24/NWC24MsgCommit.c"),
Object(Matching, "nwc24/NWC24MsgRead.c"),
Object(NonMatching, "nwc24/NWC24MsgRead.c"),
Object(NonMatching, "nwc24/NWC24MsgSubject.c"),
Object(Matching, "nwc24/NWC24Schedule.c"),
Object(NonMatching, "nwc24/NWC24DateParser.c"),
@@ -1212,7 +1212,7 @@ config.libs = [
Object(NonMatching, "exif/exif_parse.c"),
Object(Matching, "reschange/iqdec_resolution_change_a3.c"),
Object(Matching, "reschange/idct_resolution_change_var.c"),
Object(NonMatching, "reschange/idct_resolution_change_var.c"),
Object(NonMatching, "texturecvtr/Texture_MCUtoY8U8V8.c"),
Object(NonMatching, "texturecvtr/Texture_MCUtoRGB565.c"),
@@ -1692,8 +1692,8 @@ config.libs = [
Object(Matching, "fa/pdm_disk.c"),
Object(NonMatching, "fa/pdm_partition.c"),
Object(NonMatching, "fa/pf_cache.c"),
Object(Matching, "fa/pf_cluster.c"),
Object(Matching, "fa/pf_dir.c"),
Object(NonMatching, "fa/pf_cluster.c"),
Object(NonMatching, "fa/pf_dir.c"),
Object(Matching, "fa/pf_entry.c"),
Object(NonMatching, "fa/pf_entry_iterator.c"),
Object(NonMatching, "fa/pf_fat.c"),
@@ -1704,7 +1704,7 @@ config.libs = [
Object(Matching, "fa/pf_file.c"),
Object(Matching, "fa/pf_path.c"),
Object(Matching, "fa/pf_sector.c"),
Object(Matching, "fa/pf_volume.c"),
Object(NonMatching, "fa/pf_volume.c"),
Object(Matching, "fa/pf_volume_apiadd.c"),
Object(Matching, "fa/pf_cp932.c"),
Object(Matching, "fa/pf_api_util.c"),
@@ -1860,7 +1860,7 @@ config.libs = [
Object(Matching, "fa/msc/puh_msc.c"),
Object(Matching, "fa/msc/puh_msc_cmd.c"),
Object(Matching, "fa/msc/puh_msc_blk.c"),
Object(NonMatching, "fa/msc/puh_msc_blk.c"),
]
),
RVLSDKLib("sdi", [

View File

@@ -143,11 +143,7 @@ namespace ipl {
#else
VEC3 operator-(const VEC3& rhs) const { return VEC3(x - rhs.x, y - rhs.y, z - rhs.z); }
#endif
#ifdef IPL_FOCUS_OBJECT_CPP
VEC3 operator*(f32 val) const;
#else
VEC3 operator*(f32 val) const { return VEC3(x * val, y * val, z * val); }
#endif
VEC3 operator*(f64 val) const {
nw4r::math::VEC3 vecOut;
VEC3Scale(&vecOut, this, (f32)val);

View File

@@ -53,7 +53,24 @@ namespace ipl {
mBScroller.init();
}
BOOL calc(bool canScroll);
BOOL calc(bool canScroll) __attribute__((never_inline)) /*for now*/ {
BOOL result = FALSE;
if (canScroll) {
if (mBScroller.calc()) {
result = TRUE;
}
}
mScroller.calc();
f32 movable = mScroller.movable_pos(mBScroller.getSpeed());
mScroller.addScroll(movable);
mBScroller.addSoundFreq(movable);
return result;
}
BOOL is_busy() const {
BOOL result = TRUE;

View File

@@ -102,7 +102,12 @@ namespace ipl {
static const char* getButtonName(int button) { return smButtonName[button]; }
#endif
void setEventHandler(::gui::EventHandler * event);
#ifdef IPL_SD_CHANNEL_SELECT_CPP
void setEventHandler(::gui::EventHandler * event,
::gui::EventHandler * optOutEvent = NULL);
#else
void setEventHandler(::gui::EventHandler * event, ::gui::EventHandler * optOutEvent);
#endif
void setText(const char* paneName, u32 msgId);
void setText(const char* paneName, const wchar_t* text);

View File

@@ -203,9 +203,9 @@ namespace ipl {
bool enqueueLoadNotice();
bool enqueuePageNotice();
bool enqueueResultNotice(u32 result);
bool enqueueChannelNotice(u64 titleId, u32 value);
bool enqueueChannelNotice(u32 controller, u32 page, u32 index, u32 value);
bool enqueueMoveNotice(u32 controller, u32 page, u32 index);
bool enqueueStateNotice(u64 titleId, u32 state);
bool enqueueStateNotice(u32 controller, u32 page, u32 index, u32 state);
bool enqueueErrorNotice(u32 page, u32 index);
bool enqueueCommandNotice(u32 page, u32 index, u32 command);
bool enqueueDeleteNotice(u32 controller, u32 page, u32 index);

View File

@@ -368,20 +368,20 @@ namespace nw4r {
u32 sheetOffsetsScratchSize;
sheetGlyphCount = font->glgr.inner.sheetGlyphCount; // 0x1C
dataBlockCount = font->hdr.dataBlocks; // 0x0E
sheetGlyphCount = font->glgr.inner.sheetGlyphCount; // 0x1C
// countName = font->glgr.inner.nameCount;
countSheet = font->glgr.inner.sheetCount;
// count0A = font->glgr.inner.smthCount_0x0a;
// count0C = font->glgr.inner.smthCount_0x0c;
sheetOffsetsSize = ROUNDUP(countSheet * sizeof(u16), 4);
sheetOffsetsScratch = (u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
stepSheetFlags = detail::CalcSizeFlagSet(countSheet);
flagsSheetsOff = detail::CalcOffsetSheetFlags(font->glgr.inner.nameCount, countSheet, font->glgr.inner.smthCount_0x0a,
font->glgr.inner.smthCount_0x0c);
flagsSheets = (const u32*)font + (flagsSheetsOff >> 2);
sheetOffsetsSize = ROUNDUP(countSheet * sizeof(u16), 4);
sheetOffsetsScratch = (u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
pGlgr = &font->glgr;
ENSURE_WORK_HAS_SIZE(ctx, glgrEnd - (u8*)font + sheetOffsetsSize);
// if (ctx->pWorkEnd - workCurr < fontSizeToEndOfGlgr + sheetOffsetsSize) {

View File

@@ -15,13 +15,9 @@ static s8 clampS8(s32 v) {
void TMCJPEGDEC_IdctBlock4x4(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigzag) {
s32 bd;
s32 d;
s32 c;
s32 a;
s32 cd;
s32 oddrot;
s32 evsum;
s32 rot;
s32 d;
s32 b;
s32* sp;
@@ -30,41 +26,57 @@ void TMCJPEGDEC_IdctBlock4x4(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigzag
s32 tmp[64];
s32 i;
s32 evsum, rot, oddrot, cd;
sp = block + 24;
dp = tmp + 24;
for (i = 0; i < 4; i++) {
s32 a, b, c, d;
s32 odddiff, bd, evsum, cd, rot, oddrot;
a = sp[0];
b = sp[1];
c = sp[2];
d = sp[3];
odddiff = b - d;
for (i = 0; i < 2; i++) {
a = sp[0]; // 0x0
b = sp[1]; // 0x4
c = sp[2]; // 0x8
d = sp[3]; // 0xc
bd = b + d;
evsum = a + c;
cd = a - c;
rot = (odddiff * 0xB5) >> 8;
oddrot = rot + bd;
dp[0] = evsum + oddrot;
dp[1] = cd + rot;
dp[2] = cd - rot;
oddrot = (0xB5 * (sp[1] - sp[3]) >> 8) + bd;
rot = (0xB5 * (sp[1] - sp[3])) >> 8;
dp[1] = (a - c) + rot;
dp[2] = (a - c) - rot;
dp[3] = evsum - oddrot;
sp -= 8;
dp -= 8;
dp[0] = evsum + oddrot;
b = sp[-7]; // -0x1c
d = sp[-5]; // -0x14
bd = b + d;
rot = ((b - d) * 0xB5) >> 8;
oddrot = rot + bd;
a = sp[-8]; // -0x20
c = sp[-6]; // -0x18
dp[-8] = (a + c) + oddrot;
dp[-7] = (a - c) + rot;
dp[-6] = (a - c) - rot;
dp[-5] = (a + c) - oddrot;
sp -= 16;
dp -= 16;
}
{
u32 idx = 3;
sp = tmp + 3;
for (i = 0; i < 4; i++) {
u8* bp = conv_row_ptr + idx;
a = tmp[idx] + 0x40000;
b = tmp[idx + 8];
d = tmp[idx + 24];
c = tmp[idx + 16];
a = sp[0] + 0x40000;
b = sp[8];
d = sp[24];
c = sp[16];
evsum = a + c;
cd = a - c;
@@ -78,6 +90,7 @@ void TMCJPEGDEC_IdctBlock4x4(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigzag
bp[pitch * 2] = clampU8((cd - rot) >> 11);
bp[pitch * 4 - pitch] = clampU8((evsum - oddrot) >> 11);
sp--;
idx -= 1;
}
}
@@ -118,37 +131,38 @@ void TMCJPEGDEC_IdctBlock4x4_Col(s32* sp, u8* conv_row_ptr, u16 pitch, s32 zigza
s32 a, b, c, d;
s32 evsum, evdiff, oddsum, odddiff, rot, oddrot;
for (i = 0; i < 4; i++) {
a = src[0];
b = src[1];
c = src[2];
d = src[3];
odddiff = b - d;
oddsum = b + d;
evsum = a + c;
evdiff = a - c;
rot = (odddiff * 0xB5) >> 8;
oddrot = rot + oddsum;
dst[0] = evsum + oddrot;
dst[1] = evdiff + rot;
dst[2] = evdiff - rot;
dst[3] = evsum - oddrot;
src -= 8;
dst -= 8;
for (i = 0; i < 2; i++) {
s32 a0 = src[0], b0 = src[1], c0 = src[2], d0 = src[3];
s32 a1 = src[-8], b1 = src[-7], c1 = src[-6], d1 = src[-5];
s32 odddiff0 = b0 - d0;
s32 oddsum0 = b0 + d0;
s32 evsum0 = a0 + c0;
s32 evdiff0 = a0 - c0;
s32 rot0 = (odddiff0 * 0xB5) >> 8;
s32 odddiff1 = b1 - d1;
s32 oddsum1 = b1 + d1;
s32 evsum1 = a1 + c1;
s32 evdiff1 = a1 - c1;
s32 rot1 = (odddiff1 * 0xB5) >> 8;
dst[0] = evsum0 + (oddsum0 + rot0);
dst[1] = evdiff0 + rot0;
dst[2] = evdiff0 - rot0;
dst[3] = evsum0 - (oddsum0 + rot0);
dst[-8] = evsum1 + (oddsum1 + rot1);
dst[-7] = evdiff1 + rot1;
dst[-6] = evdiff1 - rot1;
dst[-5] = evsum1 - (oddsum1 + rot1);
src -= 16;
dst -= 16;
}
src = tmp + 3;
for (i = 3; i >= 0; i--) {
s32 evdiff;
s32 a;
s32 c;
s32 b;
s32 evsum;
s32 d;
s32 oddsum;
s32 odddiff;
s32 rot;
s32 oddrot;
u8* out = conv_row_ptr + i;
a = src[0];
b = src[8];
@@ -156,7 +170,7 @@ void TMCJPEGDEC_IdctBlock4x4_Col(s32* sp, u8* conv_row_ptr, u16 pitch, s32 zigza
d = src[24];
odddiff = b - d;
oddsum = d + b;
oddsum = b + d;
evsum = a + c;
evdiff = a - c;
rot = odddiff * 0xB5 >> 8;

View File

@@ -166,23 +166,23 @@ s32 TMCJPEGDEC_set_converterRGBA8(TMCCJPEGDecWork* work) {
}
static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 red;
s8 crValue;
u8* luminance;
u8* cb;
u8* cr;
TMCCJPEGDecState* state;
u8* texture;
s32 height;
s32 column;
s32 yEnd;
s32 xEnd;
s32 green;
s32 yEnd;
s32 column;
s32 tileWidth;
s32 blueOffset;
u16* output;
s32 tileRow;
s32 lumaSkip;
s8 crValue;
s32 red;
s32 chromaSkip;
s32 width;
s32 cbValue;
@@ -216,7 +216,7 @@ static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
cbValue = (s8)*cb++;
crValue = (s8)*cr++;
redOffset = (crValue * 359) >> 8;
greenOffset = -(crValue * 183 + cbValue * 88) >> 8;
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
blueOffset = (cbValue * 454) >> 8;
}
{
@@ -285,20 +285,20 @@ static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
}
static void TMCJPEGDEC_converterYUV411toRGBA8edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 chromaSkip;
s32 tileRow;
s32 xEnd;
u8* texture;
TMCCJPEGDecState* state;
s32 column;
u8* luminance;
u8* cb;
u8* cr;
TMCCJPEGDecState* state;
s32 tileWidth;
u8* texture;
s32 width;
s32 height;
u8* cr;
s32 column;
s32 lumaSkip;
s32 xEnd;
s32 yEnd;
s32 tileWidth;
s32 lumaSkip;
s32 chromaSkip;
s32 tileRow;
u16* output;
s32 cbValue;
s8 crValue;
@@ -366,11 +366,11 @@ static void TMCJPEGDEC_converterYUV411toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 chromaSkip;
s32 lumaSkip;
s32 blue;
s32 cbValue;
s32 tileWidth;
TMCCJPEGDecState* state;
u16* output;
s32 xEnd;
u8* texture;
s32 width;
s32 height;
@@ -379,7 +379,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
s32 red;
u8* cr;
s32 column;
s32 xEnd;
u16* output;
s32 yEnd;
s32 redOffset;
s32 tileRow;
@@ -387,7 +387,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
s32 blueOffset;
s32 value;
s32 green;
s32 blue;
s32 lumaSkip;
s32 crValue;
luminance = work->convBuf + 4;
@@ -415,7 +415,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((blue | green | red) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -426,7 +426,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((blue | green | red) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -441,21 +441,21 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
}
static void TMCJPEGDEC_converterYUV422toRGBA8edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 blue;
u16* output;
s32 xEnd;
s32 column;
u8* luminance;
u8* cb;
u8* cr;
TMCCJPEGDecState* state;
s32 tileWidth;
u8* luminance;
u8* texture;
s32 width;
s32 height;
u8* cb;
u8* texture;
s32 column;
s32 chromaSkip;
s32 xEnd;
s32 yEnd;
s32 lumaSkip;
s32 chromaSkip;
s32 tileRow;
u16* output;
s32 cbValue;
s32 crValue;
s32 redOffset;
@@ -463,7 +463,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
s32 blueOffset;
s32 value;
s32 red;
s32 lumaSkip;
s32 blue;
s32 green;
luminance = work->convBuf + 4;
@@ -502,7 +502,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
red = value + redOffset;
blue = value + blueOffset;
green = value + greenOffset;
if ((blue | green | red) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -517,19 +517,19 @@ static void TMCJPEGDEC_converterYUV422toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
}
static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 tileRow;
s32 blue;
s8 crValue;
s32 chromaSkip;
u8* luminance;
TMCCJPEGDecState* state;
u8* texture;
s32 xEnd;
s32 width;
s32 height;
s32 green;
s32 blue;
s32 blueOffset;
u8* texture;
s32 lumaSkip;
s32 yEnd;
s32 xEnd;
s32 tileRow;
s32 value;
s32 column;
u8* cr;
@@ -538,7 +538,7 @@ static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
s32 redOffset;
u8* cb;
u16* output;
s32 blueOffset;
s32 green;
s32 red;
s32 cbValue;
@@ -620,11 +620,11 @@ static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
static void TMCJPEGDEC_converterYUV420toRGBA8edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* luminance = work->convBuf + 4;
u8* cb = work->convBuf + 260;
s32 width;
u8* cr = work->convBuf + 324;
TMCCJPEGDecState* state = work->pState;
s32 tileWidth = (state->convWidth >> 2) << 1;
u8* texture = state->pTexBuffer;
u8* cr = work->convBuf + 324;
s32 width;
s32 height;
if (state->dataSizeX == (u32)x) {
width = state->stepXExt;
@@ -686,7 +686,7 @@ static void TMCJPEGDEC_converterYUV420toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
static void TMCJPEGDEC_converterYUV211toRGBA8(TMCCJPEGDecWork* work, s32 x, s32 y) {
u16* output;
s32 tileRow;
s32 column;
s32 redOffset;
TMCCJPEGDecState* state;
s32 lumaSkip;
@@ -695,7 +695,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
u8* cb;
u8* cr;
s32 height;
s32 column;
s32 tileRow;
s32 chromaSkip;
s32 width;
s32 xEnd;
@@ -742,7 +742,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((blue | green | red) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -770,7 +770,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
u16* output;
s32 lumaSkip;
s32 blue;
u8* texture;
s32 tileRow;
u8* luminance;
u8* cb;
u8* cr;
@@ -783,7 +783,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
s32 greenOffset;
s32 yEnd;
s32 cbValue;
s32 tileRow;
u8* texture;
s32 blueOffset;
s32 red;
s8 crValue;
@@ -831,7 +831,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((blue | green | red) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -856,9 +856,9 @@ static void TMCJPEGDEC_converterYUV211toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
static void TMCJPEGDEC_converterYUV444toRGBA8(TMCCJPEGDecWork* work, s32 x, s32 y) {
u16* output;
s32 tileWidth;
s32 tileRow;
s32 rowSkip;
u8* texture;
s32 xEnd;
u8* luminance;
u8* cb;
u8* cr;
@@ -867,9 +867,9 @@ static void TMCJPEGDEC_converterYUV444toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
s32 height;
s32 width;
s32 column;
s32 xEnd;
s32 rowSkip;
s32 yEnd;
s32 tileWidth;
u8* texture;
s32 row;
s32 red;
s32 cbValue;
@@ -896,10 +896,10 @@ static void TMCJPEGDEC_converterYUV444toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
cbValue = (s8)*cb++;
crValue = (s8)*cr++;
value = *luminance++;
green = value + (-(crValue * 183 + cbValue * 88) >> 8);
green = value + (-(cbValue * 88 + crValue * 183) >> 8);
red = value + ((crValue * 359) >> 8);
blue = value + ((cbValue * 454) >> 8);
if ((blue | green | red) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;

View File

@@ -171,7 +171,9 @@ s32 TMCJPEGDEC_set_converterY8U8V8(TMCCJPEGDecWork* work) {
static void TMCJPEG_814EFEAC(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 rowSkip;
u8* output;
s32 chromaXEnd;
u32 tileRow;
u32 chromaTileWidth;
s32 chromaYEnd;
u8* lumaTexture;
TMCCJPEGDecState* state;
@@ -214,17 +216,17 @@ static void TMCJPEG_814EFEAC(TMCCJPEGDecWork* work, s32 x, s32 y) {
}
luminance += rowSkip;
}
tileWidth = state->chromaWidth >> 3;
chromaTileWidth = state->chromaWidth >> 3;
x = (u32)x >> 2;
width = 8 / state->scaleFactor;
height = 8 / state->scaleFactor;
xEnd = x + width;
chromaXEnd = x + width;
chromaYEnd = y + height;
for (; y < chromaYEnd; y++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cb + 128;
for (column = x; column < chromaXEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;
@@ -233,6 +235,7 @@ static void TMCJPEG_814EFEAC(TMCCJPEGDecWork* work, s32 x, s32 y) {
}
static void TMCJPEG_814F043C(TMCCJPEGDecWork* work, s32 x, s32 y) {
u32 chromaTileWidth;
TMCCJPEGDecState* state;
u8* lumaTexture;
u8* luminance;
@@ -247,9 +250,9 @@ static void TMCJPEG_814F043C(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* output;
u8* cb;
u8* cr;
s32 width;
s32 tileOffset;
s32 xEnd;
s32 tileOffset;
s32 width;
u32 tileWidth;
luminance = work->convBuf + 4;
@@ -284,13 +287,13 @@ static void TMCJPEG_814F043C(TMCCJPEGDecWork* work, s32 x, s32 y) {
x = (u32)x >> 2;
width = (width + 3) >> 2;
xEnd = x + width;
tileWidth = state->chromaWidth >> 3;
chromaTileWidth = state->chromaWidth >> 3;
chromaEnd = y + height;
for (; y < chromaEnd; y++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cb + 128;
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;
@@ -358,6 +361,7 @@ static void TMCJPEG_814F0A58(TMCCJPEGDecWork* work, s32 x, s32 y) {
}
static void TMCJPEG_814F11C4(TMCCJPEGDecWork* work, s32 x, s32 y) {
u32 chromaTileWidth;
TMCCJPEGDecState* state;
u8* lumaTexture;
u8* luminance;
@@ -372,9 +376,9 @@ static void TMCJPEG_814F11C4(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* output;
u8* cb;
u8* cr;
s32 width;
s32 tileOffset;
s32 xEnd;
s32 tileOffset;
s32 width;
u32 tileWidth;
luminance = work->convBuf + 4;
@@ -409,13 +413,13 @@ static void TMCJPEG_814F11C4(TMCCJPEGDecWork* work, s32 x, s32 y) {
x = (u32)x >> 1;
width = (width + 1) >> 1;
xEnd = x + width;
tileWidth = state->chromaWidth >> 3;
chromaTileWidth = state->chromaWidth >> 3;
chromaEnd = y + height;
for (; y < chromaEnd; y++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cb + 128;
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;
@@ -424,21 +428,23 @@ static void TMCJPEG_814F11C4(TMCCJPEGDecWork* work, s32 x, s32 y) {
}
static void TMCJPEG_814F17E0(TMCCJPEGDecWork* work, s32 x, s32 y) {
s32 chromaYEnd;
u8* lumaTexture;
s32 height;
u8* luminance;
s32 chromaYEnd;
s32 column;
u8* lumaTexture;
s32 chromaXEnd;
u8* luminance;
u32 chromaTileWidth;
u8* cbTexture;
s32 row;
s32 width;
u8* crTexture;
s32 xEnd;
u32 tileWidth;
u8* cb;
TMCCJPEGDecState* state;
s32 yEnd;
s32 width;
s32 xEnd;
u8* cr;
u32 tileWidth;
s32 row;
row = y;
luminance = work->convBuf + 4;
@@ -464,14 +470,14 @@ static void TMCJPEG_814F17E0(TMCCJPEGDecWork* work, s32 x, s32 y) {
y = (u32)y >> 1;
width = 8 / state->scaleFactor;
height = 8 / state->scaleFactor;
xEnd = x + width;
chromaXEnd = x + width;
chromaYEnd = y + height;
tileWidth = state->chromaWidth >> 3;
chromaTileWidth = state->chromaWidth >> 3;
for (; y < chromaYEnd; y++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cb + 128;
for (column = x; column < chromaXEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;
@@ -480,6 +486,7 @@ static void TMCJPEG_814F17E0(TMCCJPEGDecWork* work, s32 x, s32 y) {
}
static void TMCJPEG_814F1F48(TMCCJPEGDecWork* work, s32 x, s32 y) {
u32 chromaTileWidth;
TMCCJPEGDecState* state;
u8* lumaTexture;
u8* luminance;
@@ -490,13 +497,13 @@ static void TMCJPEG_814F1F48(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* crTexture;
u32 tileRow;
s32 height;
s32 width;
s32 yEnd;
u8* output;
u8* cb;
u8* cr;
s32 xEnd;
s32 tileOffset;
s32 yEnd;
s32 width;
u32 tileWidth;
luminance = work->convBuf + 4;
@@ -532,13 +539,13 @@ static void TMCJPEG_814F1F48(TMCCJPEGDecWork* work, s32 x, s32 y) {
x = (u32)x >> 1;
width = (width + 1) >> 1;
xEnd = x + width;
tileWidth = state->chromaWidth >> 3;
chromaTileWidth = state->chromaWidth >> 3;
chromaEnd = y + ((height + 1) >> 1);
for (; y < chromaEnd; y++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cb + 128;
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;
@@ -547,8 +554,9 @@ static void TMCJPEG_814F1F48(TMCCJPEGDecWork* work, s32 x, s32 y) {
}
static void TMCJPEG_814F2570(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* lumaTexture;
u32 chromaTileWidth;
TMCCJPEGDecState* state;
u8* lumaTexture;
u8* luminance;
s32 column;
s32 row;
@@ -588,13 +596,13 @@ static void TMCJPEG_814F2570(TMCCJPEGDecWork* work, s32 x, s32 y) {
luminance += 8 - width;
}
y = (u32)y >> 1;
tileWidth = state->chromaWidth >> 3;
chromaTileWidth = state->chromaWidth >> 3;
chromaEnd = y + 8 / state->scaleFactor;
for (; y < chromaEnd; y++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cb + 128;
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;

View File

@@ -796,11 +796,11 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
if (remaining != 0) {
remaining--;
} else {
totalCandidates = totalCandidates + 1;
totalCandidates++;
if (options->countOnly == '\0') {
*output++ = spellingBuffer[spellingIndex];
*output++ = 0;
candidateCount = candidateCount + 1;
candidateCount++;
}
else if ((int)totalCandidates >= options->maxCount) goto finishSpelling;
if (candidateCount >= params->maxCandidates) goto finishSpelling;
@@ -1001,10 +1001,10 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
}
if (Zi8IsDupWordW(output,(ziU8)phoneticIndex,work) == 0) {
if (remaining == 0) {
totalCandidates = totalCandidates + 1;
totalCandidates++;
if (options->countOnly == 0) {
output += phoneticIndex + 1;
candidateCount = candidateCount + 1;
candidateCount++;
} else if ((int)totalCandidates >= options->maxCount) goto finishSpelling;
if (candidateCount >= params->maxCandidates) goto finishSpelling;
} else {

View File

@@ -187,7 +187,8 @@ unsigned int Zi8MatchROMdata1(ziWChar *elements, ziU8 count, ziU8 language, ziWC
ZI_WORK->unk_0x1764 = (ziU8*)group;
if (ZI_WORK->unk_0x1764 == 0) {
if (Zi8GetTableSize(language & 0xff,0xb,ZI_WORK) != 0) {
ZI_WORK->unk_0x1764 = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK));
tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK);
ZI_WORK->unk_0x1764 = (ziU8*)tableAddress;
}
}
if (ZI_WORK->unk_0x1764 != 0) {

View File

@@ -140,7 +140,8 @@ matched:
}
if (language == 1) {
byteOutput = (ziU8*)output;
for (index = copied = 0; index < (ziS32)wordSize && copied < capacity; copied++) {
index = 0;
for (copied = 0; index < (ziS32)wordSize && copied < capacity; copied++) {
byteOutput[index] = word[index];
index++;
byteOutput[index] = word[index];

View File

@@ -15,11 +15,11 @@ void Zi8Memset(ziPtr, ziU32, ziU32);
ziBool Zi8_81480224(ziUserWord* word ZI_NEED_WORK) {
ziU8 length;
ziU8 position;
ziUwdNode* previous;
ziUwdNode* current;
ziUwdNode* added;
ziUserWord* candidate;
ziU8 position;
if (ZI_WORK->uwdCount >= 32) {
Zi8LogError(0x19D, __zi8_work_data);
return 0;
@@ -56,7 +56,8 @@ ziBool Zi8_81480224(ziUserWord* word ZI_NEED_WORK) {
previous = current;
current = current->next;
}
added = &ZI_WORK->uwdNodes[ZI_WORK->uwdCount++];
length = ZI_WORK->uwdCount++;
added = &ZI_WORK->uwdNodes[length];
if (previous == 0) {
ZI_WORK->uwdList = added;
added->next = current;
@@ -88,18 +89,17 @@ void Zi8_8148047C(ziPtr __zi8_work_data) {
ziU8 Zi8MatchUWDdata(ziWChar* pattern, ziU8 length, ziWChar* currentWord, ziU16 currentLength, ziU8 language, ziWChar* output, ziU16 capacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {
ziUserDictionary* dictionary;
ziU8* cursor;
ziU8* begin;
int fallback = 0;
ziU8* boundary;
ziU8* end;
ziUserWord* previous;
int firstSegment;
ziU32 size;
int headerSize;
int entryLength;
int entryLanguage;
volatile int entryLength;
int previousOffset;
int visited = 0;
int fallback = 0;
ziU8* begin;
ziWChar folded;
ziU8* text;
int position;
@@ -144,7 +144,7 @@ ziU8 Zi8MatchUWDdata(ziWChar* pattern, ziU8 length, ziWChar* currentWord, ziU16
ZI_WORK->unk_0x141[1] = language;
ZI_WORK->unk_0x141[2] = prefixLength;
previousOffset = 4;
while (prefixLength > 0) {
for (; prefixLength > 0; prefixLength--, position++) {
folded = currentWord[position];
ZI_WORK->unk_0x141[previousOffset] = Zi8ConvertWC2UC(folded, language, __zi8_work_data);
ZI_WORK->unk_0x184[previousOffset] = 0;
@@ -156,14 +156,12 @@ ziU8 Zi8MatchUWDdata(ziWChar* pattern, ziU8 length, ziWChar* currentWord, ziU16
ZI_WORK->unk_0x140 = 0;
break;
}
prefixLength--;
position++;
}
}
}
if (ZI_WORK->unk_0x140 == 0 && length == 0) return 0;
rescan:
cursor = begin = dictionary->entries + dictionary->current;
begin = cursor = dictionary->entries + dictionary->current;
boundary = (ziU8*)dictionary + dictionary->boundary + 7;
end = (ziU8*)dictionary + dictionary->end + 7;
if (begin < boundary) firstSegment = 1;
@@ -172,7 +170,8 @@ rescan:
size = *cursor;
if ((ziS32)ZI_WORK->unk_0x13C > visited++ || (((ziUserWord*)cursor)->size & 0xC0) != 0) {
next:
if ((cursor += size) > end) {
cursor += size;
if (cursor > end) {
if (firstSegment) break;
firstSegment = 1;
size = cursor - end - 1;
@@ -180,9 +179,8 @@ next:
}
} else {
previous = (ziUserWord*)(cursor + size);
if ((ziU8*)previous > end) previous = (ziUserWord*)(dictionary->entries + (cursor - end - 1));
text = cursor;
headerSize = *text++;
if ((ziU8*)previous > end) previous = (ziUserWord*)(cursor + ((ziU8*)dictionary - end) + 7);
text = &((ziUserWord*)cursor)->language;
entryLanguage = *text++;
entryLength = *text++;
text++;

View File

@@ -22,10 +22,10 @@ ziU32 ZiDAWGGetChild(ziU32 node) {
node += offset;
if (((ziU32)header & 2) != 0) {
if ((*(ziU8*)node & 0x80) != 0) {
offset = ((*(ziU8*)node & 0x7f) << 16) +
((((ziU32)*((ziU8*)node + 1) & 0xffff) << 8) + *((ziU8*)node + 2)) + 0x8000;
offset = (*(ziU8*)node & 0x7f) * 0x10000 + ((ziU32)*((ziU8*)node + 1) & 0xffff) * 0x100 + *((ziU8*)node + 2) + 0x8000;
} else {
offset = (((ziU32)*(ziU8*)node & 0xffff) << 8) + (ziU32)*((ziU8*)node + 1);
offset = ((ziU32)*(ziU8*)node & 0xffff) * 0x100;
offset += (ziU32)*((ziU8*)node + 1);
}
} else if (((ziU32)header & 8) != 0) {
if ((*(ziU8*)node & 0x80) != 0) {
@@ -70,8 +70,8 @@ ziU8* ZiDAWGGetSibling(ziU8* cursor) {
}
if ((*cursor & 0x80) != 0) {
node += (*cursor & 0x7f) * 0x10000 +
(((ziU32)cursor[1] << 8) + (ziU32)cursor[2]) + 0x8000;
node += (*cursor & 0x7f) * 0x10000 + (ziU32)cursor[1] * 0x100 +
(ziU32)cursor[2] + 0x8000;
} else {
node = cursor[1] + (node + (ziU16)*cursor * 0x100);
}

View File

@@ -72,11 +72,7 @@ struct DVDCommandBlock {
DVDCommandBlock* prev; // 0x04
u32 command; // 0x08
#ifdef BS2_MACH_VOLATILE_DVD_STATE
volatile s32 state;
#else
s32 state; // 0x0C
#endif
u32 offset; // 0x10
u32 length; // 0x14

View File

@@ -35,7 +35,14 @@ u8 g_pfd_sddrv_buf[0x200];
static FAInsertCallback g_attach_func = 0;
static FAEjectCallback g_detach_func = 0;
u32 g_callback_status;
u32 g_event;
u32 g_inserted_status;
u32 g_removed_status;
u32 g_attach_status;
u32 g_detach_status;
u32 g_sddrv_work0;
u32 g_sddrv_work1;
extern u8 pfd_get_media_drv_char(FADisk*, s8*, u32);
extern void pdm_disk_notify_media_insert(FADisk*);
@@ -318,10 +325,11 @@ s32 pfd_sddrv_init(FADisk* disk) {
}
if ((pfd_sddrv_flags(&g_pfd_sddrv_info) & 1) != 0) {
OSReport("INFO SD Card driver is already initialize. pfd_sddrv_init()\n");
if (disk == g_pfd_sddrv_info.disk) {
return 0;
sd_result = 0;
if (disk != g_pfd_sddrv_info.disk) {
sd_result = -44;
}
return -44;
return sd_result;
}
if ((g_pfd_sddrv_info.flags & 4) == 0) {
g_pfd_sddrv_info.bytes_per_sector = 0x200;
@@ -499,7 +507,7 @@ s32 pfd_sddrv_finalize(FADisk* disk) {
}
g_pfd_sddrv_info.device = 0;
}
g_pfd_sddrv_info.flags = g_pfd_sddrv_info.flags & 0xfffffffe;
g_pfd_sddrv_info.flags = g_pfd_sddrv_info.flags & ~1;
g_pfd_sddrv_info.media_inserted = 0;
g_pfd_sddrv_info.disk = 0;
g_pfd_sddrv_info.drive = 0;
@@ -1523,7 +1531,7 @@ s32 pfd_sddrv_full_format(void) {
return -31;
}
if (result != 0) {
OSReport("ERR Failed to build up and write MBR and BPB fields.\n");
OSReport("ERR Failed to build up and write MBR and BPB fields.\n\0\0");
return result;
}
return 0;

View File

@@ -2,6 +2,7 @@
#include <string.h>
UHF_MSC_DEVICE uhg_msc_blk_device_tbl[8];
u32 uhg_msc_blk_msg_id;
static u8* st_uhs_msc_blk_buf;
extern void pdm_disk_notify_media_insert(FADisk* disk);
s32 uhf_msc_blk_init(FADisk* disk);
@@ -86,14 +87,9 @@ s32 uhf_msc_blk_mount(FADisk* disk) {
return ((device->flags >> 2) & 1) - 1;
}
static inline u16 ReadTransferBlocks(u32 remaining, u32 limit) {
u16 count = limit;
if (remaining <= limit) { count = remaining; }
return count;
}
s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* completed) {
struct { UHF_MSC_DEVICE* device; u16 blocks; } transfer;
UHF_MSC_DEVICE* device;
u16 transfer_blocks;
s32 error;
u32 block_size;
u8* transfer_buffer;
@@ -108,24 +104,24 @@ s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* com
if (blocks == 0) {
return 0;
}
transfer.device = NULL;
device = NULL;
{
u32 index;
UHF_MSC_DEVICE* candidate;
for (candidate = uhg_msc_blk_device_tbl, index = 0; index < 8; candidate++, index++) {
if (candidate->disk == disk) {
transfer.device = &uhg_msc_blk_device_tbl[index];
device = &uhg_msc_blk_device_tbl[index];
break;
}
}
}
if (transfer.device == NULL) {
if (device == NULL) {
return -1;
}
if (!(transfer.device->flags & 4)) {
if (!(device->flags & 4)) {
return -1;
}
block_size = transfer.device->block_size;
block_size = device->block_size;
if (block_size == 0) {
return -1;
}
@@ -143,18 +139,21 @@ s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* com
transfer_buffer = buffer;
}
do {
transfer.blocks = ReadTransferBlocks(blocks, transfer_limit);
error = usbh_msc_read10(transfer.device, sector, transfer.blocks, transfer_buffer, sense);
transfer_blocks = transfer_limit;
if (blocks <= transfer_limit) {
transfer_blocks = blocks;
}
error = usbh_msc_read10(device, sector, transfer_blocks, transfer_buffer, sense);
if (error == 0) {
if (!cacheable) {
memcpy(buffer, transfer_buffer, transfer.blocks * block_size);
buffer += transfer.blocks * block_size;
memcpy(buffer, transfer_buffer, transfer_blocks * block_size);
buffer += transfer_blocks * block_size;
} else {
transfer_buffer += transfer.blocks * block_size;
transfer_buffer += transfer_blocks * block_size;
}
blocks -= transfer.blocks;
sector += transfer.blocks;
*completed += transfer.blocks;
blocks -= transfer_blocks;
sector += transfer_blocks;
*completed += transfer_blocks;
if (blocks == 0) {
break;
}
@@ -164,8 +163,8 @@ s32 uhf_msc_blk_pread(FADisk* disk, u8* buffer, u32 sector, u32 blocks, u32* com
case 11:
break;
case 34:
if (transfer.device->disk != NULL) {
pdm_disk_notify_media_insert(transfer.device->disk);
if (device->disk != NULL) {
pdm_disk_notify_media_insert(device->disk);
}
break;
default:

View File

@@ -1,25 +1,25 @@
#include <private/fa/pdm.h>
#include <revolution/types.h>
#define MBR_WORD(buf, offset) (((pf_u32)(buf)[(offset) + 3] << 24) + ((pf_u32)(buf)[(offset) + 2] << 16) + ((pf_u32)(buf)[(offset) + 1] << 8) + (buf)[offset])
#define MBR_WORD(buf, offset) ((pf_u32)(buf)[offset] + ((pf_u32)(buf)[(offset) + 1] << 8) + ((pf_u32)(buf)[(offset) + 2] << 16) + ((pf_u32)(buf)[(offset) + 3] << 24))
static inline pf_u16 read_boot_u16(pf_u8* buf, pf_u32 offset) {
if ((pf_u32)&buf[offset] & 1) { return (buf[offset + 1] << 8) | buf[offset]; }
return PF_SWAP_16(*(pf_u16*)&buf[(offset + 1) & ~1]);
}
pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mbr) {
pf_s16 index;
pf_u32 start[4];
pf_u32 count[4];
pf_u32* p_start;
pf_u32* p_count;
pf_s16 index;
*p_is_mbr = 0;
if (buf[510] != 0x55 || buf[511] != 0xAA) { return 2; }
p_start = start;
p_count = count;
for (index = 0; index < 4; index++) {
*p_start = 0;
*p_start = (((pf_u32)buf[456] << 16) + buf[454]) + (((pf_u32)buf[457] << 24) + ((pf_u32)buf[455] << 8));
*p_count = (((pf_u32)buf[460] << 16) + buf[458]) + (((pf_u32)buf[461] << 24) + ((pf_u32)buf[459] << 8));
*p_start = (((pf_u32)buf[457] << 24) + (((pf_u32)buf[455] << 8) + (((pf_u32)buf[456] << 16) + buf[454])));
*p_count = (((pf_u32)buf[461] << 24) + (((pf_u32)buf[459] << 8) + (((pf_u32)buf[460] << 16) + buf[458])));
if (*p_start != 0 && *p_count != 0) {
if (index == 0) { *p_is_mbr = 1; }
} else {
@@ -29,15 +29,11 @@ pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mb
p_count++;
buf += 16;
}
p_start = start;
p_count = count;
for (index = 0; index < 4; index++) {
if (*p_start + *p_count > total) {
if (start[index] + count[index] > total) {
if (index == 0) { *p_is_mbr = 0; }
return 2;
}
p_start++;
p_count++;
}
return 0;
}
@@ -141,7 +137,7 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
}
return 0;
}
static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u16 media_bps;
pf_u32 ratio;
pf_u32 start;
@@ -158,9 +154,6 @@ static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sec
else if (ratio == 8) { start >>= 3; }
return sector + start;
}
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) NO_INLINE {
return partition_physical_sector(p_part, sector, bps);
}
pf_s32 pdm_part_get_partition(PDM_DISK* p_disk, pf_u32 id, PDM_PARTITION** pp_part) {
pf_s32 err;
pf_u16 index;

View File

@@ -24,6 +24,15 @@ typedef struct PFDIR_FAT_HINT {
pf_u32 previous_cluster;
} PFDIR_FAT_HINT;
pf_s8 pf_dir_sep_backslash[] = "\\";
pf_s8 pf_dir_sep_slash[] = "/";
extern pf_s8 pf_dir_volume_sep[];
extern pf_s8 pf_dir_wildcard[];
extern pf_s8 pf_dir_parent_name[];
extern pf_s8 pf_dir_current_name[];
__declspec(section ".sdata2") pf_u8 pf_dir_rename_marker[1] = {0xE5};
__declspec(section ".sdata2") pf_u8 pf_dir_move_marker[1] = {0xE5};
typedef struct PFDIR_STR {
const pf_s8* p_head;
const pf_s8* p_tail;
@@ -140,19 +149,15 @@ extern pf_s32 PFVOL_CheckCurrentDir(PF_VOLUME* volume, pf_u32 start_cluster);
extern pf_s32 PFENT_RemoveEntry(PF_DIR_ENT* entry, PF_ENT_ITER* iter);
extern pf_s32 PFFAT_FreeChain(PFDIR_FFD* ffd, pf_u32 start_cluster, pf_u32 chain_index, pf_u32 size);
static inline PF_CUR_DIR* current_directories(PFDIR_VOLUME_DIRS* state) {
return state->current_dirs;
}
static inline pf_u32 current_directory_is_open(PF_VOLUME* volume, const PF_DIR_ENT* entry) {
static inline pf_u32 current_directory_is_open(PF_VOLUME* volume, pf_u32 cluster) {
pf_u32 index;
for (index = 0; index < 4; index++) {
if (volume == pf_vol_set.volume_state.volumes[index].p_vol) {
PFDIR_VOLUME_DIRS* state = (PFDIR_VOLUME_DIRS*)pf_vol_set.volume_state.volumes[index].p_vol;
PF_CUR_DIR* directory = current_directories(state);
PF_CUR_DIR* directory = state->current_dirs;
pf_u32 slot;
for (slot = 0; slot < 4; slot++, directory++) {
if ((directory->stat & 1) != 0 && directory->directory.start_cluster == entry->start_cluster) { return 1; }
if ((directory->stat & 1) != 0 && directory->directory.start_cluster == cluster) { return 1; }
}
}
}
@@ -290,8 +295,8 @@ pf_s32 PFDIR_p_opendir(PF_VOLUME* volume, PFDIR_STR* path, PFDIR_DIR** opened_di
PFDIR_DIR* dir;
pf_s32 error;
if ((PFSTR_StrNCmp(path, (const pf_s8*)"\\", 1, 0, 1) == 0 ||
PFSTR_StrNCmp(path, (const pf_s8*)"/", 1, 0, 1) == 0) &&
if ((PFSTR_StrNCmp(path, pf_dir_sep_backslash, 1, 0, 1) == 0 ||
PFSTR_StrNCmp(path, pf_dir_sep_slash, 1, 0, 1) == 0) &&
PFSTR_StrNCmp(path, (const pf_s8*)"", 1, 1, 1) == 0) {
error = PFENT_GetRootDir(volume, &entry);
if (error != 0) {
@@ -299,22 +304,22 @@ pf_s32 PFDIR_p_opendir(PF_VOLUME* volume, PFDIR_STR* path, PFDIR_DIR** opened_di
}
goto open_directory;
} else if (PFSTR_StrNumChar(path, 1) == 2 &&
PFSTR_StrNCmp(path, (const pf_s8*)":", 1, 1, 1) == 0) {
PFSTR_StrNCmp(path, pf_dir_volume_sep, 1, 1, 1) == 0) {
error = PFVOL_GetCurrentDir(volume, &entry);
goto open_directory;
} else if (PFSTR_StrNumChar(path, 1) == 3 &&
PFSTR_StrNCmp(path, (const pf_s8*)":", 1, 1, 1) == 0 &&
(PFSTR_StrNCmp(path, (const pf_s8*)"\\", 1, 2, 1) == 0 ||
PFSTR_StrNCmp(path, (const pf_s8*)"/", 1, 2, 1) == 0)) {
PFSTR_StrNCmp(path, pf_dir_volume_sep, 1, 1, 1) == 0 &&
(PFSTR_StrNCmp(path, pf_dir_sep_backslash, 1, 2, 1) == 0 ||
PFSTR_StrNCmp(path, pf_dir_sep_slash, 1, 2, 1) == 0)) {
error = PFENT_GetRootDir(volume, &entry);
if (error != 0) {
return error;
}
goto open_directory;
} else {
if (PFSTR_StrNCmp(path, (const pf_s8*)":", 1, 1, 1) == 0 &&
(PFSTR_StrNCmp(path, (const pf_s8*)"\\", 1, 2, 1) == 0 ||
PFSTR_StrNCmp(path, (const pf_s8*)"/", 1, 2, 1) == 0)) {
if (PFSTR_StrNCmp(path, pf_dir_volume_sep, 1, 1, 1) == 0 &&
(PFSTR_StrNCmp(path, pf_dir_sep_backslash, 1, 2, 1) == 0 ||
PFSTR_StrNCmp(path, pf_dir_sep_slash, 1, 2, 1) == 0)) {
PFSTR_MoveStrPos(path, 2);
}
error = PFENT_ITER_GetEntryOfPath(&iter, &entry, volume, path, 0);
@@ -365,7 +370,7 @@ pf_s32 PFDIR_p_readdir(PFDIR_DIR* dir, PFDIR_READ_RESULT* result) {
dir->next_position = 0;
}
do {
PFSTR_InitStr(&pattern, (const pf_s8*)"*", 1);
PFSTR_InitStr(&pattern, pf_dir_wildcard, 1);
PFSTR_SetLocalStr(&pattern, 0);
error = PFENT_findEntryPos(&ffd, &entry, dir->current_position, &pattern, 0x7F, 0,
&logical_position, &entry_position);
@@ -410,11 +415,24 @@ extern pf_s32 PFFAT_GetSectorSpecified(PFDIR_FFD* ffd, pf_u32 index, pf_u32 allo
extern void PFPATH_AdjustExtShortName(pf_s8* name, pf_u32 position);
extern pf_s32 PFCACHE_AllocateDataPage(PF_VOLUME* volume, pf_u32 sector, PF_CACHE_PAGE** page, pf_u32* size);
extern void PFCACHE_FreeDataPage(PF_VOLUME* volume, PF_CACHE_PAGE* page);
extern void PFCACHE_FreeDataPage(PF_VOLUME* volume, PF_CACHE_PAGE* page);pf_s8 pf_dir_volume_sep[] = ":";
pf_s8 pf_dir_wildcard[] = "*";
pf_s8 pf_dir_parent_name[] = "..";
pf_s8 pf_dir_current_name[] = ".";
static inline void set_dot_entry(pf_u8* buffer) {
pf_u32 index;
buffer[0] = '.';
for (index = 1; index < 11; index++) { buffer[index] = ' '; }
buffer[1] = ' ';
buffer[2] = ' ';
buffer[3] = ' ';
buffer[4] = ' ';
buffer[5] = ' ';
buffer[6] = ' ';
buffer[7] = ' ';
buffer[8] = ' ';
buffer[9] = ' ';
buffer[10] = ' ';
}
static inline void set_dot_dot_entry(pf_u8* buffer) {
@@ -449,7 +467,7 @@ extern pf_s32 PFENT_ITER_GetEntryOfPattern(PF_ENT_ITER* iter, PF_DIR_ENT* entry,
extern pf_s32 PFENT_ITER_FindEntry(PF_ENT_ITER* iter, PF_DIR_ENT* entry, PFDIR_STR* pattern,
pf_u8 attributes, pf_u32 start, pf_u32* found);
extern pf_s32 PFENT_findEntry(PFDIR_FFD* ffd, PF_DIR_ENT* entry, pf_u32 start, PFDIR_STR* pattern,
pf_u32 required_attributes, pf_u32 forbidden_attributes);
pf_u32 attr_required, pf_u32 attr_forbidden);
extern pf_u32 PFSTR_GetCodeMode(PFDIR_STR* path);
extern const pf_s8* PFSTR_GetStrPos(PFDIR_STR* path, pf_u32 target);
extern pf_s32 PFPATH_SplitPathPattern(PF_STR* path, PFDIR_STR* directory, PFDIR_STR* pattern);
@@ -463,16 +481,6 @@ extern pf_s32 PFFILE_FsexecOpenFile(PF_DIR_ENT* entry, PF_ENT_ITER* iter, pf_u32
extern pf_s32 PFPATH_cmpName(const pf_s8* short_name, PFDIR_STR* pattern, pf_u32 short_search);
extern pf_s32 PFPATH_cmpNameUni(const pf_u16* name, PFDIR_STR* pattern);
pf_s32 PFDIR_p_mkdir(PF_VOLUME* volume, PF_STR* path, pf_u32 option, PF_DTA* data) {
pf_u32 index;
pf_u32* next_sector;
pf_u16 filename_length;
pf_u16 original_offset;
pf_u8 checksum;
pf_u8 lfn_count = 0;
pf_u32 cluster;
pf_u32 lfn_index;
pf_u32 entry_sector;
pf_s32 error;
PF_DIR_ENT parent_entry;
PF_DIR_ENT entry;
pf_s8 normalized_name[512];
@@ -486,9 +494,19 @@ pf_s32 PFDIR_p_mkdir(PF_VOLUME* volume, PF_STR* path, pf_u32 option, PF_DTA* dat
pf_u32 found;
pf_u32 page_size;
PF_CACHE_PAGE* page;
pf_u8 lfn_count = 0;
pf_u32 sector = 0;
pf_u32 written;
pf_u32 position;
pf_u32 entry_sector;
pf_u16 filename_length;
pf_u16 original_offset;
pf_u8 checksum;
pf_u32 cluster;
pf_u32 index;
pf_u32 lfn_index;
pf_u32* next_sector;
pf_s32 error;
error = PFPATH_SplitPath((PFDIR_STR*)path, &directory, &filename);
if (error != 0) { return error; }
@@ -652,7 +670,7 @@ pf_s32 PFDIR_p_chdir(PF_VOLUME* p_vol, PFDIR_STR* p_path_str) {
PF_ENT_ITER iter;
PF_DIR_ENT entry_dir;
if (((PFSTR_StrNCmp(p_path_str, (pf_s8*)"\\", 1U, 0, 1U) == 0) || (PFSTR_StrNCmp(p_path_str, (pf_s8*)"/", 1U, 0, 1U) == 0)) &&
if (((PFSTR_StrNCmp(p_path_str, pf_dir_sep_backslash, 1U, 0, 1U) == 0) || (PFSTR_StrNCmp(p_path_str, pf_dir_sep_slash, 1U, 0, 1U) == 0)) &&
(PFSTR_StrNCmp(p_path_str, (pf_s8*)"", 1U, 1, 1U) == 0)) {
err = PFENT_GetRootDir(p_vol, &entry_dir);
if (err != 0) {
@@ -665,11 +683,11 @@ pf_s32 PFDIR_p_chdir(PF_VOLUME* p_vol, PFDIR_STR* p_path_str) {
return 0;
}
if ((PFSTR_StrNumChar(p_path_str, 1U) == 2) && (PFSTR_StrNCmp(p_path_str, (pf_s8*)":", 1U, 1, 1U) == 0)) {
if ((PFSTR_StrNumChar(p_path_str, 1U) == 2) && (PFSTR_StrNCmp(p_path_str, pf_dir_volume_sep, 1U, 1, 1U) == 0)) {
return 0;
}
if ((PFSTR_StrNumChar(p_path_str, 1U) == 3) && (PFSTR_StrNCmp(p_path_str, (pf_s8*)":", 1U, 1, 1U) == 0) &&
((PFSTR_StrNCmp(p_path_str, (pf_s8*)"\\", 1U, 2, 1U) == 0) || (PFSTR_StrNCmp(p_path_str, (pf_s8*)"/", 1U, 2, 1U) == 0))) {
if ((PFSTR_StrNumChar(p_path_str, 1U) == 3) && (PFSTR_StrNCmp(p_path_str, pf_dir_volume_sep, 1U, 1, 1U) == 0) &&
((PFSTR_StrNCmp(p_path_str, pf_dir_sep_backslash, 1U, 2, 1U) == 0) || (PFSTR_StrNCmp(p_path_str, pf_dir_sep_slash, 1U, 2, 1U) == 0))) {
err = PFENT_GetRootDir(p_vol, &entry_dir);
if (err != 0) {
return err;
@@ -681,8 +699,8 @@ pf_s32 PFDIR_p_chdir(PF_VOLUME* p_vol, PFDIR_STR* p_path_str) {
return 0;
}
if ((PFSTR_StrNCmp(p_path_str, (pf_s8*)":", 1U, 1, 1U) == 0) &&
((PFSTR_StrNCmp(p_path_str, (pf_s8*)"\\", 1U, 2, 1U) == 0) || (PFSTR_StrNCmp(p_path_str, (pf_s8*)"/", 1U, 2, 1U) == 0))) {
if ((PFSTR_StrNCmp(p_path_str, pf_dir_volume_sep, 1U, 1, 1U) == 0) &&
((PFSTR_StrNCmp(p_path_str, pf_dir_sep_backslash, 1U, 2, 1U) == 0) || (PFSTR_StrNCmp(p_path_str, pf_dir_sep_slash, 1U, 2, 1U) == 0))) {
PFSTR_MoveStrPos(p_path_str, 2);
}
err = PFENT_ITER_GetEntryOfPath(&iter, &entry_dir, p_vol, p_path_str, 0);
@@ -865,20 +883,18 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
pf_u32 position;
pf_u32 found;
pf_u16 time;
pf_u8 deleted_marker[1] = {0xE5};
pf_s32 filename_length;
pf_u32* next_sector;
pf_s32 allocation_error = 0;
pf_u8 deleted_marker[1];
pf_u32 sector;
pf_u16 saved_initial_char = 0;
pf_u32* next_sector;
pf_s32 filename_length;
pf_s32 parse_error;
const pf_s8* filename;
pf_u32 remaining_lfns;
pf_u32 lfn_index;
pf_s32 allocation_error = 0;
pf_u16 saved_initial_char = 0;
pf_s32 error;
pf_u32 index;
PF_DIR_ENT* update_entry;
deleted_marker[0] = pf_dir_rename_marker[0];
error = PFPATH_SplitPath((PFDIR_STR*)old_path, &directory, &source_name);
if (error != 0) { return error; }
if (PFSTR_GetCodeMode(&source_name) == 2) {
@@ -899,8 +915,9 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
if (found == 0) { return 3; }
if ((source_entry.attr & 8) != 0) { return 3; }
if ((source_entry.attr & 1) != 0) { return 0x18; }
if (PFSTR_StrNCmp((PFDIR_STR*)new_path, (const pf_s8*)":", 1, 1, 1) == 0 &&
volume != PFPATH_GetVolumeFromPath(new_path)) { return 0x1F; }
if (PFSTR_StrNCmp((PFDIR_STR*)new_path, pf_dir_volume_sep, 1, 1, 1) == 0) {
if (volume != PFPATH_GetVolumeFromPath(new_path)) { return 0x1F; }
}
error = PFPATH_SplitPath((PFDIR_STR*)new_path, &directory, &destination_name);
if (error != 0) { return error; }
if (PFSTR_GetCodeMode(&destination_name) == 2) {
@@ -910,11 +927,11 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
}
PFSTR_SetLocalStr(&destination_name, (pf_u32)normalized_name);
if (PFSTR_GetCodeMode(&destination_name) == 1) {
filename = PFSTR_GetStrPos(&destination_name, 1);
const pf_s8* filename = PFSTR_GetStrPos(&destination_name, 1);
error = pf_strcmp(PFSTR_GetStrPos(&directory, 1), filename);
} else {
filename = PFSTR_GetStrPos(&destination_name, 1);
error = pf_w_strcmp((const pf_u16*)PFSTR_GetStrPos(&directory, 1), (const pf_u16*)filename);
const pf_u16* filename = (const pf_u16*)PFSTR_GetStrPos(&destination_name, 1);
error = pf_w_strcmp((const pf_u16*)PFSTR_GetStrPos(&directory, 1), filename);
}
if (error != 0) {
error = PFENT_ITER_GetEntryOfPath(&destination_iter, &destination_entry,
@@ -931,13 +948,12 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
if (PFFILE_IsOpened(&source_entry) != 0) { return 0x13; }
} else {
if (directory_is_open(&source_entry) != 0) { return 0x13; }
if (current_directory_is_open(source_entry.p_vol, &source_entry) != 0) { return 0x1C; }
if (PFSTR_StrNCmp(&source_name, (const pf_s8*)"..", 1, 0, 2) == 0) { return 0x1C; }
if (PFSTR_StrNCmp(&source_name, (const pf_s8*)".", 1, 0, 1) == 0) { return 0x1C; }
if (current_directory_is_open(source_entry.p_vol, source_entry.start_cluster) != 0) { return 0x1C; }
if (PFSTR_StrNCmp(&source_name, pf_dir_parent_name, 1, 0, 2) == 0) { return 0x1C; }
if (PFSTR_StrNCmp(&source_name, pf_dir_current_name, 1, 0, 1) == 0) { return 0x1C; }
{
pf_u32 directory_sector;
PFDIR_SFD* file = ((PFDIR_VOLUME_DIRS*)volume)->sfds;
directory_sector = volume->bpb.first_data_sector +
pf_u32 directory_sector = volume->bpb.first_data_sector +
((source_entry.start_cluster - 2) << volume->bpb.log2_sectors_per_cluster);
for (index = 0; index < 5; index++, file++) {
if ((file->stat & 1) != 0 && (file->stat & 2) != 0) {
@@ -962,21 +978,21 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
PFENT_getcurrentDateTimeForEnt(&destination_entry.access_date, &time);
error = PFENT_updateEntry(&destination_entry, 1);
if (error != 0) { return error; }
goto return_allocation_error;
goto finish_rename;
}
if (source_entry.num_entry_LFNs != 0 && (source_entry.small_letter_flag & 0x18) == 0) {
saved_initial_char = source_entry.long_name[0];
source_entry.long_name[0] = 0;
for (lfn_index = 1; lfn_index <= source_entry.num_entry_LFNs; lfn_index++) {
for (index = 1; index <= source_entry.num_entry_LFNs; index++) {
error = PFENT_ITER_Retreat(&source_iter, 0);
if (error != 0) { return error; }
error = PFSEC_WriteData(volume, deleted_marker, source_iter.sector,
error = PFSEC_WriteData(volume, (pf_u8*)&deleted_marker, source_iter.sector,
source_iter.offset, 1, &written, 0);
if (error != 0) { return error; }
if (written != 1) { return 0x11; }
}
}
error = PFSEC_WriteData(volume, deleted_marker, source_entry.entry_sector,
error = PFSEC_WriteData(volume, (pf_u8*)&deleted_marker, source_entry.entry_sector,
source_entry.entry_offset, 1, &written, 0);
if (error != 0) { return error; }
if (written != 1) { return 0x11; }
@@ -1005,7 +1021,7 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
if (allocation_error != 0) {
if (source_entry.num_entry_LFNs != 0 && (source_entry.small_letter_flag & 0x18) == 0) {
source_entry.long_name[0] = saved_initial_char;
source_entry.entry_offset -= ((pf_u32)source_entry.num_entry_LFNs << 5) & (0xffU << 5);
source_entry.entry_offset -= (pf_u16)(source_entry.num_entry_LFNs * 32);
}
update_entry = &source_entry;
} else {
@@ -1014,13 +1030,13 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
PFENT_getcurrentDateTimeForEnt(&destination_entry.access_date, &time);
update_entry = &destination_entry;
}
remaining_lfns = update_entry->num_entry_LFNs;
if (remaining_lfns != 0 && (update_entry->small_letter_flag & 0x18) == 0) {
index = update_entry->num_entry_LFNs;
if (index != 0 && (update_entry->small_letter_flag & 0x18) == 0) {
sector = update_entry->entry_sector;
next_sector = previous_chain;
while (remaining_lfns >= 1) {
PFENT_storeLFNEntryFieldsToBuf(entry_buffer, update_entry, remaining_lfns,
update_entry->check_sum, remaining_lfns == update_entry->num_entry_LFNs);
while (index >= 1) {
PFENT_storeLFNEntryFieldsToBuf(entry_buffer, update_entry, index,
update_entry->check_sum, index == update_entry->num_entry_LFNs);
error = PFSEC_WriteData(volume, entry_buffer, sector, update_entry->entry_offset, 32, &written, 0);
if (error != 0) { return error; }
if (written != 32) { return 0x11; }
@@ -1029,13 +1045,13 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
update_entry->entry_offset = 0;
sector = *next_sector++;
}
remaining_lfns--;
index--;
}
update_entry->entry_sector = sector;
}
error = PFENT_updateEntry(update_entry, 1);
finish_rename:
if (error != 0) { return error; }
return_allocation_error:
return allocation_error;
}
pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
@@ -1057,19 +1073,19 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
pf_u32 position;
pf_u32 found;
pf_u16 time;
pf_u8 deleted_marker[1] = {0xE5};
pf_s32 filename_length;
pf_u32* next_sector;
pf_u32 parent_cluster;
pf_u8 deleted_marker[1];
pf_u32 sector;
pf_u32* next_sector;
pf_s32 filename_length;
pf_s32 parse_error;
pf_s32 allocation_error;
pf_s32 error;
pf_u16 saved_initial_char = 0;
pf_u32 lfn_index;
pf_u32 index;
pf_u32 lfn_index;
pf_u16 saved_initial_char = 0;
PF_DIR_ENT* update_entry;
deleted_marker[0] = pf_dir_move_marker[0];
error = PFENT_ITER_GetEntryOfPath(&source_iter, &source_entry, volume, (PFDIR_STR*)old_path, 0);
if (error != 0) { return error; }
if (volume != PFPATH_GetVolumeFromPath(new_path)) { return 0x1F; }
@@ -1096,15 +1112,14 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
if (PFFILE_IsOpened(&source_entry) != 0) { return 0x13; }
} else {
if (directory_is_open(&source_entry) != 0) { return 0x13; }
if (current_directory_is_open(source_entry.p_vol, &source_entry) != 0) { return 0x1C; }
if (current_directory_is_open(source_entry.p_vol, source_entry.start_cluster) != 0) { return 0x1C; }
error = PFPATH_SplitPath((PFDIR_STR*)old_path, &directory, &source_name);
if (error != 0) { return error; }
if (PFSTR_StrNCmp(&source_name, (const pf_s8*)"..", 1, 0, 2) == 0) { return 10; }
if (PFSTR_StrNCmp(&source_name, (const pf_s8*)".", 1, 0, 1) == 0) { return 10; }
if (PFSTR_StrNCmp(&source_name, pf_dir_parent_name, 1, 0, 2) == 0) { return 10; }
if (PFSTR_StrNCmp(&source_name, pf_dir_current_name, 1, 0, 1) == 0) { return 10; }
{
pf_u32 directory_sector;
PFDIR_SFD* file = ((PFDIR_VOLUME_DIRS*)volume)->sfds;
directory_sector = volume->bpb.first_data_sector +
pf_u32 directory_sector = volume->bpb.first_data_sector +
((source_entry.start_cluster - 2) << volume->bpb.log2_sectors_per_cluster);
for (index = 0; index < 5; index++, file++) {
if ((file->stat & 1) != 0 && (file->stat & 2) != 0) {
@@ -1118,9 +1133,10 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
}
destination_entry.start_cluster = destination_parent.start_cluster;
for (;;) {
pf_u32 parent_cluster;
if (destination_entry.start_cluster == 1 || destination_entry.start_cluster == 0) { break; }
PFFAT_InitFFD(&destination_iter.ffd, &destination_hint, volume, &destination_entry.start_cluster);
PFSTR_InitStr(&parent_name, (const pf_s8*)"..", 1);
PFSTR_InitStr(&parent_name, pf_dir_parent_name, 1);
PFSTR_SetLocalStr(&parent_name, 0);
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &parent_name, 0x7F, 0);
if (error != 0) { return error; }
@@ -1142,19 +1158,18 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
parse_error = PFPATH_parseShortName(destination_entry.short_name, &destination_name);
if (destination_entry.short_name[0] == 0) { return 2; }
if (source_entry.num_entry_LFNs != 0 && (source_entry.small_letter_flag & 0x18) == 0) {
pf_u32 entry_index;
saved_initial_char = source_entry.long_name[0];
source_entry.long_name[0] = 0;
for (entry_index = 1; entry_index <= source_entry.num_entry_LFNs; entry_index++) {
for (index = 1; index <= source_entry.num_entry_LFNs; index++) {
error = PFENT_ITER_Retreat(&source_iter, 0);
if (error != 0) { return error; }
error = PFSEC_WriteData(volume, deleted_marker, source_iter.sector,
error = PFSEC_WriteData(volume, (pf_u8*)&deleted_marker, source_iter.sector,
source_iter.offset, 1, &written, 0);
if (error != 0) { return error; }
if (written != 1) { return 0x11; }
}
}
error = PFSEC_WriteData(volume, deleted_marker, source_entry.entry_sector,
error = PFSEC_WriteData(volume, (pf_u8*)&deleted_marker, source_entry.entry_sector,
source_entry.entry_offset, 1, &written, 0);
if (error != 0) { return error; }
if (written != 1) { return 0x11; }
@@ -1183,7 +1198,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
if (allocation_error != 0) {
if (source_entry.num_entry_LFNs != 0 && (source_entry.small_letter_flag & 0x18) == 0) {
source_entry.long_name[0] = saved_initial_char;
source_entry.entry_offset -= ((pf_u32)source_entry.num_entry_LFNs << 5) & (0xffU << 5);
source_entry.entry_offset -= (pf_u16)((source_entry.num_entry_LFNs & 0xff) * 32);
}
update_entry = &source_entry;
} else {
@@ -1193,7 +1208,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
update_entry = &destination_entry;
if ((source_entry.attr & 0x10) != 0) {
PFFAT_InitFFD(&source_iter.ffd, &source_hint, volume, &source_entry.start_cluster);
PFSTR_InitStr(&parent_name, (const pf_s8*)"..", 1);
PFSTR_InitStr(&parent_name, pf_dir_parent_name, 1);
PFSTR_SetLocalStr(&parent_name, 0);
error = PFENT_findEntry(&source_iter.ffd, &source_entry, 0, &parent_name, 0x7F, 0);
if (error != 0) { return error; }
@@ -1233,164 +1248,6 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
return allocation_error;
}
pf_s32 PFDIR_p_fsnext(PF_DTA* data) {
PFDIR_FFD ffd;
PFDIR_FAT_HINT hint;
PF_DIR_ENT entry;
PFDIR_STR pattern;
pf_u32 logical_position = 0;
pf_u32 entry_position = 0;
pf_u32 code_mode;
pf_s32 index = 0;
pf_s32 error;
if ((data->status & 1) == 1) {
code_mode = 1;
error = PFSTR_InitStr(&pattern, data->reg_exp, code_mode);
} else {
code_mode = 2;
error = PFSTR_InitStr(&pattern, (const pf_s8*)((PF_DTAW*)data)->reg_expW, code_mode);
}
if (error != 0) {
return error;
}
PFSTR_SetLocalStr(&pattern, (pf_u32)data->reg_exp);
while (entry_position < 999999) {
if (data->parent_pos >= 999999) { return 10; }
entry.start_cluster = data->parent_start_cluster;
PFFAT_InitFFD(&ffd, &hint, data->p_vol, &entry.start_cluster);
error = PFENT_findEntryPos(&ffd, &entry, data->parent_pos, &pattern, data->attr, 0,
&logical_position, &entry_position);
if (error != 0) { return error; }
data->parent_pos = entry_position + 1;
if (entry_position == 999999) { return 3; }
else { break; }
}
pf_strcpy(data->FileName, entry.short_name);
if ((data->status & 2) == 2) {
PFPATH_transformInUnicode(((PF_DTAW*)data)->FileNameW, data->FileName);
}
if (entry.long_name[0] != 0) {
if ((pf_vol_set.setting & 2) == 2) {
pf_vol_set.setting &= 0xFFFFFFFC;
pf_vol_set.setting |= 1;
PFPATH_transformFromUnicodeToNormal(data->LongName, entry.long_name);
pf_vol_set.setting &= 0xFFFFFFFC;
pf_vol_set.setting |= 2;
} else {
PFPATH_transformFromUnicodeToNormal(data->LongName, entry.long_name);
}
if ((data->status & 2) == 2) {
pf_w_strcpy(((PF_DTAW*)data)->LongNameW, entry.long_name);
}
} else {
data->LongName[0] = 0;
if ((data->status & 2) == 2) {
((PF_DTAW*)data)->LongNameW[0] = 0;
}
}
if (((PFDIR_VOLUME_DIRS*)data->p_vol)->num_opened_files != 0) {
for (index = 0; index < 5; index++) {
if ((((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].stat & 1) != 0 && (((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].stat & 2) != 0 &&
entry.p_vol == ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.p_vol &&
((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.entry_sector == entry.entry_sector &&
((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.entry_offset == entry.entry_offset) {
data->FileSize = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.file_size;
data->Time = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.modify_time;
data->Date = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.modify_date;
data->Attribute = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.attr;
data->num_entry_LFNs = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.num_entry_LFNs;
data->ordinal = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.ordinal;
data->check_sum = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.check_sum;
break;
}
}
}
if (((PFDIR_VOLUME_DIRS*)data->p_vol)->num_opened_files == 0 || index == 5) {
data->FileSize = entry.file_size;
data->Time = entry.modify_time;
data->Date = entry.modify_date;
data->Attribute = entry.attr;
data->num_entry_LFNs = entry.num_entry_LFNs;
data->ordinal = entry.ordinal;
data->check_sum = entry.check_sum;
}
return 0;
}
pf_s32 PFDIR_p_fsfirst(PF_VOLUME* volume, PF_STR* path, pf_u8 attributes, PF_DTA* data) {
PFDIR_STR directory;
PFDIR_STR pattern;
PF_DIR_ENT entry;
PF_ENT_ITER iter;
pf_s32 error;
error = PFPATH_SplitPathPattern(path, &directory, &pattern);
if (error != 0) {
return error;
}
error = PFENT_ITER_GetEntryOfPattern(&iter, &entry, volume, &directory);
if (error != 0) {
return error;
}
if ((entry.attr & 0x10) == 0) {
return 0x14;
}
data->parent_start_cluster = entry.start_cluster;
data->parent_pos = 0;
data->p_vol = entry.p_vol;
data->attr = attributes;
data->status = 0;
if (PFSTR_GetCodeMode(&pattern) == 1) {
PFPATH_SetSearchPattern(data->reg_exp, 0, &pattern);
data->status |= 1;
} else {
PFPATH_SetSearchPattern(data->reg_exp, ((PF_DTAW*)data)->reg_expW, &pattern);
data->status |= 2;
}
return PFDIR_p_fsnext(data);
}
pf_s32 PFDIR_p_fsexec_chmod(PF_DTA* data, PF_DIR_ENT* entry, pf_u32 mode, pf_u32 attributes) {
PFDIR_VOLUME_DIRS* volume_dirs = (PFDIR_VOLUME_DIRS*)entry->p_vol;
pf_u16 date;
pf_u16 time;
pf_u8 create_time_ms;
pf_s32 index = 0;
pf_s32 error;
if ((attributes & 0x40) != 0) {
attributes = (pf_u8)(attributes & ~0x40);
}
if ((entry->attr & 0x10) != 0) {
if ((attributes & 4) != 0) {
return 10;
}
if (directory_is_open(entry) != 0) { return 0x13; }
entry->attr = attributes | 0x10;
} else {
if ((attributes & 0x10) != 0) {
return 10;
}
if (PFFILE_IsOpened(entry) != 0) {
return 0x13;
}
entry->attr = attributes;
}
PFENT_getcurrentDateTimeForEnt(&entry->access_date, &time);
error = PFENT_updateEntry(entry, 0);
if (error != 0) {
return error;
}
if ((mode & 0x80000000) == 0) {
data->Attribute = entry->attr;
}
error = PFCACHE_FlushDataCacheSpecific(entry->p_vol, 0);
if (error != 0) { return error; }
return 0;
}
pf_s32 PFDIR_p_fsexec_remove(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITER* iter) {
PFDIR_VOLUME_DIRS* volume_dirs = (PFDIR_VOLUME_DIRS*)entry->p_vol;
PFDIR_FAT_HINT hint;
@@ -1444,6 +1301,47 @@ pf_s32 PFDIR_p_fsexec_remove(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITER* iter)
return release_directory_chain(&iter->ffd, start_cluster, chain_size);
}
pf_s32 PFDIR_p_fsexec_chmod(PF_DTA* data, PF_DIR_ENT* entry, pf_u32 mode, pf_u32 attributes) {
PFDIR_VOLUME_DIRS* volume_dirs = (PFDIR_VOLUME_DIRS*)entry->p_vol;
pf_u16 date;
pf_u16 time;
pf_u8 create_time_ms;
pf_s32 index = 0;
pf_s32 error;
if ((attributes & 0x40) != 0) {
attributes = (pf_u8)(attributes & ~0x40);
}
if ((entry->attr & 0x10) != 0) {
if ((attributes & 4) != 0) {
return 10;
}
if (directory_is_open(entry) != 0) { return 0x13; }
entry->attr = attributes | 0x10;
} else {
if ((attributes & 0x10) != 0) {
return 10;
}
if (PFFILE_IsOpened(entry) != 0) {
return 0x13;
}
entry->attr = attributes;
}
PFENT_getcurrentDateTimeForEnt(&entry->access_date, &time);
error = PFENT_updateEntry(entry, 0);
if (error != 0) {
return error;
}
if ((mode & 0x80000000) == 0) {
data->Attribute = entry->attr;
}
error = PFCACHE_FlushDataCacheSpecific(entry->p_vol, 0);
if (error != 0) { return error; }
return 0;
}
pf_s32 PFDIR_p_fsexec_fopen(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITER* iter, pf_u32 flags,
pf_u32 mode) {
pf_s8 long_name[13];
@@ -2030,3 +1928,121 @@ void PFDIR_chdmod(PF_STR* path, pf_u8 attributes) {
}
volume_dirs->cache.signature = 0;
}
pf_s32 PFDIR_p_fsnext(PF_DTA* data) {
PFDIR_FFD ffd;
PFDIR_FAT_HINT hint;
PF_DIR_ENT entry;
PFDIR_STR pattern;
pf_u32 logical_position = 0;
pf_u32 entry_position = 0;
pf_u32 code_mode;
pf_s32 index = 0;
pf_s32 error;
if ((data->status & 1) == 1) {
code_mode = 1;
error = PFSTR_InitStr(&pattern, data->reg_exp, code_mode);
} else {
code_mode = 2;
error = PFSTR_InitStr(&pattern, (const pf_s8*)((PF_DTAW*)data)->reg_expW, code_mode);
}
if (error != 0) {
return error;
}
PFSTR_SetLocalStr(&pattern, (pf_u32)data->reg_exp);
while (entry_position < 999999) {
if (data->parent_pos >= 999999) { return 10; }
entry.start_cluster = data->parent_start_cluster;
PFFAT_InitFFD(&ffd, &hint, data->p_vol, &entry.start_cluster);
error = PFENT_findEntryPos(&ffd, &entry, data->parent_pos, &pattern, data->attr, 0,
&logical_position, &entry_position);
if (error != 0) { return error; }
data->parent_pos = entry_position + 1;
if (entry_position == 999999) { return 3; }
else { break; }
}
pf_strcpy(data->FileName, entry.short_name);
if ((data->status & 2) == 2) {
PFPATH_transformInUnicode(((PF_DTAW*)data)->FileNameW, data->FileName);
}
if (entry.long_name[0] != 0) {
if ((pf_vol_set.setting & 2) == 2) {
pf_vol_set.setting &= 0xFFFFFFFC;
pf_vol_set.setting |= 1;
PFPATH_transformFromUnicodeToNormal(data->LongName, entry.long_name);
pf_vol_set.setting &= 0xFFFFFFFC;
pf_vol_set.setting |= 2;
} else {
PFPATH_transformFromUnicodeToNormal(data->LongName, entry.long_name);
}
if ((data->status & 2) == 2) {
pf_w_strcpy(((PF_DTAW*)data)->LongNameW, entry.long_name);
}
} else {
data->LongName[0] = 0;
if ((data->status & 2) == 2) {
((PF_DTAW*)data)->LongNameW[0] = 0;
}
}
if (((PFDIR_VOLUME_DIRS*)data->p_vol)->num_opened_files != 0) {
for (index = 0; index < 5; index++) {
if ((((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].stat & 1) != 0 && (((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].stat & 2) != 0 &&
entry.p_vol == ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.p_vol &&
((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.entry_sector == entry.entry_sector &&
((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.entry_offset == entry.entry_offset) {
data->FileSize = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.file_size;
data->Time = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.modify_time;
data->Date = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.modify_date;
data->Attribute = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.attr;
data->num_entry_LFNs = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.num_entry_LFNs;
data->ordinal = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.ordinal;
data->check_sum = ((PFDIR_VOLUME_DIRS*)data->p_vol)->sfds[index].dir_entry.check_sum;
break;
}
}
}
if (((PFDIR_VOLUME_DIRS*)data->p_vol)->num_opened_files == 0 || index == 5) {
data->FileSize = entry.file_size;
data->Time = entry.modify_time;
data->Date = entry.modify_date;
data->Attribute = entry.attr;
data->num_entry_LFNs = entry.num_entry_LFNs;
data->ordinal = entry.ordinal;
data->check_sum = entry.check_sum;
}
return 0;
}
pf_s32 PFDIR_p_fsfirst(PF_VOLUME* volume, PF_STR* path, pf_u8 attributes, PF_DTA* data) {
PFDIR_STR directory;
PFDIR_STR pattern;
PF_DIR_ENT entry;
PF_ENT_ITER iter;
pf_s32 error;
error = PFPATH_SplitPathPattern(path, &directory, &pattern);
if (error != 0) {
return error;
}
error = PFENT_ITER_GetEntryOfPattern(&iter, &entry, volume, &directory);
if (error != 0) {
return error;
}
if ((entry.attr & 0x10) == 0) {
return 0x14;
}
data->parent_start_cluster = entry.start_cluster;
data->parent_pos = 0;
data->p_vol = entry.p_vol;
data->attr = attributes;
data->status = 0;
if (PFSTR_GetCodeMode(&pattern) == 1) {
PFPATH_SetSearchPattern(data->reg_exp, 0, &pattern);
data->status |= 1;
} else {
PFPATH_SetSearchPattern(data->reg_exp, ((PF_DTAW*)data)->reg_expW, &pattern);
data->status |= 2;
}
return PFDIR_p_fsnext(data);
}

View File

@@ -29,6 +29,12 @@ typedef struct PFITER_ENT_ITER {
pf_u8 log2_entries_per_sector;
} PFITER_ENT_ITER;
__declspec(section ".sdata") pf_s8 g_pfent_iter_parent_dir[] = "..";
__declspec(section ".sdata") pf_s8 g_pfent_iter_current_dir[] = ".";
__declspec(section ".sdata") pf_s8 g_pfent_iter_colon[] = ":";
__declspec(section ".sdata") pf_s8 g_pfent_iter_backslash[] = "\\";
__declspec(section ".sdata") pf_s8 g_pfent_iter_slash[] = "/";
typedef struct PFITER_BPB {
pf_u16 bytes_per_sector;
pf_u16 num_reserved_sectors;
@@ -234,8 +240,8 @@ pf_s32 PFENT_ITER_DoFindEntry(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent, PF_STR
pf_u32 index_search_from;
pf_u32 is_extsfn = 0;
*p_is_found = 0;
if (PFSTR_StrCmp(p_pattern, (pf_s8*)"..") == 0 && (p_ent->attr & 0x10) && p_ent->start_cluster == 1) return 2;
if (PFSTR_StrCmp(p_pattern, (pf_s8*)".") == 0) {
if (PFSTR_StrCmp(p_pattern, g_pfent_iter_parent_dir) == 0 && (p_ent->attr & 0x10) && p_ent->start_cluster == 1) return 2;
if (PFSTR_StrCmp(p_pattern, g_pfent_iter_current_dir) == 0) {
*p_is_found = 1;
return 0;
}
@@ -339,10 +345,10 @@ pf_s32 PFENT_ITER_DoGetEntry(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent, PF_VOLU
pf_s32 err;
pf_u32 code_mode;
if (PFSTR_StrNCmp(p_path, (pf_s8*)":", 1, 1, 1) == 0) {
if (PFSTR_StrNCmp(p_path, g_pfent_iter_colon, 1, 1, 1) == 0) {
PFSTR_MoveStrPos(p_path, 2);
}
if ((PFSTR_StrNCmp(p_path, (pf_s8*)"\\", 1, 0, 1) == 0 || PFSTR_StrNCmp(p_path, (pf_s8*)"/", 1, 0, 1) == 0)) {
if ((PFSTR_StrNCmp(p_path, g_pfent_iter_backslash, 1, 0, 1) == 0 || PFSTR_StrNCmp(p_path, g_pfent_iter_slash, 1, 0, 1) == 0)) {
err = PFENT_GetRootDir(p_vol, p_ent);
if (err != 0) {
return err;
@@ -528,7 +534,7 @@ pf_s32 PFENT_ITER_FindCluster(PF_DIR_ENT* p_ent, pf_u32 cluster, pf_bool* p_is_f
while (iter.index != 0) {
err = PFENT_ITER_LoadEntry(&iter);
if (err != 0) return err;
if (pf_strncmp((pf_s8*)iter.buf, (pf_s8*)"..", 2) == 0) break;
if (pf_strncmp((pf_s8*)iter.buf, g_pfent_iter_parent_dir, 2) == 0) break;
err = PFENT_ITER_Retreat(&iter, 0);
if (err != 0) return err;
if (current_cluster == cluster) {
@@ -552,7 +558,7 @@ pf_s32 PFENT_ITER_FindCluster(PF_DIR_ENT* p_ent, pf_u32 cluster, pf_bool* p_is_f
while (current_cluster > 2) {
err = PFENT_ITER_LoadEntry(&iter);
if (err != 0) return err;
if (pf_strncmp((pf_s8*)iter.buf, (pf_s8*)"..", 2) == 0) {
if (pf_strncmp((pf_s8*)iter.buf, g_pfent_iter_parent_dir, 2) == 0) {
if (current_cluster == cluster) {
*p_is_found = 1;
return 0;
@@ -685,8 +691,8 @@ pf_s32 PFENT_ITER_FindEntry(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent, PF_STR*
pf_s32 err;
*p_is_found = 0;
if (attr_required & attr_forbidden) return 10;
if (PFSTR_StrNCmp(p_pattern, (pf_s8*)":", 1, 1, 1) == 0) PFSTR_MoveStrPos(p_pattern, 2);
if (PFSTR_StrNCmp(p_pattern, (pf_s8*)"\\", 1, 0, 1) == 0 || PFSTR_StrNCmp(p_pattern, (pf_s8*)"/", 1, 0, 1) == 0) {
if (PFSTR_StrNCmp(p_pattern, g_pfent_iter_colon, 1, 1, 1) == 0) PFSTR_MoveStrPos(p_pattern, 2);
if (PFSTR_StrNCmp(p_pattern, g_pfent_iter_backslash, 1, 0, 1) == 0 || PFSTR_StrNCmp(p_pattern, g_pfent_iter_slash, 1, 0, 1) == 0) {
err = PFENT_GetRootDir(p_iter->p_vol, p_ent);
if (err != 0) return err;
if (PFSTR_StrNumChar(p_pattern, 1) == 1 && PFSTR_StrNCmp(p_pattern, (pf_s8*)"\0\0\0", 2, 0, 1) == 0) return 0;
@@ -726,29 +732,24 @@ pf_s32 PFENT_ITER_GetEntryOfIter(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent) {
return 0;
}
static inline pf_u32 CopyLongNameFragment(PFITER_ENT_ITER* iter, pf_u8* destination, pf_u32 offset) {
pf_memcpy(destination, &iter->buf[1], 10);
pf_memcpy(destination + 10, &iter->buf[14], 12);
pf_memcpy(destination + 22, &iter->buf[28], 4);
return offset + 26;
}
pf_s32 PFENT_ITER_GetLFNEntryName(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent) {
pf_u32 index;
pf_u8* destination;
pf_u16* destination;
pf_u32 i;
pf_u32 index;
pf_s32 err;
if (p_ent->num_entry_LFNs != 0 && !(p_ent->small_letter_flag & 0x18)) {
i = 0;
for (index = 0; i < p_ent->num_entry_LFNs; ++i) {
for (i = 0; i < p_ent->num_entry_LFNs; ++i) {
err = PFENT_ITER_Retreat(p_iter, 0);
if (err != 0) return err;
err = PFENT_ITER_LoadEntry(p_iter);
if (err != 0) return err;
destination = (pf_u8*)p_ent->long_name + index;
index = CopyLongNameFragment(p_iter, destination, index);
index = i * 13;
destination = &p_ent->long_name[index];
pf_memcpy(destination, &p_iter->buf[1], 10);
pf_memcpy(destination + 5, &p_iter->buf[14], 12);
pf_memcpy(destination + 11, &p_iter->buf[28], 4);
}
p_ent->long_name[(p_ent->num_entry_LFNs * 26U) >> 1] = 0;
p_ent->long_name[p_ent->num_entry_LFNs * 26 >> 1] = 0;
}
return 0;
}

View File

@@ -94,18 +94,13 @@ typedef struct PFFAT_FFD {
PF_VOLUME* p_vol;
} PFFAT_FFD;
static const struct {
u32 bad;
u32 eoc1;
u32 eoc2;
u32 fat0_mask;
u32 fat1;
} fat_special_values[FAT_MAX] = {
{0xFF7, 0xFF8, 0xFFF, 0xF00, 0xFFF},
{0xFFF7, 0xFFF8, 0xFFFF, 0xFF00, 0xFFFF},
{0xFFFFFF7, 0xFFFFFF8, 0xFFFFFFF, 0xFFFFF00, 0xFFFFFFF}
const u32 fat_special_values[FAT_MAX*5+1] = {
0xFF7, 0xFF8, 0xFFF, 0xF00, 0xFFF,
0xFFF7, 0xFFF8, 0xFFFF, 0xFF00, 0xFFFF,
0xFFFFFF7, 0xFFFFFF8, 0xFFFFFFF, 0xFFFFF00, 0xFFFFFFF, 0
};
extern s32 PFSEC_ReadFAT(PF_VOLUME* volume, u8* buffer, u32 sector, u16 offset,
u16 size);
extern s32 PFCACHE_AllocateDataPage(PF_VOLUME* volume, u32 sector,
@@ -404,7 +399,7 @@ s32 PFFAT_FindClusterLink(PFFAT_FFD* file, u32 chainIndex, u32* cluster,
if (nextCluster == 0) {
return 13;
}
if (nextCluster == fat_special_values[file->p_vol->bpb.fat_type].eoc2) {
if (nextCluster == fat_special_values[file->p_vol->bpb.fat_type*5+2]) {
return 0;
}
*cluster = nextCluster;
@@ -471,7 +466,7 @@ s32 PFFAT_FindClusterLinkWithBuf(PFFAT_FFD* file, u32 chainIndex,
if (nextCluster == 0) {
return 13;
}
if (nextCluster == fat_special_values[file->p_vol->bpb.fat_type].eoc2) {
if (nextCluster == fat_special_values[file->p_vol->bpb.fat_type*5+2]) {
return 0;
}
*cluster = nextCluster;
@@ -525,7 +520,7 @@ s32 PFFAT_ReadCluster(PFFAT_FFD* file, u32 cluster, u32 chainIndex,
return 6;
}
if (file->cluster_link.buffer != 0 &&
value != fat_special_values[file->p_vol->bpb.fat_type].eoc2) {
value != fat_special_values[file->p_vol->bpb.fat_type*5+2]) {
if (file->cluster_link.max_count > file->cluster_link.position &&
file->cluster_link.max_count != 0) {
if (chainIndex == file->cluster_link.position *
@@ -588,7 +583,7 @@ s32 PFFAT_ReadClusterWithBuf(PFFAT_FFD* file, u32 cluster, u32 chainIndex,
return 6;
}
if (file->cluster_link.buffer != 0 &&
value != fat_special_values[file->p_vol->bpb.fat_type].eoc2) {
value != fat_special_values[file->p_vol->bpb.fat_type*5+2]) {
if (file->cluster_link.max_count > file->cluster_link.position &&
file->cluster_link.max_count != 0) {
if (chainIndex == file->cluster_link.position *
@@ -667,7 +662,7 @@ s32 PFFAT_WriteCluster(PFFAT_FFD* file, u32 cluster, u32 chainIndex,
}
}
} else if (cluster !=
fat_special_values[file->p_vol->bpb.fat_type].eoc2) {
fat_special_values[file->p_vol->bpb.fat_type*5+2]) {
error = PFFAT_FindClusterLink(file, chainIndex, &accessCluster,
&useClusterLink);
if (error != 0) {
@@ -757,7 +752,7 @@ s32 PFFAT_WriteClusterWithBuf(PFFAT_FFD* file, u32 cluster, u32 chainIndex,
}
}
} else if (cluster !=
fat_special_values[file->p_vol->bpb.fat_type].eoc2) {
fat_special_values[file->p_vol->bpb.fat_type*5+2]) {
error = PFFAT_FindClusterLinkWithBuf(
file, chainIndex, &accessCluster, &useClusterLink, page);
if (error != 0) {
@@ -814,7 +809,7 @@ s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
PF_CACHE_PAGE* page;
volume = file->p_vol;
eoc2 = fat_special_values[volume->bpb.fat_type].eoc2;
eoc2 = fat_special_values[volume->bpb.fat_type*5+2];
*firstAllocatedCluster = -1;
*lastAllocatedCluster = -1;
lastFreeCluster = -1;
@@ -919,8 +914,8 @@ s32 PFFAT_GetClusterInChain(PFFAT_FFD* file, u32 chainIndex, u32 mode,
PF_CACHE_PAGE* page;
s32 error;
badCluster = fat_special_values[file->p_vol->bpb.fat_type].bad;
eoc1 = fat_special_values[file->p_vol->bpb.fat_type].eoc1;
badCluster = fat_special_values[file->p_vol->bpb.fat_type*5+0];
eoc1 = fat_special_values[file->p_vol->bpb.fat_type*5+1];
*locateEnd = -1;
*locateStart = -1;
@@ -950,7 +945,7 @@ s32 PFFAT_GetClusterInChain(PFFAT_FFD* file, u32 chainIndex, u32 mode,
appendCount = file->last_cluster.max_chain_index + numClusters -
chainIndex;
currentCluster = file->last_cluster.num_last_cluster;
nextCluster = fat_special_values[file->p_vol->bpb.fat_type].eoc2;
nextCluster = fat_special_values[file->p_vol->bpb.fat_type*5+2];
searchIndex = file->last_cluster.max_chain_index + 1;
}
} else {
@@ -984,7 +979,7 @@ s32 PFFAT_GetClusterInChain(PFFAT_FFD* file, u32 chainIndex, u32 mode,
}
} else {
nextCluster =
fat_special_values[file->p_vol->bpb.fat_type].eoc2;
fat_special_values[file->p_vol->bpb.fat_type*5+2];
searchIndex--;
}
if ((nextCluster < 2 ||
@@ -1060,7 +1055,7 @@ s32 PFFAT_GetClusterContinuousSectorInChain(PFFAT_FFD* file,
}
if (cluster + 1 != nextCluster) {
if (nextCluster ==
fat_special_values[volume->bpb.fat_type].eoc2) {
fat_special_values[volume->bpb.fat_type*5+2]) {
file->last_cluster.num_last_cluster = cluster;
file->last_cluster.max_chain_index = chainIndex - 1;
}
@@ -1107,7 +1102,7 @@ s32 PFFAT_GetClusterAllocatedInChain(PFFAT_FFD* file, u32 initialCluster,
return error;
}
if (nextCluster ==
fat_special_values[volume->bpb.fat_type].eoc2) {
fat_special_values[volume->bpb.fat_type*5+2]) {
file->last_cluster.num_last_cluster = cluster;
file->last_cluster.max_chain_index = chainIndex - 1;
break;
@@ -1475,7 +1470,7 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
if (startCluster == 0) {
return 0;
}
eoc1 = fat_special_values[volume->bpb.fat_type].eoc1;
eoc1 = fat_special_values[volume->bpb.fat_type*5+1];
if (size != 0) {
fileSize = size;
clusterSize = volume->bpb.bytes_per_sector
@@ -1551,24 +1546,26 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
0, 1, page);
chainIndex++;
} else {
s32 entryError;
currentPage = page;
switch (volume->bpb.fat_type) {
case FAT_12:
error = PFFAT12_WriteFATEntryWithBuf(
entryError = PFFAT12_WriteFATEntryWithBuf(
volume, (u16)startCluster, 0, currentPage);
break;
case FAT_16:
error = PFFAT16_WriteFATEntryWithBuf(volume, startCluster, 0,
entryError = PFFAT16_WriteFATEntryWithBuf(volume, startCluster, 0,
currentPage);
break;
case FAT_32:
error = PFFAT32_WriteFATEntryWithBuf(volume, startCluster, 0,
entryError = PFFAT32_WriteFATEntryWithBuf(volume, startCluster, 0,
currentPage);
break;
default:
error = 15;
entryError = 15;
break;
}
error = entryError;
}
if (error != 0) {
PFCACHE_FreeDataPage(volume, page);
@@ -1588,9 +1585,9 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
}
{
s32 firstFlushError;
u32 fatSector;
u16 fatIndex;
PF_CACHE_PAGE* flushPage;
u16 fatIndex;
u32 fatSector;
firstFlushError = 0;
flushPage = page;
@@ -1630,7 +1627,7 @@ s32 PFFAT_getBeforeChain(PF_VOLUME* volume, u32 startCluster,
s32 alreadyAllocated;
s32 error;
eoc1 = fat_special_values[volume->bpb.fat_type].eoc1;
eoc1 = fat_special_values[volume->bpb.fat_type*5+1];
*cluster = -1;
error = PFCACHE_AllocateDataPage(volume, -1, &page,
&alreadyAllocated);
@@ -1702,7 +1699,7 @@ s32 PFFAT_InitFATRegion(PF_VOLUME* volume)
}
PFCACHE_FreeFATPage(volume, page);
fatValue = volume->bpb.media |
fat_special_values[volume->bpb.fat_type].fat0_mask;
fat_special_values[volume->bpb.fat_type*5+3];
switch (volume->bpb.fat_type) {
case FAT_12:
if (fatValue > 0xFFF) {
@@ -1732,7 +1729,7 @@ s32 PFFAT_InitFATRegion(PF_VOLUME* volume)
if (error != 0) {
return error;
}
fatValue = fat_special_values[volume->bpb.fat_type].fat1;
fatValue = fat_special_values[volume->bpb.fat_type*5+4];
switch (volume->bpb.fat_type) {
case FAT_12:
if (fatValue > 0xFFF) {
@@ -1778,7 +1775,7 @@ s32 PFFAT_MakeRootDir(PF_VOLUME* volume)
s32 error;
rootCluster = volume->bpb.root_dir_cluster;
fatValue = fat_special_values[volume->bpb.fat_type].eoc2;
fatValue = fat_special_values[volume->bpb.fat_type*5+2];
switch (volume->bpb.fat_type) {
case FAT_12:
if (fatValue > 0xFFF) {
@@ -1940,7 +1937,7 @@ s32 PFFAT_TraceClustersChain(PFFAT_FFD* file, u32 startCluster, u32 size,
volume = file->p_vol;
if (size == -1 && file->last_cluster.num_last_cluster != 0) {
*targetCluster = file->last_cluster.num_last_cluster;
*nextClusterOutput = fat_special_values[volume->bpb.fat_type].eoc2;
*nextClusterOutput = fat_special_values[volume->bpb.fat_type*5+2];
return 0;
}
clusterSize = volume->bpb.bytes_per_sector *
@@ -1964,7 +1961,7 @@ s32 PFFAT_TraceClustersChain(PFFAT_FFD* file, u32 startCluster, u32 size,
}
savedCluster = startCluster;
if (nextCluster ==
fat_special_values[volume->bpb.fat_type].eoc2) {
fat_special_values[volume->bpb.fat_type*5+2]) {
file->last_cluster.num_last_cluster = startCluster;
file->last_cluster.max_chain_index = chainIndex - 1;
break;
@@ -2125,5 +2122,5 @@ s32 PFFAT_FinalizeFFD(PFFAT_FFD* file)
u32 PFFAT_GetValueOfEOC2(PF_VOLUME* volume)
{
return fat_special_values[volume->bpb.fat_type].eoc2;
return fat_special_values[volume->bpb.fat_type*5+2];
}

View File

@@ -1015,25 +1015,35 @@ void PFPATH_SetSearchPattern(pf_s8* p_buf_local, pf_u16* p_buf_unicode, PF_STR*
PFPATH_transformFromUnicodeToNormal(p_buf_local, p_buf_unicode);
}
pf_s8 pf_path_sig_byte0 = 1;
pf_s8 pf_path_sig_byte1 = 2;
pf_u32 PFPATH_CheckExtShortNameSignature(PF_STR* p_str) {
pf_u32 result = 0;
pf_s8 sig[2] = "\x01\x02";
pf_s8 sig[2];
sig[0] = pf_path_sig_byte0;
sig[1] = pf_path_sig_byte1;
if (PFSTR_StrNCmp(p_str, sig, 1, 0, 2) == 0) {
result = 1;
}
return result;
}
__declspec(section ".sdata2") pf_s8 pf_path_sig_c0 = 1;
__declspec(section ".sdata2") pf_s8 pf_path_sig_c1 = 2;
__declspec(export) const pf_u16 pf_path_sig_z0 = 0;
pf_u32 PFPATH_CheckExtShortName(PF_STR* p_str, pf_u32 target, pf_bool wildcard) {
pf_u32 result = 0;
pf_s16 i;
pf_s16 num;
pf_bool is_wildcard = PF_FALSE;
pf_s8 sig[2] = "\x01\x02";
pf_s8 sig[2];
pf_s8* p_c;
pf_u16* p_wc;
sig[0] = pf_path_sig_c0;
sig[1] = pf_path_sig_c1;
if (PFSTR_StrNCmp(p_str, sig, target, 0, 2) == 0 ||
(PFSTR_StrNCmp(p_str, (pf_s8*)"?", target, 0, 1) == 0 &&
(PFSTR_StrNCmp(p_str, (pf_s8*)"?", target, 1, 1) == 0 || PFSTR_StrNCmp(p_str, (pf_s8*)"*", target, 0, 1) == 0)) ||
@@ -1071,15 +1081,21 @@ pf_u32 PFPATH_CheckExtShortName(PF_STR* p_str, pf_u32 target, pf_bool wildcard)
return result;
}
__declspec(section ".sdata2") pf_s8 pf_path_idx_sig0 = 1;
__declspec(section ".sdata2") pf_s8 pf_path_idx_sig1 = 2;
__declspec(export) const pf_u16 pf_path_sig_z1 = 0;
pf_u32 PFPATH_GetExtShortNameIndex(PF_STR* p_str, pf_u32* p_index) {
pf_bool result = PF_FALSE;
pf_s16 i;
pf_s16 num;
pf_u32 index;
pf_s8 sig[2] = "\x01\x02";
pf_s8 sig[2];
pf_s8* p_c;
pf_u16* p_wc;
sig[0] = pf_path_idx_sig0;
sig[1] = pf_path_idx_sig1;
if (PFSTR_StrNCmp(p_str, sig, 1, 0, 2) == 0) {
index = 0;

View File

@@ -224,7 +224,8 @@ typedef struct PFVOL_SET {
PFVOL_SET pf_vol_set;
static s8 default_volume_label[12] = "NO NAME ";
static s8 default_volume_label[16] = "NO NAME ";
__declspec(section ".sdata2") u8 deleted_entry_mark[8] = {0xE5};
extern s32 PFDRV_mount(PFVOL_VOLUME* volume);
extern s32 PFDRV_unmount(PFVOL_VOLUME* volume, u32 mode);
extern s32 PFDRV_format(PFVOL_VOLUME* volume, const u8* format_options);
@@ -587,7 +588,7 @@ s32 PFVOL_p_rmvvol(PFVOL_VOLUME* volume) {
u32 logical_position;
u32 entry_position;
u32 processed;
u8 deleted[1] = {0xE5};
u8 deleted = deleted_entry_mark[0];
s32 error;
error = PFENT_GetRootDir(volume, &root_entry);
@@ -602,7 +603,7 @@ s32 PFVOL_p_rmvvol(PFVOL_VOLUME* volume) {
return error;
}
if (entry_position != 999999) {
error = PFSEC_WriteData(volume, deleted, entry.entry_sector, entry.entry_offset, 1, &processed, 0);
error = PFSEC_WriteData(volume, &deleted, entry.entry_sector, entry.entry_offset, 1, &processed, 0);
if (error != 0) {
return error;
}
@@ -1051,8 +1052,21 @@ static inline s32 initialize_volume_cache(PFVOL_VOLUME* volume, PFVOL_DRIVER* dr
}
static inline s32 attach_mount(PFVOL_VOLUME* volume, PFVOL_DRIVER* driver) {
s32 error = clear_mount(volume);
if (error != 0) { pf_vol_set.last_error = error; volume->last_error = error; return error; }
s32 error;
if ((volume->flags & 8) == 0) {
s32 result = PFVOL_DoMountVolume(volume);
if (result != 0) {
error = result;
goto done;
}
volume->fsi_flag &= ~7;
PFDRV_ClearUnmountRequested(volume);
pf_vol_set.num_mounted_volumes++;
}
PFDRV_ClearMountRequested(volume);
error = 0;
done:
if (error != 0) { pf_vol_set.last_error = error; volume->last_error = error; return 0; }
driver->stat |= 2;
return 0;
}
@@ -1105,13 +1119,7 @@ s32 PFVOL_attach(PFVOL_DRIVER* driver, s32 notify_command, void* callback_data)
pf_vol_set.num_attached_drives++;
if (PFDRV_IsInserted(volume) != 0) {
driver->stat |= 0x10;
error = clear_mount(volume);
if (error != 0) {
pf_vol_set.last_error = error;
volume->last_error = error;
return 0;
}
driver->stat |= 2;
attach_mount(volume, driver);
}
return 0;
}
@@ -1475,23 +1483,19 @@ s32 PFVOL_setcode(PFVOL_CHARCODE* code_set) {
return copy_codeset(code_set);
}
static inline u32 ContextStatus(const PFVOL_CONTEXT* context) {
return context->stat & 1;
}
s32 PFVOL_regctx(void) {
s32 context_id;
u32 context_index;
s32 free_context_index;
s32 context_id;
s32 error;
error = PFSYS_GetCurrentContextID(&context_id);
if (error != 0) { pf_vol_set.last_error = 26; return 26; }
free_context_index = 0;
for (context_index = 1; context_index < 4; context_index++) {
u32 stat;
stat = ContextStatus(&pf_vol_set.context[context_index - 1]);
if (stat != 0 && pf_vol_set.context[context_index - 1].context_id == context_id) { break; }
if (stat == 0 && free_context_index == 0) { free_context_index = context_index; }
if ((pf_vol_set.context[context_index - 1].stat & 1) != 0 &&
pf_vol_set.context[context_index - 1].context_id == context_id) { break; }
if ((pf_vol_set.context[context_index - 1].stat & 1) == 0 && free_context_index == 0) { free_context_index = context_index; }
}
if (context_index == 4) {
if (free_context_index != 0) {

View File

@@ -562,13 +562,11 @@ static inline u32 kbdChannelFlags(u32 channel) {
}
static void kbd_led_handler(BOOL success, void* callbackArg) {
const KBDLEDCallbackData* callback;
u32 index;
u32 err;
index = (u32)callbackArg;
callback = &kbdLCBuf[index];
kbdCmdBuf[index].device = 0;
if (callback->callbackAddress == (USBKBDCmdLEDCallback)(u32)kbdCmdBuf[index].device) {
if (kbdLCBuf[index].callbackAddress == (USBKBDCmdLEDCallback)(u32)kbdCmdBuf[index].device) {
return;
}
switch (success) {

View File

@@ -276,15 +276,14 @@ static inline f32 object_interval_distance(f32 interval) {
const f32 sensorIntervalConversion = 0.383864f;
static void reset_kpad(KPADInside* kpad) {
f32 sensorDistance;
f32 upperY;
f32 distanceValue;
f32 zero;
f32 upperY;
f32 sensorDistance;
f32 lowerY;
f32 one;
f32 negativeOne;
KPADDPDObject* object;
f32 calibratedDistance;
negativeOne = -1.0f;
one = 1.0f;
zero = 0.0f;
@@ -300,9 +299,8 @@ static void reset_kpad(KPADInside* kpad) {
kpad->value508 = negativeOne / kp_err_dist_speed;
kpad->value50C = kp_ah_circle_radius * kp_ah_circle_radius;
kpad->value514 = kp_err_dist_min;
calibratedDistance = kp_dist_vv1;
distanceValue = calibratedDistance / sensorDistance;
kpad->value510 = calibratedDistance;
distanceValue = kp_dist_vv1 / sensorDistance;
kpad->value510 = kp_dist_vv1;
kpad->status.release = 0;
kpad->status.trig = 0;
kpad->status.hold = 0;
@@ -856,33 +854,26 @@ static s8 select_1obj_continue(KPADInside* kpad) {
}
*matchedCandidate = *source;
{
f32 distance;
f32 normY;
f32 vertical;
f32 directionY;
f32 axisX = kpad->horizonTangent.x;
f32 normX = kpad->horizonAxis.x;
f32 axisY = kpad->horizonTangent.y;
f32 normY = kpad->horizonAxis.y;
f32 distance = kpad->dpdObjectDistance;
f32 horizontal = axisX * normX;
f32 vertical = axisY * normX;
f32 offsetX;
f32 axisY;
f32 horizontal;
f32 axisX;
f32 directionX;
f32 normX;
f32 directionY;
f32 offsetY;
f32 tangentY;
f32 tangentX;
axisX = kpad->horizonTangent.x;
normX = kpad->horizonAxis.x;
axisY = kpad->horizonTangent.y;
normY = kpad->horizonAxis.y;
distance = kpad->dpdObjectDistance;
horizontal = axisX * normX;
vertical = axisY * normX;
tangentY = axisY * normY;
tangentX = axisX * normY;
directionX = horizontal + tangentY;
directionY = vertical - tangentX;
offsetX = distance * directionX;
offsetX = directionX * distance;
kpad->dpdObjectDirection.x = directionX;
offsetY = distance * directionY;
offsetY = directionY * distance;
kpad->dpdObjectDirection.y = directionY;
if (matchedCandidate == kpad->dpdState.candidates) {
kpad->dpdState.candidates[1].x = matchedCandidate->x + offsetX;

View File

@@ -202,40 +202,33 @@ static inline NWC24Err WriteMBNoReplyField(NWC24MsgObjPrivate* msg) {
return err;
}
typedef struct {
u32 flags;
char* buffer;
} MBFieldWork;
static inline NWC24Err WriteMBRegDateField(NWC24MsgObjPrivate* msg) {
MBFieldWork field;
static inline NWC24Err WriteMBRegDateField(NWC24MsgObjPrivate* msg, u32 flags) {
NWC24Err err;
s32 length;
field.flags = msg->msgBoardFlags.raw & 0xFFFF;
if (!field.flags)
char* buffer;
if (!flags)
return NWC24_OK;
field.buffer = NWC24WorkP->stringWork;
Mail_memset(field.buffer, 0, 1024);
Mail_sprintf(field.buffer, "X-Wii-MB-RegDate: %04X\r\n", field.flags);
length = STD_strnlen(field.buffer, 1024);
err = NWC24FWrite(field.buffer, length, m_pFile);
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_sprintf(buffer, "X-Wii-MB-RegDate: %04X\r\n", flags);
length = STD_strnlen(buffer, 1024);
err = NWC24FWrite(buffer, length, m_pFile);
if (err == NWC24_OK)
msg->length += length;
return err;
}
static inline NWC24Err WriteMBDelayField(NWC24MsgObjPrivate* msg) {
MBFieldWork field;
static inline NWC24Err WriteMBDelayField(NWC24MsgObjPrivate* msg, u32 flags) {
NWC24Err err;
s32 length;
field.flags = msg->msgBoardFlags.raw & 0xFF0000;
if (!field.flags)
char* buffer;
if (!flags)
return NWC24_OK;
field.buffer = NWC24WorkP->stringWork;
Mail_memset(field.buffer, 0, 1024);
Mail_sprintf(field.buffer, "X-Wii-MB-Delay: %02X\r\n", field.flags >> 16);
length = STD_strnlen(field.buffer, 1024);
err = NWC24FWrite(field.buffer, length, m_pFile);
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_sprintf(buffer, "X-Wii-MB-Delay: %02X\r\n", flags >> 16);
length = STD_strnlen(buffer, 1024);
err = NWC24FWrite(buffer, length, m_pFile);
if (err == NWC24_OK)
msg->length += length;
return err;
@@ -313,8 +306,8 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
CHECK_WRITE(WriteIconNewField(msg));
if (msg->msgBoardFlags.raw != 0) {
CHECK_WRITE(WriteMBNoReplyField(msg));
CHECK_WRITE(WriteMBRegDateField(msg));
CHECK_WRITE(WriteMBDelayField(msg));
{ u16 dateFlags = msg->msgBoardFlags.raw; CHECK_WRITE(WriteMBRegDateField(msg, dateFlags)); }
CHECK_WRITE(WriteMBDelayField(msg, msg->msgBoardFlags.raw & 0xFF0000));
}
}
CHECK_WRITE(WriteExtraFields(msg));

View File

@@ -19,7 +19,7 @@ static inline NWC24Err SelectMBox(const NWC24MsgObjPrivate* msg, NWC24MBoxType*
}
NWC24Err NWC24ReadMsgField(const NWC24MsgObj* msg, char* fieldName, u8* output, u32 capacity) {
NWC24MsgObjPrivate* privateMsg = (NWC24MsgObjPrivate*)msg;
const NWC24MsgObjPrivate* privateMsg = (const NWC24MsgObjPrivate*)msg;
NWC24File file;
NWC24FileStream stream;
char* field;
@@ -268,7 +268,7 @@ NWC24Err NWC24ReadMsgMBOptOutFlag(const NWC24MsgObj* msg, BOOL* optOut, u32* app
}
NWC24Err NWC24ReadMsgFromAddr(const NWC24MsgObj* msg, char* address, u32 capacity) {
NWC24MsgObjPrivate* privateMsg = (NWC24MsgObjPrivate*)msg;
const NWC24MsgObjPrivate* privateMsg = (const NWC24MsgObjPrivate*)msg;
NWC24MBoxType type;
NWC24File file;
NWC24FileStream stream;
@@ -312,7 +312,7 @@ NWC24Err NWC24ReadMsgFromAddr(const NWC24MsgObj* msg, char* address, u32 capacit
}
NWC24Err NWC24ReadMsgSubject(const NWC24MsgObj* msg, char* subject, u32 capacity) {
NWC24MsgObjPrivate* privateMsg = (NWC24MsgObjPrivate*)msg;
const NWC24MsgObjPrivate* privateMsg = (const NWC24MsgObjPrivate*)msg;
NWC24MBoxType type;
NWC24File file;
u32 length;
@@ -386,14 +386,14 @@ NWC24Err NWC24ReadMsgTextEx(const NWC24MsgObj* msg, char* text, u32 capacity, ch
}
static NWC24Err ReadMsgTextInternal(const NWC24MsgObj* msg, char* text, u32 capacity, char* charset, u32 charsetCapacity, NWC24Encoding* encoding) {
u32 length;
const NWC24MsgObjPrivate* privateMsg = (const NWC24MsgObjPrivate*)msg;
NWC24MBoxType type;
NWC24File file;
NWC24Err result, closeResult;
NWC24Err overflow = NWC24_OK;
char* buffer;
u32 length;
u32 decodedSize;
NWC24MsgObjPrivate* privateMsg = (NWC24MsgObjPrivate*)msg;
char* buffer;
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool())
return NWC24_ERR_LIB_NOT_OPENED;
if (!(privateMsg->type & 0x200))
@@ -415,8 +415,8 @@ static NWC24Err ReadMsgTextInternal(const NWC24MsgObj* msg, char* text, u32 capa
if (length == 0)
return NWC24_ERR_NULL;
if (length > capacity - 1) {
length = capacity - 1;
overflow = NWC24_ERR_OVERFLOW;
length = capacity - 1;
}
result = NWC24iMBoxOpenStoredMsg(type, privateMsg->msgId, &file);
switch (result) {
@@ -452,16 +452,13 @@ static NWC24Err ReadMsgTextInternal(const NWC24MsgObj* msg, char* text, u32 capa
result = NWC24FRead(text, length, &file);
text[length] = 0;
break;
case 2: {
NWC24Err decodeResult;
case 2:
decodedSize = 0;
decodeResult = ReadBase64Data(&file, &privateMsg->text, (u8*)text, length, &decodedSize);
if (decodeResult == NWC24_OK && decodedSize != privateMsg->textSize)
decodeResult = NWC24_ERR_FORMAT;
result = decodeResult;
result = ReadBase64Data(&file, &privateMsg->text, (u8*)text, length, &decodedSize);
if (result == NWC24_OK && decodedSize != privateMsg->textSize)
result = NWC24_ERR_FORMAT;
text[length] = 0;
break;
}
case 3:
result = ReadQPText(privateMsg, &file, text, length);
break;
@@ -481,7 +478,7 @@ close:
}
NWC24Err NWC24ReadMsgAttached(const NWC24MsgObj* msg, u32 index, u8* output, u32 capacity) {
NWC24MsgObjPrivate* privateMsg = (NWC24MsgObjPrivate*)msg;
const NWC24MsgObjPrivate* privateMsg = (const NWC24MsgObjPrivate*)msg;
NWC24File file;
NWC24MBoxType type;
u32 decodedSize;
@@ -510,8 +507,11 @@ NWC24Err NWC24ReadMsgAttached(const NWC24MsgObj* msg, u32 index, u8* output, u32
}
decodedSize = 0;
result = ReadBase64Data(&file, &privateMsg->attached[index], output, capacity, &decodedSize);
if (result == NWC24_OK) {
if (decodedSize != ((const NWC24MsgObjPrivate*)msg)->attachedSize[index]) result = NWC24_ERR_FORMAT;
switch (result) {
case NWC24_OK:
if (decodedSize != privateMsg->attachedSize[index]) { result = NWC24_ERR_FORMAT; }
break;
default: break;
}
closeResult = NWC24iMBoxCloseMsg(&file);
if (result == NWC24_OK)

View File

@@ -743,16 +743,15 @@ NWC24Err NWC24iSetMsgSubjectQP(NWC24MsgObj* msg, const u16* subject, u32 subject
u32 workSize, NWC24Charset charset, char* charsetName) {
u32 workHalf;
u32 sourceOffset;
u32 charsetLength;
u32 secondSize;
u8* second;
u32 subjectLength;
u32 lineLength;
u32 secondSize;
u32 outputLength;
u32 total;
u32 combinedLength;
u32 i;
u32 outputLength;
u32 firstCharsetLength;
u32 charsetLength;
NWC24Err result;
secondSize = workSize - (workSize >> 1);
@@ -771,8 +770,8 @@ NWC24Err NWC24iSetMsgSubjectQP(NWC24MsgObj* msg, const u16* subject, u32 subject
work[i] = ' ';
}
}
firstCharsetLength = strlen(charsetName);
NWC24iDetectBreakPoint(&lineLength, charset, work, subjectLength, (0x38 - firstCharsetLength) / 3);
charsetLength = strlen(charsetName);
NWC24iDetectBreakPoint(&lineLength, charset, work, subjectLength, (0x38 - charsetLength) / 3);
result = NWC24EncodeWord(second, secondSize, &outputLength, charsetName, 0x40, 'Q', work, lineLength);
switch (result) {
default:

View File

@@ -1,4 +1,3 @@
#define BS2_MACH_VOLATILE_DVD_STATE
#define BS2_MACH_FIVE_ARG_READ
#include "BS2/BS2.h"
#include "BS2/BS2BringUp.h"
@@ -65,7 +64,7 @@ volatile int CacheFailed = 0;
volatile int RegionValid = 0;
volatile int NandPending = 0;
vu32 CancelNand = 0;
vu32 LowReadResult = 0;
u32 LowReadResult = 0;
u32 CacheCommandComplete = 0;
u32 AudioBufferUnconfigured = 0;
u64 ResetTime = 0;
@@ -578,7 +577,7 @@ void BS2StartGame() {
u32 (*entry)(void);
StartingGame = TRUE;
while (CoverBlock.state != DVD_STATE_IDLE) {
while (DVDGetCommandBlockStatus(&CoverBlock) != DVD_STATE_IDLE) {
}
BS2Report("BS2StartGame(1)\n");
@@ -678,6 +677,8 @@ void BS2StartGame() {
LowReadResult = 0;
DVDLowReadDiskID(&DiskID, (DVDLowCallback)callback);
while (LowReadResult == 0) {
BOOL enabled = OSDisableInterrupts();
OSRestoreInterrupts(enabled);
}
status = LowReadResult;
@@ -692,6 +693,8 @@ void BS2StartGame() {
LowReadResult = 0;
DVDLowRequestError((DVDLowCallback)callback);
while (LowReadResult == 0) {
BOOL enabled = OSDisableInterrupts();
OSRestoreInterrupts(enabled);
}
driveError = DVDLowGetImmBufferReg() & 0xFF000000;
if (driveError == 0x01000000 || (driveError = DVDLowGetImmBufferReg() & 0xFF000000) == 0x03000000) {
@@ -726,6 +729,8 @@ disk_done:
(DVDLowCallback)callback);
}
while (LowReadResult == 0) {
BOOL enabled = OSDisableInterrupts();
OSRestoreInterrupts(enabled);
}
status = LowReadResult;
@@ -743,6 +748,8 @@ disk_done:
LowReadResult = 0;
DVDLowRequestError((DVDLowCallback)callback);
while (LowReadResult == 0) {
BOOL enabled = OSDisableInterrupts();
OSRestoreInterrupts(enabled);
}
driveError = DVDLowGetImmBufferReg() & 0xFF000000;
if (driveError == 0x01000000 || (driveError = DVDLowGetImmBufferReg() & 0xFF000000) == 0x03000000) {

View File

@@ -9,10 +9,14 @@
#include <string.h>
typedef struct UpdateThreadData {
OSThread thread;
u8 stack[4096];
} UpdateThreadData;
static u32 Flags0[BS2_UPDATE_ENTRY_COUNT] = {0};
static u32 Flags1[BS2_UPDATE_ENTRY_COUNT] = {0};
static OSThread Thread = {0};
static u8 ThreadStack[4096] = {0};
static UpdateThreadData Thread = {0};
static BS2UpdateHeader UpdateHeader0 ALIGN32 = {0};
static BS2UpdateHeader UpdateHeader1 ALIGN32 = {0};
@@ -35,7 +39,7 @@ static u32 UpdateImportResult = 0;
u32 StartUpdate = 0;
u32 CancelUpdate = 0;
static u32 UpdateProgress = 0;
static volatile s32 rc = 0;
static s32 rc = 0;
static u64 VersionIOS = 0;
static u32 VersionMEM2 = 0;
static u32 VersionES = 0;
@@ -72,9 +76,9 @@ void BS2UpdateInit(void* allocator) {
memset(EntriesToImport, 0, 0x40000);
memset(Flags1, 0, sizeof(Flags1));
BS2Report("Create update thread\n");
OSCreateThread(&Thread, UpdateThread, NULL, ThreadStack + sizeof(ThreadStack),
sizeof(ThreadStack), 31, 1);
OSResumeThread(&Thread);
OSCreateThread(&Thread.thread, UpdateThread, NULL, Thread.stack + sizeof(Thread.stack),
sizeof(Thread.stack), 31, 1);
OSResumeThread(&Thread.thread);
}
static void* UpdateThread(void* argument) {

View File

@@ -249,14 +249,13 @@ void LayoutByNW4R::create(MEMAllocator* allocator) {
animationCount = paneInfo.animationCount;
u16 animationIndex = 0;
while (animationIndex < animationCount) {
const AnimationFile* const& animation = paneInfo.animations[animationIndex];
void* resource = mpMultiArcResourceAccessor->GetResource(0, animation->name);
void* resource = mpMultiArcResourceAccessor->GetResource(0, paneInfo.animations[animationIndex]->name);
AnimTransformPane* transform = static_cast<AnimTransformPane*>(
getLayout()->CreateAnimTransform(resource, mpMultiArcResourceAccessor));
if (forceName != NULL) {
pane->forceAddAnimation(allocator, animation->id, transform, forceName, false, true);
pane->forceAddAnimation(allocator, paneInfo.animations[animationIndex]->id, transform, forceName, false, true);
} else {
pane->addAnimation(allocator, animation->id, transform, false, true);
pane->addAnimation(allocator, paneInfo.animations[animationIndex]->id, transform, false, true);
}
++animationIndex;
}

View File

@@ -1607,12 +1607,8 @@ namespace ipl {
void Address::set_err_msg(wchar_t* errMsg, u32 errMsgLen, NWC24Err err) {
memset(errMsg, 0, errMsgLen * sizeof(wchar_t));
union MessageValue {
const wchar_t* text;
u32 id;
} message;
message.text = System::getMessage(MESG_ERROR_CODE);
wcsncat(errMsg, message.text, errMsgLen - wcslen(errMsg));
wcsncat(errMsg, System::getMessage(MESG_ERROR_CODE), errMsgLen - wcslen(errMsg));
u32 msgId = MESG_ERROR_CODE;
wchar_t errCode[32];
memset(errCode, 0, sizeof(errCode));
@@ -1621,22 +1617,17 @@ namespace ipl {
switch (err) {
case NWC24_ERR_NETWORK: {
message.id = MESG_ERROR_NWC24_NETWORK;
msgId = MESG_ERROR_NWC24_NETWORK;
break;
}
case NWC24_ERR_SERVER:
case NWC24_ERR_FULL: {
message.id = MESG_ERROR_NWC24_SERVER;
break;
}
default: {
message.id = reinterpret_cast<u32>(message.text);
msgId = MESG_ERROR_NWC24_SERVER;
break;
}
}
message.text = System::getMessage(message.id);
wcsncat(errMsg, message.text, errMsgLen - wcslen(errMsg));
wcsncat(errMsg, System::getMessage(msgId), errMsgLen - wcslen(errMsg));
}
void Address::entry_friend() {

View File

@@ -1704,9 +1704,6 @@ void ipl::scene::AddressEdit::stt_wait_btn_fadein() {
}
void ipl::scene::AddressEdit::stt_wait_btn_fadeout() {
nw4r::lyt::Pane* label;
const wchar_t* message;
ipl::utility::FrameController* animator;
bool friendFinished;
if (mpFriendCache->getInfo(mSelectedFriend).attr.status == 2) {
friendFinished = !mpCodeLayout->getAnim(0x15)->isPlaying();
@@ -1718,11 +1715,11 @@ void ipl::scene::AddressEdit::stt_wait_btn_fadeout() {
friendFinished &= !mpCodeLayout->getAnim(0x17)->isPlaying();
if (friendFinished) {
label = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_card_msg_00", true);
message = ipl::System::getMessage(0x30);
nw4r::lyt::Pane* label = mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_card_msg_00", true);
const wchar_t* message = ipl::System::getMessage(0x30);
set_textbox(label, message);
ipl::System::getDialog()->callS2Btn2(0x142, 0x141, true);
animator = mpCodeLayout->getAnim(0x1c);
ipl::layout::Animator* animator = mpCodeLayout->getAnim(0x1c);
animator->initFrame();
animator->restart();
mState = 4;
@@ -2125,8 +2122,6 @@ state0:
goto state0Common;
case 3:
goto state0Button3;
case 4:
goto done;
default:
goto done;
}
@@ -2158,14 +2153,11 @@ state0Button3: {
nw4r::lyt::Pane* pane = layout->getNW4RLyt()->GetRootPane()->FindPaneByName(paneName, true);
ipl::math::VEC3 position(0.0f, 0.0f, 0.0f);
PSMTXMultVec(pane->GetGlobalMtx(), reinterpret_cast<Vec*>(&position), reinterpret_cast<Vec*>(&position));
f32 xOffset;
f32 scale;
f32 height;
xOffset = 15.0f;
height = 50.0f;
scale = 0.5f;
f32 xOffset = 15.0f;
f32 height = 50.0f;
f32 scale = 0.5f;
position.x = position.x + xOffset;
position.y = position.y + height * scale;
position.y = position.y + scale * height;
(mpBalloon)
->setPos(position, false, 1);
(mpBalloon)->fadein();
@@ -2202,14 +2194,11 @@ state22Button3:
nw4r::lyt::Pane* pane = layout->getNW4RLyt()->GetRootPane()->FindPaneByName(paneName, true);
ipl::math::VEC3 position(0.0f, 0.0f, 0.0f);
PSMTXMultVec(pane->GetGlobalMtx(), reinterpret_cast<Vec*>(&position), reinterpret_cast<Vec*>(&position));
f32 xOffset;
f32 scale;
f32 height;
xOffset = 15.0f;
height = 50.0f;
scale = 0.5f;
f32 xOffset = 15.0f;
f32 height = 50.0f;
f32 scale = 0.5f;
position.x = position.x + xOffset;
position.y = position.y + height * scale;
position.y = position.y + scale * height;
(mpBalloon)
->setPos(position, false, 1);
(mpBalloon)->fadein();
@@ -2258,8 +2247,6 @@ void ipl::scene::AddressEdit::start_left_event(const char* paneName) {
}
break;
}
case 4:
break;
default:
break;
}

View File

@@ -1,4 +1,3 @@
#define IPL_FOCUS_OBJECT_CPP
#include "scene/board/iplFocusObject.h"
#include "scene/parentalDialog/iplParentalDialog.h"
@@ -12,28 +11,6 @@
#include <revolution/cx.h>
#include <revolution/enc.h>
extern char scPaneName_B_Stop[];
namespace ipl {
namespace math {
static inline VEC3 addWeightedVectors(const VEC3& start, const VEC3& end) {
VEC3 sum;
nw4r::math::VEC3Add(&sum, &start, &end);
return sum;
}
static inline void normalizeVector(nw4r::math::VEC3* result, const VEC3& sum, f32 frames) {
nw4r::math::VEC3Scale(result, &sum, 1.0f / frames);
}
template <>
VEC3 LinearIntp<VEC3>::get() const {
nw4r::math::VEC3 result;
VEC3 sum = addWeightedVectors(mStart * (mMaxFrame - mFrame), mEnd * getCurrentFrame());
normalizeVector(&result, sum, getMaxFrame());
return result;
}
}
}
namespace ipl {
namespace scene {
// clang-format off
@@ -360,13 +337,6 @@ namespace ipl {
}
}
}
namespace math {
inline VEC3 VEC3::operator*(f32 val) const {
return VEC3(x * val, y * val, z * val);
}
}
namespace scene {
void focus_object::stt_normal() {
Button* button = get_button();
@@ -2121,7 +2091,7 @@ namespace ipl {
if (event == ::gui::EventHandler::ON_TRIG) {
if (con->downTrg(controller::BTN_INTERACT)) {
if (strcmp(paneName, scPaneName_B_Stop) == 0) {
if (strcmp(paneName, "B_Stop") == 0) {
if (mpInstance->mState == focus_object::STATE_NORMAL) {
focus_object::get_button()->animation(Button::IDANIM_OPTOUT_SELECT);
@@ -2142,24 +2112,3 @@ namespace ipl {
}
} // namespace scene
} // namespace ipl
char scPaneName_B_Stop[] = "B_Stop";
BOOL ipl::scene::scroller::calc(bool canScroll) {
BOOL result = FALSE;
if (canScroll) {
if (mBScroller.calc()) {
result = TRUE;
}
}
mScroller.calc();
f32 movable = mScroller.movable_pos(mBScroller.getSpeed());
mScroller.addScroll(movable);
mBScroller.addSoundFreq(movable);
return result;
}

View File

@@ -328,7 +328,7 @@ namespace ipl {
return isSceneCreated();
}
void SDButton::setEventHandler(::gui::EventHandler* event) {
void SDButton::setEventHandler(::gui::EventHandler* event, ::gui::EventHandler* optOutEvent) {
mpGui->setEventHandler(event);
}

View File

@@ -335,7 +335,7 @@ namespace ipl {
return true;
}
bool SDChannelSelect::enqueueChannelNotice(u64 titleId, u32 value) {
bool SDChannelSelect::enqueueChannelNotice(u32 controller, u32 page, u32 index, u32 value) {
if (mCurrentSDState != 6) {
return false;
}
@@ -344,7 +344,7 @@ namespace ipl {
command.type = 10;
command.arguments.values[0] = value;
command.arguments.values[1] = (u32)&mFirstTitleCount;
command.titleId = titleId;
command.titleId = ((u64)page << 32) | index;
mCommandQueue.push(command);
return true;
}
@@ -363,7 +363,7 @@ namespace ipl {
return true;
}
bool SDChannelSelect::enqueueStateNotice(u64 titleId, u32 state) {
bool SDChannelSelect::enqueueStateNotice(u32 controller, u32 page, u32 index, u32 state) {
if (mCurrentSDState != 6) {
return false;
}
@@ -372,7 +372,7 @@ namespace ipl {
command.type = 7;
command.arguments.values[0] = state;
command.arguments.values[1] = 0;
command.titleId = titleId;
command.titleId = ((u64)page << 32) | index;
mCommandQueue.push(command);
return true;
}

View File

@@ -282,7 +282,7 @@ FaderSceneCommand SDChannelTitle::calcFadein() {
if (!mpFade->isPlaying()) {
iplSDChannelTitle_playBannerIntro(this);
SDButton* button = static_cast<SDButton*>(System::getScene(0x24));
button->setEventHandler(mpButtonEventHandler);
button->setEventHandler(mpButtonEventHandler, NULL);
button->animation(13);
button->animation(14);
mState = 1;
@@ -344,7 +344,7 @@ void SDChannelTitle::initCalcFadeout() {
button->animation(15);
button->animation(16);
}
button->setEventHandler(NULL);
button->setEventHandler(NULL, NULL);
}
FaderSceneCommand SDChannelTitle::calcFadeout() {
@@ -736,7 +736,8 @@ extern "C" void iplSDChannelTitle_startCopyProgress(SDChannelTitle* scene) {
if (channel->mStateFlags == 3) {
scene->mState = 26;
scene->mErrorMessage = 0xaf;
} else if (scene->mpChannelSelect->enqueueChannelNotice(scene->mTitleId, reinterpret_cast<u32>(&scene->mTitleRange))) {
} else if (scene->mpChannelSelect->enqueueChannelNotice(0, static_cast<u32>(scene->mTitleId >> 32),
static_cast<u32>(scene->mTitleId), reinterpret_cast<u32>(&scene->mTitleRange))) {
scene->mState = 20;
} else {
scene->mState = 26;
@@ -825,7 +826,8 @@ extern "C" void iplSDChannelTitle_updateCopyStart(SDChannelTitle* scene) {
ESTitleId temporaryTitle = SCGetTmpTitleID();
if (temporaryTitle && scene->mTitleId != temporaryTitle) {
if (System::isReceiveScheduleStopped()) {
if (scene->mpChannelSelect->enqueueStateNotice(temporaryTitle, 1)) {
if (scene->mpChannelSelect->enqueueStateNotice(0, static_cast<u32>(temporaryTitle >> 32),
static_cast<u32>(temporaryTitle), 1)) {
scene->mState = 16;
} else {
scene->mState = 26;

View File

@@ -763,7 +763,7 @@ unlock_driver:
int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet* previousRecords,
u32* changedIndex) {
u32 previousIndex;
u32 currentIndex;
u32 currentIndex = 0;
int found = 0;
int result = 0;
u32 ssidLength;
@@ -774,7 +774,6 @@ int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet*
AtermApRecord* previousRecord = previousRecords->entries;
currentIndex = 0;
for (; currentIndex < currentRecords->count; currentIndex++) {
AtermSsidBuffer ssidName;
ssidName.clear.word0 = 0;
@@ -817,6 +816,8 @@ int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet*
int currentHasAoss;
int previousHasAoss;
previousHasAoss = 0;
currentHasAoss = 0;
aossSsidName.clear.word0 = 0;
aossSsidName.clear.word1 = 0;
aossSsidName.clear.word2 = 0;
@@ -826,8 +827,6 @@ int ATERMFindChangedApRecord(AtermApRecordSet* currentRecords, AtermApRecordSet*
aossSsidName.clear.word6 = 0;
aossSsidName.clear.word7 = 0;
aossSsidName.clear.finalWord = 0;
currentHasAoss = 0;
previousHasAoss = 0;
currentRecord = currentRecords->entries;
previousRecord = previousRecords->entries;
@@ -1871,13 +1870,13 @@ int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 ke
union { u64 value; u8 bytes[8]; } counter;
u32 initialValue[2];
u8* outputBlock;
s32 blockIndex;
s32 blockOffset;
u8* destinationBytes;
const u8* sourceBytes;
s32 pass;
s32 blockCount;
u32 rounds;
s32 blockOffset;
s32 blockCount;
s32 pass;
s32 blockIndex;
int result = 1;
initialValue[1] = 0xA6A6A6A6;
@@ -1896,7 +1895,7 @@ int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 ke
memcpy(destinationBytes + 8, sourceBytes, length);
memcpy(block.bytes, initialValue, sizeof(initialValue));
for (pass = 0; pass < 6; pass++) {
for (blockIndex = 1, blockOffset = 8; blockIndex <= blockCount; blockIndex++, blockOffset += 8) {
for (blockOffset = 8, blockIndex = 1; blockIndex <= blockCount; blockIndex++, blockOffset += 8) {
u64 passBase = (u64)(s64)blockCount * (u64)(s64)pass;
u8* stateBytes = block.bytes;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,69 +0,0 @@
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/fa/api/FAAttach] pool: IDENTICAL
[libs/RVL_SDK/src/fa/api/FAAttach] objdiff: code None/500 data 240/240 functions 0/1 fuzzy 99.3600 linked code 0
[libs/RVL_SDK/src/fa/api/FAAttach] instruction-exact functions: 0/1
[libs/RVL_SDK/src/fa/api/FAAttach] section .bss size 208 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .data size 24 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .text size 500 match 99.36
[libs/RVL_SDK/src/fa/api/FAAttach] below 100: FAAttach 99.36
[libs/RVL_SDK/src/fa/api/FAAttach] baseline: code None/500 data 240 functions 0 fuzzy 99.3600
[src/bannerSound/AxAdpcmPlayer] pool: IDENTICAL
[src/bannerSound/AxAdpcmPlayer] objdiff: code 3088/3088 data 6476/6476 functions 13/13 fuzzy 100.0000 linked code 3088
[src/bannerSound/AxAdpcmPlayer] instruction-exact functions: 12/13
[src/bannerSound/AxAdpcmPlayer] section .bss size 6400 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .ctors size 4 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .data size 32 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sbss size 16 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sdata size 8 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sdata2 size 16 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .text size 3088 match 100.0
[src/bannerSound/AxAdpcmPlayer] baseline: code 3088/3088 data 6476 functions 13 fuzzy 100.0000
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 96/180 functions 1/7 fuzzy 98.6539 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .data size 40 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.65385
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.96712
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 96 functions 1 fuzzy 98.6539
[src/scene/board/iplFocusObject] pool: IDENTICAL
[src/scene/board/iplFocusObject] objdiff: code 20332/20332 data 2576/2576 functions 89/89 fuzzy 100.0000 linked code 0
[src/scene/board/iplFocusObject] instruction-exact functions: 89/89
[src/scene/board/iplFocusObject] section .data size 2168 match 100.0
[src/scene/board/iplFocusObject] section .rodata size 176 match 100.0
[src/scene/board/iplFocusObject] section .sdata size 176 match 100.0
[src/scene/board/iplFocusObject] section .sdata2 size 56 match 100.0
[src/scene/board/iplFocusObject] section .text size 20332 match 100.0
[src/scene/board/iplFocusObject] baseline: code 19772/20332 data 2576 functions 88 fuzzy 99.6471
[src/system/iplKeyboard] pool: IDENTICAL
[src/system/iplKeyboard] objdiff: code 4752/6024 data 1184/1184 functions 31/32 fuzzy 98.7351 linked code 0
[src/system/iplKeyboard] instruction-exact functions: 31/32
[src/system/iplKeyboard] section .data size 1168 match 100.0
[src/system/iplKeyboard] section .sdata size 8 match 100.0
[src/system/iplKeyboard] section .sdata2 size 8 match 100.0
[src/system/iplKeyboard] section .text size 6024 match 98.73506
[src/system/iplKeyboard] below 100: create__Q33ipl8keyboard7ManagerFPQ33ipl4nand4FilePQ23EGG4Heap 94.00944
[src/system/iplKeyboard] baseline: code 4752/6024 data 1184 functions 31 fuzzy 98.7351
[libs/RVL_SDK/src/fa/pf_dir] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_dir] objdiff: code 18976/18976 data 40/40 functions 38/38 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/fa/pf_dir] instruction-exact functions: 38/38
[libs/RVL_SDK/src/fa/pf_dir] section .sdata size 32 match 100.0
[libs/RVL_SDK/src/fa/pf_dir] section .sdata2 size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_dir] section .text size 18976 match 100.0
[libs/RVL_SDK/src/fa/pf_dir] baseline: code 11704/18976 data 40 functions 35 fuzzy 99.5432
regressions vs baseline: 0
global matched_code_percent: 88.93407 -> 89.19556
global fuzzy_match_percent: 99.50078 -> 99.50607
global complete_code_percent: 65.19670 -> 65.19670
global matched_data_percent: 99.07044 -> 99.07044
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS

View File

@@ -1,126 +0,0 @@
# Fuzzy lane continuation
Baseline: `711ee737f98c1febb2e3d9580bec9be423fd3b19`. Four new exact functions; AxAdpcmPlayer was already matched and linked after origin/main #774.
| Unit | Instruction-exact before → after | Objdiff functions before → after | Code bytes before → after / total | Data bytes before → after / total |
| --- | --- | --- | --- | --- |
| `libs/RVL_SDK/src/fa/api/FAAttach` | 0/1 → 0/1 | 0/1 → 0/1 | 0 → 0 / 500 | 240 → 240 / 240 |
| `src/bannerSound/AxAdpcmPlayer` | 12/13 → 12/13 | 13/13 → 13/13 | 3088 → 3088 / 3088 | 6476 → 6476 / 6476 |
| `libs/RVLMiddleware/eZiText/src/clib/zkokeyp` | 1/7 → 1/7 | 1/7 → 1/7 | 332 → 332 / 5200 | 96 → 96 / 180 |
| `src/scene/board/iplFocusObject` | 88/89 → 89/89 | 88/89 → 89/89 | 19772 → 20332 / 20332 | 2576 → 2576 / 2576 |
| `src/system/iplKeyboard` | 31/32 → 31/32 | 31/32 → 31/32 | 4752 → 4752 / 6024 | 1184 → 1184 / 1184 |
| `libs/RVL_SDK/src/fa/pf_dir` | 35/38 → 38/38 | 35/38 → 38/38 | 11704 → 18976 / 18976 | 40 → 40 / 40 |
Instruction-exact counts above reproduce the gate. Ax reports 12/13 there despite objdiff 13/13; the existing CR1 branch-disassembly normalization issue is independently proven: `checkFile__19AxAdpcmSimplePlayerFPvUl` has all 372 encoded function bytes identical, while odiff displays two different CR1 branch targets. It contributes no new gain.
## Remaining functions
- `FAAttach` 99.36% — 125/125 instructions; ten index/scaled-index/table-base register differences. 3 distinct compiled source forms; attempts lines 3166–3168.
- `Zi8_8148302C` 99.49152% — 59/59 instructions; six work-pointer/value register differences. 4 distinct compiled source forms; attempts lines 3173–3176.
- `Zi8_81483264` 98.902435% — 41/41 instructions; eight metadata/index register differences. 9 distinct compiled source forms; attempts lines 3180–3190.
- `Zi8_81483308` 99.13793% — 58/58 instructions; nine count-pointer/index register differences. 7 distinct compiled source forms; attempts lines 3194–3200.
- `Zi8_814833F0` 99.04256% — 47/47 instructions; eight key/index register differences. 5 distinct compiled source forms; attempts lines 3205–3209.
- `Zi8_814834AC` 99.3586% — 344/343 instructions; extra narrowing in initialized-byte chain, operand scheduling and register differences. 21 distinct compiled source forms; attempts lines 3213–3235.
- `Zi8GetKOcandidates` 97.96712% — 673/669 instructions; extra zero load, helper-return narrowing, final postincrement copy, addressing/condition scheduling. 14 distinct compiled source forms; attempts lines 3241–3257.
- `create__Q33ipl8keyboard7ManagerFPQ33ipl4nand4FilePQ23EGG4Heap` 94.00944% — 318/318 instructions; allocation-result moves across null constructors, dictionary index scheduling and MemoSetting stack-temporary order. 24 distinct compiled source forms; attempts lines 3293–3318.
## Matched functions and source review
`focus_object::cmn_calc`: added a real VEC3 sum and result temporary, with reciprocal evaluation inside normalization; frame 0x60 → 0x70, 140/140 instructions, zero differences.
`PFDIR_p_move`: corrected the six-argument entry-search prototype, used the matching table entry as the current-directory base, moved the actual cluster read inside that helper, separated LFN traversal lifetimes; 631/631 instructions, zero differences.
`PFDIR_p_rename`: shared the typed filename cursor and separated the file, retreat and remaining-LFN counters; corrected error-return branches and count mask; 625/625 instructions, zero differences.
`PFDIR_p_mkdir`: ordinary 11-byte short-name loop and full real scalar declaration order, preserving addressable local order; 562/562 instructions, zero differences.
## Data proof
FAAttach 240/240, Ax 6476/6476, focus 2576/2576, keyboard 1184/1184, PF 40/40 already have all data matched. No config/symbol rename or extent edit was justified.
zkokeyp .data 40-byte ten-entry switch table is byte-identical and each relocation names the exact Zi8_81483118 at the same offset/addend. extab 56 bytes match. extabindex 84 bytes differ only at length words offset64 (1376 versus1372 for Zi8_814834AC) and offset76 (2692 versus2676 for Zi8GetKOcandidates). Exception relocations resolve to identical extab offsets0,8,16,24,32,40,48; anonymous compiler symbol names differ as expected. The candidate function begins four bytes later in our .text because the previous function has an extra instruction. The remaining data differences follow these two code lengths.
## Files and local commits
- `libs/RVL_SDK/src/fa/pf_dir.c`
- `src/scene/board/iplFocusObject.cpp`
- `tools/decomp-assist/fz1.attempts.md`
- `tools/decomp-assist/fz1.next.final-gate.txt`
- `tools/decomp-assist/fz1.next.report.md`
- d4976af8 match focus vector interpolation
- 0035e899 match directory move and correct entry prototype
- d5de7189 match directory rename traversal
- 9170cd3e match directory creation locals
The final evidence commit is identified in the final reply. Matching phase only; the gate retains the existing linked status.
## Final clean gate, verbatim
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/fa/api/FAAttach] pool: IDENTICAL
[libs/RVL_SDK/src/fa/api/FAAttach] objdiff: code None/500 data 240/240 functions 0/1 fuzzy 99.3600 linked code 0
[libs/RVL_SDK/src/fa/api/FAAttach] instruction-exact functions: 0/1
[libs/RVL_SDK/src/fa/api/FAAttach] section .bss size 208 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .data size 24 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .text size 500 match 99.36
[libs/RVL_SDK/src/fa/api/FAAttach] below 100: FAAttach 99.36
[libs/RVL_SDK/src/fa/api/FAAttach] baseline: code None/500 data 240 functions 0 fuzzy 99.3600
[src/bannerSound/AxAdpcmPlayer] pool: IDENTICAL
[src/bannerSound/AxAdpcmPlayer] objdiff: code 3088/3088 data 6476/6476 functions 13/13 fuzzy 100.0000 linked code 3088
[src/bannerSound/AxAdpcmPlayer] instruction-exact functions: 12/13
[src/bannerSound/AxAdpcmPlayer] section .bss size 6400 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .ctors size 4 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .data size 32 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sbss size 16 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sdata size 8 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sdata2 size 16 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .text size 3088 match 100.0
[src/bannerSound/AxAdpcmPlayer] baseline: code 3088/3088 data 6476 functions 13 fuzzy 100.0000
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 96/180 functions 1/7 fuzzy 98.6539 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .data size 40 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.65385
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.96712
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 96 functions 1 fuzzy 98.6539
[src/scene/board/iplFocusObject] pool: IDENTICAL
[src/scene/board/iplFocusObject] objdiff: code 20332/20332 data 2576/2576 functions 89/89 fuzzy 100.0000 linked code 0
[src/scene/board/iplFocusObject] instruction-exact functions: 89/89
[src/scene/board/iplFocusObject] section .data size 2168 match 100.0
[src/scene/board/iplFocusObject] section .rodata size 176 match 100.0
[src/scene/board/iplFocusObject] section .sdata size 176 match 100.0
[src/scene/board/iplFocusObject] section .sdata2 size 56 match 100.0
[src/scene/board/iplFocusObject] section .text size 20332 match 100.0
[src/scene/board/iplFocusObject] baseline: code 19772/20332 data 2576 functions 88 fuzzy 99.6471
[src/system/iplKeyboard] pool: IDENTICAL
[src/system/iplKeyboard] objdiff: code 4752/6024 data 1184/1184 functions 31/32 fuzzy 98.7351 linked code 0
[src/system/iplKeyboard] instruction-exact functions: 31/32
[src/system/iplKeyboard] section .data size 1168 match 100.0
[src/system/iplKeyboard] section .sdata size 8 match 100.0
[src/system/iplKeyboard] section .sdata2 size 8 match 100.0
[src/system/iplKeyboard] section .text size 6024 match 98.73506
[src/system/iplKeyboard] below 100: create__Q33ipl8keyboard7ManagerFPQ33ipl4nand4FilePQ23EGG4Heap 94.00944
[src/system/iplKeyboard] baseline: code 4752/6024 data 1184 functions 31 fuzzy 98.7351
[libs/RVL_SDK/src/fa/pf_dir] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_dir] objdiff: code 18976/18976 data 40/40 functions 38/38 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/fa/pf_dir] instruction-exact functions: 38/38
[libs/RVL_SDK/src/fa/pf_dir] section .sdata size 32 match 100.0
[libs/RVL_SDK/src/fa/pf_dir] section .sdata2 size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_dir] section .text size 18976 match 100.0
[libs/RVL_SDK/src/fa/pf_dir] baseline: code 11704/18976 data 40 functions 35 fuzzy 99.5432
regressions vs baseline: 0
global matched_code_percent: 88.93407 -> 89.19556
global fuzzy_match_percent: 99.50078 -> 99.50607
global complete_code_percent: 65.19670 -> 65.19670
global matched_data_percent: 99.07044 -> 99.07044
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```

View File

@@ -1,107 +0,0 @@
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/fa/api/FAAttach] pool: IDENTICAL
[libs/RVL_SDK/src/fa/api/FAAttach] objdiff: code None/500 data 240/240 functions 0/1 fuzzy 99.3600 linked code 0
[libs/RVL_SDK/src/fa/api/FAAttach] instruction-exact functions: 0/1
[libs/RVL_SDK/src/fa/api/FAAttach] section .bss size 208 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .data size 24 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/fa/api/FAAttach] section .text size 500 match 99.36
[libs/RVL_SDK/src/fa/api/FAAttach] below 100: FAAttach 99.36
[libs/RVL_SDK/src/fa/api/FAAttach] baseline: code None/500 data 240 functions 0 fuzzy 99.3600
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 96/180 functions 1/7 fuzzy 98.6539 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .data size 40 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 98.65385
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 97.61904
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_8148302C 99.49152
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483264 98.902435
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_81483308 99.13793
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814833F0 99.04256
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8_814834AC 99.3586
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] below 100: Zi8GetKOcandidates 97.96712
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 332/5200 data 96 functions 1 fuzzy 98.6539
[src/system/iplKeyboard] pool: IDENTICAL
[src/system/iplKeyboard] objdiff: code 4752/6024 data 1184/1184 functions 31/32 fuzzy 98.7351 linked code 0
[src/system/iplKeyboard] instruction-exact functions: 31/32
[src/system/iplKeyboard] section .data size 1168 match 100.0
[src/system/iplKeyboard] section .sdata size 8 match 100.0
[src/system/iplKeyboard] section .sdata2 size 8 match 100.0
[src/system/iplKeyboard] section .text size 6024 match 98.73506
[src/system/iplKeyboard] below 100: create__Q33ipl8keyboard7ManagerFPQ33ipl4nand4FilePQ23EGG4Heap 94.00944
[src/system/iplKeyboard] baseline: code 4752/6024 data 1184 functions 31 fuzzy 98.7351
[src/BS2/BS2Update] pool: IDENTICAL
[src/BS2/BS2Update] objdiff: code 400/4052 data 10488/10488 functions 9/10 fuzzy 94.2300 linked code 0
[src/BS2/BS2Update] instruction-exact functions: 9/10
[src/BS2/BS2Update] section .bss size 9056 match 100.0
[src/BS2/BS2Update] section .data size 1328 match 100.0
[src/BS2/BS2Update] section .sbss size 80 match 100.0
[src/BS2/BS2Update] section .sdata size 24 match 100.0
[src/BS2/BS2Update] section .text size 4052 match 94.23001
[src/BS2/BS2Update] below 100: UpdateThread 93.59803
[src/BS2/BS2Update] baseline: code 112/4052 data 10488 functions 8 fuzzy 91.6604
[src/channelScript/CHANSVm] pool: IDENTICAL
[src/channelScript/CHANSVm] objdiff: code 37608/53564 data 6904/6904 functions 221/233 fuzzy 99.3644 linked code 0
[src/channelScript/CHANSVm] instruction-exact functions: 221/233
[src/channelScript/CHANSVm] section .data size 4672 match 100.0
[src/channelScript/CHANSVm] section .rodata size 1432 match 100.0
[src/channelScript/CHANSVm] section .sbss size 16 match 100.0
[src/channelScript/CHANSVm] section .sdata size 600 match 100.0
[src/channelScript/CHANSVm] section .sdata2 size 184 match 100.0
[src/channelScript/CHANSVm] section .text size 53564 match 99.364426
[src/channelScript/CHANSVm] below 100: CHANSVmConvertToFloatFromStr 97.59036
[src/channelScript/CHANSVm] below 100: VmDateDtor 94.96703
[src/channelScript/CHANSVm] below 100: VmStringReplace 97.878784
[src/channelScript/CHANSVm] below 100: VmStringSplit 98.04054
[src/channelScript/CHANSVm] below 100: CHANSVmFormatString 99.84919
[src/channelScript/CHANSVm] below 100: VmBlobGetHexString 98.71951
[src/channelScript/CHANSVm] below 100: VmBlobPackCommon 97.949104
[src/channelScript/CHANSVm] below 100: VmBlobUnpack 98.452614
[src/channelScript/CHANSVm] below 100: VmWinEmuWrite 99.62687
[src/channelScript/CHANSVm] below 100: CHANSVmAddExe 99.625984
[src/channelScript/CHANSVm] below 100: CHANSVmLinkModules 98.677246
[src/channelScript/CHANSVm] below 100: CHANSVmStep 96.46608
[src/channelScript/CHANSVm] baseline: code 37608/53564 data 6904 functions 221 fuzzy 99.3644
[src/BS2/BS2Mach] pool: IDENTICAL
[src/BS2/BS2Mach] objdiff: code 4940/16980 data 155504/158528 functions 24/29 fuzzy 98.1595 linked code 0
[src/BS2/BS2Mach] instruction-exact functions: 24/29
[src/BS2/BS2Mach] section .bss size 155232 match 100.0
[src/BS2/BS2Mach] section .data size 3024 match None
[src/BS2/BS2Mach] section .sbss size 240 match 100.0
[src/BS2/BS2Mach] section .sdata size 32 match 100.0
[src/BS2/BS2Mach] section .text size 16980 match 98.159485
[src/BS2/BS2Mach] below 100: Run 16.744186
[src/BS2/BS2Mach] below 100: BS2StartGame 98.72774
[src/BS2/BS2Mach] below 100: BS2StartGCGame 99.5614
[src/BS2/BS2Mach] below 100: CheckBS2CommandStatus 99.50739
[src/BS2/BS2Mach] below 100: BS2Tick 98.230415
[src/BS2/BS2Mach] baseline: code 4940/16980 data 155504 functions 24 fuzzy 97.8276
[src/scene/setting/AOSS] pool: IDENTICAL
[src/scene/setting/AOSS] objdiff: code 6436/16192 data 3928/3928 functions 16/21 fuzzy 96.7779 linked code 0
[src/scene/setting/AOSS] instruction-exact functions: 15/21
[src/scene/setting/AOSS] section .bss size 3496 match 100.0
[src/scene/setting/AOSS] section .data size 368 match 100.0
[src/scene/setting/AOSS] section .sbss size 32 match 100.0
[src/scene/setting/AOSS] section .sdata size 24 match 100.0
[src/scene/setting/AOSS] section .sdata2 size 8 match 100.0
[src/scene/setting/AOSS] section .text size 16192 match 96.777916
[src/scene/setting/AOSS] below 100: AOSS_Init_old 93.78725
[src/scene/setting/AOSS] below 100: AOSSDecryptMessage 97.74143
[src/scene/setting/AOSS] below 100: AOSSApplyAuthOptions 98.77193
[src/scene/setting/AOSS] below 100: AOSSSendHelloRequest 92.190475
[src/scene/setting/AOSS] below 100: AOSSXorBufferWithKey 98.605446
[src/scene/setting/AOSS] baseline: code 6436/16192 data 3928 functions 16 fuzzy 96.7779
regressions vs baseline: 0
global matched_code_percent: 89.64909 -> 89.65871
global fuzzy_match_percent: 99.53278 -> 99.53815
global complete_code_percent: 67.39544 -> 67.39544
global matched_data_percent: 99.36508 -> 99.36508
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
review note: libs/RVL_SDK/include/revolution/dvd.h: volatile object declaration (orchestrator checks the target really re-reads it) (+1 net), e.g. volatile s32 state;
review note: src/BS2/BS2Mach.c: volatile object declaration (orchestrator checks the target really re-reads it) (+1 net), e.g. vu32 LowReadResult = 0;
review note: src/BS2/BS2Update.c: volatile object declaration (orchestrator checks the target really re-reads it) (+1 net), e.g. static volatile s32 rc = 0;
note: config touched: config/43U/symbols.txt (orchestrator reviews every config/symbols change)
GATE PASS

View File

@@ -1,129 +0,0 @@
# Fuzzy lane round 2, final verified handoff
One new exact function: `BS2UpdateInit`. Two additional target-proven volatile/poll corrections improve fuzzy code, and remain non-matching. All 31 remaining functions have at least three distinct successfully compiled source forms logged; build failures do not count.
Final full gate (no `--quick`; clean build):
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/fa/api/FAAttach] objdiff: code None/500 data 240/240 functions 0/1 fuzzy 99.3600 linked code 0
[libs/RVL_SDK/src/fa/api/FAAttach] instruction-exact functions: 0/1
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 332/5200 data 96/180 functions 1/7 fuzzy 98.6539 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 1/7
[src/system/iplKeyboard] objdiff: code 4752/6024 data 1184/1184 functions 31/32 fuzzy 98.7351 linked code 0
[src/system/iplKeyboard] instruction-exact functions: 31/32
[src/BS2/BS2Update] objdiff: code 400/4052 data 10488/10488 functions 9/10 fuzzy 94.2300 linked code 0
[src/BS2/BS2Update] instruction-exact functions: 9/10
[src/channelScript/CHANSVm] objdiff: code 37608/53564 data 6904/6904 functions 221/233 fuzzy 99.3644 linked code 0
[src/channelScript/CHANSVm] instruction-exact functions: 221/233
[src/BS2/BS2Mach] objdiff: code 4940/16980 data 155504/158528 functions 24/29 fuzzy 98.1595 linked code 0
[src/BS2/BS2Mach] instruction-exact functions: 24/29
[src/scene/setting/AOSS] objdiff: code 6436/16192 data 3928/3928 functions 16/21 fuzzy 96.7779 linked code 0
[src/scene/setting/AOSS] instruction-exact functions: 15/21
regressions vs baseline: 0
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
Before -> after (matched code/data bytes; denominators unchanged):
| Unit | Raw gate exact functions | Objdiff exact functions | Code bytes | Data bytes |
|---|---|---|---|---|
| `libs/RVL_SDK/src/fa/api/FAAttach` | 0/1 -> 0/1 | 0/1 -> 0/1 | 0 -> 0 / 500 | 240 -> 240 / 240 |
| `libs/RVLMiddleware/eZiText/src/clib/zkokeyp` | 1/7 -> 1/7 | 1/7 -> 1/7 | 332 -> 332 / 5200 | 96 -> 96 / 180 |
| `src/system/iplKeyboard` | 31/32 -> 31/32 | 31/32 -> 31/32 | 4752 -> 4752 / 6024 | 1184 -> 1184 / 1184 |
| `src/BS2/BS2Update` | 8/10 -> 9/10 | 8/10 -> 9/10 | 112 -> 400 / 4052 | 10488 -> 10488 / 10488 |
| `src/channelScript/CHANSVm` | 221/233 -> 221/233 | 221/233 -> 221/233 | 37608 -> 37608 / 53564 | 6904 -> 6904 / 6904 |
| `src/BS2/BS2Mach` | 24/29 -> 24/29 | 24/29 -> 24/29 | 4940 -> 4940 / 16980 | 155504 -> 155504 / 158528 |
| `src/scene/setting/AOSS` | 15/21 -> 15/21 | 16/21 -> 16/21 | 6436 -> 6436 / 16192 | 3928 -> 3928 / 3928 |
Remaining functions (one line each; successful distinct source forms are additional to declaration permutations):
- `libs/RVL_SDK/src/fa/api/FAAttach::FAAttach` — 99.36%; Drive index narrowing and attached-table base register allocation; 125/125 instructions. 9 source forms.
- `libs/RVLMiddleware/eZiText/src/clib/zkokeyp::Zi8_8148302C` — 99.49152%; Work pointer and key-table value registers exchange; 59/59. 5 source forms.
- `libs/RVLMiddleware/eZiText/src/clib/zkokeyp::Zi8_81483264` — 98.902435%; Parameter/metadata and byte iteration index registers exchange; 41/41. 6 source forms.
- `libs/RVLMiddleware/eZiText/src/clib/zkokeyp::Zi8_81483308` — 99.13793%; Count pointer and running counter registers exchange; 58/58. 5 source forms.
- `libs/RVLMiddleware/eZiText/src/clib/zkokeyp::Zi8_814833F0` — 99.04256%; Metadata pointer and candidate index registers exchange; 47/47. 5 source forms.
- `libs/RVLMiddleware/eZiText/src/clib/zkokeyp::Zi8_814834AC` — 99.3586%; Zero initialization chain emits an extra clrlwi; addressing/register operands also differ; 344/343. 8 source forms.
- `libs/RVLMiddleware/eZiText/src/clib/zkokeyp::Zi8GetKOcandidates` — 97.96712%; Candidate loop boundaries, helper return narrowing and temporary scheduling; 673/669. 6 source forms.
- `src/system/iplKeyboard::create__Q33ipl8keyboard7ManagerFPQ33ipl4nand4FilePQ23EGG4Heap` — 94.00944%; Inline resource-node constructor boundary, OEM dictionary index and MemoSetting stack copy order; 318/318. 7 source forms.
- `src/BS2/BS2Update::UpdateThread` — 93.59803%; Import/scan branch and store scheduling, common bases and temporaries; proven rc reloads restored, nine target instructions still absent; 904/913. 10 source forms.
- `src/channelScript/CHANSVm::CHANSVmConvertToFloatFromStr` — 97.59036%; End pointer initialization store and object-type compare occur in opposite order; 83/83. 6 source forms.
- `src/channelScript/CHANSVm::VmDateDtor` — 94.96703%; Variadic date argument and year stack-store scheduling; 91/91. 4 source forms.
- `src/channelScript/CHANSVm::VmStringReplace` — 97.878784%; Search/replacement lengths and live cursor register allocation; 132/132. 3 source forms.
- `src/channelScript/CHANSVm::VmStringSplit` — 98.04054%; Delimiter/parent cursor and result array register allocation; 222/222. 4 source forms.
- `src/channelScript/CHANSVm::CHANSVmFormatString` — 99.84919%; Two temporary object/string-length registers exchange late in the formatter; 431/431. 6 source forms.
- `src/channelScript/CHANSVm::VmBlobGetHexString` — 98.71951%; Output offset and decoded hex digit registers exchange; 82/82. 4 source forms.
- `src/channelScript/CHANSVm::VmBlobPackCommon` — 97.949104%; Packing mode, format and copy-loop temporary register allocation; 668/668. 4 source forms.
- `src/channelScript/CHANSVm::VmBlobUnpack` — 98.452614%; Two-pass format parser and blob cursor/count register allocation; 517/517. 5 source forms.
- `src/channelScript/CHANSVm::VmWinEmuWrite` — 99.62687%; String object and total byte-length registers exchange; 67/67. 4 source forms.
- `src/channelScript/CHANSVm::CHANSVmAddExe` — 99.625984%; Module header and executable type argument registers exchange, plus address operand order; 254/254. 4 source forms.
- `src/channelScript/CHANSVm::CHANSVmLinkModules` — 98.677246%; Dispatch/module/index and global-list pointer registers exchange; 189/189. 4 source forms.
- `src/channelScript/CHANSVm::CHANSVmStep` — 96.46608%; Default step count and loop-entry branch form, floating constant bases and opcode temporaries; 1253/1253. 5 source forms.
- `src/BS2/BS2Mach::Run` — 16.744186%; Target explicitly clears fixed GPRs and the stack pointer and enters via LR; ordinary C cache-loop/callback forms cannot encode that handoff under the no-asm constraint; 11/43. 3 source forms.
- `src/BS2/BS2Mach::BS2StartGame` — 98.72774%; Five initial base/store scheduling operands and five legacy DI address/value register operands remain after fixing all polling loops; 393/393. 17 source forms.
- `src/BS2/BS2Mach::BS2StartGCGame` — 99.5614%; External DVD getter call versus inline state load, and wide tick multiplication operand allocation; 228/228. 8 source forms.
- `src/BS2/BS2Mach::CheckBS2CommandStatus` — 99.50739%; Partition-count slwi and CacheCommandComplete store occur in opposite order; 406/406. 13 source forms.
- `src/BS2/BS2Mach::BS2Tick` — 98.230415%; Boot/hardware address-base sharing, progress-store scheduling and loader output scope; six target instructions absent; 1934/1940. 4 source forms.
- `src/scene/setting/AOSS::AOSS_Init_old` — 93.78725%; Timeout default loads share an array base instead of independent references; local/global allocation and initialization/branch scheduling also differ; 1575/1584. 7 source forms.
- `src/scene/setting/AOSS::AOSSDecryptMessage` — 97.74143%; Checksum and key schedule/state/input/output cursor registers exchange; 321/321. 4 source forms.
- `src/scene/setting/AOSS::AOSSApplyAuthOptions` — 98.77193%; Authentication flags and configuration subrecord pointers use different registers; 114/114. 4 source forms.
- `src/scene/setting/AOSS::AOSSSendHelloRequest` — 92.190475%; Common CRC/key-state base hoisting and packet/key/socket local boundaries differ; 271/273. 8 source forms.
- `src/scene/setting/AOSS::AOSSXorBufferWithKey` — 98.605446%; Unrolled XOR result ownership and packet/mask address register allocation; 147/147. 21 source forms.
Data proof and limits:
- `BS2Update`: `Thread` at 0x810B2580 is an OSThread of size 0x318; target OSCreateThread uses a separate 4096-byte stack starting at thread+0x318. Corrected only the data extent from 0x1318 to 0x318, kept the address and full .bss section size 9056, and left stack bytes unowned. Separate real, initialized thread/stack objects produce 72/72 identical Init instructions and preserve data 10488/10488.
- `zkokeyp`: .data and .extab bytes match. .extabindex has two differing real function-size words (1376/1372 and 2692/2676), corresponding to the two remaining functions with extra instructions. No data rename/extent fix can legitimately conceal that.
- `BS2Mach`: the first 3020 .data bytes are identical, followed by four zero alignment bytes in the target. Anonymous string/table symbols have no authorized real source object name to pair. Two jump table relocation sets also refer into non-matching functions. Data remains 155504/158528; no invented names, pinned literals or padding objects were added.
- Other owned units retain 100% objdiff data. No weak inline/vtable data was suppressed. No other symbol rename or extent correction was made.
Target proof for qualifiers:
- DVD state field: repeated target CoverBlock.state reads at 0xDE0 with a back edge from 0xDE8 and no call. Qualification is guarded by BS2_MACH_VOLATILE_DVD_STATE, defined only by BS2Mach.c; all other translation units compile the original header field.
- LowReadResult: empty repeated polls at 0x1130/0x117C/0x1290/0x12E8, with further loads at 0x113C/0x129C immediately after poll exits. The previous interrupt calls were absent from target code.
- Static signed rc: target store at 0xD5C followed by load at 0xD64, and store at 0xE48 followed by load at 0xE50, with no intervening call. Signed volatile restores two real reads. No use-site volatile cast was added.
Uncertainties:
- AOSSParseNetworkSettings is objdiff 100%, byte-identical, and declaration-tool score (0,0). The gate uses odiff, which incorrectly rebases its CR1 conditional branches by the 36-byte function-position delta. The raw gate consequently prints 15/21, while objdiff and bytes prove 16/21. Raw output is preserved verbatim above; source/metadata were not changed to manipulate this metric.
- Remaining allocation/scheduling causes are hypotheses supported by target diffs and unsuccessful source experiments, not claims that the original source is known.
- Run needs the fixed-register handoff described above; no forbidden assembly or fabricated match was attempted.
Files changed and source commits:
```text
fcbd5a298408059adaf22d29cecb21b9a9cfa301
match update thread creation and object extent
config/43U/symbols.txt
src/BS2/BS2Update.c
tools/decomp-assist/fz1.attempts.md
```
```text
9ab3eb8183594c3a940d7bbb147de7e3c085bca0
restore dvd callback polling
libs/RVL_SDK/include/revolution/dvd.h
src/BS2/BS2Mach.c
tools/decomp-assist/fz1.attempts.md
```
```text
ce9cff4fa6c2d03310c780b1592d02c49bc6c367
preserve update result reloads
src/BS2/BS2Update.c
tools/decomp-assist/fz1.attempts.md
```
Verification artifacts:
- `tools/decomp-assist/fz1.attempts.md` — structural diagnoses, source variant hashes/results, proofs and final all-open audit.
- `tools/decomp-assist/fz1.r2.final-gate.txt` — complete final clean gate output.
- `tools/decomp-assist/fz1.r2.report.md` — this report.
No push, PR, branch switch, rebase, other worktree mutation or subagent was used. Earlier untracked artifacts were left untouched.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -827,869 +827,3 @@ PFVOL_attach: 98.72159%; 174/176 instructions; inline clear_mount return boundar
PFVOL_regctx: 99.0%; 15 register-only status/free-index differences
Changed source files: libs/RevoEX/src/so/SOOption.c and libs/RVL_SDK/src/fa/pf_volume.c; attempts log tools/decomp-assist/fz3.attempts.md. Commits43b95ca5/d4a8860d. No config/symbol edits. Full clean gate PASS; pool identical across7 units; regressions0, forbidden0, readability0, target DOL SHA1 preserved.
# Round 5 HIGH; fresh HEAD 2039813c, owned seven units only
libs/RevoEX/src/so/SOOption: POOL IDENTICAL up to 0 (mine=0 base=0)
libs/RVL_SDK/src/fa/pf_volume: POOL IDENTICAL up to 1 (mine=1 base=1)
libs/RVL_SDK/src/fa/pf_entry_iterator: POOL IDENTICAL up to 0 (mine=0 base=0)
src/keyboard/tiString: POOL IDENTICAL up to 0 (mine=0 base=0)
src/keyboard/tiSignWindow: POOL IDENTICAL up to 30 (mine=30 base=30)
libs/RVL_SDK/src/fa/msc/puh_msc_blk: POOL IDENTICAL up to 0 (mine=0 base=0)
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var: POOL IDENTICAL up to 0 (mine=0 base=0)
SOGetInterfaceOpt current origin/main source identical after fetch; structural diagnosis: frame0x30 119/119 instructions; five parameter-color differences only; target reuses level storage for returnedLength and option storage for reply. Data0/0, no pool.
SOGetInterfaceOpt | R5 scope reply and returnedLength at payload lifetime | 119/119 instructions; structural/exact differences (0, 5)
SOGetInterfaceOpt | R5 snapshot requested option after prepare before validation | 119/119 instructions; structural/exact differences (0, 5)
SOGetInterfaceOpt | R5 isolate result of ioctl from prepare and allocation error | BUILD FAIL uto -pragma "cats off" -pragma "warn_notinlined off" -maxerrors 1 -nosyspath -RTTI off -fp_contract on -str reuse -DSDK_IPL -D_REVOLUTION -DMEM_MANAGER_DIRECT -i include -i include/global -i libs/MetroTRK/include -i libs/Runtime/include -i libs/MSL/include -i libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -ipa file -fp_contract off -lang=c -MMD -c libs/RevoEX/src/so/SOOption.c -o build/43U/src/libs/RevoEX/src/so && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RevoEX/src/so/SOOption.d build/43U/src/libs/RevoEX/src/so/SOOption.d
### mwcceppc.exe Compiler:
# File: libs\RevoEX\src\so\SOOption.c
# --------------------------------------
# 125: int ioctlResult;
# Error: ^^^
# (10141) expression syntax error
# Too many errors printed, aborting program
User break, cancelled...
ninja: build stopped: subcommand failed.
R5 SO restored: 119/119 instructions; structural/exact differences (0, 5)
SOGetInterfaceOpt | R5 ioctl result block with valid C89 declaration | 119/119 instructions; structural/exact differences (0, 5)
R5 declaration search60 builds (0,5), no improvement; 119/119 instructions; structural/exact differences (0, 5)
R5 PFVOL_p_rmvvol fetch rc=1 ; origin/main d34e09d5dcb0dd67dd34a4a3b41c6238fe499689; source identical=True; baseline open per fresh report. 64/64 frame0x500. Folded scalar initializer li versus target lbz template; four prolog scheduling differences. Real deleted byte template currently8byte extent, no rename/extent proof sufficient, data210976/210976.
PFVOL_p_rmvvol | R5 const deleted scalar with explicit initializer | 64/64 instructions; structural/exact differences (2, 4)
PFVOL_p_rmvvol | R5 byte marker in directory byte field struct initializer | 64/64 instructions; structural/exact differences (0, 0)
PFVOL_p_rmvvol | R5 byte marker array copied from template via initializer | BUILD FAIL -maxerrors 1 -nosyspath -RTTI off -fp_contract on -str reuse -DSDK_IPL -D_REVOLUTION -DMEM_MANAGER_DIRECT -i include -i include/global -i libs/MetroTRK/include -i libs/Runtime/include -i libs/MSL/include -i libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -ipa file -fp_contract off -lang=c -MMD -c libs/RVL_SDK/src/fa/pf_volume.c -o build/43U/src/libs/RVL_SDK/src/fa && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/fa/pf_volume.d build/43U/src/libs/RVL_SDK/src/fa/pf_volume.d
### mwcceppc.exe Compiler:
# File: libs\RVL_SDK\src\fa\pf_volume.c
# ----------------------------------------
# 591: u8 deleted[1] = {deleted_entry_mark[0]};
# Error: ^
# (10124) illegal constant expression
# Too many errors printed, aborting program
User break, cancelled...
ninja: build stopped: subcommand failed.
R5 PFVOL_p_rmvvol restored: 64/64 instructions; structural/exact differences (2, 4)
PFVOL_p_rmvvol | R5 byte marker array aggregate with literal initializer | 64/64 instructions; structural/exact differences (0, 0)
PFVOL_p_rmvvol | R5 deleted-field struct using named mark initializer | BUILD FAIL ontract on -str reuse -DSDK_IPL -D_REVOLUTION -DMEM_MANAGER_DIRECT -i include -i include/global -i libs/MetroTRK/include -i libs/Runtime/include -i libs/MSL/include -i libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -ipa file -fp_contract off -lang=c -MMD -c libs/RVL_SDK/src/fa/pf_volume.c -o build/43U/src/libs/RVL_SDK/src/fa && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/fa/pf_volume.d build/43U/src/libs/RVL_SDK/src/fa/pf_volume.d
### mwcceppc.exe Compiler:
# File: libs\RVL_SDK\src\fa\pf_volume.c
# ----------------------------------------
# 591: struct { u8 first_byte; } deleted = {deleted_entry_mark[0]};
# Error: ^
# (10124) illegal constant expression
# Too many errors printed, aborting program
User break, cancelled...
ninja: build stopped: subcommand failed.
R5 PFVOL_p_rmvvol aggregate exact candidate rejected: extra local template would leave old mark as unused object; removing old mark regresses section data. No padding or extent change justified solely by one byte access. 64/64 instructions; structural/exact differences (2, 4)
R5 PFVOL_attach fetch rc=0 ; origin/main 78d682775730a945bd3c3211dd704cc170f82b4b; source identical=True; baseline open per fresh report. 174/176 frame0x20. Caller ignores mount helper return, target still materializes its success/error into r0; ours collapses inline boundary and tests r3 from final void call. Other clear_mount consumers already exact, use attach-only helper variants.
PFVOL_attach | R5 flatten mount helper with explicit retained mount status | 176/176 instructions; structural/exact differences (10, 22)
PFVOL_attach | R5 mount result as helper state record | 174/176 instructions; structural/exact differences (10, 39)
PFVOL_attach | R5 successful mount branch first in attach helper | 174/176 instructions; structural/exact differences (19, 39)
R5 attach restored 174/176 instructions; structural/exact differences (10, 39)
PFVOL_attach | R5 explicit mount status join through shared completion label | 173/176 instructions; structural/exact differences (11, 39)
PFVOL_attach | R5 attach-only clear helper with status output parameter | 174/176 instructions; structural/exact differences (10, 39)
PFVOL_attach | R5 attach-only aggregate mount return | 174/176 instructions; structural/exact differences (10, 39)
R5 attach final restored 174/176 instructions; structural/exact differences (10, 39)
R5 PFVOL_regctx fetch rc=0 ; origin/main 1ce1b0458a9bb25cdfd7828882f9c2baf4e84ef6; source identical=True; baseline open per fresh report. 75/75 frame0x10 identical unrolled branches, target free index r8 status r5 versus ours r5/r8; declarations last. All owned data exact, no label renames warranted.
PFVOL_regctx | R5 signed iteration index with unchanged context bounds | 75/75 instructions; structural/exact differences (1, 16)
PFVOL_regctx | R5 status declaration alongside error before loop | 75/75 instructions; structural/exact differences (0, 15)
PFVOL_regctx | R5 per-iteration typed context reference before status extraction | 75/75 instructions; structural/exact differences (0, 18)
R5 regctx restored 75/75 instructions; structural/exact differences (0, 15)
R5 PFENT_ITER_FindCluster fetch rc=0 ; origin/main a2abf248541b955965816157d0c0412cdb7f3f62; source identical=True; baseline open per fresh report. 237/237 frame0xa0. Same locals/branches/inline LoadEntry, eight register-only differences between constant1 and entriesPerSector. Data24/24 exact.
PFENT_ITER_FindCluster | R5 shared typed first-cluster value for iterator and hint initialization | 237/237 instructions; structural/exact differences (0, 8)
PFENT_ITER_FindCluster | R5 entriesPerSector lifetime scoped to initialized iterator | 237/237 instructions; structural/exact differences (0, 11)
PFENT_ITER_FindCluster | R5 signed entries-per-sector temporary for positive power-of-two count | 237/237 instructions; structural/exact differences (0, 8)
R5 FindCluster restored 237/237 instructions; structural/exact differences (0, 8)
R5 PFENT_ITER_GetLFNEntryName fetch rc=0 ; origin/main a2abf248541b955965816157d0c0412cdb7f3f62; source identical=True; baseline open per fresh report. 73/73 frame0x30. Target maintains byte offset +=26 in r31 and copy destination r30 computed each iteration. Ours carries pointer; final target reloads numLFNs, multiply26 and clear bit0 before sthx. Inline LoadEntry boundary otherwise same.
PFENT_ITER_GetLFNEntryName | R5 byte-address offset and terminator from live LFN count | 76/73 instructions; structural/exact differences (26, 75)
PFENT_ITER_GetLFNEntryName | R5 byte destinations for all three LFN fragments | 76/73 instructions; structural/exact differences (26, 75)
PFENT_ITER_GetLFNEntryName | R5 byte offset converted through UTF16 index at destination | 74/73 instructions; structural/exact differences (11, 34)
R5 GetLFNEntryName restored 73/73 instructions; structural/exact differences (9, 43)
R5 GetLFN shift-index candidate has extra rlwinm alignment mask and multiply13+slwi versus target multiply26+clearbit; restored 73/73 instructions; structural/exact differences (9, 43)
R5 inputChar__Q39textinput8tistring9DecolatedFw fetch rc=0 ; origin/main a2abf248541b955965816157d0c0412cdb7f3f62; source identical=True; baseline open per fresh report. 125/136 frame0x30. Main Kana and insertion blocks structurally match. Hangul branch target retains dynamic append count, initialNUL and dead newline comparison from inline converter; source folds count1 directstores. Data288/288 exact; no data pairing gaps.
inputChar__Q39textinput8tistring9DecolatedFw | R5 Hangul append with advancing output pointer and count | 125/136 instructions; structural/exact differences (18, 73)
inputChar__Q39textinput8tistring9DecolatedFw | R5 Hangul conversion local32bit length and explicit initial terminator | 126/136 instructions; structural/exact differences (17, 73)
inputChar__Q39textinput8tistring9DecolatedFw | R5 Hangul typed append helper carrying current UTF16 length | 125/136 instructions; structural/exact differences (18, 73)
R5 tiString restored 125/136 instructions; structural/exact differences (18, 73)
R5 create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator fetch rc=0 ; origin/main d0c3d43000a96839d7d74dee39c3998cc4a99aa4; source identical=True; baseline open per fresh report. 221/221 frame0x50, branches and all constructors/calls same; 34 differences are hoisted pane vtable/constants and animation count/table registers. Data3468/3468 and pool30 strings exact.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R5 count and forceName declared at animation-binding phase | 221/221 instructions; structural/exact differences (0, 61)
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R5 widened loop state with explicit16bit animation lookup boundary | 221/221 instructions; structural/exact differences (0, 34)
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R5 placement-construction helper separates pane lookup from constructor inline scope | 221/221 instructions; structural/exact differences (42, 73)
R5 SignWindow restored 221/221 instructions; structural/exact differences (0, 34)
R5 SignWindow declaration search24 budget completed after structural/source trials; baseline coloring retained.
R5 uhf_msc_blk_pread fetch rc=0 From https://github.com/coah80/wii-ipl
d0c3d430..65cd387b main -> origin/main; origin/main 65cd387bcb48559396b79257ab6069fcda9bf259; source identical=True; baseline open per fresh report. 129/129 frame0x40. Same find-device and read/retry branches, only10 differences swapping transfer_blocks r25/product r27 against target r27/r25. Data424/424 exact.
uhf_msc_blk_pread | R5 transfer count lifetime restricted to each read iteration | 129/129 instructions; structural/exact differences (0, 27)
uhf_msc_blk_pread | R5 byte-count product ordered block-size then transfer count | 129/129 instructions; structural/exact differences (0, 10)
uhf_msc_blk_pread | R5 byte-count temporary scoped to copied noncacheable transfer | BUILD FAIL reuse -DSDK_IPL -D_REVOLUTION -DMEM_MANAGER_DIRECT -i include -i include/global -i libs/MetroTRK/include -i libs/Runtime/include -i libs/MSL/include -i libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -ipa file -fp_contract off -lang=c -MMD -c libs/RVL_SDK/src/fa/msc/puh_msc_blk.c -o build/43U/src/libs/RVL_SDK/src/fa/msc && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/fa/msc/puh_msc_blk.d build/43U/src/libs/RVL_SDK/src/fa/msc/puh_msc_blk.d
### mwcceppc.exe Compiler:
# File: libs\RVL_SDK\src\fa\msc\puh_msc_blk.c
# ----------------------------------------------
# 152: transfer_buffer += transfer_bytes;
# Error: ^^^^^^^^^^^^^^
# (10140) undefined identifier 'transfer_bytes'
# Too many errors printed, aborting program
User break, cancelled...
ninja: build stopped: subcommand failed.
R5 pread restored 129/129 instructions; structural/exact differences (0, 10)
uhf_msc_blk_pread | R5 corrected byte-count temporary in copy branch only | 129/129 instructions; structural/exact differences (0, 33)
R5 pread declaration search71 builds no improvement; restored 129/129 instructions; structural/exact differences (0, 10)
R5 TMCJPEGDEC_IdctBlock4x4 fetch rc=0 ; origin/main 65cd387bcb48559396b79257ab6069fcda9bf259; source identical=True; baseline open per fresh report. 136/136 frame0x120, row loads, arithmetic scheduling and store order differ19 structural/93 exact. Target first pass reuses row temporaries and stores0,1,2,3; d+b operand order. Column clamp/pitch schedule shape same. No data sections.
TMCJPEGDEC_IdctBlock4x4 | R5 reusable row temporaries with canonical four-store order and d+b operand | 136/136 instructions; structural/exact differences (37, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 delay even coefficient loads until odd rotation expression | 130/136 instructions; structural/exact differences (45, 134)
TMCJPEGDEC_IdctBlock4x4 | R5 odd sum before rotation with same store boundaries | 136/136 instructions; structural/exact differences (37, 93)
R5 luma restored 136/136 instructions; structural/exact differences (19, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 native-int arithmetic locals at coefficient conversion boundaries | 136/136 instructions; structural/exact differences (37, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 named odd difference and multiplication before delayed rotation shift | 136/136 instructions; structural/exact differences (37, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 commuted butterfly addition operands for both row stores | 136/136 instructions; structural/exact differences (37, 93)
R5 luma after extra structural probes restored 136/136 instructions; structural/exact differences (19, 93)
PFVOL_p_rmvvol | R5 named const marker definition after functions, preserving actual object and references | 64/64 instructions; structural/exact differences (2, 4)
R5 const definition-order probe restored 64/64 instructions; structural/exact differences (2, 4)
R5 TMCJPEGDEC_IdctBlock4x4_Col fetch rc=0 ; origin/main 65cd387bcb48559396b79257ab6069fcda9bf259; source identical=True; baseline open per fresh report. 139/137 frame0x120, extra saved r28 and epilog reload plus reassociated odd sums; target reuses row variables and stores0..3; column arithmetic operand order d+b. No data sections.
TMCJPEGDEC_IdctBlock4x4_Col | R5 common odd rotation locals reused in positive and negative butterfly outputs | 137/137 instructions; structural/exact differences (31, 48)
TMCJPEGDEC_IdctBlock4x4_Col | R5 target odd-sum and rotated-sum operand order on shared temporaries | 137/137 instructions; structural/exact differences (31, 48)
TMCJPEGDEC_IdctBlock4x4_Col | R5 reuse row coefficients and butterfly state across both column rows | 135/137 instructions; structural/exact differences (47, 136)
R5 Col restored 139/137 instructions; structural/exact differences (33, 134)
PFVOL_p_rmvvol | R5 external linkage for named readonly marker, same8byte definition | 64/64 instructions; structural/exact differences (2, 4)
R5 restored after linkage probe 64/64 instructions; structural/exact differences (2, 4)
TMCJPEGDEC_IdctBlock4x4 | R5 common row helper with named butterfly intermediates | 136/136 instructions; structural/exact differences (31, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 row helper output parameter before readonly input | 136/136 instructions; structural/exact differences (31, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 row helper coefficient locals before butterfly state | 136/136 instructions; structural/exact differences (31, 93)
TMCJPEGDEC_IdctBlock4x4_Col | R5 common row helper with named butterfly intermediates | 137/137 instructions; structural/exact differences (31, 54)
TMCJPEGDEC_IdctBlock4x4_Col | R5 row helper output parameter before readonly input | 137/137 instructions; structural/exact differences (31, 54)
TMCJPEGDEC_IdctBlock4x4_Col | R5 row helper coefficient locals before butterfly state | 137/137 instructions; structural/exact differences (31, 54)
R5 helper probes restored 139/137 instructions; structural/exact differences (33, 134)
PFENT_ITER_GetLFNEntryName | R5 directory-name address plus byte offset and byte-length terminator conversion | 76/73 instructions; structural/exact differences (24, 75)
R5 integer-address probe restored 73/73 instructions; structural/exact differences (9, 43)
TMCJPEGDEC_IdctBlock4x4 | R5 single rotation expression reused in first-row butterfly | 136/136 instructions; structural/exact differences (13, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 single rotation with fourth-plus-second sum order | 136/136 instructions; structural/exact differences (13, 93)
TMCJPEGDEC_IdctBlock4x4 | R5 single rotation and target first-row output-store order | 136/136 instructions; structural/exact differences (39, 93)
R5 luma narrowed rotation restored 136/136 instructions; structural/exact differences (19, 93)
R5 IDCT luma single objdiff 90.43459 function 85.161766 136/136 instructions; structural/exact differences (13, 93)
R5 IDCT luma single reverse objdiff 90.412415 function 85.088234 136/136 instructions; structural/exact differences (13, 93)
R5 IDCT Col shared oddrot objdiff 90.773834 function 83.89781 137/137 instructions; structural/exact differences (31, 48)
SOGetInterfaceOpt | R5 command-return helper with option and level ordered by validation lifetime | 119/119 instructions; structural/exact differences (0, 14)
R5 SO payload helper restored 119/119 instructions; structural/exact differences (0, 5)
R5 luma full local block declaration search: declaration block:
s32 bd;
s32 d;
s32 c;
s32 a;
s32 b;
s32* sp;
s32* dp;
s32 tmp[64];
s32 i;
s32 evsum, rot, oddrot, cd;
start (19, 93)
best (19, 93) after 120 builds; source restored; best order was:
s32 bd;
s32 d;
s32 c;
s32 a;
s32 b;
s32* sp;
s32* dp;
s32 tmp[64];
s32 i;
s32 evsum, rot, oddrot, cd;
R5 Col leading declaration search13 builds no improvement, retained shared oddRotation expressions:137/137 instructions,31 structural48 exact; no new exact function claimed. objdiff83.240875->83.89781.
R5 data ownership audit: all seven units already have100% matched_data, owned sections unchanged; SOOption/IDCT have no data, volume210976,iterator24,tiString288,SignWindow3468,MSC424 exact. No symbol rename or extent change made: no name-pairing gap in these units. Weak emitted vtables ignored. All source experiments confined to owned units and restored except reusable IDCT odd-rotation locals.
R5 completeness audit of every open function, count of distinct successful source attempts this round:
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator: 3 successful distinct source attempts; remains open.
inputChar__Q39textinput8tistring9DecolatedFw: 3 successful distinct source attempts; remains open.
SOGetInterfaceOpt: 4 successful distinct source attempts; remains open.
TMCJPEGDEC_IdctBlock4x4: 12 successful distinct source attempts; remains open.
TMCJPEGDEC_IdctBlock4x4_Col: 6 successful distinct source attempts; remains open.
PFENT_ITER_FindCluster: 3 successful distinct source attempts; remains open.
PFENT_ITER_GetLFNEntryName: 4 successful distinct source attempts; remains open.
PFVOL_p_rmvvol: 5 successful distinct source attempts; remains open.
PFVOL_attach: 6 successful distinct source attempts; remains open.
PFVOL_regctx: 3 successful distinct source attempts; remains open.
uhf_msc_blk_pread: 3 successful distinct source attempts; remains open.
R5 precommit quick gate over all seven owned units: GATE PASS; regressions0, forbidden0, readability0, all pools identical. Retained only column-IDCT shared odd rotations, removes extra saved-register save/restore,139->137 instructions. Exact counts/code bytes/data bytes unchanged.
R5 final full clean gate is running after code commit650cc87e. No source edits while it builds. Live before-run metrics normalized missing data to0:
main/src/keyboard/tiSignWindow: 55/56 exact; code6300/7184; data3468/3468
main/src/keyboard/tiString: 41/42 exact; code4632/5176; data288/288
main/libs/RevoEX/src/so/SOOption: 3/4 exact; code816/1292; data0/0
main/libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var: 4/6 exact; code712/1804; data0/0
main/libs/RVL_SDK/src/fa/pf_entry_iterator: 14/16 exact; code6640/7880; data24/24
main/libs/RVL_SDK/src/fa/pf_volume: 34/37 exact; code16732/17992; data210976/210976
main/libs/RVL_SDK/src/fa/msc/puh_msc_blk: 10/11 exact; code1556/2072; data424/424
## Round5 final full clean gate, copied verbatim
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/so/SOOption] pool: IDENTICAL
[libs/RevoEX/src/so/SOOption] objdiff: code 816/1292 data None/None functions 3/4 fuzzy 99.9226 linked code 0
[libs/RevoEX/src/so/SOOption] instruction-exact functions: 3/4
[libs/RevoEX/src/so/SOOption] section .text size 1292 match 99.9226
[libs/RevoEX/src/so/SOOption] below 100: SOGetInterfaceOpt 99.78992
[libs/RevoEX/src/so/SOOption] baseline: code 816/1292 data None functions 3 fuzzy 99.9226
[libs/RVL_SDK/src/fa/pf_volume] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_volume] objdiff: code 16732/17992 data 210976/210976 functions 34/37 fuzzy 99.8755 linked code 0
[libs/RVL_SDK/src/fa/pf_volume] instruction-exact functions: 34/37
[libs/RVL_SDK/src/fa/pf_volume] section .bss size 210944 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .data size 16 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .sdata2 size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .text size 17992 match 99.8755
[libs/RVL_SDK/src/fa/pf_volume] below 100: PFVOL_p_rmvvol 95.9375
[libs/RVL_SDK/src/fa/pf_volume] below 100: PFVOL_attach 98.72159
[libs/RVL_SDK/src/fa/pf_volume] below 100: PFVOL_regctx 99.0
[libs/RVL_SDK/src/fa/pf_volume] baseline: code 16732/17992 data 210976 functions 34 fuzzy 99.8755
[libs/RVL_SDK/src/fa/pf_entry_iterator] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_entry_iterator] objdiff: code 6640/7880 data 24/24 functions 14/16 fuzzy 99.6264 linked code 0
[libs/RVL_SDK/src/fa/pf_entry_iterator] instruction-exact functions: 14/16
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .sdata size 24 match 100.0
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .text size 7880 match 99.626396
[libs/RVL_SDK/src/fa/pf_entry_iterator] below 100: PFENT_ITER_FindCluster 99.81013
[libs/RVL_SDK/src/fa/pf_entry_iterator] below 100: PFENT_ITER_GetLFNEntryName 90.53425
[libs/RVL_SDK/src/fa/pf_entry_iterator] baseline: code 6640/7880 data 24 functions 14 fuzzy 99.6264
[src/keyboard/tiString] pool: IDENTICAL
[src/keyboard/tiString] objdiff: code 4632/5176 data 288/288 functions 41/42 fuzzy 98.9629 linked code 0
[src/keyboard/tiString] instruction-exact functions: 41/42
[src/keyboard/tiString] section .data size 288 match 100.0
[src/keyboard/tiString] section .text size 5176 match 98.962906
[src/keyboard/tiString] below 100: inputChar__Q39textinput8tistring9DecolatedFw 90.132355
[src/keyboard/tiString] baseline: code 4632/5176 data 288 functions 41 fuzzy 98.9629
[src/keyboard/tiSignWindow] pool: IDENTICAL
[src/keyboard/tiSignWindow] objdiff: code 6300/7184 data 3468/3468 functions 55/56 fuzzy 99.8914 linked code 0
[src/keyboard/tiSignWindow] instruction-exact functions: 55/56
[src/keyboard/tiSignWindow] section .ctors size 4 match 100.0
[src/keyboard/tiSignWindow] section .data size 2672 match 100.0
[src/keyboard/tiSignWindow] section .rodata size 784 match 100.0
[src/keyboard/tiSignWindow] section .sdata size 8 match 100.0
[src/keyboard/tiSignWindow] section .text size 7184 match 99.891426
[src/keyboard/tiSignWindow] below 100: create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator 99.117645
[src/keyboard/tiSignWindow] baseline: code 6300/7184 data 3468 functions 55 fuzzy 99.8914
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] pool: IDENTICAL
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] objdiff: code 1556/2072 data 424/424 functions 10/11 fuzzy 99.8938 linked code 0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] instruction-exact functions: 10/11
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .bss size 384 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .data size 32 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .text size 2072 match 99.89382
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] below 100: uhf_msc_blk_pread 99.57365
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] baseline: code 1556/2072 data 424 functions 10 fuzzy 99.8938
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] pool: IDENTICAL
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] objdiff: code 712/1804 data None/None functions 4/6 fuzzy 90.7738 linked code 0
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] instruction-exact functions: 4/6
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] section .text size 1804 match 90.773834
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] below 100: TMCJPEGDEC_IdctBlock4x4 85.625
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] below 100: TMCJPEGDEC_IdctBlock4x4_Col 83.89781
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] baseline: code 712/1804 data None functions 4 fuzzy 90.5743
regressions vs baseline: 0
global matched_code_percent: 88.92459 -> 88.92459
global fuzzy_match_percent: 99.48913 -> 99.48926
global complete_code_percent: 65.19670 -> 65.19670
global matched_data_percent: 99.06781 -> 99.06781
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
Round5 exact functions, matched code bytes, matched data bytes before -> after:
libs/RevoEX/src/so/SOOption: functions 3/4 -> 3/4; code 816 -> 816/1292; data 0 -> 0/0
libs/RVL_SDK/src/fa/pf_volume: functions 34/37 -> 34/37; code 16732 -> 16732/17992; data 210976 -> 210976/210976
libs/RVL_SDK/src/fa/pf_entry_iterator: functions 14/16 -> 14/16; code 6640 -> 6640/7880; data 24 -> 24/24
src/keyboard/tiString: functions 41/42 -> 41/42; code 4632 -> 4632/5176; data 288 -> 288/288
src/keyboard/tiSignWindow: functions 55/56 -> 55/56; code 6300 -> 6300/7184; data 3468 -> 3468/3468
libs/RVL_SDK/src/fa/msc/puh_msc_blk: functions 10/11 -> 10/11; code 1556 -> 1556/2072; data 424 -> 424/424
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var: functions 4/6 -> 4/6; code 712 -> 712/1804; data 0 -> 0/0
Round5 every remaining open function relisted after final clean build:
SOGetInterfaceOpt: 99.78992%; five parameter-register coloring differences; frame/branches/instruction count exact; 4 distinct successful source attempts.
PFVOL_p_rmvvol: 95.9375%; constant scalar folds to li; target loads byte initializer template; aggregate exact-code variants need different data and were rejected; 5 distinct successful source attempts.
PFVOL_attach: 98.72159%; inline clear_mount result boundary removes two target instructions; success status materialization unresolved; 6 distinct successful source attempts.
PFVOL_regctx: 99.0%; 15 free-index/status register-color differences in unrolled loop; 3 distinct successful source attempts.
PFENT_ITER_FindCluster: 99.81013%; eight constant-one/entries-per-sector register-color differences; 3 distinct successful source attempts.
PFENT_ITER_GetLFNEntryName: 90.53425%; target byte-offset loop versus source pointer induction, plus terminator multiply/clear-bit form; 4 distinct successful source attempts.
inputChar__Q39textinput8tistring9DecolatedFw: 90.132355%; Hangul conversion helper boundary folds dynamic append and count;125/136 instructions; 3 distinct successful source attempts.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator: 99.117645%; 34 hoisted vtable/constants and animation-loop register-color differences; 3 distinct successful source attempts.
uhf_msc_blk_pread: 99.57365%; 10 transfer-count/product register-color differences; 3 distinct successful source attempts.
TMCJPEGDEC_IdctBlock4x4: 85.625%; row scheduling/store order and operands;136/136 instructions,19 structural93 exact differences; 12 distinct successful source attempts.
TMCJPEGDEC_IdctBlock4x4_Col: 83.89781%; row scheduling/operand order;137/137 instructions,31 structural48 exact differences; 6 distinct successful source attempts.
Files changed: libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var.c and tools/decomp-assist/fz3.attempts.md; code commit650cc87e. No symbol/config changes, no unowned eZiText changes. Zero new exact functions; retained one honest fuzzy improvement: Col83.240875->83.89781 and139->137 instructions. Full gatePASS, regressions0, forbidden0, readability0; target DOL SHA1 unchanged.
Uncertain: original Hangul converter/helper structure, clear_mount inline result materialization, IDCT source scheduling, and whether pure register differences have another real source lever. No full-completion claim.
# Round6 XHIGH, same branch HEAD98cb7171. Each trial logs first differing instruction and source construct, with original always restored until accepted by gate.
SOGetInterfaceOpt first difference instruction5: parameter level moved to r25, targetr26. Register allocation class;119/119 frame0x30 branches operands/helper calls identical. Change full option-helper formal parameter lifetime ordering before declaration-only searches.
SOGetInterfaceOpt | R6 full helper with option level length value lifetime order | objdiff 98.32773; 119/119 instructions; structural/exact (4, 42); first (5, ('mr', 'r27, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 full helper option before level with unchanged output arguments | objdiff 98.32773; 119/119 instructions; structural/exact (4, 42); first (5, ('mr', 'r27, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 initialize request-state locals before preparation | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 retain option parameter until reply pointer initialization | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 option command store before level at reply setup boundary | objdiff 99.85714; 119/119 instructions; structural/exact (2, 3); first (5, ('mr', 'r28, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 option store precedes level before both reply pointer declarations | objdiff 99.85714; 119/119 instructions; structural/exact (2, 3); first (5, ('mr', 'r28, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 selection state fields initialized option before level but command stores in target order | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 typed command-header aggregate assignment retains8byte command extent | BUILD FAIL /src/so && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RevoEX/src/so/SOOption.d build/43U/src/libs/RevoEX/src/so/SOOption.d ### mwcceppc.exe Compiler: # File: libs\RevoEX\src\so\SOOption.c # -------------------------------------- # 119: InterfaceHeader header = {level, option}; # Error: ^ # (10124) illegal constant expression # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed.
SOGetInterfaceOpt | R6 typed command-header copy with C89 field initialization | objdiff 98.0084; 121/119 instructions; structural/exact (12, 82); first (0, ('stwu', 'r1, -0x40(r1)'), ('stwu', 'r1, -0x30(r1)'))
SOGetInterfaceOpt | R6 command and response phases share typed local length and reply union state | objdiff 98.23529; 119/119 instructions; structural/exact (0, 41); first (5, ('mr', 'r27, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 length validator defined after get implementation using forward declaration | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 distinct preparation status and operation result lifetimes | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 separate ioctl result from public API return result | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 typed response state stores length pointer before data pointer | objdiff 98.94958; 119/119 instructions; structural/exact (0, 24); first (5, ('mr', 'r28, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 typed response state stores data pointer before length pointer | objdiff 98.94958; 119/119 instructions; structural/exact (0, 24); first (5, ('mr', 'r28, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 command and returned-length pointers grouped as IPC input state | objdiff 99.07563; 119/119 instructions; structural/exact (0, 22); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 allocation request and response-buffer pointer in shared state record | objdiff 98.94958; 119/119 instructions; structural/exact (0, 24); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
R6 SOGetInterfaceOpt register-only declaration search after helper/state/lifetime trials: declaration block:
s32 rm;
int temporary;
int size;
int result;
InterfaceOption* request;
InterfaceCommand* command;
int* returnedLength;
u8* reply;
start (0, 5)
best (0, 5) after 30 builds; source restored; best order was:
s32 rm;
int temporary;
int size;
int result;
InterfaceOption* request;
InterfaceCommand* command;
int* returnedLength;
u8* reply;
R6 PFVOL_p_rmvvol first difference instruction3: source li r0,0xe5 before root pointer setup; target addi r4,r1,0x2b0 then SDA lbz at6. Initialization construct folded scalar versus aggregate byte template;64/64 frame0x500. Source on origin/main identical. Inspect real template type/extents, do not add padding or unused objects.
PFVOL_p_rmvvol | R6 ordinary memcpy of named marker byte allows builtin constant-size copy | objdiff 89.375; 67/64 instructions; structural/exact (7, 63); first (2, ('li', 'r4, 0'), ('stw', 'r0, 0x504(r1)'))
R6 deleted marker data evidence: target .sdata2 aligned8, sole extent8 contains E5 followed7zeros, only code relocation lbz readsbyte0 and PFSEC_WriteData count1. A local one-byte initializer proves compiled template1 but does not independently prove original object1 rather than array8; no extent edits retained without full pairing proof/gate.
PFVOL_p_rmvvol | R6 explicit byte view of named readonly marker before root lookup | objdiff 93.75; 64/64 instructions; structural/exact (2, 3); first (4, ('lbz', 'r0, 0(0)'), ('stw', 'r31, 0x4fc(r1)'))
PFVOL_p_rmvvol | R6 readonly marker byte view in scalar declaration initializer | objdiff 93.75; 64/64 instructions; structural/exact (2, 3); first (4, ('lbz', 'r0, 0(0)'), ('stw', 'r31, 0x4fc(r1)'))
R6 marker byte-view cast generates actual SDA lbz without volatile or new data. Target and ours now both load the same8-byte E5/zero marker through one-byte access; target object lbl_816959A0 vs real source deleted_entry_mark may require permitted name pairing. Investigate relocation names before changing config.
PFVOL_p_rmvvol | R6 typed deleted directory-byte field copied through readonly marker view | objdiff 93.75; 64/64 instructions; structural/exact (2, 3); first (4, ('lbz', 'r0, 0(0)'), ('stw', 'r31, 0x4fc(r1)'))
PFVOL_p_rmvvol | R6 one-byte directory-mark aggregate copy initialized from named readonly data | objdiff 93.75; 64/64 instructions; structural/exact (2, 3); first (4, ('lbz', 'r0, 0(0)'), ('stw', 'r31, 0x4fc(r1)'))
PFVOL_p_rmvvol | R6 natural one-byte local initializer with obsolete8byte constant removed | objdiff 100.0; 64/64 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r6-candidates/PFVOL_p_rmvvol_natural_one_byte_local_initializer_with_obsolete8byte_constant_removed.txt
R6 natural local deleted[1]={0xE5} proves byte-template initialization and target64/64 instructions exact. Code100%; original8byte global removed, section may have7 alignment bytes. Testing authorized symbol extent correction only, no addresses or split/section totals will change. Proof: PFVOL_p_rmvvol sole SDA21 relocation lbz reads one byte, stores to stack byte8, WriteData pointer stack8 count1; natural type u8[1] and target next unit alignment8 account for trailing7zero bytes.
R6 ACCEPTED data extent proof: PFVOL_p_rmvvol relocation SDA21 at offset0x7a8 reads1 byte of lbl_816959A0; stack byte8 is passed to PFSEC_WriteData count1; local u8[1] initializer compiles identical64 instructions. Correct object extent8->1 at same0x816959A0, leave7 alignment zeros unowned; split .sdata2 remains8 bytes and unit data210976/210976 unchanged. No address or section-total edits.
R6 PFVOL_p_rmvvol exact100%, ctxdiff64/64 diffs0, pool identical; volume34/37->35/37, matched code16732->16988/17992; quick full-build gatePASS, regressions0/forbidden0/readability0, DOL SHA1 correct.
R6 PFVOL_attach first difference35 is exit branch displacement524 vs532, caused by missing inline return-materialization instructions. First semantic difference142 beq8 vs12, then missing mr r0,r3. Frame0x20 correct, data/pool exact; change attach-only status conversion and helper completion boundary; shared clear_mount consumers must stay exact.
PFVOL_attach | R6 native-int attach mount status converts signed-long inline return | objdiff 98.72159; 174/176 instructions; structural/exact (10, 39); first (35, ('b', '524'), ('b', '532'))
PFVOL_attach | R6 unsigned attach-status view of inline mount result | objdiff 98.72159; 174/176 instructions; structural/exact (10, 39); first (35, ('b', '524'), ('b', '532'))
PFVOL_attach | R6 auto-inline attach-only mount helper preserves returned status boundary | objdiff 98.72159; 174/176 instructions; structural/exact (10, 39); first (35, ('b', '524'), ('b', '532'))
PFVOL_attach | R6 auto inline clear_mount boundary | objdiff 98.72159; 174/176 instructions; structural/exact (10, 39); first (35, ('b', '524'), ('b', '532'))
PFVOL_attach | R6 single joined mount status after success branch | objdiff 95.142044; 176/176 instructions; structural/exact (10, 22); first (134, ('li', 'r31, 0'), ('ori', 'r0, r0, 0x10'))
PFVOL_regctx | R6 fresh origin/main unchanged function; first difference16 free_context_index r5 versus targetr8; frame0x10 and75instructions identical, unrolled-loop stat r8 versus targetr5. Structural diagnosis complete; declaration/temporary experiments next.
PFVOL_regctx | R6 context id and free slot state | objdiff 80.36; 83/75 instructions; structural/exact (27, 71); first (12, ('b', '268'), ('b', '236'))
PFVOL_regctx | R6 unsigned free slot and signed status temporary | objdiff 99.0; 75/75 instructions; structural/exact (0, 15); first (16, ('li', 'r5, 0'), ('li', 'r8, 0'))
PFVOL_regctx | R6 explicit continue after selecting free context | objdiff 99.0; 75/75 instructions; structural/exact (0, 15); first (16, ('li', 'r5, 0'), ('li', 'r8, 0'))
PFENT_ITER_FindCluster | R6 origin/main source unchanged; pool identical; first39 li r7,1 vs targetr8,1, with8pure operand diffs/237instructions/frame0xA0; constantone and entries_per_sector interference. Structural initialization boundaries examined before declsearch.
PFENT_ITER_FindCluster | R6 initialize FAT hint before iterator fields | objdiff 95.43882; 237/237 instructions; structural/exact (8, 50); first (2, ('li', 'r8, 0'), ('li', 'r6, 0'))
PFENT_ITER_FindCluster | R6 inline iterator setup with returned entry count | BUILD FAIL s/RVL_SDK/src/fa && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/fa/pf_entry_iterator.d build/43U/src/libs/RVL_SDK/src/fa/pf_entry_iterator.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\fa\pf_entry_iterator.c # ------------------------------------------------ # 500: pf_u32 entries_per_sector = 1 << iter->log2_entries_per_sector; # Error: ^^^^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed.
PFENT_ITER_FindCluster | R6 C89 inline iterator setup and returned entry count | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R6 entry geometry state shares first cluster constant | BUILD FAIL ld/43U/src/libs/RVL_SDK/src/fa/pf_entry_iterator.d build/43U/src/libs/RVL_SDK/src/fa/pf_entry_iterator.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\fa\pf_entry_iterator.c # ------------------------------------------------ # 513: iter.log2_geometry.entries = p_ent->p_vol->bpb.log2_bytes_per_sector - 5; # Error: ^ # (10393) 'log2_geometry' is not a member of class 'struct PFITER_ENT_ITER' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed.
PFENT_ITER_FindCluster | R6 typed entry geometry shares first cluster constant | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_GetLFNEntryName | R6 fresh fetch and source check; first13 pointer induction mr r31,r28 versus target zero fragment counter r29. Both73/frame0x30; target keeps byteoffset, calculates destination atloop44, reloadsLFNcount and terminates count*26 masked even. Need fragment-address/terminator constructs, not register edits.
PFENT_ITER_GetLFNEntryName | R6 byteoffset destination and count-derived terminator | objdiff 79.328766; 76/73 instructions; structural/exact (24, 75); first (0, ('stwu', 'r1, -0x20(r1)'), ('stwu', 'r1, -0x30(r1)'))
PFENT_ITER_GetLFNEntryName | R6 fragment inline helper returns byteoffset | objdiff 99.246574; 73/73 instructions; structural/exact (0, 8); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper counter initializes before offset | objdiff 99.178085; 73/73 instructions; structural/exact (0, 9); first (13, ('li', 'r30, 0'), ('li', 'r29, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper progress fields counter then offset | objdiff 99.38356; 73/73 instructions; structural/exact (0, 7); first (13, ('li', 'r30, 0'), ('li', 'r29, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment progress offset then counter | objdiff 99.38356; 73/73 instructions; structural/exact (0, 7); first (13, ('li', 'r30, 0'), ('li', 'r29, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper offset parameter first | objdiff 99.246574; 73/73 instructions; structural/exact (0, 8); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper updates byteoffset by pointer | objdiff 79.328766; 76/73 instructions; structural/exact (24, 75); first (0, ('stwu', 'r1, -0x20(r1)'), ('stwu', 'r1, -0x30(r1)'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper uses UTF16 destination type | objdiff 99.246574; 73/73 instructions; structural/exact (0, 8); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 retained ordinary inline fragment copy returning byteoffset, count-derived terminator; source73 target73, structural0, remaining7 registeroperand differences. declsearch6builds moved declaration index beforecounter, best7; no artificial fields retained.
PFENT_ITER_GetLFNEntryName | R6 quick gate PASS:99.38356 vs90.53425;14/16 exact unchanged, code6640/7880 data24/24, global regressions0 forbidden0 readability0 DOL26116613f624061ba99c8d1a299aaa6efa85670d. Retain structural correction with7 registerdifferences for future escalation.
inputChar__Q39textinput8tistring9DecolatedFw | R6 fresh origin source unchanged poolidentical; first10 branch extent corresponds125vs136/frame0x30; true firstconstruct65 mode3 lacks inlined dynamiccount append, initialNUL, ch==newline comparison. Count truncation also foldedaway; do generic builder helper experiments, no invented newline stub.
inputChar__Q39textinput8tistring9DecolatedFw | R6 two inline builder boundaries return input length | objdiff 90.132355; 125/136 instructions; structural/exact (18, 73); first (10, ('beq', '428'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R6 inline append length by C++ reference | objdiff 90.132355; 125/136 instructions; structural/exact (18, 73); first (10, ('beq', '428'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R6 input builder constructor append finish method boundaries | objdiff 90.757355; 126/136 instructions; structural/exact (17, 73); first (10, ('beq', '432'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R6 out of class auto inline input builder methods | objdiff 90.757355; 126/136 instructions; structural/exact (17, 73); first (10, ('beq', '432'), ('beq', '472'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R6 fresh origin source unchanged pool30identical; first48 vtablelisr26 vstarget25;221instructions/frame0x50 and34operandonly differences. Hoistedconstructor vtables and animationCount/animationentry lifetimes interfere; try animation inline boundary.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R6 animation resource setup in independent inline helper | objdiff 90.22172; 223/221 instructions; structural/exact (45, 158); first (48, ('lis', 'r27, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R6 animation inline helper retains owner field reloads | objdiff 97.714935; 221/221 instructions; structural/exact (0, 73); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R6 pane descriptor pointer instead of reference lifetime | objdiff 99.117645; 221/221 instructions; structural/exact (0, 34); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
uhf_msc_blk_pread | R6 fresh fetch source unchanged poolidentical; first75 clrlwi transfer_blocks r25 vstarget27, productr27 vstarget25;129instructions/frame0x40 and10operand-only differences. Try transfer selection inline boundary and actual read transfer descriptor, then declarations.
uhf_msc_blk_pread | R6 inline transfer limit selection returns u16 | objdiff 99.612404; 129/129 instructions; structural/exact (0, 10); first (26, ('li', 'r25, 0'), ('li', 'r26, 0'))
uhf_msc_blk_pread | R6 inline selection returns full count caller narrows | objdiff 98.21706; 130/129 instructions; structural/exact (9, 59); first (18, ('b', '424'), ('b', '420'))
uhf_msc_blk_pread | R6 read descriptor combines selected device and transfer count | objdiff 100.0; 129/129 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r6-candidates/uhf_msc_blk_pread_read_descriptor_combines_selected_device_and_transfer_count.txt
uhf_msc_blk_pread | R6 exact candidate: inline u16 selection fixes count operand at75; ordinary read descriptor {device,blocks} fixes device/product live-range ordering.129/129 instructions0 structural0 operands; no dummy objects, pwrite unchanged.
TMCJPEGDEC_IdctBlock4x4 | R6 fresh origin/main function unchanged, poolidentical; first2 addi sp=r3 versus targetr8;136/frame0x120 identical but19instruction-form and93operanddifferences. Reused input/temporary pointers allow parameter coalescing; separate row/column pass scopes before operand tuning.
uhf_msc_blk_pread | R6 quick GATE PASS:11/11 vs10/11, code2072/2072 vs1556/2072 data424/424 unchanged, unitall100. Globalregressions0 forbidden0 readability0, ctxdiff129/129diffs0, DOL26116613f624061ba99c8d1a299aaa6efa85670d.
TMCJPEGDEC_IdctBlock4x4 | R6 distinct row and column pointer scopes | objdiff 85.84559; 136/136 instructions; structural/exact (19, 89); first (2, ('addi', 'r3, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R6 IDCT pass descriptor pairs source and temporary pointers | objdiff 85.77206; 136/136 instructions; structural/exact (19, 93); first (2, ('addi', 'r7, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R6 pass descriptor includes transform loop index | objdiff 85.77206; 136/136 instructions; structural/exact (19, 93); first (2, ('addi', 'r7, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R6 target order row stores and reusable even differences | objdiff 81.81618; 136/136 instructions; structural/exact (20, 93); first (2, ('addi', 'r3, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4_Col | R6 fresh origin source differs onlyaccepted oddrot commontemps fromHIGH; poolidentical; actual first8 lwz b r5 vstarget10, pointers7/8alreadymatch,137/frame0x120;31formdiffs/48operands, arithmeticload/store scheduling plus b/c/rot registerswap. Separate pass and row coefficients next.
TMCJPEGDEC_IdctBlock4x4_Col | R6 independent row and column source pointer scopes | objdiff 83.38686; 137/137 instructions; structural/exact (31, 54); first (8, ('lwz', 'r5, 4(r7)'), ('lwz', 'r10, 4(r7)'))
TMCJPEGDEC_IdctBlock4x4_Col | R6 shared coefficient temporaries row store sequence operand d+b | objdiff 78.948906; 135/137 instructions; structural/exact (47, 136); first (0, ('stwu', 'r1, -0x110(r1)'), ('stwu', 'r1, -0x120(r1)'))
TMCJPEGDEC_IdctBlock4x4_Col | R6 inline four-point helper returns arithmetic terms struct | objdiff 74.07299; 155/137 instructions; structural/exact (58, 154); first (0, ('stwu', 'r1, -0x160(r1)'), ('stwu', 'r1, -0x120(r1)'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper computes next offset before copies | objdiff 99.38356; 73/73 instructions; structural/exact (0, 7); first (13, ('li', 'r30, 0'), ('li', 'r29, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment position and read status state | objdiff 99.38356; 73/73 instructions; structural/exact (0, 7); first (13, ('li', 'r30, 0'), ('li', 'r29, 0'))
PFENT_ITER_GetLFNEntryName | R6 reordered counter initialization after declaration search | objdiff 99.45206; 73/73 instructions; structural/exact (0, 6); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 fragment helper accepts caller computed destination | objdiff 99.45206; 73/73 instructions; structural/exact (0, 6); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 copy helper fragment destination and byte offset state | objdiff 99.45206; 73/73 instructions; structural/exact (0, 6); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 caller scoped fragment destination temporary | objdiff 99.45206; 73/73 instructions; structural/exact (0, 6); first (14, ('li', 'r30, 0'), ('li', 'r31, 0'))
PFENT_ITER_GetLFNEntryName | R6 caller destination lifetime plus searched declaration order | objdiff 100.0; 73/73 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r6-candidates/PFENT_ITER_GetLFNEntryName_caller_destination_lifetime_plus_searched_declaration_order.txt
PFENT_ITER_GetLFNEntryName | R6 exact: fragment helper accepts computed destination; caller owns destination lifetime; initialization counter before byteoffset; declaration index,destination,counter,error foundby2-builddeclsearch.73/73diffs0 objdiff100. Natural13UTF16/26byte fragment copies and count-derived terminator.
R6 declaration followups: SOGetInterfaceOpt30builds remained5, PFVOL_regctx13builds remained15, FindCluster30builds remained8, signcreate6builds remained34. They followed logged structural/source trials; originals restored.
PFENT_ITER_GetLFNEntryName | R6 quick GATE PASS:15/16 vs14/16, code6932/7880 vs6640/7880 data24/24,0 regressions forbidden readability, DOL26116613f624061ba99c8d1a299aaa6efa85670d.
PFENT_ITER_FindCluster | R6 explicit active FAT hint pointer lifetime | objdiff 98.50211; 237/237 instructions; structural/exact (2, 27); first (2, ('stw', 'r0, 0xa4(r1)'), ('li', 'r6, 0'))
PFENT_ITER_FindCluster | R6 iterator file descriptor named pointer temporary | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
SOGetInterfaceOpt | R6 response header couples level and returned length pointer | objdiff 99.07563; 119/119 instructions; structural/exact (0, 22); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 option payload state holds selector and returned byte pointer | objdiff 98.94958; 119/119 instructions; structural/exact (0, 24); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 request descriptor combines header selectors and allocation | objdiff 99.32773; 119/119 instructions; structural/exact (0, 16); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R6 inline header stores with selector parameter before level | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
R6 completeness checkpoint: three new exact functions PFVOL_p_rmvvol, uhf_msc_blk_pread, PFENT_ITER_GetLFNEntryName are committed after quick gate PASS. All remaining functions have >=3 distinct successfully compiled R6 source trials; SO19, attach5, regctx3, FindCluster5+, input4, sign3, IDCT4/3. SO/pfvol/string/sign/IDCT rejected candidates restored; no eZiText edits. Data audit ownedunits: all target datascores100, only proven1byte deletion marker extent correction retained; weak duplicated symbols ignored.
## R6 final full clean gate and completeness audit
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/so/SOOption] pool: IDENTICAL
[libs/RevoEX/src/so/SOOption] objdiff: code 816/1292 data None/None functions 3/4 fuzzy 99.9226 linked code 0
[libs/RevoEX/src/so/SOOption] instruction-exact functions: 3/4
[libs/RevoEX/src/so/SOOption] section .text size 1292 match 99.9226
[libs/RevoEX/src/so/SOOption] below 100: SOGetInterfaceOpt 99.78992
[libs/RevoEX/src/so/SOOption] baseline: code 816/1292 data None functions 3 fuzzy 99.9226
[libs/RVL_SDK/src/fa/pf_volume] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_volume] objdiff: code 16988/17992 data 210976/210976 functions 35/37 fuzzy 99.9333 linked code 0
[libs/RVL_SDK/src/fa/pf_volume] instruction-exact functions: 35/37
[libs/RVL_SDK/src/fa/pf_volume] section .bss size 210944 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .data size 16 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .sdata2 size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .text size 17992 match 99.933304
[libs/RVL_SDK/src/fa/pf_volume] below 100: PFVOL_attach 98.72159
[libs/RVL_SDK/src/fa/pf_volume] below 100: PFVOL_regctx 99.0
[libs/RVL_SDK/src/fa/pf_volume] baseline: code 16732/17992 data 210976 functions 34 fuzzy 99.8755
[libs/RVL_SDK/src/fa/pf_entry_iterator] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_entry_iterator] objdiff: code 6932/7880 data 24/24 functions 15/16 fuzzy 99.9772 linked code 0
[libs/RVL_SDK/src/fa/pf_entry_iterator] instruction-exact functions: 15/16
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .sdata size 24 match 100.0
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .text size 7880 match 99.97716
[libs/RVL_SDK/src/fa/pf_entry_iterator] below 100: PFENT_ITER_FindCluster 99.81013
[libs/RVL_SDK/src/fa/pf_entry_iterator] baseline: code 6640/7880 data 24 functions 14 fuzzy 99.6264
[src/keyboard/tiString] pool: IDENTICAL
[src/keyboard/tiString] objdiff: code 4632/5176 data 288/288 functions 41/42 fuzzy 98.9629 linked code 0
[src/keyboard/tiString] instruction-exact functions: 41/42
[src/keyboard/tiString] section .data size 288 match 100.0
[src/keyboard/tiString] section .text size 5176 match 98.962906
[src/keyboard/tiString] below 100: inputChar__Q39textinput8tistring9DecolatedFw 90.132355
[src/keyboard/tiString] baseline: code 4632/5176 data 288 functions 41 fuzzy 98.9629
[src/keyboard/tiSignWindow] pool: IDENTICAL
[src/keyboard/tiSignWindow] objdiff: code 6300/7184 data 3468/3468 functions 55/56 fuzzy 99.8914 linked code 0
[src/keyboard/tiSignWindow] instruction-exact functions: 55/56
[src/keyboard/tiSignWindow] section .ctors size 4 match 100.0
[src/keyboard/tiSignWindow] section .data size 2672 match 100.0
[src/keyboard/tiSignWindow] section .rodata size 784 match 100.0
[src/keyboard/tiSignWindow] section .sdata size 8 match 100.0
[src/keyboard/tiSignWindow] section .text size 7184 match 99.891426
[src/keyboard/tiSignWindow] below 100: create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator 99.117645
[src/keyboard/tiSignWindow] baseline: code 6300/7184 data 3468 functions 55 fuzzy 99.8914
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] pool: IDENTICAL
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] objdiff: code 2072/2072 data 424/424 functions 11/11 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] instruction-exact functions: 11/11
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .bss size 384 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .data size 32 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] section .text size 2072 match 100.0
[libs/RVL_SDK/src/fa/msc/puh_msc_blk] baseline: code 1556/2072 data 424 functions 10 fuzzy 99.8938
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] pool: IDENTICAL
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] objdiff: code 712/1804 data None/None functions 4/6 fuzzy 90.7738 linked code 0
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] instruction-exact functions: 4/6
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] section .text size 1804 match 90.773834
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] below 100: TMCJPEGDEC_IdctBlock4x4 85.625
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] below 100: TMCJPEGDEC_IdctBlock4x4_Col 83.89781
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] baseline: code 712/1804 data None functions 4 fuzzy 90.5743
regressions vs baseline: 0
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
libs/RevoEX/src/so/SOOption | R6 before -> after exact 3/4 -> 3/4; objdiff codebytes 816 -> 816/1292; databytes 0 -> 0/0
OPEN SOGetInterfaceOpt 99.78992% | 20 distinct compiledR6trials | 119/119 frame0x30;5parameter register differences level/option; all latercode identical.
libs/RVL_SDK/src/fa/pf_volume | R6 before -> after exact 34/37 -> 35/37; objdiff codebytes 16732 -> 16988/17992; databytes 210976 -> 210976/210976
OPEN PFVOL_attach 98.72159% | 5 distinct compiledR6trials | 174/176 frame0x20; missingerror join materialization mr0,r3 and li0,0 afterinline clear_mount.
OPEN PFVOL_regctx 99.0% | 3 distinct compiledR6trials | 75/75 frame0x10;15register differences free slotr5/8 versus statusr8/5 in unrolled contextscan.
libs/RVL_SDK/src/fa/pf_entry_iterator | R6 before -> after exact 14/16 -> 15/16; objdiff codebytes 6640 -> 6932/7880; databytes 24 -> 24/24
OPEN PFENT_ITER_FindCluster 99.81013% | 5 distinct compiledR6trials | 237/237 frame0xA0;8register differences sharedconstantoner7/8 versus entries-per-sectorr8/7.
src/keyboard/tiString | R6 before -> after exact 41/42 -> 41/42; objdiff codebytes 4632 -> 4632/5176; databytes 288 -> 288/288
OPEN inputChar__Q39textinput8tistring9DecolatedFw 90.132355% | 4 distinct compiledR6trials | 125/136 frame0x30; mode3input helper dynamicappend missing11instructions; original converter boundary unresolved.
src/keyboard/tiSignWindow | R6 before -> after exact 55/56 -> 55/56; objdiff codebytes 6300 -> 6300/7184; databytes 3468 -> 3468/3468
OPEN create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator 99.117645% | 3 distinct compiledR6trials | 221/221 frame0x50;34register differences constructor-vtable hoisting, animationCount and animationentry lifetimes.
libs/RVL_SDK/src/fa/msc/puh_msc_blk | R6 before -> after exact 10/11 -> 11/11; objdiff codebytes 1556 -> 2072/2072; databytes 424 -> 424/424
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var | R6 before -> after exact 4/6 -> 4/6; objdiff codebytes 712 -> 712/1804; databytes 0 -> 0/0
OPEN TMCJPEGDEC_IdctBlock4x4 85.625% | 4 distinct compiledR6trials | 136/136 frame0x120;19instruction-form and93operand differences source pointer coalescing, arithmetic/store scheduling.
OPEN TMCJPEGDEC_IdctBlock4x4_Col 83.89781% | 3 distinct compiledR6trials | 137/137 frame0x120;31instruction-form and48operand differences first-pass oddsum/rotation scheduling, b/c/rotation registerallocation.
Finalclean ctxdiff:PFVOL_p_rmvvol64/64diffs0;PFENT_ITER_GetLFNEntryName73/73diffs0;uhf_msc_blk_pread129/129diffs0. No code/data/regression failures. No untried remaining function.
R6 files: config/43U/symbols.txt;libs/RVL_SDK/src/fa/pf_volume.c;libs/RVL_SDK/src/fa/pf_entry_iterator.c;libs/RVL_SDK/src/fa/msc/puh_msc_blk.c;tools/decomp-assist/fz3.attempts.md. Commits:2f84a3fe exactvolume+markerextent;5ce59884 iteratorstructuralimprovement;78c76f31 exactMSC;673020e0 exactiterator. HIGH650cc87e/98cb7171 predateR6 retained.
Uncertainty: original mode3 Hangul converter source/inline boundary is unavailable; dynamiccounter and dead newline comparison are proven targetinstructions, generic helper/class attempts constant-fold. Marker1-byteextent proof recorded above; no otherdataownership changes.
# Round7 XHIGH, fresh branch HEAD72cf3991. Each trial logs first differing instruction and source construct, with original always restored until accepted by gate.
libs/RevoEX/src/so/SOOption | R7 pool run before tuning; current source alreadyorigin/main; data ownership audit starts with target extents and relocation names.
libs/RVL_SDK/src/fa/pf_volume | R7 pool run before tuning; current source alreadyorigin/main; data ownership audit starts with target extents and relocation names.
libs/RVL_SDK/src/fa/pf_entry_iterator | R7 pool run before tuning; current source alreadyorigin/main; data ownership audit starts with target extents and relocation names.
src/keyboard/tiString | R7 pool run before tuning; current source alreadyorigin/main; data ownership audit starts with target extents and relocation names.
src/keyboard/tiSignWindow | R7 pool run before tuning; current source alreadyorigin/main; data ownership audit starts with target extents and relocation names.
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var | R7 pool run before tuning; current source alreadyorigin/main; data ownership audit starts with target extents and relocation names.
libs/RevoEX/src/so/SOOption | R7 data 0/0; no unpaired owned data indicated.
SOGetInterfaceOpt | R7 extent 0x814b476c+0x1dc=0x814b4948; next SOSetInterfaceOpt 0x814b4948; overlap False
SOGetInterfaceOpt | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
libs/RVL_SDK/src/fa/pf_volume | R7 data 210976/210976; no unpaired owned data indicated.
PFVOL_attach | R7 extent 0x815e2364+0x2c0=0x815e2624; next PFVOL_detach 0x815e2624; overlap False
PFVOL_attach | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
PFVOL_regctx | R7 extent 0x815e4220+0x12c=0x815e434c; next PFVOL_unregctx 0x815e434c; overlap False
PFVOL_regctx | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
libs/RVL_SDK/src/fa/pf_entry_iterator | R7 data 24/24; no unpaired owned data indicated.
PFENT_ITER_FindCluster | R7 extent 0x815d3414+0x3b4=0x815d37c8; next PFENT_ITER_Retreat 0x815d37c8; overlap False
PFENT_ITER_FindCluster | R7 immediate stack store/reload evidence [(144, ('stw', 'r0, 0x20(r1)'), ('lwz', 'r0, 0x20(r1)'))]; no unsupported volatile changes authorized.
src/keyboard/tiString | R7 data 288/288; no unpaired owned data indicated.
inputChar__Q39textinput8tistring9DecolatedFw | R7 extent 0x81432ce4+0x220=0x81432f04; next confirmKana__Q39textinput8tistring9DecolatedFv 0x81432f04; overlap False
inputChar__Q39textinput8tistring9DecolatedFw | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
src/keyboard/tiSignWindow | R7 data 3468/3468; no unpaired owned data indicated.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 extent 0x81430e50+0x374=0x814311c4; next __dt__Q49textinput8keyboard10signwindow7AnmPaneFv 0x814311c4; overlap False
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var | R7 data 0/0; no unpaired owned data indicated.
TMCJPEGDEC_IdctBlock4x4 | R7 extent 0x814ef490+0x220=0x814ef6b0; next TMCJPEGDEC_IdctBlock2x2 0x814ef6b0; overlap False
TMCJPEGDEC_IdctBlock4x4 | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
TMCJPEGDEC_IdctBlock4x4_Col | R7 extent 0x814ef810+0x224=0x814efa34; next TMCJPEGDEC_IdctBlock2x2_Col 0x814efa34; overlap False
TMCJPEGDEC_IdctBlock4x4_Col | R7 immediate stack store/reload evidence []; no unsupported volatile changes authorized.
SOGetInterfaceOpt | R7 fresh fetch origin source identical; first5 level parameter r25 vstarget26 and optionr28 vstarget25;119instructions/frame0x30/branchforms andstoresotherwiseidentical. No overlappingextent or adjacentstackstore/reload. Const input helper and response views before declaration search.
SOGetInterfaceOpt | R7 const length input in OptionLength inline boundary | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R7 read-only view of typed selection object | objdiff 89.31933; 122/119 instructions; structural/exact (21, 116); first (0, ('stwu', 'r1, -0x40(r1)'), ('stwu', 'r1, -0x30(r1)'))
SOGetInterfaceOpt | R7 const selectors and returned response read view | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
PFVOL_attach | R7 fresh fetch origin unchanged; true first142 beq distance differs because target143 mr0,r3 gives mountstatus distinct from public return0r3.174/176 frame0x20. Successful source li3,0 afterClearMount vs targetli0,0. Inline helper/public early return boundary first, novolatileproof or extentoverlap.
PFVOL_attach | R7 public zero-return on mount error instead of discarded helper result | objdiff 100.0; 176/176 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r7-candidates/PFVOL_attach_public_zero_return_on_mount_error_instead_of_discarded_helper_result.txt
PFVOL_attach | R7 exact candidate preserves s32 mount error separately from public zero return; no artificial data or volatile; attach inline helper not called bythispath.176/176differences0.
PFVOL_attach | R7 quick GATE PASS,0regressions forbidden readability,36/37vs35/37 exact code17692/17992vs16988 data210976/210976, ctxdiff176/176diffs0. DOL26116613f624061ba99c8d1a299aaa6efa85670d.
PFVOL_regctx | R7 fresh origin unchanged; first16 free slotr5 vsr8, statusr8 vsr5,75/75/frame0x10, nobranchformdifferences/noadjacentstackreloadproof. Const context table view and inline slot boundary next.
PFVOL_regctx | R7 const context array view for registration scan | objdiff 99.0; 75/75 instructions; structural/exact (0, 15); first (16, ('li', 'r5, 0'), ('li', 'r8, 0'))
PFVOL_regctx | R7 const single context input helper for active status | objdiff 99.066666; 75/75 instructions; structural/exact (0, 14); first (16, ('li', 'r7, 0'), ('li', 'r8, 0'))
PFVOL_regctx | R7 const context helper plus declaration order index free id error | objdiff 100.0; 75/75 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r7-candidates/PFVOL_regctx_const_context_helper_plus_declaration_order_index_free_id_error.txt
PFVOL_regctx | R7 exact from real const input helper boundary ContextStatus, then declaration order context_index/free_context_index/context_id/error. Targetfree_slotr8 statusr5;75/75diffs0. const pointer selected load/temporary allocation; no volatile.
PFVOL_regctx | R7 quick GATE PASS volume37/37vs35/37, allcode17992/17992 alldata210976/210976,0regressions forbidden readability; targetDOLhash. ctxdiff75/75diffs0.
PFENT_ITER_FindCluster | R7 first39 sharedconstantone r7 vstarget8, shifted entriesr8 vstarget7,237/237/frame0xA0. Definitionvolatile evidence is iter.index, not current_cluster: iterator beginsstack0x20; target144 stw r0,0x20(r1) immediately145 lwz r0,0x20(r1), thencmp. Test private struct fieldqualifier with laterunitregressionaudit.
PFENT_ITER_FindCluster | R7 volatile iterator index field proven by immediate stack reload | objdiff 96.8903; 240/237 instructions; structural/exact (16, 202); first (18, ('b', '856'), ('b', '844'))
PFENT_ITER_FindCluster | R7 const iterator input helper returns sector entry count | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R7 const directory entry input parameter | objdiff 85.27426; 227/237 instructions; structural/exact (47, 233); first (2, ('li', 'r9, 0'), ('li', 'r6, 0'))
PFENT_ITER_FindCluster | R7 const entry view only for initial iterator setup | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R7 const cluster input in hint initialization boundary | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R7 reuse initial cluster field for hint sentinel assignments | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
inputChar__Q39textinput8tistring9DecolatedFw | R7 fresh origin unchanged; first65mode3branch size125/136frame0x30. Missing dynamicappend, initialNUL, deadnewlinecmp and countmask; no localvolatile evidence or symboloverlap. Constinput character and builder views test missing helper boundary honestly.
inputChar__Q39textinput8tistring9DecolatedFw | R7 const character pointer in mode3 inline append boundary | objdiff 90.132355; 125/136 instructions; structural/exact (18, 73); first (10, ('beq', '428'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R7 const stream view for mode3 termination and length | objdiff 90.757355; 126/136 instructions; structural/exact (17, 73); first (10, ('beq', '432'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R7 const stream reference preserves builder termination boundary | objdiff 90.757355; 126/136 instructions; structural/exact (17, 73); first (10, ('beq', '432'), ('beq', '472'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 fresh origin unchanged221/frame0x50, first48 vtableconstantr26 vstarget25,34operand-only diffs constructor/table/counter registers. Const pane metadata helper before declaration permutations; no adjacentstack reload or extent overlap.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 const pane metadata in complete construction helper | objdiff 98.07692; 221/221 instructions; structural/exact (0, 61); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 const pane metadata reference in construction boundary | objdiff 98.07692; 221/221 instructions; structural/exact (0, 61); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 animation bound read directly through const pane metadata | objdiff 96.47059; 221/221 instructions; structural/exact (3, 128); first (5, ('li', 'r19, 0'), ('li', 'r14, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 readonly pane table base as named loop input | objdiff 99.162895; 221/221 instructions; structural/exact (0, 32); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
TMCJPEGDEC_IdctBlock4x4 | R7 fresh origin unchanged136/frame0x120. First2 sourceptrr3 vsr8;19form/93operanddiffs, rowstores1,2,3,0 vtarget0,1,2,3 andload/mathoperand ordering. disasm_fn fails no.rela.text; ctxdiff/Capstone andtarget.s authoritative. Noextentoverlap orstackreloadproof. Const coefficient view first.
TMCJPEGDEC_IdctBlock4x4 | R7 const source pointer for both IDCT passes | objdiff 85.44118; 136/136 instructions; structural/exact (19, 93); first (2, ('addi', 'r3, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 const transform input behind full inline boundary | objdiff 78.338234; 130/136 instructions; structural/exact (47, 133); first (2, ('addi', 'r10, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 const public coefficient input with unit-guarded prototype | objdiff 85.44118; 136/136 instructions; structural/exact (19, 93); first (2, ('addi', 'r3, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 readonly source with first-row stores0 1 2 3 and shared rotation | objdiff 78.492645; 136/136 instructions; structural/exact (39, 93); first (2, ('addi', 'r3, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 read-only transform descriptor includes output pointer and stride | objdiff 85.588234; 136/136 instructions; structural/exact (19, 93); first (2, ('addi', 'r7, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 fresh origin unchanged137/frame0x120; first8 coefficientb r5 vsr10,31form/48operand differences, math operand d+b/rot+sum and load/store scheduling firstpass. Pointers7/8alreadytarget. Const source view then inline row boundary; no volatile/extentproof.
TMCJPEGDEC_IdctBlock4x4_Col | R7 const coefficient source pointer for signed IDCT passes | objdiff 83.89781; 137/137 instructions; structural/exact (31, 48); first (8, ('lwz', 'r5, 4(r7)'), ('lwz', 'r10, 4(r7)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 const signed transform input behind full inline boundary | objdiff 79.9927; 139/137 instructions; structural/exact (35, 135); first (1, ('addi', 'r5, r3, 0x60'), ('li', 'r0, 2'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 readonly source and target d+b rotation+sum operand order | objdiff 83.86131; 137/137 instructions; structural/exact (31, 48); first (8, ('lwz', 'r5, 4(r7)'), ('lwz', 'r10, 4(r7)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 odd coefficient recombination inside inline arithmetic boundary | objdiff 79.55474; 137/137 instructions; structural/exact (33, 81); first (2, ('addi', 'r8, r3, 0x60'), ('addi', 'r7, r3, 0x60'))
signcreate | R7 retain candidate readonly named pane table input reduces34to32operand differences221/221structural0,99.117645->99.162895. declsearch13builds nofurtherchange. Actual table remainsmutabledata withsameaddress andextent; view only const, dataowned100.
signcreate | R7 quick GATE PASS,99.162895vs99.117645,55/56 unchanged code6300/7184 data3468/3468;0regressions forbidden readability andtargetDOL. ctxdiff32operands. Constructor-vtable/table relocation load ordering also remains; lis/addi placeholders hide symbol ordering, so not all32differences are onlyregister choices.
SOGetInterfaceOpt | R7 success-scoped immutable command and response pointer bases | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R7 response immutable pointers scoped after selector stores | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R7 unsigned local selector with public API preserved | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R7 unsigned selector check in inline boundary | objdiff 94.94118; 124/119 instructions; structural/exact (9, 112); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
TMCJPEGDEC_IdctBlock4x4 | R7 readonly eight-coefficient row view for first pass | objdiff 85.661766; 136/136 instructions; structural/exact (19, 89); first (2, ('addi', 'r3, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 descending paired-row index derives both pass pointers | objdiff 74.94853; 131/136 instructions; structural/exact (42, 134); first (2, ('li', 'r7, 0x60'), ('addi', 'r8, r3, 0x60'))
IDCT R7 new structural hypothesis: target firstpass paired rows may be automatic unrolling of four single-row iterations, ratherthan hand-written pairedsource. Next test restores natural4-rowloop withsource/destination stride8; no pragmas.
TMCJPEGDEC_IdctBlock4x4 | R7 natural four-row loop lets compiler unroll paired rows | objdiff 78.213234; 130/136 instructions; structural/exact (36, 134); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
IDCT R7 natural4rowloop IS auto-unrolled2 as target, but savesr27..31 withstmw/lmw ratherthan4individualsave/restore, explaining exactly130vs136. Firstpass body40instructions matches targetcount. Scope evdiff separately from columnphase before moretuning.
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled loop with row-local even difference | objdiff 78.213234; 130/136 instructions; structural/exact (36, 134); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled rows with all arithmetic temporaries scoped to row | objdiff 78.58088; 130/136 instructions; structural/exact (36, 131); first (3, ('stmw', 'r27, 0x10c(r1)'), ('stw', 'r31, 0x11c(r1)'))
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled rows with const coefficient source | objdiff 78.213234; 130/136 instructions; structural/exact (36, 134); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled rows preserve b plus d subtree | objdiff 78.26471; 130/136 instructions; structural/exact (33, 134); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled rows recombine odd sum before rotation | objdiff 78.26471; 130/136 instructions; structural/exact (33, 134); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled rows compute even difference inside output expressions | objdiff 76.85294; 130/136 instructions; structural/exact (37, 134); first (2, ('stmw', 'r27, 0x10c(r1)'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 auto unrolled rows rotate before adding odd coefficient pair | objdiff 78.213234; 130/136 instructions; structural/exact (36, 134); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 natural four-row signed IDCT loop with shared temporaries | objdiff 99.48905; 137/137 instructions; structural/exact (0, 12); first (53, ('lwz', 'r9, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 natural signed rows with scoped coefficient and butterfly locals | objdiff 99.48905; 137/137 instructions; structural/exact (0, 12); first (53, ('lwz', 'r9, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 natural signed rows retain sum plus rotation expression | objdiff 99.34306; 137/137 instructions; structural/exact (0, 14); first (12, ('add', 'r3, r10, r12'), ('add', 'r3, r12, r10'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 natural signed rows declare immutable coefficient values in body | objdiff 97.44526; 137/137 instructions; structural/exact (0, 41); first (8, ('lwz', 'r30, 4(r7)'), ('lwz', 'r10, 4(r7)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 natural signed IDCT with second-pass d plus b operand tree | objdiff 99.52555; 137/137 instructions; structural/exact (0, 12); first (53, ('lwz', 'r9, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 natural signed IDCT second-pass b c declaration lifetimes | objdiff 98.868614; 137/137 instructions; structural/exact (0, 28); first (8, ('lwz', 'r11, 4(r7)'), ('lwz', 'r10, 4(r7)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 scoped column coefficients | objdiff 99.30657; 137/137 instructions; structural/exact (0, 13); first (53, ('lwz', 'r8, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 scoped column coefficients c before b | objdiff 99.30657; 137/137 instructions; structural/exact (0, 13); first (53, ('lwz', 'r8, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 scoped column butterfly terms | objdiff 99.52555; 137/137 instructions; structural/exact (0, 12); first (53, ('lwz', 'r9, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 scoped column butterfly terms reversed sums | objdiff 99.52555; 137/137 instructions; structural/exact (0, 12); first (53, ('lwz', 'r9, 0x20(r6)'), ('lwz', 'r10, 0x20(r6)'))
TMCJPEGDEC_IdctBlock4x4_Col | R7 EXACT: natural four-row loop auto-unrolls two rows with target load/store scheduling, first53 instructions exact; second-pass scoped coefficient/butterfly locals and d+b operand order reduce remaining12registerdiffs. declsearch28builds gives137/137 anddiffs0, objdiff100. Quick GATE PASS5/6code1260/1804 versus4/6code712; poolidentical, global0regressions forbidden readability, correctDOL. No data symbols or extents changed.
TMCJPEGDEC_IdctBlock4x4 | R7 fresh fetch origin still unchanged136/85.625; transfer proven natural signed-row odddiff/oddsum/even difference before rotation order, then tune unsigned column phase independently.
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned rows with odd and even differences before rotation | objdiff 94.30147; 136/136 instructions; structural/exact (2, 86); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned rows with target d plus b addition subtree | objdiff 94.22794; 136/136 instructions; structural/exact (2, 86); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned rows use expression for odd difference | objdiff 94.30147; 136/136 instructions; structural/exact (2, 86); first (2, ('addi', 'r12, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned rows share scoped butterfly locals | objdiff 97.09559; 136/136 instructions; structural/exact (0, 51); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 scoped natural row arithmetic reproduces first50instructions exactly136/frame0x120. Remaining unsigned-column operands51; leading5scalar declsearch32builds reduces to49; no structural differences, now separate column lifetimes and pointer declarations.
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns scoped butterfly coefficients | objdiff 96.13971; 136/136 instructions; structural/exact (0, 71); first (10, ('lwz', 'r31, 0xc(r8)'), ('lwz', 'r28, 0xc(r8)'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns have distinct input pointer lifetime | objdiff 97.64706; 136/136 instructions; structural/exact (0, 45); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns distinct pointer and scoped math | objdiff 96.36029; 136/136 instructions; structural/exact (0, 67); first (10, ('lwz', 'r31, 0xc(r8)'), ('lwz', 'r28, 0xc(r8)'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns reorder source and index declarations | objdiff 97.42647; 136/136 instructions; structural/exact (0, 49); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 all9column scalar declaration search146builds reduces45to42operand differences,136/136forms0. Firstpass remains exact; source,clamp temp,coefficients and index register choices in columnpass remain. Scoped column pointer distinguishes pass lifetimes.
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns readonly temporary-buffer pointer | objdiff 98.01471; 136/136 instructions; structural/exact (0, 42); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns use target descending loop index | objdiff 98.01471; 136/136 instructions; structural/exact (0, 42); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns signed index preserves four iteration counter | objdiff 98.01471; 136/136 instructions; structural/exact (0, 42); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 natural unsigned columns output pointer declared outside row body | objdiff 96.39706; 136/136 instructions; structural/exact (2, 46); first (52, ('addi', 'r7, r1, 0x14'), ('subf', 'r31, r5, r3'))
TMCJPEGDEC_IdctBlock4x4 | R7 source pointer before coefficient declarations | objdiff 97.79412; 136/136 instructions; structural/exact (0, 46); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 source pointer after coefficient declarations | objdiff 97.79412; 136/136 instructions; structural/exact (0, 46); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 source pointer after buffer and loop variables | objdiff 97.79412; 136/136 instructions; structural/exact (0, 46); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 unsigned column transform isolated in readonly inline phase | objdiff 90.07353; 130/136 instructions; structural/exact (10, 132); first (3, ('stmw', 'r27, 0x10c(r1)'), ('stw', 'r31, 0x11c(r1)'))
TMCJPEGDEC_IdctBlock4x4 | R7 column phase block owns coefficient and math locals | objdiff 96.47059; 136/136 instructions; structural/exact (0, 67); first (10, ('lwz', 'r31, 0xc(r8)'), ('lwz', 'r28, 0xc(r8)'))
TMCJPEGDEC_IdctBlock4x4 | R7 column phase block owns only output address and coefficients | objdiff 97.79412; 136/136 instructions; structural/exact (0, 44); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 column phase block owns only rotation and sums | objdiff 97.42647; 136/136 instructions; structural/exact (0, 47); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 column phase declares index and pointer before assignment | objdiff 98.01471; 136/136 instructions; structural/exact (0, 42); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 column phase initializes index before source after separate declarations | objdiff 98.01471; 136/136 instructions; structural/exact (0, 42); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 reuse sp for temporary-buffer column input | objdiff 97.79412; 136/136 instructions; structural/exact (0, 46); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 reuse dp for temporary-buffer column input | objdiff 97.79412; 136/136 instructions; structural/exact (0, 46); first (50, ('rlwinm', 'r6, r5, 2, 0xe, 0x1d'), ('rlwinm', 'r3, r5, 2, 0xe, 0x1d'))
TMCJPEGDEC_IdctBlock4x4 | R7 column index shares u16 output coordinate type | objdiff 96.83088; 137/136 instructions; structural/exact (6, 51); first (53, ('addi', 'r6, r1, 0x14'), ('addi', 'r11, r1, 0x14'))
TMCJPEGDEC_IdctBlock4x4 | R7 column traversal expressed by source end pointer | objdiff 71.92647; 131/136 instructions; structural/exact (51, 134); first (2, ('addi', 'r7, r3, 0x60'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 readonly column butterfly helper with named result references | objdiff 87.94118; 130/136 instructions; structural/exact (12, 132); first (3, ('stmw', 'r27, 0x10c(r1)'), ('stw', 'r31, 0x11c(r1)'))
TMCJPEGDEC_IdctBlock4x4 | R7 mutable column butterfly helper input for retail alias assumptions | objdiff 87.94118; 130/136 instructions; structural/exact (12, 132); first (3, ('stmw', 'r27, 0x10c(r1)'), ('stw', 'r31, 0x11c(r1)'))
TMCJPEGDEC_IdctBlock4x4 | R7 readonly column butterfly helper with rotation output first | objdiff 87.94118; 130/136 instructions; structural/exact (12, 132); first (3, ('stmw', 'r27, 0x10c(r1)'), ('stw', 'r31, 0x11c(r1)'))
TMCJPEGDEC_IdctBlock4x4 | R7 full natural unsigned transform with readonly inline input boundary | objdiff 87.463234; 130/136 instructions; structural/exact (11, 134); first (2, ('stmw', 'r27, 0x10c(r1)'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 full natural unsigned transform with mutable inline input boundary | objdiff 87.463234; 130/136 instructions; structural/exact (11, 134); first (2, ('stmw', 'r27, 0x10c(r1)'), ('addi', 'r8, r3, 0x60'))
TMCJPEGDEC_IdctBlock4x4 | R7 retain natural four-row unsigned pass:85.625->98.01471,136/136 identical instruction forms, first50instructions exact. Remaining42operands are cyclic r6-r11 allocation in column input/output/clamp temporaries; saved coefficients, pitch/index and arithmetic order now exact. Tested const input, scoped phase/math helpers, natural descending loop, source lifetime/assignment/decl permutations; helpers add fifth saved register and130vs136, rejected. Quick GATE PASS with signed4x4still100,0regressions forbidden/readability andcorrectDOL. Both target.extents exact, novolatile proof ordatachanges.
signcreate | R7 fresh fetch origin remains99.117645, our acceptedreadonlytable99.162895. Inspect constructor constant-hoist relocation order explicitly; next isolate metadata lookup and immutable localpointer forms.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 immutable pane metadata pointer instead of readonly reference | objdiff 99.162895; 221/221 instructions; structural/exact (0, 32); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 readonly pane metadata lookup inline boundary | objdiff 98.77828; 221/221 instructions; structural/exact (0, 44); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 immutable allocated pane buffer inputs to constructors | objdiff 98.30317; 221/221 instructions; structural/exact (0, 54); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R7 immutable readonly pane table base declaration | objdiff 99.162895; 221/221 instructions; structural/exact (0, 32); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
R7 pre-final completeness audit | SOGetInterfaceOpt | 7 successfully compiled distinct source-attempt log entries; remaining function re-listed for full gate.
R7 pre-final completeness audit | PFENT_ITER_FindCluster | 6 successfully compiled distinct source-attempt log entries; remaining function re-listed for full gate.
R7 pre-final completeness audit | inputChar__Q39textinput8tistring9DecolatedFw | 3 successfully compiled distinct source-attempt log entries; remaining function re-listed for full gate.
R7 pre-final completeness audit | create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | 8 successfully compiled distinct source-attempt log entries; remaining function re-listed for full gate.
R7 pre-final completeness audit | TMCJPEGDEC_IdctBlock4x4 | 45 successfully compiled distinct source-attempt log entries; remaining function re-listed for full gate.
R7 data audit | all six owned target data objects paired at100 percent; SOOption/IDCT own no data, pf_volume210976, entry_iterator24, tiString288, tiSignWindow3468. No rename, extent, address or section-total changes required this round. Weak deduplicated extras untouched. Prior extent audit proves no overlapping open function sizes.
# R7 final clean full gate over all six owned units (non --quick)
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/so/SOOption] pool: IDENTICAL
[libs/RevoEX/src/so/SOOption] objdiff: code 816/1292 data None/None functions 3/4 fuzzy 99.9226 linked code 0
[libs/RevoEX/src/so/SOOption] instruction-exact functions: 3/4
[libs/RevoEX/src/so/SOOption] section .text size 1292 match 99.9226
[libs/RevoEX/src/so/SOOption] below 100: SOGetInterfaceOpt 99.78992
[libs/RevoEX/src/so/SOOption] baseline: code 816/1292 data None functions 3 fuzzy 99.9226
[libs/RVL_SDK/src/fa/pf_volume] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_volume] objdiff: code 17992/17992 data 210976/210976 functions 37/37 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/fa/pf_volume] instruction-exact functions: 37/37
[libs/RVL_SDK/src/fa/pf_volume] section .bss size 210944 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .data size 16 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .sdata2 size 8 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] section .text size 17992 match 100.0
[libs/RVL_SDK/src/fa/pf_volume] baseline: code 16988/17992 data 210976 functions 35 fuzzy 99.9333
[libs/RVL_SDK/src/fa/pf_entry_iterator] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_entry_iterator] objdiff: code 6932/7880 data 24/24 functions 15/16 fuzzy 99.9772 linked code 0
[libs/RVL_SDK/src/fa/pf_entry_iterator] instruction-exact functions: 15/16
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .sdata size 24 match 100.0
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .text size 7880 match 99.97716
[libs/RVL_SDK/src/fa/pf_entry_iterator] below 100: PFENT_ITER_FindCluster 99.81013
[libs/RVL_SDK/src/fa/pf_entry_iterator] baseline: code 6932/7880 data 24 functions 15 fuzzy 99.9772
[src/keyboard/tiString] pool: IDENTICAL
[src/keyboard/tiString] objdiff: code 4632/5176 data 288/288 functions 41/42 fuzzy 98.9629 linked code 0
[src/keyboard/tiString] instruction-exact functions: 41/42
[src/keyboard/tiString] section .data size 288 match 100.0
[src/keyboard/tiString] section .text size 5176 match 98.962906
[src/keyboard/tiString] below 100: inputChar__Q39textinput8tistring9DecolatedFw 90.132355
[src/keyboard/tiString] baseline: code 4632/5176 data 288 functions 41 fuzzy 98.9629
[src/keyboard/tiSignWindow] pool: IDENTICAL
[src/keyboard/tiSignWindow] objdiff: code 6300/7184 data 3468/3468 functions 55/56 fuzzy 99.8970 linked code 0
[src/keyboard/tiSignWindow] instruction-exact functions: 55/56
[src/keyboard/tiSignWindow] section .ctors size 4 match 100.0
[src/keyboard/tiSignWindow] section .data size 2672 match 100.0
[src/keyboard/tiSignWindow] section .rodata size 784 match 100.0
[src/keyboard/tiSignWindow] section .sdata size 8 match 100.0
[src/keyboard/tiSignWindow] section .text size 7184 match 99.896996
[src/keyboard/tiSignWindow] below 100: create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator 99.162895
[src/keyboard/tiSignWindow] baseline: code 6300/7184 data 3468 functions 55 fuzzy 99.8914
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] pool: IDENTICAL
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] objdiff: code 1260/1804 data None/None functions 5/6 fuzzy 99.4013 linked code 0
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] instruction-exact functions: 5/6
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] section .text size 1804 match 99.40133
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] below 100: TMCJPEGDEC_IdctBlock4x4 98.01471
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] baseline: code 712/1804 data None functions 4 fuzzy 90.7738
regressions vs baseline: 0
global matched_code_percent: 89.19062 -> 89.24243
global fuzzy_match_percent: 99.52355 -> 99.52917
global complete_code_percent: 66.23504 -> 66.23504
global matched_data_percent: 99.36508 -> 99.36508
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
libs/RevoEX/src/so/SOOption | exact 3/4 -> 3/4 | code bytes 816 -> 816/1292 | data bytes 0 -> 0/0
R7 remaining | SOGetInterfaceOpt | 99.78992% | 119/119 identical instruction forms; five callee-saved selector/level register operands differ, first instruction5 mr r25,r4 vsr26. | 7 distinct successful source trials this round; no untried functions.
libs/RVL_SDK/src/fa/pf_volume | exact 35/37 -> 37/37 | code bytes 16988 -> 17992/17992 | data bytes 210976 -> 210976/210976
libs/RVL_SDK/src/fa/pf_entry_iterator | exact 15/16 -> 15/16 | code bytes 6932 -> 6932/7880 | data bytes 24 -> 24/24
R7 remaining | PFENT_ITER_FindCluster | 99.81013% | 237/237 identical forms; eight sector-mask and entries-per-sector register operands differ, first shared1 value r7 vsr8. Volatile iterator-index trial adds three reloads, rejected. | 6 distinct successful source trials this round; no untried functions.
src/keyboard/tiString | exact 41/42 -> 41/42 | code bytes 4632 -> 4632/5176 | data bytes 288 -> 288/288
R7 remaining | inputChar__Q39textinput8tistring9DecolatedFw | 90.132355% | 125/136; Hangul-mode append path optimized to constant index/count; target dynamic append, newline comparison and final count mask remain. No adjacent-stack reload or extent proof supports volatility or resizing. | 3 distinct successful source trials this round; no untried functions.
src/keyboard/tiSignWindow | exact 55/56 -> 55/56 | code bytes 6300 -> 6300/7184 | data bytes 3468 -> 3468/3468
R7 remaining | create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | 99.162895% | 221/221 identical forms;32 operands remain, including constructor/table relocation hoist order and loop/register allocation. First lis AnmPane r26 vsr25. | 8 distinct successful source trials this round; no untried functions.
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var | exact 4/6 -> 5/6 | code bytes 712 -> 1260/1804 | data bytes 0 -> 0/0
R7 remaining | TMCJPEGDEC_IdctBlock4x4 | 98.01471% | 136/136 identical forms;42 operands, first column pointer r6 vsr11 at instruction53. First50 instructions exact; remaining unsigned column/clamp registers cycle r6-r11. | 45 distinct successful source trials this round; no untried functions.
R7 final files: libs/RVL_SDK/src/fa/pf_volume.c; src/keyboard/tiSignWindow.cpp; libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var.c; tools/decomp-assist/fz3.attempts.md. Source commits451eaff8,becfba47,5058e494,4cd94ca2,8a89a5ba. Three new exact functions,1552 newly matched code bytes; all data unchanged100%, all six poolsidentical, correctDOL,0globalregressions/forbidden/readability. No remaining proof uncertainty for accepted changes; original Hangul helper boundary and remaining compiler allocation are unresolved as logged. No source/header/config changes after clean full gate; final commit is log only.
R8 initial pool libs/RevoEX/src/so/SOOption | POOL IDENTICAL up to 0 (mine=0 base=0)
R8 initial pool libs/RVL_SDK/src/fa/pf_entry_iterator | POOL IDENTICAL up to 0 (mine=0 base=0)
R8 initial pool src/keyboard/tiString | POOL IDENTICAL up to 0 (mine=0 base=0)
R8 initial pool src/keyboard/tiSignWindow | POOL IDENTICAL up to 30 (mine=30 base=30)
R8 initial pool libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var | POOL IDENTICAL up to 0 (mine=0 base=0)
# Round8 XHIGH, fresh branch HEADa61a7cf1. Each trial logs first differing instruction and source construct, with original always restored until accepted by gate.
SOGetInterfaceOpt | R8 origin fetched; source equal origin except README;119/119,frame0x30. First5 mr r25,r4 vtarget26; only five level/option operands. rm/temp slots0xc/8, branchforms, calls,pointersetup andload/store scheduling identical. No symbol overlap (0x814B476c+0x1dc=SOSetInterfaceOpt0x814B4948), no adjacent-stack reload proof; const OptionLength/global qualifiers already ineffective last round. Test selector inline boundary and real response block types before declaration search.
SOGetInterfaceOpt | R8 selector pair initialized inside command inline helper | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R8 selector helper receives operation before protocol level | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R8 aligned length reply remains a typed interface response block | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R8 allocated interface request pointer scoped immutable after allocation | BUILD FAIL OOption.c -o build/43U/src/libs/RevoEX/src/so && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RevoEX/src/so/SOOption.d build/43U/src/libs/RevoEX/src/so/SOOption.d ### mwcceppc.exe Compiler: # File: libs\RevoEX\src\so\SOOption.c # -------------------------------------- # 110: InterfaceOption* const request=SOiAlloc(12,size); # Error: ^^^^^^^^^^^^^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed.
SOGetInterfaceOpt | R8 immutable interface allocation pointer in its own successful scope | objdiff 98.61345; 119/119 instructions; structural/exact (0, 33); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R8 readonly interface reply byte view for memcpy input | objdiff 99.78992; 119/119 instructions; structural/exact (0, 5); first (5, ('mr', 'r25, r4'), ('mr', 'r26, r4'))
SOGetInterfaceOpt | R8 five distinct compiled structural/type/helper trials; selectors/read-only byte view preserve5operanddiffs, scopedconstallocation worsens33. Leadingdeclsearch65builds no improvement. Baseline restored119/119,99.78992, no data.
PFENT_ITER_FindCluster | R8 fetch source equalorigin,237/237frame0xa0; first39li1r7 vsr8,8registeronlydiffs constant/entry-count swap. Noextentoverlap0x815d3414+0x3b4=Retreat0x815d37c8. Targetadjacentstore/reloaditer.index0x20 alreadypreserved baseline, last roundfieldvolatileadded3loads, rejected. Loop/helper/call/scheduling otherwiseidentical; test entrycount derived from real initialized firstclusterfield.
PFENT_ITER_FindCluster | R8 entry count derives from initialized iterator first cluster | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R8 entry count computes byte geometry using preceding power of two | objdiff 97.95358; 239/237 instructions; structural/exact (5, 206); first (18, ('b', '852'), ('b', '844'))
PFENT_ITER_FindCluster | R8 readonly initialized iterator supplies first sector entry count | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R8 FAT hint first-cluster sentinel initialized in inline boundary | objdiff 99.81013; 237/237 instructions; structural/exact (0, 8); first (39, ('li', 'r7, 1'), ('li', 'r8, 1'))
PFENT_ITER_FindCluster | R8 four compiled source attempts, initialized-field and hint-inline boundaries preserve8diffs; alternate geometryshift adds2instructions and rejected. Leadingdeclsearch36builds leaves8, baseline restored99.81013. Data24bytes remains100; no header/data edits.
inputChar__Q39textinput8tistring9DecolatedFw | R8 fresh fetch sourceequalorigin,125/136frame0x30. Firstrealconstruct65Hangulmode lacksinlinedstream index/count lifetime, initialNUL andunusednewlinecompare;targetcharregister4, counter6 starts0 andcount29mask. Noadjacentstackreloadproof orsizeoverlap0x81432ce4+0x220=confirmKana0x81432f04. Test shared translatorcounter/output-reference boundaries; no empty newline stubs orunsupportedvolatile.
inputChar__Q39textinput8tistring9DecolatedFw | R8 shared translation count initialized before mode dispatch and appended in Hangul | objdiff 90.132355; 125/136 instructions; structural/exact (18, 73); first (10, ('beq', '428'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 wide translation count shared across mode dispatch | objdiff 90.132355; 125/136 instructions; structural/exact (18, 73); first (10, ('beq', '428'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 bounded input array reference and readonly character reference | objdiff 90.132355; 125/136 instructions; structural/exact (18, 73); first (10, ('beq', '428'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 append character through advancing pointer and derive UTF16 count | objdiff 89.92647; 130/136 instructions; structural/exact (18, 87); first (10, ('beq', '448'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 converter handles newline literal then ordinary character append | objdiff 93.22794; 138/136 instructions; structural/exact (17, 75); first (10, ('beq', '480'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 converter newline append through bounded buffer and const character | objdiff 93.22794; 138/136 instructions; structural/exact (17, 75); first (10, ('beq', '480'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 direct newline normalization expresses target retained comparison | objdiff 89.91912; 130/136 instructions; structural/exact (16, 73); first (10, ('beq', '448'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 generic conversion append resets buffer length on newline | objdiff 91.06618; 135/136 instructions; structural/exact (17, 62); first (10, ('beq', '468'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 conversion append carries mutable stream length through newline reset | objdiff 93.60294; 135/136 instructions; structural/exact (15, 61); first (10, ('beq', '468'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 conversion newline clears previous text and resets stream length | objdiff 91.72794; 136/136 instructions; structural/exact (15, 60); first (63, ('b', '88'), ('b', '80'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 conversion buffer owns newline reset append and readonly length | objdiff 92.52941; 135/136 instructions; structural/exact (16, 61); first (10, ('beq', '468'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 conversion buffer keeps UTF16 sized length field | objdiff 91.64706; 135/136 instructions; structural/exact (17, 62); first (10, ('beq', '468'), ('beq', '472'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 conversion buffer newline clear is a real reusable stream method | objdiff 93.05147; 136/136 instructions; structural/exact (17, 60); first (63, ('b', '88'), ('b', '80'))
inputChar__Q39textinput8tistring9DecolatedFw | R8 thirteen distinct compiled trials, including natural pointer/count references and functional newline append/reset stream boundaries. Best93.60294/135vs136 stilladds live newline branch absenttarget and lacks targetpointer/zero ordering. No candidate retained: original converter semantics/boundary unresolved; no unused newline arg, empty stub, arbitrary volatile orsymbolresize introduced. Baseline125/136,90.132355 restored.
signcreate | R8 originfetched equalcurrent99.162895,221/frame0x50. First48AnmPanevtablelisr26vs25; relocationorder targetAnmPane,Button,Scroll,table,All versusoursAnmPane,table,Button,Scroll,All. Remaining32operands includeanimationCount22vs31 andanimatedentry25vs22. Metadata,constructorallocation/calls andbranchforms exact; noextentoverlap oradjacentstackvolatileproof. Test real iterator/animation entry lifetimes before register permutations.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 immutable animation bound and force name scoped to pane setup | objdiff 98.12217; 221/221 instructions; structural/exact (0, 60); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 animation traversal explicit wide induction and UTF16 index view | objdiff 99.162895; 221/221 instructions; structural/exact (0, 32); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 pane metadata index uses proven bounded unsigned loop counter | objdiff 95.701355; 220/221 instructions; structural/exact (5, 184); first (5, ('li', 'r19, 0'), ('li', 'r14, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation entry reference lives across resource creation | objdiff 99.61539; 221/221 instructions; structural/exact (0, 13); first (49, ('lis', 'r24, 0'), ('lis', 'r27, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 animation bound and index declared together in natural for loop | objdiff 98.19005; 221/221 instructions; structural/exact (0, 58); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation reference with direct pane table lookup | objdiff 99.72851; 221/221 instructions; structural/exact (0, 10); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation reference with count declared after pane creation | objdiff 98.64253; 221/221 instructions; structural/exact (0, 53); first (49, ('lis', 'r24, 0'), ('lis', 'r27, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation slot pointer declared before pane loop and late bound | objdiff 98.64253; 221/221 instructions; structural/exact (0, 53); first (49, ('lis', 'r24, 0'), ('lis', 'r27, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 direct pane lookup with early declared readonly animation slot pointer | objdiff 99.72851; 221/221 instructions; structural/exact (0, 10); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly pane name array view across constructor branches | objdiff 96.8914; 222/221 instructions; structural/exact (5, 160); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly pane table view local to each logical pane iteration | objdiff 99.72851; 221/221 instructions; structural/exact (0, 10); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
signcreate | R8 retain readonly animation-slot reference instead of repeated table indexing, anddirect pane table lookup. Constreference is to pointer object, so actual animation pointer reloads across calls are preserved.99.162895->99.72851,221/221 instructionforms0,32->10 operands. Remaining4All/table constant-load relocation order and6animation-count22/entry31 swap. Leading3declsearch6builds nofurthergain. QuickGATE PASS55/56,data3468/3468,poolidentical,0globalregressions/forbidden/readability andtargetDOL.
TMCJPEGDEC_IdctBlock4x4 | R8 fresh fetch originequalscurrent98.01471,136/136frame0x120. First53columnpointerr6vs11 with42cyclicr6-r11operands, all instructionforms andfirst50exact. Firstpass provenautomaticunroll4rows. Newhypothesis secondpass pointerr11 is compiler-generated strength reduction from indexed tmp[idx], so its virtual lifetime begins after output/clamp locals instead of explicit column pointerdecl. Noextentoverlap0x814ef490+0x220=2x2start814ef6b0; noimmediate stackreloadproof,data0.
TMCJPEGDEC_IdctBlock4x4 | R8 indexed temporary buffer lets compiler reduce column input pointer | objdiff 100.0; 136/136 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r8-candidates/TMCJPEGDEC_IdctBlock4x4_indexed_temporary_buffer_lets_compiler_reduce_column_input_pointer.txt
TMCJPEGDEC_IdctBlock4x4 | R8 natural descending signed column index and buffer offsets | objdiff 100.0; 136/136 instructions; structural/exact (0, 0); first None
EXACT CANDIDATE /tmp/fz3-r8-candidates/TMCJPEGDEC_IdctBlock4x4_natural_descending_signed_column_index_and_buffer_offsets.txt
TMCJPEGDEC_IdctBlock4x4 | R8 ascending iteration derives descending temporary and output index | objdiff 90.117645; 138/136 instructions; structural/exact (14, 107); first (10, ('lwz', 'r29, 0xc(r8)'), ('lwz', 'r28, 0xc(r8)'))
TMCJPEGDEC_IdctBlock4x4 | R8 EXACT on firstindexed-column attempt:98.01471->100.0,136/136diffs0; replace explicit columnpointer withtmp[idx],tmp[idx+8/16/24]. Compiler generates pointerlater atvirtualregisterorderneeded forr11, resolving all42operanddiffs. Naturaldescendingi variant also100, ascending3-i changes138 and rejected. QuickGATE PASSunit6/6code1804/1804vs5/6code1260/1804,data0,poolidentical,0globalregressions forbidden readability,correctDOL. This is automatic strength reduction, no volatile, helper, symbol orconfigchange.
signcreate | R8 freshfetch remote stillwithoutnewanimationreference; target221first51All/tableloadorder, six animation bound/slot operands remain; try index declaration before bound and natural readonly animation array view, following proven IDCT auto-generated address allocation.
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 animation counter declared before immutable loop bound | objdiff 98.64253; 221/221 instructions; structural/exact (0, 54); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 pane animation force metadata and bound scoped after index declaration | objdiff 98.57466; 221/221 instructions; structural/exact (0, 56); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation array input view uses compiler generated element address | objdiff 96.49321; 221/221 instructions; structural/exact (10, 62); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 direct pane field indexing lets compiler form shared row address | objdiff 94.81901; 224/221 instructions; structural/exact (15, 174); first (48, ('lis', 'r24, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 direct pane fields and immutable late animation count | objdiff 94.253395; 224/221 instructions; structural/exact (15, 172); first (48, ('lis', 'r24, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly pane row lookup owns masked index alias boundary | objdiff 99.38914; 221/221 instructions; structural/exact (0, 21); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation slot reference begins after resource name lookup | objdiff 96.42534; 222/221 instructions; structural/exact (4, 135); first (7, ('mr', 'r23, r3'), ('mr', 'r15, r3'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 readonly animation slot reference begins after transform creation | objdiff 98.61991; 222/221 instructions; structural/exact (4, 69); first (48, ('lis', 'r26, 0'), ('lis', 'r25, 0'))
create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | R8 resource and transform declarations precede readonly animation slot view | objdiff 99.72851; 221/221 instructions; structural/exact (0, 10); first (51, ('lis', 'r30, 0'), ('lis', 'r24, 0'))
signcreate | R8 extra natural-index, animation array alias, declaration/lifetime and direct-field tests have no further gain beyondaccepted99.72851. Direct-field rewrite adds3instructions, late-bound reference adds1 orextra saved-register uses; readonly row helper worsens21operands. All rejected variants restored. Remaining exact-shape10operand diffs are4All/table relocation-load ordering and6bound/animation-slot22/31 register swap; no unsupporteddata fixes.
R8 pre-final remaining-attempt audit | SOGetInterfaceOpt | 5 distinct compiled scored attempts this round; no untried functions.
R8 pre-final remaining-attempt audit | PFENT_ITER_FindCluster | 4 distinct compiled scored attempts this round; no untried functions.
R8 pre-final remaining-attempt audit | inputChar__Q39textinput8tistring9DecolatedFw | 13 distinct compiled scored attempts this round; no untried functions.
R8 pre-final remaining-attempt audit | create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | 20 distinct compiled scored attempts this round; no untried functions.
R8 data ownership audit | owned .data/.rodata/.sdata/.ctors target symbols all100: entry_iterator24 bytes,tiString288,tiSignWindow3468;SOOption/IDCT noowned data. All5poolsidentical frominitial pool_diff; no symbolrename,extent,address,section-total orsharedheaderchange. Relocation gaps fromremainingfunctions remain codework. Clean full all-unit gate follows.
# R8 final clean full gate over all five owned units (non --quick)
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/so/SOOption] pool: IDENTICAL
[libs/RevoEX/src/so/SOOption] objdiff: code 816/1292 data None/None functions 3/4 fuzzy 99.9226 linked code 0
[libs/RevoEX/src/so/SOOption] instruction-exact functions: 3/4
[libs/RevoEX/src/so/SOOption] section .text size 1292 match 99.9226
[libs/RevoEX/src/so/SOOption] below 100: SOGetInterfaceOpt 99.78992
[libs/RevoEX/src/so/SOOption] baseline: code 816/1292 data None functions 3 fuzzy 99.9226
[libs/RVL_SDK/src/fa/pf_entry_iterator] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_entry_iterator] objdiff: code 6932/7880 data 24/24 functions 15/16 fuzzy 99.9772 linked code 0
[libs/RVL_SDK/src/fa/pf_entry_iterator] instruction-exact functions: 15/16
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .sdata size 24 match 100.0
[libs/RVL_SDK/src/fa/pf_entry_iterator] section .text size 7880 match 99.97716
[libs/RVL_SDK/src/fa/pf_entry_iterator] below 100: PFENT_ITER_FindCluster 99.81013
[libs/RVL_SDK/src/fa/pf_entry_iterator] baseline: code 6932/7880 data 24 functions 15 fuzzy 99.9772
[src/keyboard/tiString] pool: IDENTICAL
[src/keyboard/tiString] objdiff: code 4632/5176 data 288/288 functions 41/42 fuzzy 98.9629 linked code 0
[src/keyboard/tiString] instruction-exact functions: 41/42
[src/keyboard/tiString] section .data size 288 match 100.0
[src/keyboard/tiString] section .text size 5176 match 98.962906
[src/keyboard/tiString] below 100: inputChar__Q39textinput8tistring9DecolatedFw 90.132355
[src/keyboard/tiString] baseline: code 4632/5176 data 288 functions 41 fuzzy 98.9629
[src/keyboard/tiSignWindow] pool: IDENTICAL
[src/keyboard/tiSignWindow] objdiff: code 6300/7184 data 3468/3468 functions 55/56 fuzzy 99.9666 linked code 0
[src/keyboard/tiSignWindow] instruction-exact functions: 55/56
[src/keyboard/tiSignWindow] section .ctors size 4 match 100.0
[src/keyboard/tiSignWindow] section .data size 2672 match 100.0
[src/keyboard/tiSignWindow] section .rodata size 784 match 100.0
[src/keyboard/tiSignWindow] section .sdata size 8 match 100.0
[src/keyboard/tiSignWindow] section .text size 7184 match 99.96659
[src/keyboard/tiSignWindow] below 100: create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator 99.72851
[src/keyboard/tiSignWindow] baseline: code 6300/7184 data 3468 functions 55 fuzzy 99.8970
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] pool: IDENTICAL
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] objdiff: code 1804/1804 data None/None functions 6/6 fuzzy 100.0000 linked code 0
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] instruction-exact functions: 6/6
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] section .text size 1804 match 100.0
[libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var] baseline: code 1260/1804 data None functions 5 fuzzy 99.4013
regressions vs baseline: 0
global matched_code_percent: 89.86156 -> 89.87973
global fuzzy_match_percent: 99.53919 -> 99.53971
global complete_code_percent: 67.39544 -> 67.39544
global matched_data_percent: 99.36508 -> 99.36508
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
libs/RevoEX/src/so/SOOption | exact 3/4 -> 3/4 | code bytes 816 -> 816/1292 | data bytes 0 -> 0/0
R8 remaining | SOGetInterfaceOpt | 99.78992% | 119/119, frame0x30, five register operands remain: level25vs26 andoption28vs25; first5mr r25,r4 vsr26. rm/temp slots, branches, helper/load order exact. | 5 distinct compiled source attempts this round.
libs/RVL_SDK/src/fa/pf_entry_iterator | exact 15/16 -> 15/16 | code bytes 6932 -> 6932/7880 | data bytes 24 -> 24/24
R8 remaining | PFENT_ITER_FindCluster | 99.81013% | 237/237, frame0xa0, eight sharedconstant1 andentries-per-sector register operands remain; first39li r7,1 vsr8. Definitionvolatile wouldadd3loads andwasrejected, no extentoverlap. | 4 distinct compiled source attempts this round.
src/keyboard/tiString | exact 41/42 -> 41/42 | code bytes 4632 -> 4632/5176 | data bytes 288 -> 288/288
R8 remaining | inputChar__Q39textinput8tistring9DecolatedFw | 90.132355% | 125/136, frame0x30, missing original Hangul converter/index/count boundary andretainedunusednewlinecmp; allnewfunctionalbuilder candidates introduce extra livebranch ortemporaloperation ordering, rejected. | 13 distinct compiled source attempts this round.
src/keyboard/tiSignWindow | exact 55/56 -> 55/56 | code bytes 6300 -> 6300/7184 | data bytes 3468 -> 3468/3468
R8 remaining | create__Q49textinput8keyboard10signwindow12LayoutByNW4RFP12MEMAllocator | 99.72851% | 221/221, frame0x50,10operand differences: All-vtable/table address-load relocation order4 andanimation-count22vs31/slot31vs22 registerswap6. First51LISAll30vstable24; allotherconstructors, pointerread/call/order exact. | 20 distinct compiled source attempts this round.
libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var | exact 5/6 -> 6/6 | code bytes 1260 -> 1804/1804 | data bytes 0 -> 0/0
R8 final files: src/keyboard/tiSignWindow.cpp; libs/RVLMiddleware/TMC_JPEG/src/reschange/idct_resolution_change_var.c; tools/decomp-assist/fz3.attempts.md. Source commits8fbf59f0,1988244e. One new exact function and544matchedcodebytes, IDCTunit6/6code1804/1804data0. Signcreate99.162895->99.72851genuinefuzzyimprovement, exactcountunchanged. 45distinctcompiledsource trials and107declaration evaluations followingstructuraldiagnostics. Allfivepoolsidentical,data100, correctDOL,0globalregressions/forbidden/readability. No sourcechangesafterfullclean gate; finalcommit logonly. Uncertain: original Hangul helper/newline-processing structure andremaining SO/iterator/register constant-hoist choices; allacceptedbytes/state provedbygate. No untried openfunctions, no symbol/data/header/config changes, no Matching status switches orlinking claims.

File diff suppressed because one or more lines are too long

View File

@@ -1,57 +0,0 @@
# mslmisc leaf attempts
Owned units: `src/scene/sdChannelTitle/iplSDChannelTitle.cpp`, `libs/NW4R/src/ut/ut_ArchiveFontBase.cpp`.
MSL checked via live report: only `MSL_Common/wprintf` incomplete — stays in misc1b's notes.
## DECODE: SDButton::setEventHandler retail dead-param (SOLVED)
orig's real decl was **1-arg** `setEventHandler(EventHandler*)`. Evidence:
- Every orig call site (title ×2, select ×4) emits a bare `bl` with only r3/r4 — never `li r5,0`.
- The 5-insn DEF (`lwz r3,0x60; lwz r12,0; lwz r12,0x38; mtctr; bctr`) forwards to `Manager::setEventHandler`, a 1-arg weak virtual — `optOut` was never consumed.
- `Button::setEventHandler` (a DIFFERENT class, genuine 2-arg impl at 0x8139C93C) DOES emit `li r5,0` in iplFocusObject — MWCC materializes default args, so SDButton's missing r5 means the decl never had it.
- The 2-arg mangle in symbols.txt was an author mislabel inherited from `Button`'s real 2-arg.
Fix (all kept): `iplSDButton.h` decl → `void setEventHandler(::gui::EventHandler* event);`; `iplSDButton.cpp` def → 1-arg; call sites in sdChannelTitle/sdChannelSelect → 1-arg; `config/43U/symbols.txt` line 4817 renamed `...8SDButtonFPQ23gui12EventHandlerPQ23gui12EventHandler` → `...8SDButtonFPQ23gui12EventHandler`. Flipped 5 fns to instruction-identical + all sdChannelTitle data sections to 100%.
Mechanism note: renaming a `.text` address in symbols.txt propagates through the splitter into orig's DEF name AND every caller's UND reloc name — the legit rename lever.
## UNSOLVED: enqueue*Notice leading dead-arg (r4)
`SDChannelSelect::enqueueChannelNotice(u32 controller, u32 page, u32 index, u32 value)` and
`enqueueStateNotice(u32 controller, u32 state, u32 type, u32)` (4×u32 each; defs build
`command.titleId = ((u64)page << 32) | index` — proven 4×u32, not u64).
orig call sites marshal r5/r6/r7 but **never write r4** (arg1 `controller` — dead param the
def bodies ignore; iplSDMemory callers DO materialize it). Same dead-arg family as
setEventHandler but on a LEADING arg — no decl form reproduces it:
- arg-count reduction shifts the marshal left (breaks r5/r6/r7 positions)
- defaulted params must be trailing
- `(u32,u64,u32)` still needs `li r4,0` for arg1
- `scene->mPage`/`mIndex`/`channel` as arg1 all emit real loads (`lwz`/`mr`) — orig has none
- r4 is call-clobbered at both sites (`bl findChannelObject`, `bl isReceiveScheduleStopped`)
so no "value already in r4" source expr exists
Residual = `+li r4,0` plus marshal-order (orig emits r6-before-r5 / addi-first) — scheduler family.
## TIE: flushSaveBeforeExit eval-order (98.59)
Insn+reloc-identical except a 6-word window: orig `lis r3` (smArg base→r3), `lwz r4,0x94` (stw-mgr),
`stw`, `lwz r4,0x28` (heap), `lwz r3,0x94` (flush receiver — reloaded LAST). Mine: base→r4,
receiver-load before heap-load. Orig evaluated the `flushAsync` ARG before the receiver reload.
Tried: `saveHeap` local (before/after stw, decl-init, separate assign — emits at-birth or at-use,
never between), `saveData`/`mgr` local (caches receiver → 5-insn form, wrong), nested
`flushAsync(System::getMem2App())` (same as original). All ~6-word identical or regression.
## TIE: ConstructOpAnalyzeGLGR 20-diff window (91.79)
239/239 insns — orig interleaves `lhz r31,0x1c` (sheetGlyphCount) + `lhz r23,0xe` (dataBlockCount)
mid-flag-chain (issued at birth, deep-callee homes); mine emits both at-use (`lhz r26/r25`,
~8 insns later). Same callee-web rotation family. Kept: flags-first reorder (24→20 diffs) +
the second `pGlgr = &font->glgr` assignment (removing it = 113 diffs). Decl-init variant no-op.
## Status
- iplSDChannelTitle: .text 99.9, all data sections 100% (baseline was data 12.1%). Three
sub-100 fns — all at the anomalies/ties above.
- ut_ArchiveFontBase: .text 98.5 — the 20-diff window.
- DOL sha1 `26116613f624061ba99c8d1a299aaa6efa85670d` verified. No shims; both units stay NonMatching.