diff options
Diffstat (limited to 'sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp')
-rw-r--r-- | sound/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
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); |