mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 18:25:35 -04:00
2acd2d79ef
OVERLAY_REGION_FLOOR was hardcoded to 0x98000 = Tomba 1's main-EXE text end (0x10000 + 0x88000). Tomba 2's boot EXE is only 0x28800 (text ends 0x38800), so its disc overlays load at 0x80085000+ — inside [0x38800, 0x98000), which the hardcoded floor wrongly classified as statically-recompiled main-EXE text. That forced every Tomba 2 overlay onto (a) slow block-by-block dispatch and (b) the bail-prone dispatch_nonlocal_call contract path; when the per-frame interrupt pump fired mid-contract it cascaded into the $ra=$sp=1 bail storm = the Whoopee-Camp splash freeze. Make the floor a runtime value (g_overlay_region_floor), pinned at game load to (load_address + text_size) & 0x1FFFFFFF. Defaults to 0x98000 for BIOS-only; evaluates to the same 0x98000 for Tomba 1 (no behavior change), and is correct-by-construction for every game. Resolves: bail storm gone (bail_first=0); splash advances at 60 fps past the old frame-1823 wedge. NEW failure point exposed next: dispatch_depth desync on the now-local-flow overlay path (fixed in the following commit). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>