mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 18:11:16 +01:00
Save states were inconsistently saved and frequently failed to load, especially on threaded cores (SNES, N64). Two timing races were the cause: - On game start, a selected state was applied after a fixed 10ms delay with no check that the core was ready. Heavier cores aren't booted in that window, so the state applied partially and left a black screen. Replace the fixed delay with a gameManager readiness poll plus a short settle window before applying the state (mirrors the console player). - The Save & Quit handler read the state from a running emulator. On threaded cores the worker thread mutates emulator memory while getState() reads it, producing torn/corrupt buffers that are then stored permanently. Capture the screenshot while running, then pause before serializing the state and save file. Also refuse to upload zero-length state buffers so a failed capture can't overwrite good states on the server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PoAdK2fmqHGmGuXWaKN1HT