Repository navigation
overlays: list hand-written level functions as original assembly - #101
Merged
Merged
Conversation
Level code gets the counterpart of config/handwritten_asm.txt:
config/overlays/handwritten_asm.txt (67 entries, 94 catalogue entries with
joined pieces), marked ASM_FUNC("asm/overlays", ...) in src/overlays/ and
counted as finished by tools/gen_progress_report.py, which checks the list
against the source as it does the level linker remnants. The entries are
the disassembler's "Handwritten function"s plus two listed by hand; every
one already has working C for the native port. The level copy of
MobyProc is left out until the port runs it. docs/ASM_CLASSIFICATION.md
has the rule and the evidence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ByteMatch progress report
✅ Newly matched (94)
|
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.
Level code has functions written as assembly in the original, like the executable's
config/handwritten_asm.txt. Until now it had no way to say so: they sit asINCLUDE_ASMstubs that can never be matched in C and are counted as unfinished. This adds the level-code counterpart, built the same way as the level linker remnants (config/overlays/linker_remnants.txt/LINKER_REMNANT).docs/ASM_CLASSIFICATION.md notes that changing the published progress policy needs upstream review, so this is a proposal. Happy to narrow the list or change the approach.
What changes
config/overlays/handwritten_asm.txt: 67 entries, covering 94 catalogue entries / 51,748 bytes once joined pieces are counted.src/overlays/: each entry'sINCLUDE_ASM("asm/overlays", …)becomesASM_FUNC("asm/overlays", …).ASM_FUNCisINCLUDE_ASM, so the image is unchanged.tools/gen_progress_report.py:--check;ASM_FUNClines and the catalogue, sharing the remnants' check (overlay_listed());tools/overlay_variants.py: its stub pattern acceptsASM_FUNC, as it already doesLINKER_REMNANT.docs/ASM_CLASSIFICATION.md: a "Hand-written level functions" section with the rule and evidence.Which functions
The executable's rule: every function the disassembler marks "Handwritten function" (87 entries, 67 after folding joined pieces into their first names). They hold instructions ee-gcc 2.9 doesn't emit: a trapping
addi/teq, VU0 macro instructions, MMI,$atas a working register.lqc2) and func_L00_00257F4C (prot3w).nopbeforejr $31with the slot filled;$atas an ordinary register, and thejrslot left empty.Cross-check against the NTSC-U decompilation (Lombyte, MIT)
INCLUDE_ASMstubs, or copies of executable functions it keeps underassembly/.teq $0, $0, 0trap stubs.Every listed function already works in the native port
None of these are marked finished without working code behind them. Checked against OpenRAC's
port/game/rac1-pal(no_c.tsv,hand/hand.tsv,libraries.tsv) andport/game/rac1/host:nonmatching/functional.tsv(the entry or one of its joined pieces).host/collision.c: func_L00_001EFFF0, func_L00_001F10E0, func_L00_001F1D20, func_L00_001F2BE8, func_L00_001F34F0;host/collision.c+host/render_native.c: func_L00_00254218;host/render_native.c: func_L00_001FE688, func_L00_002963D8;host/anim.c: func_L00_00252D20;host/effect_quad.c: func_L00_001FD1D8;hand/: func_L02_00250A58, func_L00_002539C8;no_c.tsvclasses a/b): pieces of a function the port replaces whole, or unreachable. They are func_L00_001EF944, func_L00_001F080C, func_L00_001FEFE0, func_L00_002535C8, func_L00_00254A70 and func_L01_00262BB0.Left out: func_L00_002569F8 + func_L00_00257848, the level programs' copy of MobyProc (5,152 bytes, as
func_00212658is). The disassembler marks both, but the port does not run this copy yet (no_c.tsv: needs C). It replaces the executable's MobyProc inhost/render_native.c, so they stayINCLUDE_ASMuntil the port does the same for the level copy.Functions already done in C are untouched.
Checks
tools/overlay_file_check.pyon the 17 changed level files: 0 problems (ASM_FUNClines assemble to the same bytes).progress/report.jsonregenerated: 4,904 → 4,998 of 5,121 functions finished (+94: the 67 entries and their joined pieces), code finished 95.14% → 96.53% (level code 95.39% → 96.98%).python tools/gen_progress_report.py --checkpasses.🤖 Generated with Claude Code