diff options
author | Norbert Lange | 2009-06-08 18:33:20 +0000 |
---|---|---|
committer | Norbert Lange | 2009-06-08 18:33:20 +0000 |
commit | d3ad5fc663cbbfa4c01fbfbf5cfe6f7df82e7d10 (patch) | |
tree | 0ab6a8c490e1fdd25b8e74339533a66d62710cfc /sound/mods/soundfx.cpp | |
parent | 2c55c49534f79eb0f191f67511ab96ad8339d918 (diff) | |
download | scummvm-rg350-d3ad5fc663cbbfa4c01fbfbf5cfe6f7df82e7d10.tar.gz scummvm-rg350-d3ad5fc663cbbfa4c01fbfbf5cfe6f7df82e7d10.tar.bz2 scummvm-rg350-d3ad5fc663cbbfa4c01fbfbf5cfe6f7df82e7d10.zip |
Initital commit modifying buildsystem and adding a TFMX Module-Player
Changes in Paula.cpp/Paula.h + soundfx.cpp:
Added (easy) queueing of samples by implementing methods that act similar
like writes to the Amiga-Chipset would.
Added counting of DMA-Interrupts, that is how often a sample finished
playing.
Added a base for the interrupt-interval, in most cases this will be the
Cia-clockrate. Derived classes can then set the interval without scaling to
the samplerate
Changes in common/scummsys.h:
Only disable warnings with pragmas for MS Compilers that cant do so
otherwise. Newer MSVC Versions can and should disable warnings in the
Project-Settings.
Files in tfmx:
Some files for debugging. Wont ever be commited back into trunk so those
will contain some messy and hackish code
Added: tfmx.h/tfmx.cpp
Player for TFMX-Modules.
Rest: main.cpp etc.
Modified buildsystem to include new directory, modified main.cpp so it
calls tfmxmain (tfmxplayer.cpp) instead of starting the GUI.
svn-id: r41382
Diffstat (limited to 'sound/mods/soundfx.cpp')
-rw-r--r-- | sound/mods/soundfx.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/mods/soundfx.cpp b/sound/mods/soundfx.cpp index 101d8a077d..3af8ca19c6 100644 --- a/sound/mods/soundfx.cpp +++ b/sound/mods/soundfx.cpp @@ -46,8 +46,7 @@ public: enum { NUM_CHANNELS = 4, - NUM_INSTRUMENTS = 15, - CIA_FREQ = 715909 + NUM_INSTRUMENTS = 15 }; SoundFx(int rate, bool stereo); @@ -75,12 +74,12 @@ protected: uint16 _curPos; uint8 _ordersTable[128]; uint8 *_patternData; - int _eventsFreq; uint16 _effects[NUM_CHANNELS]; }; SoundFx::SoundFx(int rate, bool stereo) : Paula(stereo, rate) { + setTimerBaseValue(kPalCiaClock); _ticks = 0; _delay = 0; memset(_instruments, 0, sizeof(_instruments)); @@ -89,7 +88,6 @@ SoundFx::SoundFx(int rate, bool stereo) _curPos = 0; memset(_ordersTable, 0, sizeof(_ordersTable)); _patternData = 0; - _eventsFreq = 0; memset(_effects, 0, sizeof(_effects)); } @@ -167,8 +165,7 @@ void SoundFx::play() { _curPos = 0; _curOrder = 0; _ticks = 0; - _eventsFreq = CIA_FREQ / _delay; - setInterruptFreq(getRate() / _eventsFreq); + setInterruptFreqUnscaled(_delay); startPaula(); } @@ -252,7 +249,7 @@ void SoundFx::handleTick() { } void SoundFx::disablePaulaChannel(uint8 channel) { - setChannelPeriod(channel, 0); + disableChannel(channel); } void SoundFx::setupPaulaChannel(uint8 channel, const int8 *data, uint16 len, uint16 repeatPos, uint16 repeatLen) { |