Files
psxrecomp/runtime
Kevin aa6fa2c950 runtime: arm the page watch for static overlay code ranges
The static overlay path had no residency signal. overlay_page_gen only
advances for pages set in overlay_watch_bitmap, and the sole callers of
overlay_watch_set_range were the DLL loader's cand_register() and
rebuild_lazy_manifest_index() -- both inert for an AOT-static title.

So for a game dispatching through generated/overlays_static.c, every code
range was unwatched, overlay_watch_pagegen_sum returned a constant, and the
generation fast path in psx_overlay_static_code_matches answered every
dispatch after the first from its cached result. The CRC gate was therefore
consulted once per variant per process, not once per code change: the only
thing that ever cleared the cache was a savestate restore. A band that
swapped occupants kept dispatching the previously-validated variant.

Arm the watch over a variant's ranges on the cold path, before hashing them.
CD DMA reaches RAM word-by-word through psx_write_word, so an overlay load
now advances the generation of every page it touches and the next dispatch
re-hashes. Arming only sets bitmap bits and does not advance a generation,
so the gen_sum already computed for the cache write stays valid.

This is also the prerequisite for memoizing the resident variant per band:
a generation change is the load event, and until now that event never fired.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 06:27:22 -04:00
..
2026-08-15 14:46:26 -07:00
2026-08-13 10:37:18 -04:00
2026-07-29 03:18:10 -04:00