Skip to content

overlay: finish Gaspar (mountable turret update) - #173

Merged
mateuszklysz merged 1 commit into
lombyte-project:mainfrom
conor-sometimes:overlay/gaspar-finish
Oct 13, 2026
Merged

mateuszklysz merged 1 commit into
lombyte-project:mainfrom
conor-sometimes:overlay/gaspar-finish

Conversation

@conor-sometimes

Copy link
Copy Markdown
Contributor

Before

Gaspar (level 09) had one pending function.

Function Bytes
FUN_L09_00304c80 mountable turret update 3492

After

It is exact, so Gaspar is complete. One commit, gated, on current main (#171).

It is the turret the hero mounts: he sits in it, aims with the stick and fires the two barrels in turn. Nothing to port (rac1-decomp has it as asm only, and no other planet has a matched copy); written from an m2c draft. The unit is in OVERLAY_SN_UNITS, so it builds with SN cc1 like the rest of 003033a0.c.

Things worth a look

  • D_0013E5BC (also read by clamp_voice_position_to_collision; named sound_probe_ignore) is declared as an array and written [0] = moby: as a plain scalar the compiler assumes it can't alias the moby fields and hoists the loads above the store, where retail keeps the store first.
  • Case 0's zero stores: vars->unk40 = 0 has to come last in source; the scheduler first emits the store that frees the vars register (checked with -fsched-verbose).
  • The beam blink is an if/else chain with the 4.0f/0.4f block written twice, so the compiler reuses the 4.0 already in $f20; the stick y invert has its own stick_y; D_L09_00161CC0 is f32[2] with the sda attribute so Ps2EeAs reaches it through $gp (commented); the two *= 0.97f lines are swapped and the barrel select is vars->barrel == 0 ? 4 : 3.
  • The turret's vars, its beam table D_L09_00180440 and D_L09_00166E00 get file-local struct types (no shared header uses them); moby and hero fields come from the shared headers. No configure.py entries, no compiler flags.

Verification

  • make elf ends with PASS: reconstructed boot ELF matches retail
  • make overlays ends with PASS: all 2780 overlay functions in C match retail, with their 17232 copies in other places
  • make check passes

FUN_L09_00304c80, the last pending function of l09. The sound-probe
global D_0013E5BC is declared as an array (retail keeps its store
ahead of the moby loads), and the case-0 zero stores follow the
order that frees the vars register last.
@github-actions

Copy link
Copy Markdown

Decompilation progress

C_EXACT Change Matched bytes Functions C_FUZZY
All code 86.65 % +0.10 pp 3,072,740 / 3,546,268 B (+3,492 B) 3,934 / 4,233 (+1) 87.98 %
Boot executable 84.73 % — 298,968 / 352,840 B (—) 1,159 / 1,219 (—) 98.11 %
Game 84.26 % — 229,892 / 272,844 B (—) 865 / 905 (—) 98.40 %
SDK 86.35 % — 69,076 / 79,996 B (—) 294 / 314 (—) 97.12 %
Level overlays 86.86 % +0.11 pp 2,773,772 / 3,193,428 B (+3,492 B) 2,775 / 3,014 (+1) 86.86 %
Shared level code 78.82 % — 891,052 / 1,130,492 B (—) 1,428 / 1,583 (—) 78.82 %
Per-level code 91.26 % +0.17 pp 1,882,720 / 2,062,936 B (+3,492 B) 1,347 / 1,431 (+1) 91.26 %
1 newly matched function (3,492 B)
Function Address Size Unit
FUN_L09_00304c80 0x00304c80 3,492 B level_09/gameplay/vendor/003033a0

Compared with main (e934c0a). C_FUZZY uses main's last measurement.

@decomp-dev

decomp-dev Bot commented Oct 13, 2026

Copy link
Copy Markdown

Report for SCUS_971.99 (e934c0a - 64d5a61)

📈 Matched code: 86.65% (+0.10%, +3492 bytes)
📈 Linked code: 86.65% (+0.10%, +3492 bytes)

✅ 1 new match
Unit Item Bytes Before After
level_09/gameplay/vendor/003033a0 FUN_L09_00304c80 +3492 0.00% 100.00%

@mateuszklysz mateuszklysz added the enhancement New feature or request label Oct 13, 2026
@mateuszklysz
mateuszklysz merged commit 5c2acf3 into lombyte-project:main Oct 13, 2026
3 checks passed
@conor-sometimes
conor-sometimes deleted the overlay/gaspar-finish branch October 13, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants