Repository navigation
feat(overlays): six functions adapted from the NTSC decomp, without its compiler tricks - #71
Merged
Merged
Conversation
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>
Report for SCES_509.16 (e1ee2ee - f3cf5d7)📈 Matched code: 82.56% (+0.17%, +6408 bytes) ✅ 9 new matches
🥀 4 broken matches
📉 1 regression in an unmatched item
|
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.
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) andoverlay_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.Where the NTSC decomp's C only steered the compiler, these use the plain form, which matches as well:
switch, not a chain ofgotos.volatileon the display flag.func_L01_002FABE8is 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 updatefunc_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.tsvrows, and regeneratesnonmatching/README.mdwithnonmatching.py'sindex(). 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 throughvolatileandgototricks).Credited in
THIRD_PARTY_NOTICES.mdand in each function's source comment.Generated with Claude Code