diff options
Diffstat (limited to 'libretro.c')
-rw-r--r-- | libretro.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -428,6 +428,8 @@ static int32_t samples_to_play = 0; void retro_run(void) { bool updated = false; + int result; + bool okay; #ifndef USE_BLARGG_APU static int16_t audio_buf[2048]; #endif @@ -440,6 +442,24 @@ void retro_run(void) IPPU.RenderThisFrame = false; #endif + result = -1; + okay = environ_cb(RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE, &result); + if (okay) + { + bool audioEnabled = 0 != (result & 2); + bool videoEnabled = 0 != (result & 1); + bool hardDisableAudio = 0 != (result & 8); + IPPU.RenderThisFrame = videoEnabled; + S9xSetSoundMute(!audioEnabled || hardDisableAudio); + Settings.HardDisableAudio = hardDisableAudio; + } + else + { + IPPU.RenderThisFrame = true; + S9xSetSoundMute(false); + Settings.HardDisableAudio = false; + } + poll_cb(); RETRO_PERFORMANCE_INIT(S9xMainLoop_func); |