aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNebuleon Fumika2013-02-08 03:22:27 -0500
committerNebuleon Fumika2013-02-08 03:22:27 -0500
commitd4fcf2697c9a45594e3ee0b8bf82e480ddd0b69b (patch)
tree3588c9f6d03e034918dead8dcd3dd790b9d922f1 /source
parent4676a520e1b181e5891550331100b2629d7cbd7f (diff)
downloadsnes9x2005-d4fcf2697c9a45594e3ee0b8bf82e480ddd0b69b.tar.gz
snes9x2005-d4fcf2697c9a45594e3ee0b8bf82e480ddd0b69b.tar.bz2
snes9x2005-d4fcf2697c9a45594e3ee0b8bf82e480ddd0b69b.zip
Require one audio buffer to be free again. Otherwise, if the 4 buffers get full, it's already game over, and getAudiobuff becomes NULL for about 400 milliseconds, stopping all emulation.
Diffstat (limited to 'source')
-rw-r--r--source/nds/entry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp
index af832f9..77620bf 100644
--- a/source/nds/entry.cpp
+++ b/source/nds/entry.cpp
@@ -1004,7 +1004,7 @@ void S9xProcessSound (unsigned int)
unsigned int Now = getSysTime();
if (Now - LastSoundEmissionTime >= SOUND_EMISSION_INTERVAL)
{
- if(ds2_checkAudiobuff() > AUDIO_BUFFER_COUNT)
+ if(ds2_checkAudiobuff() > AUDIO_BUFFER_COUNT - 1)
{
LastSoundEmissionTime++;
return;
@@ -1022,7 +1022,7 @@ void S9xProcessSound (unsigned int)
{
LastSoundEmissionTime += SOUND_EMISSION_INTERVAL;
SoundEmissionTimeError += SOUND_EMISSION_INTERVAL_ERROR;
- if (SoundEmissionTimeError > FIXED_POINT)
+ if (SoundEmissionTimeError >= FIXED_POINT)
{
LastSoundEmissionTime += SoundEmissionTimeError >> FIXED_POINT_SHIFT;
SoundEmissionTimeError &= FIXED_POINT_REMAINDER;