Repository navigation
feat(src): two Oozla functions in C, closer near miss for func_L11_00420C88 - #396
Merged
Veradictus merged 6 commits intoNov 3, 2026
Merged
Conversation
Every block now aligns with retail; about 120 instructions differ, mostly register names. Per-branch call tails, retail branch order, nested call arguments, strict float compares and case-local variables recover the control flow and the object/state/path allocation; case 19's table index was 0x54c where retail uses 0x56c. The remaining eight bytes are the D_L11_001B359C load in the second switch's case 5 partner loop. The draft's earlier counts included 47 alignment nops from a do/while(0) macro. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017f7s8MnhdrdEynhYhxkLs6
From the nonmatching draft (1268/1268 bytes, four preheader instructions reordered). Declaring the RGB mask as a constant local inside the inner loop gives its set a long lifetime, so loop.c hoists it on the first pass ahead of the pointer preparations, as retail does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017f7s8MnhdrdEynhYhxkLs6
Oozla state handler (1108 bytes, -G8 unit). The draft was one sched2 tie away: holding the scale constant in its own variable (k) for -k*y and k*x, instead of overwriting it with the product, makes sched2 issue k*x before the zero direction argument as retail does. Writing the height update as one speed*step product fixes the other multiply's operand order. Removes the nonmatching draft and the functional port stand-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017f7s8MnhdrdEynhYhxkLs6
ByteMatch progress reportSCES_516.07
No function changes. SCUS_972.68_v2
No function changes. SCUS_972.68
No function changes. Commit 50a05a1 · Ratchet & Clank: Going Commando on ByteMatch |
… left Second attempt: the case 5 partner loop takes the matched sibling func_L11_00424A60's for(;;) shape with its inline moby helpers, so the D_L11_001B359C load stays last before the loop entry and reorg moves it into the branch slot as retail's one-word $gp form; case 28 and case 40 get their own locals. 15,832/15,832 bytes; the remaining 18 rows are index/base register swaps after the value-returning func_002B60B0 call in cases 14, 15 and 22. A void declaration of func_002B60B0 closes all of them, as it does for func_L11_00452450; not used, the callee returns its pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017f7s8MnhdrdEynhYhxkLs6
Veradictus
added a commit
that referenced
this pull request
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #394: two Oozla (level 01) functions matched from their retained near misses, and an improved near miss for Joba's largest remaining function.
Matched
func_L01_003D1A48int rgb = 0xFFFFFF;at the top of the inner loop body. As an inline constant its lifetime was 1, so loop.c's first pass (threshold already lowered by two float hoists) left it for the rerun, after five pointer preparations; as a local its set is the first movable insn and is hoisted first, giving retail's preheader order.-O2 -G8 -gin its own unit.func_L01_003D8358step = speed*stepswapped themul.soperands (expand_binop swaps them when the target is an operand); the height now addsspeed*stepdirectly. Reusingscalefor both the constant and the product tied the scale multiply with an argument move in sched2 (equal priority, decided by dependent count); holding the constant in its ownkgives retail's order. Default-G8profile; its port-only C row and file are removed (as in 588f8f0).Notes only
func_L11_00420C88(15,832 bytes): the retained body is now 15,832/15,832 bytes with 18 register-only rows left. Earlier drafts' counts hid 47 alignment nops from ado/while(0)macro. Recovered: per-branch call tails, retail branch order, nested call arguments, strict float compares, case-local variables, the case 5 partner loop in the shape of matched siblingfunc_L11_00424A60(itsD_L11_001B359Cload now lands in the branch slot as retail's one-word$gpform), and a real index error in case 19 (0x54cwhere retail uses0x56c).Question for maintainers:
func_002B60B0's declaration in Joba callersTwo independent Joba functions match completely only if this caller declares
func_002B60B0as returningvoid:func_L11_00420C88: with the retained body, avoiddeclaration closes all 18 remaining rows (verified: 1 of 1 places match). With the truevoid *return, sched1 ranks the post-call index load above theluiand local-alloc sees$v0as still in use, so index and base swap$v0/$v1at three call sites.func_L11_00452450: avoiddeclaration closes its seven rows (see its note).src/game/002B60B0.creturns its pointer, and COMPILER-NOTES forbids an invented void return, so neither is used here. Most existing callers insrc/already declare itvoid. If maintainers accept that these callers' original declaration wasvoid(retail leaving$v0free after the call at every site is consistent with that), both functions can land as matches; otherwise the notes stand.Validation
tools/check.py: each matched function 1 of 1 USA v1.01 place.func_L01_003D8358also has a USA v2.00 place, not checked here (no US2 dump on this machine); PAL has neither.tools/build.py all --strict: 28 programs OK, zero C fallbacks (01_oozla: OK: 2062852 loaded bytes equal).python3 -m unittest discover -s tests: 339 tests OK.tests/check_repository.py: repository checks passed.🤖 Generated with Claude Code
https://claude.ai/code/session_017f7s8MnhdrdEynhYhxkLs6