mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
6da3c34a36
Detect a side-effect-free poll loop by its repeated same-PC interrupt checks and, when the window touched no MMIO and issued no stores, fast-forward guest time to the next internal device event (vblank/timer/cdrom/dma/sio) in whole loop quanta — bit-exact versus executing the spins one by one. Off switch: PSX_IDLE_SKIP=0 env or the idle_skip TCP command; gated off in exception context, precise mode, and lockstep. memory.c adds the two always-on gates the skip requires: g_guest_store_count (bumped at every raw store chokepoint) and g_mmio_access_count (bumped on every device-page read/write). Any store or MMIO touch in the window disqualifies it as a pure poll loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>