diff options
author | Twinaphex | 2018-03-31 13:49:54 +0200 |
---|---|---|
committer | GitHub | 2018-03-31 13:49:54 +0200 |
commit | 9f836824d9f447ac8f2ffc829ebb02e49caf5e57 (patch) | |
tree | 55988350254e2e685e0c55d095d9a0f8d64c41b2 /libretro.c | |
parent | 8ca47fd3e698aa0ccc63bb62784818d243cf3643 (diff) | |
parent | bb13407869200360f90e10233fc649fc056f4e98 (diff) | |
download | snes9x2005-9f836824d9f447ac8f2ffc829ebb02e49caf5e57.tar.gz snes9x2005-9f836824d9f447ac8f2ffc829ebb02e49caf5e57.tar.bz2 snes9x2005-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.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); |