Skip to content

Match the engine-trail ribbon builder (func_0022F738) - #102

Merged
Lynder063 merged 1 commit into
OpenRAC:mainfrom
xx255q:match/engine-trail
Oct 19, 2026
Merged

Lynder063 merged 1 commit into
OpenRAC:mainfrom
xx255q:match/engine-trail

Conversation

@xx255q

@xx255q xx255q commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

func_0022F738 in src/game/space.c, the space flights' engine-trail ribbon builder (1,188 bytes), is now C and matches exactly: the 0x210-byte frame, every instruction, and the 4 alignment bytes after it. There are no new flags, inline assembly, register pins or barriers.

What closed the last differences (from a 62-byte near miss):

  1. The two engine rings are inside the trail state struct at their real offset, +0xC0 of D_0013E130, so they still live at 0x0013E1F0 / 0x0013E3F0. This changes which address expressions GCC shares, and gives retail's order of the cross-product calls.
  2. The across/side normal vectors are grouped in one workspace struct, with the same stack layout, and the engine index is declared in its loop. That reproduces every spill slot.
  3. The second vertex loop sets its position pointer in its own for initializer, after the first draw, which gives retail's setup around that draw.

Checks

  • tools/file_check.py src/game/space.c: 15 C functions, 0 not exact.
  • bash tools/build_sn.sh: 1224/1224 audited exact, every function at its retail address, the image matches retail.
  • progress/report.json regenerated (4,904 → 4,905 of 5,121 functions, 95.14% → 95.17% code); --check passes.

The port-only C in nonmatching/functional/func_0022F738.c is left as it is, as for func_0023C5E0 in #99 (ByteMatch leaves out matched functions).

Origin: the candidate was prepared with ChatGPT against this main (1db496d2). I applied it unchanged to a clean checkout and reran every check above here.

🤖 Generated with Claude Code

The two engine rings sit in the trail state struct at +0xC0, the
across/side normals share one workspace and the second vertex loop sets
its position pointer in its own initializer: 1,188/1,188 bytes, no flags
or barriers. Full build 1224/1224 exact; progress/report.json regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xx255q
xx255q force-pushed the match/engine-trail branch from e7d3c86 to 474c8c8 Compare October 19, 2026 15:16
@Lynder063
Lynder063 merged commit d43212f into OpenRAC:main Oct 19, 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