Skip to content

Match four PAL bounded table lookups - #59

Open
Sumaiter wants to merge 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-table-lookups
Open

Sumaiter wants to merge 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-table-lookups

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Add matching C for four previously unmatched SCES_532.85 main-image functions:

  • func_0048F4C0 (56 bytes): read the first 16-bit field of a 32-byte record.
  • func_0048F4F8 (56 bytes): read the 16-bit field at offset 0x0A of the same record table.
  • func_0048F5C8 (56 bytes): read the first 16-bit field of the 8-byte record table.
  • func_00498468 (52 bytes): return a value for indices 0..3, zero for index 4, and -1 for every other unsigned index.

The first three retain the low-16-bit handle mask, null-table check and inclusive upper bounds. Their partial table layout is shared in include/pal/record_tables.h; the existing declaration of D_002215D8 as void * is preserved.

Validation:

  • Compiled all four final source files through the existing tools/cc.sh pipeline with its default SN compiler settings and no new flags.
  • All 220 bytes match using the repository's relocation masks. Independently resolved every HI16/LO16 pair: eight relocations total, pointing to the original global addresses D_002215D8 and D_002F33B8.
  • Verified the final source hashes against the tested files.
  • Added only four PAL match rows and four US other rows; every existing map row is unchanged.
  • Regenerated progress using tools/progress.py: PAL increases by four functions and 220 bytes (5,138 -> 5,142 functions; 396,888 -> 397,108 bytes). The US report is unchanged.
  • Both US and PAL tools/progress.py --check passed, as did git diff --check.

This branch is independent of PRs #57 and #58. Validation is limited to these PAL functions; a full rebuild, global audits and US-disc comparisons were not run. No retail binaries, assets or disassembly are included.

Reconstruct three low-16-bit handle lookups and the four-entry value
lookup in the SCES_532.85 main image. Preserve inclusive table limits,
the zero sentinel at index 4 and -1 for other invalid indices.

The final sources reproduce 220 bytes through tools/cc.sh. All eight
HI16/LO16 relocations were verified against the original global data
addresses. Add the proven map rows and regenerate the PAL progress report.

Co-Authored-By: Codex <noreply@openai.com>
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.

1 participant