From 29a5c6a45b90e64cf5d618da4cdcd6e6da3425fb Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Wed, 18 Aug 2010 21:38:43 +0000 Subject: SCUMM/FM-TOWNS: start rewriting audio code - Start rewriting audio code for FM-TOWNS versions of Loom, Indy3 and Monkey Island 1 using the recently added code in towns_audio.cpp (Zak should work the same way, but I can't test, since I don't own that one). - All sound types (pcm, euphony and cd audio) now support volume and balance control (e.g. try walking into/out of the kitchen and opening/closing the door in the Scumm Bar in Monkey Island 1 or walking into/out of the circus tent). - Pcm sounds now support proper loop start/end and note offsets (e.g. try out the hammer sound in the forge in LOOM for example). - some other minor improvements - The FM-Towns versions of Indy 4 and Monkey Island 2 are not affected. I don't have Monkey Island 2, but I presume that it will work like Indy 4. Adding support for these will be a separate task, since they work quite differently. svn-id: r52198 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 18 +++++++++++++++++- sound/softsynth/fmtowns_pc98/towns_audio.h | 1 + sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 10 ++++++++++ sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 12 ++++++++++++ sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h | 10 ++++++---- 5 files changed, 46 insertions(+), 5 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 46569dd842..bef062b8e6 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -200,7 +200,7 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac INTCB(notImpl), // 72 INTCB(notImpl), - INTCB(notImpl), + INTCB(cdaToggle), INTCB(notImpl), INTCB(notImpl), // 76 @@ -222,9 +222,19 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac _timerBase = (uint32)(_baserate * 1000000.0f); _tickLength = 2 * _timerBase; + + setTimerCallbackA((ChipTimerProc)&TownsAudioInterface::timerCallbackA); + setTimerCallbackB((ChipTimerProc)&TownsAudioInterface::timerCallbackB); } TownsAudioInterface::~TownsAudioInterface() { + Common::StackLock lock(_mutex); + reset(); + _ready = false; + + setTimerCallbackA(); + setTimerCallbackB(); + delete[] _fmSaveReg[0]; delete[] _fmSaveReg[1]; delete[] _fmInstruments; @@ -759,6 +769,12 @@ int TownsAudioInterface::intf_updateOutputVolume(va_list &args) { return 0; } +int TownsAudioInterface::intf_cdaToggle(va_list &args) { + //int mode = va_arg(args, int); + //_unkMask = mode ? 0x7f : 0x3f; + return 0; +} + int TownsAudioInterface::intf_pcmUpdateEnvelopeGenerator(va_list &args) { for (int i = 0; i < 8; i++) pcmUpdateEnvelopeGenerator(i); diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.h b/sound/softsynth/fmtowns_pc98/towns_audio.h index 950c016b4e..95fb1ded59 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.h +++ b/sound/softsynth/fmtowns_pc98/towns_audio.h @@ -95,6 +95,7 @@ private: int intf_setOutputVolume(va_list &args); int intf_resetOutputVolume(va_list &args); int intf_updateOutputVolume(va_list &args); + int intf_cdaToggle(va_list &args); int intf_pcmUpdateEnvelopeGenerator(va_list &args); int intf_notImpl(va_list &args); diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 82d0bd0438..6d52937cc6 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -1037,11 +1037,21 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) _musicPlaying(false), _sfxPlaying(false), _fading(false), _looping(0), _ready(false) { _sfxOffsets[0] = _sfxOffsets[1] = 0; + + setTimerCallbackA((ChipTimerProc)&TownsPC98_AudioDriver::timerCallbackA); + setTimerCallbackB((ChipTimerProc)&TownsPC98_AudioDriver::timerCallbackB); } TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { + Common::StackLock lock(_mutex); + reset(); + _ready = false; + + setTimerCallbackA(); + setTimerCallbackB(); + if (_channels) { for (int i = 0; i < _numChan; i++) delete _channels[i]; diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index 241b9bde50..e304537c22 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -835,6 +835,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; _timerbase = (uint32)(_baserate * 1000000.0f); @@ -842,6 +843,9 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : TownsPC98_FmSynth::~TownsPC98_FmSynth() { Common::StackLock lock(_mutex); + + _ready = false; + _mixer->stopHandle(_soundHandle); delete _ssg; delete _prc; @@ -1154,6 +1158,14 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { return numSamples; } +void TownsPC98_FmSynth::setTimerCallbackA(ChipTimerProc proc) { + _timers[0].cb = proc; +} + +void TownsPC98_FmSynth::setTimerCallbackB(ChipTimerProc proc) { + _timers[1].cb = proc; +} + uint8 TownsPC98_FmSynth::readSSGStatus() { return _ssg->chanEnable(); } diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index 3072503610..4c2de467d7 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -71,6 +71,10 @@ public: } protected: + typedef void (TownsPC98_FmSynth::*ChipTimerProc)(); + void setTimerCallbackA(ChipTimerProc proc = &TownsPC98_FmSynth::timerCallbackA); + void setTimerCallbackB(ChipTimerProc proc = &TownsPC98_FmSynth::timerCallbackB); + // Implement this in your inherited class if your driver generates // additional output that has to be inserted into the buffer. virtual void nextTickEx(int32 *buffer, uint32 bufferSize) {} @@ -80,8 +84,8 @@ protected: } uint8 readSSGStatus(); - virtual void timerCallbackA() = 0; - virtual void timerCallbackB() = 0; + virtual void timerCallbackA() {} + virtual void timerCallbackB() {} // The audio driver can store and apply two different audio settings // (usually for music and sound effects). The channel mask will determine @@ -139,8 +143,6 @@ private: bool _regProtectionFlag; - typedef void (TownsPC98_FmSynth::*ChipTimerProc)(); - struct ChipTimer { bool enabled; uint16 value; -- cgit v1.2.3 From b55a70acb88a7375ac21351450ea99ed2f72d820 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Fri, 20 Aug 2010 17:04:32 +0000 Subject: KYRA/TOWNS: fix memory leak and some cleanup svn-id: r52232 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 7 +------ sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 9 +-------- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 20 ++++++++++---------- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h | 11 ++++++----- 4 files changed, 18 insertions(+), 29 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index bef062b8e6..bbc4891edc 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -222,19 +222,14 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac _timerBase = (uint32)(_baserate * 1000000.0f); _tickLength = 2 * _timerBase; - - setTimerCallbackA((ChipTimerProc)&TownsAudioInterface::timerCallbackA); - setTimerCallbackB((ChipTimerProc)&TownsAudioInterface::timerCallbackB); } TownsAudioInterface::~TownsAudioInterface() { Common::StackLock lock(_mutex); reset(); + deinit(); _ready = false; - setTimerCallbackA(); - setTimerCallbackB(); - delete[] _fmSaveReg[0]; delete[] _fmSaveReg[1]; delete[] _fmInstruments; diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 6d52937cc6..7b7fbddc4b 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -1037,21 +1037,14 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) _musicPlaying(false), _sfxPlaying(false), _fading(false), _looping(0), _ready(false) { _sfxOffsets[0] = _sfxOffsets[1] = 0; - - setTimerCallbackA((ChipTimerProc)&TownsPC98_AudioDriver::timerCallbackA); - setTimerCallbackB((ChipTimerProc)&TownsPC98_AudioDriver::timerCallbackB); } TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { Common::StackLock lock(_mutex); - reset(); - + deinit(); _ready = false; - setTimerCallbackA(); - setTimerCallbackB(); - if (_channels) { for (int i = 0; i < _numChan; i++) delete _channels[i]; diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index e304537c22..b51f695087 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -842,11 +842,9 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : } TownsPC98_FmSynth::~TownsPC98_FmSynth() { - Common::StackLock lock(_mutex); - - _ready = false; + if (_ready) + deinit(); - _mixer->stopHandle(_soundHandle); delete _ssg; delete _prc; delete[] _chanInternal; @@ -885,6 +883,9 @@ bool TownsPC98_FmSynth::init() { _prc->init(_percussionData); } + _timers[0].cb = &TownsPC98_FmSynth::timerCallbackA; + _timers[1].cb = &TownsPC98_FmSynth::timerCallbackB; + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); @@ -1158,12 +1159,11 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { return numSamples; } -void TownsPC98_FmSynth::setTimerCallbackA(ChipTimerProc proc) { - _timers[0].cb = proc; -} - -void TownsPC98_FmSynth::setTimerCallbackB(ChipTimerProc proc) { - _timers[1].cb = proc; +void TownsPC98_FmSynth::deinit() { + _mixer->stopHandle(_soundHandle); + _timers[0].cb = &TownsPC98_FmSynth::idleTimerCallback; + _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback; + _ready = false; } uint8 TownsPC98_FmSynth::readSSGStatus() { diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index 4c2de467d7..17bb98482c 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -71,9 +71,7 @@ public: } protected: - typedef void (TownsPC98_FmSynth::*ChipTimerProc)(); - void setTimerCallbackA(ChipTimerProc proc = &TownsPC98_FmSynth::timerCallbackA); - void setTimerCallbackB(ChipTimerProc proc = &TownsPC98_FmSynth::timerCallbackB); + void deinit(); // Implement this in your inherited class if your driver generates // additional output that has to be inserted into the buffer. @@ -84,8 +82,8 @@ protected: } uint8 readSSGStatus(); - virtual void timerCallbackA() {} - virtual void timerCallbackB() {} + virtual void timerCallbackA() = 0; + virtual void timerCallbackB() = 0; // The audio driver can store and apply two different audio settings // (usually for music and sound effects). The channel mask will determine @@ -143,6 +141,9 @@ private: bool _regProtectionFlag; + typedef void (TownsPC98_FmSynth::*ChipTimerProc)(); + void idleTimerCallback() {}; + struct ChipTimer { bool enabled; uint16 value; -- cgit v1.2.3 From 74b6fdcae4b82fe77906e1811c03c2ec43c4cc98 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Fri, 20 Aug 2010 22:10:15 +0000 Subject: FM-TOWNS AUDIO: fix possible crash (This crash might have occured on very slow machines or when using valgrind) svn-id: r52245 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index bbc4891edc..5c0961b8c3 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -104,7 +104,8 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac _fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0), _baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), _pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume), - _outputVolumeFlags(0), _outputMuteFlags(0), _ready(false) { + _outputVolumeFlags(0), _outputMuteFlags(0), _pcmChanOut(0), _pcmChanReserved(0), _pcmChanKeyPressed(0), + _pcmChanEffectPlaying(0), _pcmChanKeyPlaying(0), _ready(false) { #define INTCB(x) &TownsAudioInterface::intf_##x static const TownsAudioIntfCallback intfCb[] = { -- cgit v1.2.3 From fd23ab2e17da6f74efdc94ed1b19ec4dd81da558 Mon Sep 17 00:00:00 2001 From: Yotam Barnoy Date: Thu, 2 Sep 2010 10:41:26 +0000 Subject: FMTOWNS AUDIO: fixed divide by zero exception from commit 52013 Also removed 1 or 2 float operations. svn-id: r52492 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 5c0961b8c3..5e1ac0201f 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -1404,8 +1404,11 @@ void TownsAudioInterface::updateOutputVolume() { // balance values for our -128 to 127 volume range // CD-AUDIO - int volume = (int)(((float)MAX(_outputLevel[12], _outputLevel[13]) * 255.0f) / 63.0f); - int balance = (int)((float)((_outputLevel[13] - _outputLevel[12]) * 127.0f) / (float)MAX(_outputLevel[12], _outputLevel[13])); + uint32 maxVol = MAX(_outputLevel[12], _outputLevel[13]); + + int volume = (int)(maxVol * (255.0f / 63.0f)); + int balance = maxVol ? (int)( ( ((int)_outputLevel[13] - _outputLevel[12]) * 127) / (float)maxVol) : 0; + AudioCD.setVolume(volume); AudioCD.setBalance(balance); } -- cgit v1.2.3 From 37d28b2fe506a7ef93315c934d3813c71bc5f882 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sat, 4 Sep 2010 11:40:24 +0000 Subject: FM-TOWNS AUDIO: minor fix in cd audio volume setting svn-id: r52521 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 5e1ac0201f..66a83f74ce 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -1406,7 +1406,7 @@ void TownsAudioInterface::updateOutputVolume() { // CD-AUDIO uint32 maxVol = MAX(_outputLevel[12], _outputLevel[13]); - int volume = (int)(maxVol * (255.0f / 63.0f)); + int volume = (int)(((float)(maxVol * 255) / 63.0f)); int balance = maxVol ? (int)( ( ((int)_outputLevel[13] - _outputLevel[12]) * 127) / (float)maxVol) : 0; AudioCD.setVolume(volume); -- cgit v1.2.3 From b876527014ffbd1dd47eb735a77cca9a241175b9 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sat, 4 Sep 2010 13:19:49 +0000 Subject: SOUND: Remove semicolon svn-id: r52522 --- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index 17bb98482c..4a618338ed 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -142,7 +142,7 @@ private: bool _regProtectionFlag; typedef void (TownsPC98_FmSynth::*ChipTimerProc)(); - void idleTimerCallback() {}; + void idleTimerCallback() {} struct ChipTimer { bool enabled; -- cgit v1.2.3 From c91a07229a8bd841e6b6e77d977254c388a2e407 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 18 Sep 2010 10:55:16 +0000 Subject: JANITORIAL: Removed most punctuation at end of warning() and error() Our warning() and error() functions always add an exclamation mark to the end of the message anyway. svn-id: r52791 --- sound/softsynth/fmtowns_pc98/towns_euphony.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_euphony.cpp b/sound/softsynth/fmtowns_pc98/towns_euphony.cpp index 0c0c203cc9..19dbd619d2 100644 --- a/sound/softsynth/fmtowns_pc98/towns_euphony.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_euphony.cpp @@ -560,10 +560,10 @@ uint8 TownsEuphonyDriver::appendEvent(uint8 evt, uint8 chan) { void TownsEuphonyDriver::sendEvent(uint8 mode, uint8 command) { if (mode == 0) { - warning("TownsEuphonyDriver: Mode 0 not implemented."); + warning("TownsEuphonyDriver: Mode 0 not implemented"); } else if (mode == 0x10) { - warning("TownsEuphonyDriver: Mode 0x10 not implemented."); + warning("TownsEuphonyDriver: Mode 0x10 not implemented"); } else if (mode == 0xff) { if (command >= 0xf0) { -- cgit v1.2.3 From b11263be90c72619bb360d64d7d06ffcd8addd20 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Wed, 22 Sep 2010 19:39:54 +0000 Subject: KYRA PC-98: fix endianess in music frequency svn-id: r52855 --- sound/softsynth/fmtowns_pc98/towns_euphony.cpp | 2 +- sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_euphony.cpp b/sound/softsynth/fmtowns_pc98/towns_euphony.cpp index 19dbd619d2..626c0166e5 100644 --- a/sound/softsynth/fmtowns_pc98/towns_euphony.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_euphony.cpp @@ -560,7 +560,7 @@ uint8 TownsEuphonyDriver::appendEvent(uint8 evt, uint8 chan) { void TownsEuphonyDriver::sendEvent(uint8 mode, uint8 command) { if (mode == 0) { - warning("TownsEuphonyDriver: Mode 0 not implemented"); + // warning("TownsEuphonyDriver: Mode 0 not implemented"); } else if (mode == 0x10) { warning("TownsEuphonyDriver: Mode 0x10 not implemented"); diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 7b7fbddc4b..72054f71c6 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -312,7 +312,7 @@ void TownsPC98_MusicChannel::processEvents() { void TownsPC98_MusicChannel::processFrequency() { if (_flags & CHS_RECALCFREQ) { - _frequency = (((const uint16 *)_drv->_opnFreqTable)[_frqBlockMSB & 0x0f] + _frqLSB) | (((_frqBlockMSB & 0x70) >> 1) << 8); + _frequency = (READ_LE_UINT16(&_drv->_opnFreqTable[(_frqBlockMSB & 0x0f) << 1]) + _frqLSB) | (((_frqBlockMSB & 0x70) >> 1) << 8); _drv->writeReg(_part, _regOffset + 0xa4, (_frequency >> 8)); _drv->writeReg(_part, _regOffset + 0xa0, (_frequency & 0xff)); @@ -709,7 +709,7 @@ void TownsPC98_MusicChannelSSG::processFrequency() { if (_flags & CHS_RECALCFREQ) { _block = _frqBlockMSB >> 4; - _frequency = ((const uint16 *)_drv->_opnFreqTableSSG)[_frqBlockMSB & 0x0f] + _frqLSB; + _frequency = READ_LE_UINT16(&_drv->_opnFreqTableSSG[(_frqBlockMSB & 0x0f) << 1]) + _frqLSB; uint16 f = _frequency >> _block; _drv->writeReg(_part, _regOffset << 1, f & 0xff); -- cgit v1.2.3 From 718fe1d18f2550a6e5247782229843fdd5d2ef7f Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sun, 3 Oct 2010 16:28:31 +0000 Subject: PC-98 AUDIO: some code size reduction for the NDS port svn-id: r52994 --- sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 30 +++++++++++++++++++--- sound/softsynth/fmtowns_pc98/towns_pc98_driver.h | 6 +++++ .../softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 28 ++++++++++++++++++-- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h | 6 +++++ 4 files changed, 65 insertions(+), 5 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 72054f71c6..21e8f9b2e5 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -160,6 +160,7 @@ public: void reset(); }; +#ifndef __DS__ class TownsPC98_MusicChannelPCM : public TownsPC98_MusicChannel { public: TownsPC98_MusicChannelPCM(TownsPC98_AudioDriver *driver, uint8 regOffs, @@ -178,6 +179,7 @@ private: typedef bool (TownsPC98_MusicChannelPCM::*ControlEventFunc)(uint8 para); const ControlEventFunc *controlEvents; }; +#endif TownsPC98_MusicChannel::TownsPC98_MusicChannel(TownsPC98_AudioDriver *driver, uint8 regOffs, uint8 flgs, uint8 num, uint8 key, uint8 prt, uint8 id) : _drv(driver), _regOffset(regOffs), _flags(flgs), _chanNum(num), _keyNum(key), @@ -928,6 +930,7 @@ void TownsPC98_SfxChannel::reset() { _drv->_ssgPatches[i + 12] = src[i + 12]; } +#ifndef __DS__ TownsPC98_MusicChannelPCM::TownsPC98_MusicChannelPCM(TownsPC98_AudioDriver *driver, uint8 regOffs, uint8 flgs, uint8 num, uint8 key, uint8 prt, uint8 id) : TownsPC98_MusicChannel(driver, regOffs, flgs, num, key, prt, id), controlEvents(0) { @@ -1016,9 +1019,13 @@ bool TownsPC98_MusicChannelPCM::control_ff_endOfTrack(uint8 para) { return false; } } +#endif // ifndef __DS__ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) : TownsPC98_FmSynth(mixer, type), - _channels(0), _ssgChannels(0), _sfxChannels(0), _rhythmChannel(0), + _channels(0), _ssgChannels(0), _sfxChannels(0), +#ifndef __DS__ + _rhythmChannel(0), +#endif _trackPtr(0), _sfxData(0), _sfxOffs(0), _ssgPatches(0), _patches(0), _sfxBuffer(0), _musicBuffer(0), @@ -1027,7 +1034,13 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) _updateChannelsFlag(type == kType26 ? 0x07 : 0x3F), _finishedChannelsFlag(0), _updateSSGFlag(type == kTypeTowns ? 0x00 : 0x07), _finishedSSGFlag(0), - _updateRhythmFlag(type == kType86 ? 0x01 : 0x00), _finishedRhythmFlag(0), + _updateRhythmFlag(type == kType86 ? +#ifndef __DS__ + 0x01 +#else + 0x00 +#endif + : 0x00), _finishedRhythmFlag(0), _updateSfxFlag(0), _finishedSfxFlag(0), _musicTickCounter(0), @@ -1062,8 +1075,9 @@ TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { delete _sfxChannels[i]; delete[] _sfxChannels; } - +#ifndef __DS__ delete _rhythmChannel; +#endif delete[] _ssgPatches; } @@ -1107,10 +1121,12 @@ bool TownsPC98_AudioDriver::init() { } } +#ifndef __DS__ if (_hasPercussion) { _rhythmChannel = new TownsPC98_MusicChannelPCM(this, 0, 0, 0, 0, 0, 1); _rhythmChannel->init(); } +#endif setMusicTempo(84); setSfxTempo(654); @@ -1152,7 +1168,9 @@ void TownsPC98_AudioDriver::loadMusicData(uint8 *data, bool loadPaused) { } if (_hasPercussion) { +#ifndef __DS__ _rhythmChannel->loadData(data + READ_LE_UINT16(src_a)); +#endif src_a += 2; } @@ -1212,8 +1230,10 @@ void TownsPC98_AudioDriver::reset() { memcpy(_ssgPatches, _drvTables + 156, 256); } +#ifndef __DS__ if (_rhythmChannel) _rhythmChannel->reset(); +#endif } void TownsPC98_AudioDriver::fadeStep() { @@ -1233,10 +1253,12 @@ void TownsPC98_AudioDriver::fadeStep() { if (!_fading) { _fading = 19; +#ifndef __DS__ if (_hasPercussion) { if (_updateRhythmFlag & _rhythmChannel->_idFlag) _rhythmChannel->reset(); } +#endif } else { if (!--_fading) reset(); @@ -1263,9 +1285,11 @@ void TownsPC98_AudioDriver::timerCallbackB() { } } +#ifndef __DS__ if (_hasPercussion) if (_updateRhythmFlag & _rhythmChannel->_idFlag) _rhythmChannel->processEvents(); +#endif } toggleRegProtection(false); diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h index 18daee1e72..162156b2b5 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h @@ -31,13 +31,17 @@ class TownsPC98_MusicChannel; class TownsPC98_MusicChannelSSG; class TownsPC98_SfxChannel; +#ifndef __DS__ class TownsPC98_MusicChannelPCM; +#endif class TownsPC98_AudioDriver : public TownsPC98_FmSynth { friend class TownsPC98_MusicChannel; friend class TownsPC98_MusicChannelSSG; friend class TownsPC98_SfxChannel; +#ifndef __DS__ friend class TownsPC98_MusicChannelPCM; +#endif public: TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type); ~TownsPC98_AudioDriver(); @@ -84,7 +88,9 @@ protected: TownsPC98_MusicChannel **_channels; TownsPC98_MusicChannelSSG **_ssgChannels; TownsPC98_SfxChannel **_sfxChannels; +#ifndef __DS__ TownsPC98_MusicChannelPCM *_rhythmChannel; +#endif const uint8 *_opnCarrier; const uint8 *_opnFreqTable; diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index b51f695087..7b94a46426 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -377,6 +377,7 @@ private: bool _ready; }; +#ifndef __DS__ class TownsPC98_FmSynthPercussionSource { public: TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt); @@ -442,6 +443,7 @@ private: bool _ready; }; +#endif TownsPC98_FmSynthSquareSineSource::TownsPC98_FmSynthSquareSineSource(const uint32 timerbase, const uint32 rtt) : _tlTable(0), _rtt(rtt), _tleTable(0), _updateRequest(-1), _tickLength(timerbase * 27), _ready(0), _reg(0), _rand(1), _outN(1), @@ -627,6 +629,7 @@ void TownsPC98_FmSynthSquareSineSource::updateRegs() { _updateRequest = -1; } +#ifndef __DS__ TownsPC98_FmSynthPercussionSource::TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt) : _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _ready(false), _volMaskA(0), _volMaskB(0), _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume) { @@ -823,11 +826,16 @@ void TownsPC98_FmSynthPercussionSource::advanceInput(RhtChannel *ins) { cur >>= 4; } } +#endif // ifndef __DS__ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : _mixer(mixer), - _chanInternal(0), _ssg(0), _prc(0), - _numChan(type == kType26 ? 3 : 6), _numSSG(type == kTypeTowns ? 0 : 3), _hasPercussion(type == kType86 ? true : false), + _chanInternal(0), _ssg(0), +#ifndef __DS__ + _prc(0), +#endif + _numChan(type == kType26 ? 3 : 6), _numSSG(type == kTypeTowns ? 0 : 3), + _hasPercussion(type == kType86 ? true : false), _oprRates(0), _oprRateshift(0), _oprAttackDecay(0), _oprFrq(0), _oprSinTbl(0), _oprLevelOut(0), _oprDetune(0), _rtt(type == kTypeTowns ? 0x514767 : 0x5B8D80), _baserate(55125.0f / (float)mixer->getOutputRate()), _volMaskA(0), _volMaskB(0), _volumeA(255), _volumeB(255), @@ -846,7 +854,9 @@ TownsPC98_FmSynth::~TownsPC98_FmSynth() { deinit(); delete _ssg; +#ifndef __DS__ delete _prc; +#endif delete[] _chanInternal; delete[] _oprRates; @@ -878,10 +888,12 @@ bool TownsPC98_FmSynth::init() { _ssg->init(&_ssgTables[0], &_ssgTables[16]); } +#ifndef __DS__ if (_hasPercussion) { _prc = new TownsPC98_FmSynthPercussionSource(_timerbase, _rtt); _prc->init(_percussionData); } +#endif _timers[0].cb = &TownsPC98_FmSynth::timerCallbackA; _timers[1].cb = &TownsPC98_FmSynth::timerCallbackB; @@ -910,8 +922,10 @@ void TownsPC98_FmSynth::reset() { if (_ssg) _ssg->reset(); +#ifndef __DS__ if (_prc) _prc->reset(); +#endif } void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { @@ -945,9 +959,11 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { _ssg->writeReg(l, value); break; case 0x10: +#ifndef __DS__ // pcm rhythm channel if (_prc) _prc->writeReg(l, value); +#endif break; case 0x20: if (l == 8) { @@ -1139,8 +1155,10 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { if (_ssg) _ssg->nextTick(tmp, render); +#ifndef __DS__ if (_prc) _prc->nextTick(tmp, render); +#endif nextTickEx(tmp, render); @@ -1176,8 +1194,10 @@ void TownsPC98_FmSynth::setVolumeIntern(int volA, int volB) { _volumeB = CLIP(volB, 0, Audio::Mixer::kMaxMixerVolume); if (_ssg) _ssg->setVolumeIntern(_volumeA, _volumeB); +#ifndef __DS__ if (_prc) _prc->setVolumeIntern(_volumeA, _volumeB); +#endif } void TownsPC98_FmSynth::setVolumeChannelMasks(int channelMaskA, int channelMaskB) { @@ -1186,8 +1206,10 @@ void TownsPC98_FmSynth::setVolumeChannelMasks(int channelMaskA, int channelMaskB _volMaskB = channelMaskB; if (_ssg) _ssg->setVolumeChannelMasks(_volMaskA >> _numChan, _volMaskB >> _numChan); +#ifndef __DS__ if (_prc) _prc->setVolumeChannelMasks(_volMaskA >> (_numChan + _numSSG), _volMaskB >> (_numChan + _numSSG)); +#endif } void TownsPC98_FmSynth::generateTables() { @@ -1400,6 +1422,7 @@ const int TownsPC98_FmSynth::_ssgTables[] = { 0x000575, 0x000463, 0x00039D, 0x0002FA, 0x000242, 0x0001B6, 0x00014C, 0x0000FB }; +#ifndef __DS__ const uint8 TownsPC98_FmSynth::_percussionData[] = { 0, 24, 1, 192, 1, 216, 2, 128, 4, 88, 23, 64, 27, 152, 1, 128, 29, 24, 2, 128, 31, 152, 0, 128, 136, 128, 128, 128, 0, 136, 97, 103, 153, 139, 34, 163, 72, 195, 27, 69, 1, 154, 137, 35, 8, 51, 169, 122, 164, 75, 133, 203, 81, 146, 168, 121, 185, 68, 202, 8, 33, 237, 49, 177, 12, 133, 140, 17, 160, 42, 161, 10, 0, 137, 176, 57, 233, 41, 160, 136, 235, 65, 177, 137, 128, 26, 164, 28, 3, 157, 51, 137, 1, 152, 113, 161, 40, 146, 115, 192, 56, 5, 169, 66, 161, 56, 1, 50, 145, 59, 39, 168, 97, 1, 160, 57, 7, 153, 50, 153, 32, 2, 25, 129, 32, 20, 186, 66, 129, 24, 153, 164, 142, 130, 169, 153, 26, 242, 138, 217, 9, 128, 204, 58, 209, 172, 40, 176, 141, @@ -1514,6 +1537,7 @@ const uint8 TownsPC98_FmSynth::_percussionData[] = { 45, 136, 18, 144, 105, 138, 1, 160, 14, 128, 132, 145, 186, 37, 138, 41, 192, 48, 145, 46, 160, 33, 44, 24, 225, 16, 13, 132, 136, 137, 16, 148, 25, 170, 194, 82, 152, 136, 91, 24, 42, 169, 33, 233, 131, 179, 24, 185, 149, 16, 57, 172, 164, 18, 10, 211, 160, 147, 211, 33, 138, 243, 129, 16, 41, 193, 0, 43, 132, 155, 73, 58, 145, 244, 145, 43, 35, 9, 171, 16, 110, 25, 8, 28, 74, 162, 128, 26, 27, 82, 45, 136, 153, 18, 8, 136, 8 }; +#endif TownsPC98_FmSynth::ChanInternal::ChanInternal() { memset(this, 0, sizeof(ChanInternal)); diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index 4a618338ed..a6fd39646a 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -32,7 +32,9 @@ class TownsPC98_FmSynthOperator; class TownsPC98_FmSynthSquareSineSource; +#ifndef __DS__ class TownsPC98_FmSynthPercussionSource; +#endif enum EnvelopeState { kEnvReady, @@ -128,7 +130,9 @@ private: }; TownsPC98_FmSynthSquareSineSource *_ssg; +#ifndef __DS__ TownsPC98_FmSynthPercussionSource *_prc; +#endif ChanInternal *_chanInternal; uint8 *_oprRates; @@ -168,7 +172,9 @@ private: Audio::Mixer *_mixer; Audio::SoundHandle _soundHandle; +#ifndef __DS__ static const uint8 _percussionData[]; +#endif static const uint32 _adtStat[]; static const uint8 _detSrc[]; static const int _ssgTables[]; -- cgit v1.2.3 From 1161714d72efea6f283c166ed9492df9a6bbf755 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Mon, 4 Oct 2010 17:30:23 +0000 Subject: FM-TOWNS AUDIO: minor fix svn-id: r53017 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 66a83f74ce..06da399fde 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -260,9 +260,9 @@ bool TownsAudioInterface::init() { setVolumeChannelMasks(-1, 0); + _ready = true; callback(0); - _ready = true; return true; } -- cgit v1.2.3 From 0e0ab8b4024bf56bb8000bdf04bda19a0e8e3e00 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Tue, 5 Oct 2010 16:22:55 +0000 Subject: PC98 AUDIO: cleanup as suggested by sev (see devel) svn-id: r53031 --- sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 22 ++++++++--------- sound/softsynth/fmtowns_pc98/towns_pc98_driver.h | 6 ++--- .../softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 28 +++++++++++----------- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h | 16 ++++++++++--- 4 files changed, 41 insertions(+), 31 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 21e8f9b2e5..3cf4caf0d1 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -160,7 +160,7 @@ public: void reset(); }; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL class TownsPC98_MusicChannelPCM : public TownsPC98_MusicChannel { public: TownsPC98_MusicChannelPCM(TownsPC98_AudioDriver *driver, uint8 regOffs, @@ -930,7 +930,7 @@ void TownsPC98_SfxChannel::reset() { _drv->_ssgPatches[i + 12] = src[i + 12]; } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_MusicChannelPCM::TownsPC98_MusicChannelPCM(TownsPC98_AudioDriver *driver, uint8 regOffs, uint8 flgs, uint8 num, uint8 key, uint8 prt, uint8 id) : TownsPC98_MusicChannel(driver, regOffs, flgs, num, key, prt, id), controlEvents(0) { @@ -1019,11 +1019,11 @@ bool TownsPC98_MusicChannelPCM::control_ff_endOfTrack(uint8 para) { return false; } } -#endif // ifndef __DS__ +#endif // DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) : TownsPC98_FmSynth(mixer, type), _channels(0), _ssgChannels(0), _sfxChannels(0), -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL _rhythmChannel(0), #endif _trackPtr(0), _sfxData(0), _sfxOffs(0), _ssgPatches(0), @@ -1035,7 +1035,7 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) _updateChannelsFlag(type == kType26 ? 0x07 : 0x3F), _finishedChannelsFlag(0), _updateSSGFlag(type == kTypeTowns ? 0x00 : 0x07), _finishedSSGFlag(0), _updateRhythmFlag(type == kType86 ? -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL 0x01 #else 0x00 @@ -1075,7 +1075,7 @@ TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { delete _sfxChannels[i]; delete[] _sfxChannels; } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL delete _rhythmChannel; #endif @@ -1121,7 +1121,7 @@ bool TownsPC98_AudioDriver::init() { } } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_hasPercussion) { _rhythmChannel = new TownsPC98_MusicChannelPCM(this, 0, 0, 0, 0, 0, 1); _rhythmChannel->init(); @@ -1168,7 +1168,7 @@ void TownsPC98_AudioDriver::loadMusicData(uint8 *data, bool loadPaused) { } if (_hasPercussion) { -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL _rhythmChannel->loadData(data + READ_LE_UINT16(src_a)); #endif src_a += 2; @@ -1230,7 +1230,7 @@ void TownsPC98_AudioDriver::reset() { memcpy(_ssgPatches, _drvTables + 156, 256); } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_rhythmChannel) _rhythmChannel->reset(); #endif @@ -1253,7 +1253,7 @@ void TownsPC98_AudioDriver::fadeStep() { if (!_fading) { _fading = 19; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_hasPercussion) { if (_updateRhythmFlag & _rhythmChannel->_idFlag) _rhythmChannel->reset(); @@ -1285,7 +1285,7 @@ void TownsPC98_AudioDriver::timerCallbackB() { } } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_hasPercussion) if (_updateRhythmFlag & _rhythmChannel->_idFlag) _rhythmChannel->processEvents(); diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h index 162156b2b5..00fcf7c5d5 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.h @@ -31,7 +31,7 @@ class TownsPC98_MusicChannel; class TownsPC98_MusicChannelSSG; class TownsPC98_SfxChannel; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL class TownsPC98_MusicChannelPCM; #endif @@ -39,7 +39,7 @@ class TownsPC98_AudioDriver : public TownsPC98_FmSynth { friend class TownsPC98_MusicChannel; friend class TownsPC98_MusicChannelSSG; friend class TownsPC98_SfxChannel; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL friend class TownsPC98_MusicChannelPCM; #endif public: @@ -88,7 +88,7 @@ protected: TownsPC98_MusicChannel **_channels; TownsPC98_MusicChannelSSG **_ssgChannels; TownsPC98_SfxChannel **_sfxChannels; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_MusicChannelPCM *_rhythmChannel; #endif diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index 7b94a46426..0a4984888d 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -377,7 +377,7 @@ private: bool _ready; }; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL class TownsPC98_FmSynthPercussionSource { public: TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt); @@ -443,7 +443,7 @@ private: bool _ready; }; -#endif +#endif // DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_FmSynthSquareSineSource::TownsPC98_FmSynthSquareSineSource(const uint32 timerbase, const uint32 rtt) : _tlTable(0), _rtt(rtt), _tleTable(0), _updateRequest(-1), _tickLength(timerbase * 27), _ready(0), _reg(0), _rand(1), _outN(1), @@ -629,7 +629,7 @@ void TownsPC98_FmSynthSquareSineSource::updateRegs() { _updateRequest = -1; } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_FmSynthPercussionSource::TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt) : _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _ready(false), _volMaskA(0), _volMaskB(0), _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume) { @@ -826,12 +826,12 @@ void TownsPC98_FmSynthPercussionSource::advanceInput(RhtChannel *ins) { cur >>= 4; } } -#endif // ifndef __DS__ +#endif // DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : _mixer(mixer), _chanInternal(0), _ssg(0), -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL _prc(0), #endif _numChan(type == kType26 ? 3 : 6), _numSSG(type == kTypeTowns ? 0 : 3), @@ -854,7 +854,7 @@ TownsPC98_FmSynth::~TownsPC98_FmSynth() { deinit(); delete _ssg; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL delete _prc; #endif delete[] _chanInternal; @@ -888,7 +888,7 @@ bool TownsPC98_FmSynth::init() { _ssg->init(&_ssgTables[0], &_ssgTables[16]); } -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_hasPercussion) { _prc = new TownsPC98_FmSynthPercussionSource(_timerbase, _rtt); _prc->init(_percussionData); @@ -922,7 +922,7 @@ void TownsPC98_FmSynth::reset() { if (_ssg) _ssg->reset(); -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_prc) _prc->reset(); #endif @@ -959,7 +959,7 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) { _ssg->writeReg(l, value); break; case 0x10: -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL // pcm rhythm channel if (_prc) _prc->writeReg(l, value); @@ -1155,7 +1155,7 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { if (_ssg) _ssg->nextTick(tmp, render); -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_prc) _prc->nextTick(tmp, render); #endif @@ -1194,7 +1194,7 @@ void TownsPC98_FmSynth::setVolumeIntern(int volA, int volB) { _volumeB = CLIP(volB, 0, Audio::Mixer::kMaxMixerVolume); if (_ssg) _ssg->setVolumeIntern(_volumeA, _volumeB); -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_prc) _prc->setVolumeIntern(_volumeA, _volumeB); #endif @@ -1206,7 +1206,7 @@ void TownsPC98_FmSynth::setVolumeChannelMasks(int channelMaskA, int channelMaskB _volMaskB = channelMaskB; if (_ssg) _ssg->setVolumeChannelMasks(_volMaskA >> _numChan, _volMaskB >> _numChan); -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL if (_prc) _prc->setVolumeChannelMasks(_volMaskA >> (_numChan + _numSSG), _volMaskB >> (_numChan + _numSSG)); #endif @@ -1422,7 +1422,7 @@ const int TownsPC98_FmSynth::_ssgTables[] = { 0x000575, 0x000463, 0x00039D, 0x0002FA, 0x000242, 0x0001B6, 0x00014C, 0x0000FB }; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL const uint8 TownsPC98_FmSynth::_percussionData[] = { 0, 24, 1, 192, 1, 216, 2, 128, 4, 88, 23, 64, 27, 152, 1, 128, 29, 24, 2, 128, 31, 152, 0, 128, 136, 128, 128, 128, 0, 136, 97, 103, 153, 139, 34, 163, 72, 195, 27, 69, 1, 154, 137, 35, 8, 51, 169, 122, 164, 75, 133, 203, 81, 146, 168, 121, 185, 68, 202, 8, 33, 237, 49, 177, 12, 133, 140, 17, 160, 42, 161, 10, 0, 137, 176, 57, 233, 41, 160, 136, 235, 65, 177, 137, 128, 26, 164, 28, 3, 157, 51, 137, 1, 152, 113, 161, 40, 146, 115, 192, 56, 5, 169, 66, 161, 56, 1, 50, 145, 59, 39, 168, 97, 1, 160, 57, 7, 153, 50, 153, 32, 2, 25, 129, 32, 20, 186, 66, 129, 24, 153, 164, 142, 130, 169, 153, 26, 242, 138, 217, 9, 128, 204, 58, 209, 172, 40, 176, 141, @@ -1537,7 +1537,7 @@ const uint8 TownsPC98_FmSynth::_percussionData[] = { 45, 136, 18, 144, 105, 138, 1, 160, 14, 128, 132, 145, 186, 37, 138, 41, 192, 48, 145, 46, 160, 33, 44, 24, 225, 16, 13, 132, 136, 137, 16, 148, 25, 170, 194, 82, 152, 136, 91, 24, 42, 169, 33, 233, 131, 179, 24, 185, 149, 16, 57, 172, 164, 18, 10, 211, 160, 147, 211, 33, 138, 243, 129, 16, 41, 193, 0, 43, 132, 155, 73, 58, 145, 244, 145, 43, 35, 9, 171, 16, 110, 25, 8, 28, 74, 162, 128, 26, 27, 82, 45, 136, 153, 18, 8, 136, 8 }; -#endif +#endif // DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_FmSynth::ChanInternal::ChanInternal() { memset(this, 0, sizeof(ChanInternal)); diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h index a6fd39646a..ddd249b1b8 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h @@ -30,9 +30,19 @@ #include "sound/mixer.h" #include "common/list.h" +#ifdef __DS__ +/* This disables the rhythm channel when emulating the PC-98 type 86 sound card. + * The only purpose is code size reduction for certain backends. + * At the moment the only games which make use of the rhythm channel are the + * (very rare) PC-98 versions of Legend of Kyrandia 2 and Lands of Lore. Music will + * still be okay, just missing a couple of rhythm instruments. + */ +#define DISABLE_PC98_RHYTHM_CHANNEL +#endif + class TownsPC98_FmSynthOperator; class TownsPC98_FmSynthSquareSineSource; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL class TownsPC98_FmSynthPercussionSource; #endif @@ -130,7 +140,7 @@ private: }; TownsPC98_FmSynthSquareSineSource *_ssg; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL TownsPC98_FmSynthPercussionSource *_prc; #endif ChanInternal *_chanInternal; @@ -172,7 +182,7 @@ private: Audio::Mixer *_mixer; Audio::SoundHandle _soundHandle; -#ifndef __DS__ +#ifndef DISABLE_PC98_RHYTHM_CHANNEL static const uint8 _percussionData[]; #endif static const uint32 _adtStat[]; -- cgit v1.2.3 From 01c9b1706823b5a872f376a51a94ae3266dad69a Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Thu, 7 Oct 2010 19:23:49 +0000 Subject: SCUMM/FM-TOWNS: improved sfx support for indy4 and monkey2 svn-id: r53052 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 06da399fde..58e09f291b 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -243,9 +243,6 @@ bool TownsAudioInterface::init() { if (_ready) return true; - if (!_drv) - return false; - if (!TownsPC98_FmSynth::init()) return false; @@ -359,8 +356,9 @@ void TownsAudioInterface::timerCallbackA() { void TownsAudioInterface::timerCallbackB() { Common::StackLock lock(_mutex); - if (_drv && _ready) { - _drv->timerCallback(1); + if (_ready) { + if (_drv) + _drv->timerCallback(1); callback(80); } } @@ -665,7 +663,7 @@ int TownsAudioInterface::intf_pcmEffectPlaying(va_list &args) { if (chan < 0x40 || chan > 0x47) return 1; chan -= 0x40; - return (_pcmChanEffectPlaying & _chanFlags[chan]) ? true : false; + return (_pcmChanEffectPlaying & _chanFlags[chan]) ? 1 : 0; } int TownsAudioInterface::intf_fmKeyOn(va_list &args) { -- cgit v1.2.3 From b58bbd719cad79445f496828f1a49465481826ee Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Fri, 8 Oct 2010 16:31:08 +0000 Subject: SCUMM/FM-TOWNS: fixed threading issue in sfx code svn-id: r53074 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 1 - sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 1 - sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 58e09f291b..f9c9529214 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -226,7 +226,6 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac } TownsAudioInterface::~TownsAudioInterface() { - Common::StackLock lock(_mutex); reset(); deinit(); _ready = false; diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 3cf4caf0d1..b711eccbe1 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -1053,7 +1053,6 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) } TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { - Common::StackLock lock(_mutex); reset(); deinit(); _ready = false; diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index 0a4984888d..dbd8e37cb7 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -907,6 +907,7 @@ bool TownsPC98_FmSynth::init() { } void TownsPC98_FmSynth::reset() { + Common::StackLock lock(_mutex); for (int i = 0; i < _numChan; i++) { for (int ii = 0; ii < 4; ii++) _chanInternal[i].opr[ii]->reset(); -- cgit v1.2.3 From 67c68afa6dd2fe1fdc300b72a7cf1d867ab38f27 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sun, 10 Oct 2010 16:44:09 +0000 Subject: FM-TOWNS AUDIO: improve thread safety svn-id: r53126 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 2 +- sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 2 +- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') 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() { -- cgit v1.2.3 From 8388e0dfea4ae0d80e51368acd12685c740c5bb5 Mon Sep 17 00:00:00 2001 From: Jordi Vilalta Prat Date: Tue, 12 Oct 2010 02:18:11 +0000 Subject: JANITORAL: Clean trailing whitespaces. svn-id: r53160 --- sound/softsynth/fmtowns_pc98/towns_audio.cpp | 16 ++++++++-------- sound/softsynth/fmtowns_pc98/towns_euphony.cpp | 4 ++-- sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 2 +- sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'sound/softsynth/fmtowns_pc98') diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp index 9823015a2d..aa6df1db5a 100644 --- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp @@ -228,7 +228,7 @@ TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfac TownsAudioInterface::~TownsAudioInterface() { reset(); _ready = false; - deinit(); + deinit(); delete[] _fmSaveReg[0]; delete[] _fmSaveReg[1]; @@ -495,7 +495,7 @@ int TownsAudioInterface::intf_enableTimerB(va_list &args) { int TownsAudioInterface::intf_loadSamples(va_list &args) { uint32 dest = va_arg(args, uint32); int size = va_arg(args, int); - uint8 *src = va_arg(args, uint8*); + uint8 *src = va_arg(args, uint8*); if (dest >= 65536 || size == 0 || size > 65536) return 3; @@ -567,7 +567,7 @@ int TownsAudioInterface::intf_loadWaveTable(va_list &args) { TownsAudio_WaveTable *s = &_waveTables[_numWaveTables++]; s->readHeader(data); - + _waveTablesTotalDataSize += s->size; callback(32, _waveTablesTotalDataSize, s->size, data + 32); @@ -723,11 +723,11 @@ int TownsAudioInterface::intf_setOutputVolume(va_list &args) { static const uint8 flags[] = { 0x0C, 0x30, 0x40, 0x80 }; uint8 chan = (chanType & 0x40) ? 8 : 12; - + chanType &= 3; left = (left & 0x7e) >> 1; right = (right & 0x7e) >> 1; - + if (chan) _outputVolumeFlags |= flags[chanType]; else @@ -1399,13 +1399,13 @@ void TownsAudioInterface::updateOutputVolume() { // FM Towns seems to support volumes of 0 - 63 for each channel. // We recalculate sane values for our 0 to 255 volume range and // balance values for our -128 to 127 volume range - + // CD-AUDIO uint32 maxVol = MAX(_outputLevel[12], _outputLevel[13]); - + int volume = (int)(((float)(maxVol * 255) / 63.0f)); int balance = maxVol ? (int)( ( ((int)_outputLevel[13] - _outputLevel[12]) * 127) / (float)maxVol) : 0; - + AudioCD.setVolume(volume); AudioCD.setBalance(balance); } diff --git a/sound/softsynth/fmtowns_pc98/towns_euphony.cpp b/sound/softsynth/fmtowns_pc98/towns_euphony.cpp index 626c0166e5..7b52b4594f 100644 --- a/sound/softsynth/fmtowns_pc98/towns_euphony.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_euphony.cpp @@ -131,7 +131,7 @@ void TownsEuphonyDriver::unloadWaveTable(int id) { void TownsEuphonyDriver::reserveSoundEffectChannels(int num) { _intf->callback(33, num); uint32 volMask = 0; - + if (num > 8) return; @@ -139,7 +139,7 @@ void TownsEuphonyDriver::reserveSoundEffectChannels(int num) { volMask |= v; v >>= 1; } - + _intf->setSoundEffectChanMask(volMask); } diff --git a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 4676ed774a..8047616dbf 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -1055,7 +1055,7 @@ TownsPC98_AudioDriver::TownsPC98_AudioDriver(Audio::Mixer *mixer, EmuType type) TownsPC98_AudioDriver::~TownsPC98_AudioDriver() { reset(); _ready = false; - deinit(); + 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 541d582c1c..e779812c42 100644 --- a/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/sound/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -845,7 +845,7 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : memset(&_timers[1], 0, sizeof(ChipTimer)); _timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback; - _timerbase = (uint32)(_baserate * 1000000.0f); + _timerbase = (uint32)(_baserate * 1000000.0f); } TownsPC98_FmSynth::~TownsPC98_FmSynth() { @@ -1179,7 +1179,7 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { void TownsPC98_FmSynth::deinit() { _ready = false; - _mixer->stopHandle(_soundHandle); + _mixer->stopHandle(_soundHandle); Common::StackLock lock(_mutex); _timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback; } -- cgit v1.2.3