Skip to content

Match 22 PAL game functions and improve remaining packing draft - #75

Merged
Lynder063 merged 3 commits into
OpenRAC:mainfrom
Sumaiter:decomp/pal-game-batch
Nov 1, 2026
Merged

Lynder063 merged 3 commits into
OpenRAC:mainfrom
Sumaiter:decomp/pal-game-batch

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds matching PAL (SCES_532.85) C for 22 game functions / 1,056 bytes. The batch covers bounded table reads, byte/word flag updates, state transitions, parameter-forwarding helpers, a counter update and a clamped float approach operation.

Area Functions
Bounded table reads 0047DB88, 0047DD30, 0047DD58, 0047DDC0, 0047DDE8, 004984A0
Flags and state writes 0049B3A8, 004E2A78, 004EF7F8, 0050DEB8, 0050F488
Parameter/call adapters and counters 00457A38, 0045E618, 0045EF28, 00499418, 00499440, 004AC708, 004B4CA8, 00549AB8
Clamped float approach 00476080
Issue #73 draft fixes 004ABFC0, 00501B58

Two unfinished drafts from #73 now match: 004ABFC0 (36 bytes) uses explicit branch assignment to retain the original signed comparison, and 00501B58 (112 bytes) declares the external deletion marker as a one-byte object so its address is materialized in the original order. Both use the default compiler options; their four HI16/LO16 relocations resolve to D_00308C80 and D_00222210. The third draft, 00470970, remains nonmatching. Its improved research-only candidate, comparison evidence and a reproducible symbolic checker are included outside the build; it is not counted as a match. See notes/pal-00470970.md.

The four accessors of D_00171C00 share an offset-based layout in pal/interface_state.h. The two 004994xx adapters share one consistent callee declaration in pal/render_parameter.h. Names/types describe observed operations and layouts; no additional high-level game meaning is claimed.

The float coefficient in 00549AB8 retains retail's exact rounded value. Three translation units use existing file-wide compiler options to reproduce their original instruction selection/scheduling: 0045E618 uses -mno-split-addresses, 00499418 uses -fno-schedule-insns, and 00476080 uses -ffast-math -fno-delayed-branch. The compiler pipeline, assembler passes and matching rules are unchanged.

Validation:

  • Compiled all 22 final source files through tools/cc.sh; their sizes and non-relocated instruction bits match the direct PAL catalogue addresses.
  • Independently verified all 41 relocation entries, including every call target and every HI16/LO16 global-address reference, against PAL retail.
  • Both US/PAL mapping and progress checks pass. Every existing mapping row is preserved; the US progress report is unchanged.
  • The PAL report increases from 5,138 to 5,160 canonical matching functions and from 396,888 to 397,944 matched bytes, relative to current main.
  • Read-only comparison of the current PAL map: 6,768 matching mapped places, zero byte mismatches, zero unavailable source objects. This is the masked-byte map comparison, not a global relocation audit.
  • The new files were compiled separately; a full source rebuild was not rerun for this batch. Full US retail and global relocation audits were not run because the US input is unavailable. Frontend counterparts are not claimed as independently verified additional matches.

This is a standalone batch based on main. Earlier pending PRs and the translated-code inventory are not included. One explicitly nonmatching research draft is included outside src/ and the progress maps. Related experiment: #73. The PS2Recomp output was used as an additional local reference; these files are reconstructed matching C. No disc data, extracted binaries, generated instruction listings, SDK material or runtime-tool changes are included.

The 00470970 draft now differs by one byte in one instruction: OR source operands are exchanged. The checker verifies this precise difference and proves identical lower 64 bits of all GPRs, the ordered store and return target for all input bit patterns using exact symbolic bit origins; changed-shift and unsupported-opcode negative controls pass. It does not model the upper 64 bits of 128-bit registers, prove the original C prototype or test game execution. This evidence does not relax byte-exact matching and adds no completed functions or bytes.

Sumaiter and others added 2 commits November 1, 2026 19:36
Add 908 matching bytes with shared state layouts and parameter declarations. Verify direct PAL catalogue bytes and all 37 relocation entries without changing the compilation or matching pipeline.

Co-Authored-By: Codex <noreply@openai.com>
@Sumaiter Sumaiter changed the title decomp(pal): match 20 table, state and parameter functions Match 22 PAL game functions and resolve two reconstruction drafts Nov 1, 2026
@Sumaiter Sumaiter changed the title Match 22 PAL game functions and resolve two reconstruction drafts Match 22 PAL game functions and improve remaining packing draft Nov 1, 2026
@Lynder063
Lynder063 merged commit 60818dd into OpenRAC:main Nov 1, 2026
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