Skip to content

feat(overlays): six functions adapted from the NTSC decomp, without its compiler tricks - #71

Merged
Lynder063 merged 9 commits into
OpenRAC:mainfrom
cnobis:feat/ports-3
Oct 14, 2026
Merged

Lynder063 merged 9 commits into
OpenRAC:mainfrom
cnobis:feat/ports-3

Conversation

@cnobis

@cnobis cnobis commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Six more exact matches adapted from the NTSC decomp's matched C, one commit each, in the same way as #69. Each passed try_func.py (EXACT) and overlay_file_check.py (0 problems). The full build has no size mismatch, every function sits at its retail address, and the report is regenerated in the last commit: 4380 of 5109.

Function Level What it does
func_L02_002DDAE8 Aridia a moby that rolls back and forth along its heading
func_L00_0023AC68 shared a HUD panel that slides open, with a pulsing label
func_L05_0024C558 Rilgar the hero's periodic wall and ledge probes, and carrying an object
func_L11_00319108 Pokitaru damage to the chain enemy, link by link
func_L10_002DB688 Orxon a moby that shuffles an order on spawn and keeps a looping voice
func_L01_002FABE8 Novalis a breakable object that bursts into dust and debris

Where the NTSC decomp's C only steered the compiler, these use the plain form, which matches as well:

  • func_L02_002DDAE8 is a switch, not a chain of gotos.
  • func_L00_0023AC68 has no volatile on the display flag.
  • func_L05_0024C558 assigns the ledge distance in a statement, not in a comma expression inside the condition.
  • func_L11_00319108 does not hide assignments in a call's argument.

func_L01_002FABE8 is the update of Novalis's small breakable rocks: class 704 (rock_formation), placed three times, at (163, 74, 66), (158, 61, 66) and (116, 89, 57). A wrench hit bursts one, confirmed in the native port, so its hit mask 0x10000 takes the wrench. The bigger cave wall with a gold bolt behind it is a different object: class 729 (destroyable_cave_wall), placed once at (100, 97, 57), with its own update func_L01_002FBBD8, a burst about four times the size and hit mask 0x800000, the one the bomb glove breaks it with.

Two keep a construct worth a reviewer's look. func_L10_002DB688 keeps the NTSC decomp's union of the shuffle buffer and a later position, because the two share one stack slot in retail and neither separate nor block-scoped arrays reproduce that. func_L01_002FABE8 keeps an inner block in its first loop so the second loop reuses those stack slots, as retail does.

The cleanup commit drops these six functions' near misses and functional C with their functional.tsv rows, and regenerates nonmatching/README.md with nonmatching.py's index(). As in #69, that also brings three stale rows on main up to date, so the two PRs touch the same lines there.

Left out: func_L13_002EE590 (its C needs alloca, which hostgen does not take, so the port would lose the function) and func_L14_00316E60 (it only matches through volatile and goto tricks).

Credited in THIRD_PARTY_NOTICES.md and in each function's source comment.

Generated with Claude Code

cnobis and others added 9 commits October 14, 2026 21:43
A moby on Aridia that rolls back and forth along its heading: state 0
starts it, states 1 and 2 speed it up to the level's limit and slow it
down before turning, state 3 moves at full speed, and every state moves
it through func_L00_002617B0. Adapted from Lombyte's FUN_L02_002dc6b0,
written as a switch where Lombyte dispatches with gotos. Level 2's
constants sit 0x90 above their US addresses, and frame_time_sq is read
with MACRO_ADDR rather than through its literal address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Draws a HUD panel that slides open with its element's open counter: a
three-part frame, an animated icon, and a label whose colour pulses with
the frame counter. It draws nothing while the hero is in vehicle mode 2
or state 50. Adapted from Lombyte's FUN_L00_0023a2d0, without its
volatile on the display flag and with the two candidate heights as plain
locals. Level 0's data sits 0xD4 to 0xE4 above its US addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero's periodic probes on Rilgar: every third frame the wall in
front of him (distance, angle, and whether it is a moby that blocks),
every fifth frame a ledge in front while he is on the ground, and while
he carries an object in control modes 0x15 and 0x16 it moves the object
to his hands. Adapted from Lombyte's FUN_L05_0024bdc0, with the hero's
fields under their names in include/hero.h and the ledge distance as a
plain statement rather than a comma expression in the condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The damage step of a Pokitaru chain enemy: links hit this frame wear
down its health, and each time the health crosses a link's share the
last link dies, takes the hit link's place, and the following links
shift up in the chain. When no link is left it bursts, spawns three
debris pieces and removes itself. Adapted from Lombyte's
FUN_L11_00317c98, without the assignments Lombyte hides in a call's
argument, which the bytes do not need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Orxon moby that shuffles a ten-entry order from the level's table on
spawn and keeps it in its pvars, then while active draws through
func_L10_002DBA50 when the hero's view reaches it and keeps its looping
voice alive; state 2 releases the voice. Adapted from Lombyte's
FUN_L10_002da2c8.

The shuffle buffer and state 2's position share one stack slot in
retail, which Lombyte's union reproduces. Separate arrays come within 8
bytes but place the position elsewhere, and arrays scoped to their case
blocks change the size, so the union stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A breakable Novalis object: when something hits it with force, it plays
its sound, throws 200 dust particles and 40 debris chunks in one of
three colours around itself, and removes itself. Adapted from Lombyte's
FUN_L01_002f9810. The first loop's locals sit in a block of their own,
which lets the second loop reuse their stack slots as retail does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unctions

The six functions of this branch are exact now: their near misses and
functional files go, with their rows in functional.tsv.

nonmatching/README.md is regenerated with tools/nonmatching.py's index().
It also catches up with main on three rows: func_L09_00306DD8's staged
file is gone, and func_L05_00317B68 and func_L00_001F8750 moved to
functional/ and game/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerated with gen_progress_report.py --no-build after build_sn.sh, and
--check says it is current. The six functions of this branch are new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@decomp-dev

decomp-dev Bot commented Oct 14, 2026

Copy link
Copy Markdown

Report for SCES_509.16 (e1ee2ee - f3cf5d7)

📈 Matched code: 82.56% (+0.17%, +6408 bytes)

✅ 9 new matches
Unit Item Bytes Before After
Level 01: Novalis func_L01_002FABE8 +992 0.00% 100.00%
Level 10: Orxon func_L10_002DB688 +964 0.00% 100.00%
Level 11: Pokitaru func_L11_00319108 +952 0.00% 100.00%
Shared level code func_L00_0023AC68 +880 0.00% 100.00%
Shared level code func_L02_002DDAE8 +864 0.00% 100.00%
Shared level code func_L03_002E9AF8 +276 100.00% 100.00%
Shared level code func_L15_002E5770 +148 100.00% 100.00%
Shared level code func_L05_0024C558 +28 96.89% 100.00%
Shared level code func_L02_002DB810 -20 100.00% 100.00%
🥀 4 broken matches
Unit Item Bytes Before After
Shared level code func_L11_0030A8C8 -756 100.00% 0.00%
Shared level code func_L08_00211A38 -748 100.00% 0.00%
Shared level code func_L00_0029AFB8 -544 100.00% 0.00%
Shared level code func_L03_002E99F0 -36 100.00% 0.00%
📉 1 regression in an unmatched item
Unit Item Bytes Before After
Shared level code func_L00_001F8750 -110 94.83% 0.00%

Lynder063 added a commit that referenced this pull request Oct 14, 2026
feat(overlays): 50 pure-C ports, plus #69, #70 and #71 merged
@Lynder063
Lynder063 merged commit ca8c3b2 into OpenRAC:main Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants