mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 10:59:16 -04:00
5da57aa478
Extends the two-process parity ring so each row carries, per watch word, the exact store PC + guest cycle + frame + (approx) writing TCB of the most recent write to that word. parity_trace_note_write() maintains the table from BOTH processes' write paths (native: memory.c psx_write_* with g_debug_last_store_pc; Beetle: beetle_libretro.cpp wtrace_callback with the store pc). Both parity_dump serializers emit the new wwpc/wwcy/wwf/wwt arrays (identical wire format), and parity_diff.py prints a side-by-side WATCH PROVENANCE block at the divergence. This turns "the gate-input value diverged" into "who/when produced it" -- the instrument ChatGPT recommended for the MMX6 over-fast wedge. First result (MMX6 cutscene->gameplay, watch 0x80071088/0x800CD3F8/0x8006D9AC/ 0x800CD3FC/0x800CD404/0x800200F4): the cutscene-setup func_8001CB3C (writer pc 0x8001CB7C of countdown 0x800CD3FC) runs ~99.7M guest cycles / ~176 frames EARLIER on native (cyc 998,597,937 frame 1769) than Beetle (cyc 1,098,296,890 frame 1942) -- same writer PC, fired early. On Beetle the state struct 0x800CD3F8 is never touched by game code (stays BIOS-init 0 -> setter path); on native it advances. The over-fast wait is localized one level above the state machine, at whatever schedules func_8001CB3C. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>