aboutsummaryrefslogtreecommitdiff
path: root/libretro.c
diff options
context:
space:
mode:
authorTwinaphex2018-03-31 13:49:54 +0200
committerGitHub2018-03-31 13:49:54 +0200
commit9f836824d9f447ac8f2ffc829ebb02e49caf5e57 (patch)
tree55988350254e2e685e0c55d095d9a0f8d64c41b2 /libretro.c
parent8ca47fd3e698aa0ccc63bb62784818d243cf3643 (diff)
parentbb13407869200360f90e10233fc649fc056f4e98 (diff)
downloadsnesemu-9f836824d9f447ac8f2ffc829ebb02e49caf5e57.tar.gz
snesemu-9f836824d9f447ac8f2ffc829ebb02e49caf5e57.tar.bz2
snesemu-9f836824d9f447ac8f2ffc829ebb02e49caf5e57.zip
Merge pull request #53 from Dwedit/submission_1
Add support for Audio/Video Disable flags and Hard Disable Audio
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..8625c57 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);