mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
d3d766c5c3
The committed beetle debug server (h_parity_dump reads=1) and beetle_libretro read hook already referenced parity_trace_reads_get / parity_trace_reads_total / parity_trace_note_read, but only a dead per-watch scalar table existed — the two readback functions were never implemented, so every psx-beetle rebuild failed to link (blocking the oracle entirely). Implement the dedicated READ ring as the symmetric counterpart of the write ring: note_read pushes one ParityEntry per read of a watched word, carrying reader provenance (pc = load PC, epc = read address, target/watch[slot] = loaded value) PLUS that slot's current last-WRITER metadata (wpc/wcycle/wframe/wtcb). One read row therefore answers "who read what value, and who last wrote it." reads_get / reads_total mirror parity_trace_get / parity_trace_total (newest rows, oldest first). Reset clears the ring. Removes the unused scalar last-reader table. Validated: psx-beetle links + boots; PSX_PARITY_TRACE=1 accrues well-formed read rows (reads_total>0, reader+writer provenance populated). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>