mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 10:59:16 -04:00
d690776fb3
`step n=1` could park before a single frame completed, so the write trace ran over nothing and the Studio showed an empty table with no indication anything had gone wrong. Measured before the fix: step n=10 advanced 2 frames, step n=1 advanced 0. debug_server_wait_if_paused() is called from three places -- the vblank path in main.cpp and two in dirty_ram_interp.c -- and each one decremented the step counter, so it drained up to 3x per frame. It now only counts a decrement when s_frame_count has actually changed, and handle_step stamps the frame it is leaving so that one does not count. Verified live: n=1 advances 1, n=5 advances 5, n=10 advances 10. This also fixes the Studio's Step button, which had the same defect. packet_writers.py no longer trusts the paused flag to mean a frame ran -- it compares frame NUMBERS across the step and errors out if nothing advanced. And an empty trace is now an explicit error rather than a report with zero rows: the packets had just been walked, so "no writes" means the trace window was wrong, not that nothing writes them. An empty table is indistinguishable from a finished search, which is the worst way for a tool to fail. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>