Skip to content

Match PAL wrapped and clamped index stepping - #66

Merged
Lynder063 merged 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-navigation-state
Nov 1, 2026
Merged

Lynder063 merged 1 commit into
OpenRAC:mainfrom
Sumaiter:decomp/pal-navigation-state

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Adds matching C for PAL func_00496118 (84 bytes), which advances an index. Wrap mode returns (current + step + count) % count; otherwise negative steps clamp at zero and nonnegative steps clamp at count - 1. It preserves the original signed arithmetic and does not introduce additional checks or normalization.

Validation: compiled the final source through the repository's SN compiler and tools/cc.sh. All 84 bytes match PAL retail at catalogue address 0x00496118, with no relocations or masking. Both versions of tools/progress.py --check and tools/match_map.py --check pass, as does git diff --check.

Only the new verified PAL map row and US other row were added; all previous rows were retained. Reports/README were regenerated and the US report is semantically unchanged. Based directly on upstream main, independently of the other open PRs; PAL changes from 5,138 / 396,888 to 5,139 matched functions / 396,972 bytes.

The upstream sources passed a full compilation in the preceding work; this final new source was compiled and byte-checked separately. No US image is available locally, so global US match/relocation audits were not run. No retail data, disassembly, SDK sources or toolchain files are included.

Preserve the signed wrap formula and direction-dependent lower/upper
clamps of func_00496118 without adding new bounds behavior.

Co-Authored-By: Codex <noreply@openai.com>
@Lynder063
Lynder063 merged commit 189b8d6 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