Skip to content

Match two PAL type predicates - #64

Open
Sumaiter wants to merge 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-type-predicates
Open

Sumaiter wants to merge 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-type-predicates

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Adds matching C for two PAL type predicates. func_00528538 tests whether a nonzero type occurs in the four bytes beginning at D_00171BC0 + 0x29 (64 bytes), retaining its unused first argument. func_00540958 follows the original object links at offsets 0x2EF4 and 0x2B0, then checks whether the byte at 0x67 is 7, 8 or 10 (64 bytes). Its only null check is the original outer-link check.

Validation:

  • Compiled both final sources through the repository's SN compiler and tools/cc.sh: 128 bytes match PAL retail at their catalogue addresses.
  • The linked-object predicate matches without relocation masking. Independently verified the other routine's HI16/LO16 reference pair against 0x00171BC0, including the object addend.
  • Added only the two 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, both versions of tools/match_map.py --check, and git diff --check pass.

The existing repository sources were compiled in an earlier contribution's full compilation run; these two 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 two functions / 128 bytes to the PAL baseline of 5,138 / 396,888; its report records 5,140 / 397,016.

Reconstruct the four-entry nonzero type scan and linked-object type test
with the original null checks, offsets and unsigned range comparison.

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