mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 10:59:16 -04:00
8f83ebf3bb
The guest runs as native code, so "faster CPU" cannot mean "execute quicker" -- it means CHARGE LESS for the same work. Every device schedules off psx_cycle_count and the CRTC fires VBlank on a fixed cycle period, so scaling the per-instruction charge down by N lets the CPU complete N times the work inside one frame while timers, SPU, CDROM and the refresh rate keep their real-world rates. Scaling the VBlank period instead would slow everything EXCEPT the CPU, which is backwards. Q16 fixed point with a carried remainder, not a divide: this is the hottest path in the runtime and integer division of a 1-2 cycle instruction cost would floor to zero and lose all time. The accumulator keeps the total charge exact instead of drifting by the truncation on every call. Stock (65536) short-circuits, so a non-overclocked build pays one predictable compare. [video] cpu_overclock, percent, 100 = stock. Needed because hueponik's pal100full8 requires >900%. STATUS, measured, not assumed: 100% and 300% boot and run. 1000% does NOT reach a display -- and it is neither hung nor host-bound, frames advance steadily at ~39/s (455 -> 2574 over 54s) while the guest never enables the display. So the guest's own boot path stalls at that ratio; the mechanism moves time correctly but something in the boot sequence does not survive the CPU running 10x ahead of its devices. Not yet isolated, and it is the blocker for pal100full8. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>