aboutsummaryrefslogtreecommitdiff
path: root/libretro.c
diff options
context:
space:
mode:
authorDwedit2018-03-30 22:35:35 -0500
committerDwedit2018-03-30 22:35:35 -0500
commitf453201fa149d3e2a85f0b466b1c67c6c90d54e0 (patch)
treed1c97fb8954fc210e09f35cbb2738720ea47aa1f /libretro.c
parent8ca47fd3e698aa0ccc63bb62784818d243cf3643 (diff)
downloadsnes9x2005-f453201fa149d3e2a85f0b466b1c67c6c90d54e0.tar.gz
snes9x2005-f453201fa149d3e2a85f0b466b1c67c6c90d54e0.tar.bz2
snes9x2005-f453201fa149d3e2a85f0b466b1c67c6c90d54e0.zip
Add support for Audio/Video Disable flags
Add support for Hard Disable Audio Fix frame discarding causing infinite loops Fix MSVC building
Diffstat (limited to 'libretro.c')
-rw-r--r--libretro.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libretro.c b/libretro.c
index 47729b0..43dad13 100644
--- a/libretro.c
+++ b/libretro.c
@@ -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);