mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
1bc74b8190
Review (mstan): a host-output callback could change the shared CPU (GPR2 set to 0x12345678 survived an online psx_mod_function_entry). Each host-output callback now gets a private CPUState copy whose changes are discarded, and while one runs (psx_mod_host_output_scope) every guest-mutating mod service refuses: memory writes, host_write_ram, call_guest*, DMA / SPU / VRAM uploads, guest and GPU-DMA allocations, texture packet memory, the cycle-scale gate and finish_function. netplay_view_mods_test reproduces the review case (GPR2 + PC changed in the callback) and checks the shared CPU is byte-identical after the hook; it fails without the copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>