Skip to content

Batch 16: promote 13 overlay functions and refine guarded C - #180

Merged
mateuszklysz merged 341 commits into
lombyte-project:mainfrom
pezzadev:decompilerizer-batch-16
Oct 14, 2026
Merged

mateuszklysz merged 341 commits into
lombyte-project:mainfrom
pezzadev:decompilerizer-batch-16

Conversation

@pezzadev

@pezzadev pezzadev commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Before

These 13 overlay functions still used retail assembly oracles. Other resident and overlay units had missing or incomplete C bodies.

After

Promote 13 overlay functions (23,692 canonical bytes), add 28 guarded overlay C bodies, and refine existing resident and overlay C. Rebased onto main 9745b8624dc0 while preserving its data definitions and canonical names.

Promoted function Canonical size (bytes)
FUN_L00_0023d198 572
FUN_L00_002598b0 308
FUN_L00_002c26c8 2804
FUN_L01_002edca0 4040
FUN_L10_002e5be0 732
FUN_L12_002bf140 1420
FUN_L12_002e9f68 3732
FUN_L13_002c25b8 1912
FUN_L13_0030c3b8 1572
FUN_L15_002a7880 1980
FUN_L15_002c2938 1684
FUN_L15_002d0fa8 1172
FUN_L18_002e9768 1764

Resident refinements cover sceGsSetDefDispEnv, MPEG sequenceheader, sceSifInitCmd, object/shrub render-class registration, setup_fs_aa_buffer, and font_print_window.

Pending overlay work covers HUD animation, hero/help state, entity updates and particle effects, and vendor rendering. These bodies retain their NON_MATCHING/INCLUDE_ASM oracles and still have instruction differences. A 100% text score alone is not counted as a promotion; FUN_L05_00255208 retains its oracle because its earlier full-file promotion affected exact peers.

Reuse GeometryQuad, share the existing aligned beam-point layout, and reconcile prototypes and data aliases with main. Keep small-data placement aliases local where the SN extern-hoisting step requires them. No compiler routes, tracked progress files, or game data are changed.

Verification

  • make elf ends with PASS: reconstructed boot ELF matches retail and the retail SHA-256 matches.
  • make overlays: 2,822 C functions, 17,352 copy placements, and 3,895 level data objects match retail.
  • make check: 99 tests pass.
  • Fresh C-body measurements for all changed units, including rechecks after declaration/layout cleanup; all 13 promoted functions report promotable.
  • No new conflicting data labels; 717 remain against main's limit of 720. No body assembly, register pins, or custom text sections were added.

Local validation uses a private copy of the SN assembler with a 64 MiB stack reserve to handle the unchanged upstream L03 source; every other assembler-file byte is unchanged. No toolchain binary is included.

Pending C is work in progress. Passing the oracle-backed retail build does not establish that those C bodies are exact.

@github-actions

Copy link
Copy Markdown

Decompilation progress

