mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
c981b3a2d7
The cached line-leader rule charges a fetch at every 16-byte line start of the runtime PC. The BIOS emitter tested bits[3:0] of the ROM address instead and assumed every copy window preserves them. OpenBIOS copies its kernel from ROM 0x1FC1E4D4 to RAM 0x500, which shifts them by 4. Each kernel line crossing was charged one instruction early, where it is a hit, and the real crossing went uncharged. 1,152 kernel instruction sites differed from the interpreter. The test now uses the runtime PC that relocate_ra already computes. In the OpenBIOS kernel, 823 misplaced fetch sites go and 773 are added at runtime line starts. Retail profiles are unaffected: SCPH-1001's copy windows are 16-byte aligned and SCPH-101/5552 declare none. The uncached_fetch_charge ctest now also replays every cached OpenBIOS run from a cold cache against the interpreter's fetch path and the Beetle transcription. R4 (OpenBIOS, recompiled kernel, HLE boot) reaches the game entry 6,013 guest cycles later than with the uncached fix alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>