Skip to content

Match four PAL scalar smoothing routines - #61

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

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

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Adds matching C for the PAL scalar target-approach helper and three wrappers. The helper keeps the original snap comparisons, minimum signed step, and returned delta, including returning the unscaled delta when it snaps to the target. The wrappers retain the original integer-to-float conversions and global override behavior.

PAL function Behavior Matched bytes
func_004760C0 Approach a target with a fractional/minimum step 116
func_00498038 Integer target, fraction 0.2, minimum step 0.01 64
func_0049B418 Global override or minimum-step update; report nonzero delta 116
func_0049C260 Integer target, fraction 0.3, minimum step 0.03 64

Validation:

  • Compiled all four final sources through the repository's SN compiler and tools/cc.sh pipeline: 360 bytes match PAL retail at the catalogue addresses. The helper matches with no relocations; fabsf is emitted inline as abs.s.
  • Independently resolved all three call relocations to 0x004760C0 and the HI16/LO16 global reference to 0x00221680, including object addends.
  • Added only four verified PAL map rows and the corresponding US other rows, preserving all previous rows. Regenerated the progress reports/README; the US report is semantically unchanged.
  • Both versions of tools/progress.py --check and git diff --check pass.

Full source compilation with JOBS=8 bash tools/build.sh passed: 5,265 files. A read-only masked-byte check using tools/match_map.py's compiled-function/retail helpers against every existing PAL match row found 6,750 matching places, 0 mismatches and 0 missing source objects. This is not a global relocation audit; the five relocations of this contribution were independently resolved as described above.

No US retail image is available locally, so the US-wide match and relocation audits were not run. The new functions were checked directly against PAL retail, with all external references independently verified. No retail data, disassembly, toolchain files or SDK sources are included.

Based directly on upstream main, independently of the earlier open contributions. This PR adds four functions / 360 bytes to the upstream PAL baseline of 5,138 / 396,888; its report records 5,142 / 397,248.

Reconstruct the target-approach helper and three wrappers from PAL retail
code, retaining its return value, comparisons and minimum-step behavior.

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