aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/softsynth/fmtowns_pc98/towns_audio.cpp2
-rw-r--r--sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp2
-rw-r--r--sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp11
3 files changed, 7 insertions, 8 deletions
diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp
index f9c9529214..9823015a2d 100644
--- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -227,8 +227,8 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac
TownsAudioInterface::~TownsAudioInterface() {
reset();
- deinit();
_ready = false;
+ deinit();
delete[] _fmSaveReg[0];
delete[] _fmSaveReg[1];
diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
index b711eccbe1..4676ed774a 100644
--- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
+++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
@@ -1054,8 +1054,8 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type)
TownsPC98_AudioDriver::~TownsPC98_AudioDriver() {
reset();
- deinit();
_ready = false;
+ deinit();
if (_channels) {
for (int i = 0; i < _numChan; i++)
diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
index dbd8e37cb7..541d582c1c 100644
--- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
+++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
@@ -844,8 +844,7 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) :
memset(&_timers[0], 0, sizeof(ChipTimer));
memset(&_timers[1], 0, sizeof(ChipTimer));
- _timers[0].cb = &TownsPC98_FmSynth::timerCallbackA;
- _timers[1].cb = &TownsPC98_FmSynth::timerCallbackB;
+ _timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback;
_timerbase = (uint32)(_baserate * 1000000.0f);
}
@@ -1125,7 +1124,7 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) {
memset(tmp, 0, sizeof(int32) * numSamples);
int32 samplesLeft = numSamples >> 1;
- while (samplesLeft) {
+ while (_ready && samplesLeft) {
int32 render = samplesLeft;
for (int i = 0; i < 2; i++) {
@@ -1179,10 +1178,10 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) {
}
void TownsPC98_FmSynth::deinit() {
- _mixer->stopHandle(_soundHandle);
- _timers[0].cb = &TownsPC98_FmSynth::idleTimerCallback;
- _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback;
_ready = false;
+ _mixer->stopHandle(_soundHandle);
+ Common::StackLock lock(_mutex);
+ _timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback;
}
uint8 TownsPC98_FmSynth::readSSGStatus() {