C_EXACT Change Matched bytes Functions C_FUZZY
All code 88.45 % +0.67 pp 3,136,836 / 3,546,268 B (+23,692 B) 3,980 / 4,233 (+13) 89.70 %
Boot executable 85.65 % — 302,216 / 352,840 B (—) 1,163 / 1,219 (—) 98.13 %
Game 84.51 % — 230,576 / 272,844 B (—) 866 / 905 (—) 98.40 %
SDK 89.55 % — 71,640 / 79,996 B (—) 297 / 314 (—) 97.21 %
Level overlays 88.76 % +0.74 pp 2,834,620 / 3,193,428 B (+23,692 B) 2,817 / 3,014 (+13) 88.76 %
Shared level code 80.64 % +0.68 pp 911,592 / 1,130,492 B (+7,724 B) 1,442 / 1,583 (+4) 80.64 %
Per-level code 93.22 % +0.77 pp 1,923,028 / 2,062,936 B (+15,968 B) 1,375 / 1,431 (+9) 93.22 %
Data in C Change Matched bytes
All data 32.31 % — 4,017,559 / 12,433,372 B (—)
Boot executable 2.16 % — 15,091 / 699,136 B (—)
Level overlays 34.11 % — 4,002,468 / 11,734,236 B (—)
13 newly matched functions (23,692 B)
Function Address Size Unit
FUN_L01_002edca0 0x002edca0 4,040 B shared/gameplay/entities/002b8c08
FUN_L12_002e9f68 0x002e9f68 3,732 B level_12/gameplay/entities/002bf140
FUN_L00_002c26c8 0x002c26c8 2,804 B shared/gameplay/entities/002bffa8
FUN_L15_002a7880 0x002a7880 1,980 B level_15/gameplay/entities/0029aff0
FUN_L13_002c25b8 0x002c25b8 1,912 B level_13/gameplay/entities/002c13b0
FUN_L18_002e9768 0x002e9768 1,764 B level_18/gameplay/entities/002a7220
FUN_L15_002c2938 0x002c2938 1,684 B level_15/gameplay/entities/0029aff0
FUN_L13_0030c3b8 0x0030c3b8 1,572 B level_13/gameplay/vendor/003058a8
FUN_L12_002bf140 0x002bf140 1,420 B level_12/gameplay/entities/002bf140
FUN_L15_002d0fa8 0x002d0fa8 1,172 B level_15/gameplay/entities/0029aff0
FUN_L10_002e5be0 0x002e5be0 732 B level_10/gameplay/vendor/002df270
FUN_L00_0023d198 0x0023d198 572 B shared/ui/frames/0023d028
FUN_L00_002598b0 0x002598b0 308 B shared/gameplay/entities/00259710

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

@decomp-dev

decomp-dev Bot commented Oct 14, 2026

Copy link
Copy Markdown

Report for SCUS_971.99 (9745b86 - 90c01e1)

📈 Matched code: 88.45% (+0.67%, +23692 bytes)
📈 Linked code: 88.45% (+0.67%, +23692 bytes)

✅ 13 new matches
Unit Item Bytes Before After
shared/gameplay/entities/002b8c08 FUN_L01_002edca0 +4040 0.00% 100.00%
level_12/gameplay/entities/002bf140 FUN_L12_002e9f68 +3732 0.00% 100.00%
shared/gameplay/entities/002bffa8 FUN_L00_002c26c8 +2804 0.00% 100.00%
level_15/gameplay/entities/0029aff0 FUN_L15_002a7880 +1980 0.00% 100.00%
level_13/gameplay/entities/002c13b0 FUN_L13_002c25b8 +1912 0.00% 100.00%
level_18/gameplay/entities/002a7220 FUN_L18_002e9768 +1764 0.00% 100.00%
level_15/gameplay/entities/0029aff0 FUN_L15_002c2938 +1684 0.00% 100.00%
level_13/gameplay/vendor/003058a8 FUN_L13_0030c3b8 +1572 0.00% 100.00%
level_12/gameplay/entities/002bf140 FUN_L12_002bf140 +1420 0.00% 100.00%
level_15/gameplay/entities/0029aff0 FUN_L15_002d0fa8 +1172 0.00% 100.00%
level_10/gameplay/vendor/002df270 FUN_L10_002e5be0 +732 0.00% 100.00%
shared/ui/frames/0023d028 FUN_L00_0023d198 +572 0.00% 100.00%
shared/gameplay/entities/00259710 FUN_L00_002598b0 +308 0.00% 100.00%

@mateuszklysz mateuszklysz added the enhancement New feature or request label Oct 14, 2026
@pezzadev pezzadev changed the title decompilerizer batch 16 Batch 16: promote 13 overlay functions and refine guarded C Oct 14, 2026
@pezzadev
pezzadev marked this pull request as ready for review October 14, 2026 18:18
@mateuszklysz
mateuszklysz merged commit 6db3f55 into lombyte-project:main Oct 14, 2026
3 checks passed
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