You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an issue moved from my personal repository to this one, from @Dwedit
There are two different RunAhead features.
* One is provided within Core Options, and you use it from the "Options" menu after running a game. This feature works fine.
* The other is the RunAhead feature provided by RetroArch. When you use this option, you get half speed emulation, sound problems, and in-game freezes during fade transitions.
I'll summarize the changes I made to libretro.cpp:
In retro_run, we now check for Audio and Video being enabled, then apply those settings to bsnes. However, bsnes does not have individual toggles for audio and video being enabled or disabled. Instead, it has a flag which disables both, which is named "runahead". So when RetroArch wants to disable both audio and video at the same time, I set the "runahead" flag. This is good enough for now, but separate toggles would be better. Setting the audio/video disable flags fixes the half speed gameplay and sound problems.
In retro_serialize and retro_serialize_size, we now check for the "Fast Savestates" flag, and use that to determine whether to use internal code pointers in the savestate or not. This fixes the in-game crashes due to having a more accurate savestate.
But there's a big issue with doing this that breaks Secondary Instance mode. I had foolishly designed the RunAhead feature to use the same flag (Fast Savestates) for both serialization within one instance, and transferring state between the Main instance and Secondary instance. Transferring internal code pointers from the Main instance to the Secondary instance is guaranteed to crash.
So the flags I'm providing with RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE aren't adequate for catching that case. I'd need more flags to indicate what's going on. Example, add a flag to indicate that a savestate is okay to store internal pointers in, add a flag to indicate that runahead is enabled, add a flag to indicate that runahead is in Secondary Instance mode, add a flag to indicate which is the main instance and which is the secondary instance, etc...
Since RetroArch is already released with RunAhead mode without any additional flags, I'd need a stopgap solution to block second instance mode. One way (platform specific for Windows and Linux) is to check if another library with the same name (but different path) has already loaded, then claim initialization has failed, so it will unload the core.
The text was updated successfully, but these errors were encountered:
This is an issue moved from my personal repository to this one, from @Dwedit
The text was updated successfully, but these errors were encountered: