libretro-mirrors / beetle-saturn-libretro

Standalone port of Mednafen Saturn to the libretro API.
GNU General Public License v2.0
61 stars 40 forks source link

Fix hang on boot when rewind or runahead is enabled #197

Closed jdgleaver closed 3 years ago

jdgleaver commented 3 years ago

191 introduced an unfortunate regression - when starting content with fast forward or runahead enabled, the core will hang due to a deadlock between a wait in the VDP2 rendering thread and a wait in the VDP2 savestate function on the main thread. It seems that this is actually an upstream bug - but it never manifests there, since it is virtually impossible to trigger a savestate on the first frame when using standalone (whereas libretro rewind and runahead features cause this to happen immediately).

This PR fixes the problem by ensuring that the VDP2 savestate function 'wakes up' the VDP2 rendering thread when necessary.