mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
d300319b7e
Upstream now has one live main-RAM geometry: retail 2 MiB mirrored four times across the 8 MiB decode window, or 8 MiB unique with the opt-in 8 MB RAM mod (psx_memory.h). memory.c's RAM array is sized for the largest geometry, so the pass store policy was handed 8 MiB even on a retail boot, and a store to a mirror (0x80200000..) would have landed in the unused upper backing bytes instead of folding onto RAM. With the 8 MB map live, the checkpoint copied and restored only the low 2 MiB. - memory.c passes the store policy psx_ram_live_bytes(), so pass stores fold exactly as psx_ram_map_write does outside a pass. - render_pass.c checkpoints, restores and (PSX_RENDER_PASS_VERIFY) hashes memory_get_ram_bytes() bytes; the copy grows if a later session boots with the larger map. - render_pass_sandbox_test: policy and a real pass with 8 MiB live (unique addresses up to 0x7FFFFF, all 8 MiB restored), then a retail pass folding mirrors again. Restoring a fixed 2 MiB fails it twice; folding with the backing size fails it twice. render_pass_guards pins the live size in memory.c and in the checkpoint, restore and hash. - psx_ram_runtime_map_test (upstream's 2/8 MiB test over the real memory.c and dma.c) links those files with section GC. The pass paths make six more symbols reachable there (the pass flag and store policy, the synchronous GPU linked-list walk); its stubs double them, trapping if a pass path ever runs. With the macOS-only link gaps stubbed as well, the test passes on this branch as on master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>