Repository navigation
feat(pal,us2): port four functions, mark three original assembly, retain one near miss - #441
Open
nominalsan wants to merge 1 commit into
Open
nominalsan wants to merge 1 commit into
nominalsan wants to merge 1 commit into
Conversation
…ain one near miss C ports of matched USA v1.01 functions, each its own -g8.c unit with its original's profile: - func_US2_002D3138: func_002D2188 with text id 0x2BE5 for 0x2D4F. - func_US2_00349C00: func_00348EC0 with the menu fields 0x70 further in and 88-byte label slots. - func_US2_L02_00400E04: func_PAL_L02_00403FF0 with v2.00's data and text ids 0x2DDB, 0x2DDC, 0x2DF8, 0x2DF4, 0x2DDD. - func_PAL_L08_003DF82C (levels 8 and 19): func_L08_003DB518 with the fade step scaled by 1.2f. Marked ASM_FUNC under AGENTS.md's second criterion (needs a maintainer's agreement): func_PAL_002A0F68 is func_002A05A8 plus two mul.s by 1.2f, with the same 26 trapping add/addi/sub/dsub, $at as a working register and two cvt.w.s words the compiler never emits; func_PAL_L01_00305C50 and func_US2_L01_00305170 are func_0029D4D0 (qmtc2, 15 trapping ops, three alternate entries) plus an 84-byte tail with a fourth alternate entry, a trapping addi and two teq. Near miss: func_PAL_L09_0040FD68 (984/984 bytes, 0/1) differs only by a $v0/$v1 and $f3/$f4 swap in case 3. Instrumented local-alloc and the sched1 trace pin it to quantity priorities; the notes record the measured model and the next hypothesis, with a matching-blockers.md entry. Checks: - tools/check.py: func_US2_002D3138 28 of 28, func_US2_00349C00 28 of 28, func_US2_L02_00400E04 1 of 1, func_PAL_L08_003DF82C 2 of 2. - tools/build.py all --strict: 28 programs OK in each of USA v1.01, PAL and USA v2.00; each new C function is in every carrying placed.json. - python3 -m unittest discover -s tests: 540 tests OK (1 skipped); tests/check_repository.py: passed; tools/progress.py --check: passed. Report not regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ByteMatch progress reportSCES_516.07
No function changes. SCUS_972.68
No function changes. SCUS_972.68_v2
No function changes. Commit d56e6bc · Ratchet & Clank: Going Commando on ByteMatch |
This was referenced Nov 10, 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.
What
Four functions of the PAL (SCES_516.07) and USA v2.00 releases ported as C from their matched counterparts, three marked original assembly, and one PAL near miss retained in
nonmatching/.func_US2_002D3138func_002D2188with text id 0x2BE5 for 0x2D4F. Newsrc/us2/game/002D3138-g8.cwith its original's profilefunc_US2_00349C00func_00348EC0with the menu fields 0x70 further in and 88-byte label slots. Newsrc/us2/game/00349368-g8.cfunc_US2_L02_00400E04func_PAL_L02_00403FF0(#437) with v2.00's data (D_US2_L02_<address>) and text ids 0x2DDB, 0x2DDC, 0x2DF8, 0x2DF4, 0x2DDD. NewL02_00400E04-g8.cfunc_PAL_L08_003DF82Cfunc_L08_003DB518with the fade step scaled by 1.2f (50 Hz). Newsrc/pal/levels/shared/L08_003DF82C-g8.cMarked
ASM_FUNCunder the second criterion of AGENTS.md, "Handwritten assembly", so these need a maintainer's agreement:func_PAL_002A0F68(792):func_002A05A8(alreadyASM_FUNC, feat(src): four functions in C (sky renderers, level-8 emitter, beam), three original assembly routines #425) plus twomul.sby 1.2f. Like it: 26 trapping add/addi/sub/dsub,$atas a working register, and twocvt.w.swords in an encoding the compiler never emits.func_PAL_L01_00305C50andfunc_US2_L01_00305170(804 each, 6 levels): the first 720 bytes arefunc_0029D4D0(alreadyASM_FUNC:qmtc2, 15 trapping ops, three alternate entries), followed by an 84-byte tail with a fourth alternate entry, a trappingaddiand twoteq.Retained near miss (marker kept):
func_PAL_L09_0040FD68(984/984 bytes, 0/1), the PAL copy offunc_L09_0040AC48. Only case 3's tick test differs, a$v0/$v1and$f3/$f4swap. A private instrumented local-alloc dump and the sched1 trace pin it to quantity priorities. The note records the measured model (one extra instruction tied to the counter, emitting no code, reproduces retail's whole assignment) and the next hypothesis. There is a newdocs/contributing/matching-blockers.mdentry, "A PAL constant that reorders local allocation".Checked
tools/check.py:func_US2_002D313828 of 28,func_US2_00349C0028 of 28,func_US2_L02_00400E041 of 1,func_PAL_L08_003DF82C2 of 2.tools/build.py all --strict: 28 programs OK.tools/build.py all --version pal --strict: 28 programs OK.tools/build.py all --version us2 --strict: 28 programs OK.placed.json: each new C function is placed at all its places (28, 28, 1, 2); none fell back.python3 -m unittest discover -s tests: 540 tests, OK (1 skipped).python3 tests/check_repository.py: repository checks passed.python3 tools/progress.py --check: passes (the reports of us, pal, us2 agree).git ls-files --eol: all 15 changed filesi/lf w/lf.The strict builds ran on the branch's sources. Only documentation changed after them: the near-miss note, its README row and the blockers entry.
tools/progress.pywas not run, andprogress/report.jsonand the README are not touched.Adds 3 PAL functions (1 C, 2 original assembly) and 4 USA v2.00 functions (3 C, 1 original assembly); no USA v1.01 functions.
🤖 Generated with Claude Code