aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoão Silva2017-01-25 19:29:42 +0000
committerJoão Silva2017-01-25 19:29:42 +0000
commit68bed4bb89cdcda28e890591f3f5ce05882b0b6a (patch)
treed188d2055a87e1431590332f1fcd9d32f5ff3526 /source
parent73b5963bf2e7a8c65bbad150f52e5e626486311f (diff)
downloadsnesemu-68bed4bb89cdcda28e890591f3f5ce05882b0b6a.tar.gz
snesemu-68bed4bb89cdcda28e890591f3f5ce05882b0b6a.tar.bz2
snesemu-68bed4bb89cdcda28e890591f3f5ce05882b0b6a.zip
Recover sound after loading a savestate.
Diffstat (limited to 'source')
-rw-r--r--source/soundux.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/source/soundux.c b/source/soundux.c
index 9e71bae..a67ca6b 100644
--- a/source/soundux.c
+++ b/source/soundux.c
@@ -267,12 +267,7 @@ void S9xFixSoundAfterSnapshotLoad()
SoundData.channels[i].needs_decode = true;
S9xSetSoundFrequency(i, SoundData.channels[i].hertz);
SoundData.channels [i].envxx = SoundData.channels [i].envx << ENVX_SHIFT;
- SoundData.channels [i].next_sample = 0;
- SoundData.channels [i].interpolate = 0;
- SoundData.channels [i].previous [0] = (int32_t) SoundData.channels [i].previous16 [0];
- SoundData.channels [i].previous [1] = (int32_t) SoundData.channels [i].previous16 [1];
}
- IAPU.Scanline = 0;
}
void S9xSetFilterCoefficient(int tap, int value)
@@ -352,12 +347,9 @@ int S9xGetEnvelopeHeight(int channel)
void S9xSetSoundFrequency(int channel, int hertz) // hertz [0~64K<<1]
{
- if (so.playback_rate)
- {
- if (SoundData.channels[channel].type == SOUND_NOISE)
- hertz = NoiseFreq [APU.DSP [APU_FLG] & 0x1f];
- SoundData.channels[channel].frequency = (hertz * so.freqbase) >> 11;
- }
+ if (SoundData.channels[channel].type == SOUND_NOISE)
+ hertz = NoiseFreq [APU.DSP [APU_FLG] & 0x1f];
+ SoundData.channels[channel].frequency = (hertz * so.freqbase) >> 11;
}
void S9xSetSoundHertz(int channel, int hertz)
@@ -765,12 +757,6 @@ void S9xMixSamples(uint16_t* buffer, int sample_count)
int J;
int I;
- if (so.mute_sound)
- {
- memset(buffer, 0, sample_count * sizeof(buffer [0]));
- return;
- }
-
if (SoundData.echo_enable)
memset(EchoBuffer, 0, sample_count * sizeof(EchoBuffer [0]));
memset(MixBuffer, 0, sample_count * sizeof(MixBuffer [0]));