Skip to content

Match three PAL selection-slot lookups - #63

Open
Sumaiter wants to merge 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-selection-slots
Open

Sumaiter wants to merge 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-selection-slots

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Adds matching C for three adjacent PAL slot-lookup routines. func_004A9948 scans three slots for the active index (88 bytes); func_004A99A0 performs the same scan for a supplied index (64 bytes). Each returns the first empty slot or 3 if none is empty. func_004A99E0 returns the address of the first nonzero field at record offsets 0x24 / 0x28, falling back to the three-slot array (80 bytes). Its partial record type preserves the 0xB8 stride.

Validation:

  • Compiled all three final sources through the repository's SN compiler and tools/cc.sh: 232 bytes match PAL retail at their catalogue addresses.
  • Independently verified the call target 0x00506BB8 and all four HI16/LO16 reference pairs against D_0020C710 and D_00308208, including object addends.
  • Added only the three verified PAL map rows and corresponding US other rows, retaining every prior row. Regenerated reports/README; the US report is semantically unchanged.
  • Both versions of tools/progress.py --check and git diff --check pass.

The existing repository sources were compiled in the preceding contribution's full compilation run; these three final sources were compiled and verified separately. No US retail image is available locally, so global US match/relocation audits were not run. No retail data, disassembly or toolchain files are included.

Based directly on upstream main, independently of the other open contributions. This PR adds three functions / 232 bytes to the PAL baseline of 5,138 / 396,888; its report records 5,141 / 397,120.

Recover both three-slot scans and the prioritized field/fallback lookup
with the original 184-byte record stride and return addresses.

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