Skip to content

Match seventeen PAL fixed-size hash lookups - #72

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

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

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Adds matching C for seventeen PAL fixed-size hash-table lookup variants: fourteen eight-slot routines (112 bytes each) and three three-slot routines (128 bytes each), totaling 1,952 bytes. The loops retain key/value offsets 0x08 / 0x0C, eight-byte entry stride, probe increment 0x13D573, early exit on an empty slot, distinct deleted-entry marker addresses, and the original probe limit.

Each one-byte deleted marker is defined as zero-initialized C data. Its address and zero-initialization were checked against PAL .bss; marker identity is preserved separately for every variant. No retail data is included.

Validation:

  • Compiled every final source through the repository's SN compiler and tools/cc.sh: all seventeen functions match their direct PAL catalogue addresses, with only object relocation fields masked.
  • Independently resolved all seventeen R_MIPS_GPREL16 references through the objects' .reginfo GP values and named data symbols. Retail's PAL GP 0x002259FF was derived from startup instructions at 0x00157678 / 0x0015768C and the move to GP at 0x001576A0.
  • Checked that the variants share the expected retail loop structure and differ only in the identified marker address and table-size fields. The final object-to-retail checks were still performed independently for every function.
  • Added only the seventeen verified PAL map rows and corresponding US other rows, preserving every previous row. Regenerated reports/README; the US report is semantically unchanged.
  • Both versions of tools/progress.py --check and tools/match_map.py --check, plus git diff --check, pass.

The baseline sources passed a full compilation in preceding work; these final new sources were compiled and checked separately. No US retail image is available locally, so global US match/relocation audits were not run. The compiler/assembler pipeline is unchanged. No disassembly, SDK sources or toolchain files are included.

Based directly on upstream main, independently of the other open contributions. PAL increases from 5,138 / 396,888 to 5,155 matched functions / 398,840 bytes. The PAL 0x00509088 candidate is excluded because the existing US source already owns that identifier; its map row is unchanged.

Reconstruct fourteen eight-slot and three three-slot lookup variants,
preserving probe arithmetic, empty slots and distinct deleted markers.

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