From 28c1f3fbb36ee2febe9f7eb8d289ceae809e5f93 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Sun, 30 Sep 2007 11:16:25 +0000 Subject: removed unused function, simplified handlePattern svn-id: r29139 --- sound/mods/soundfx.cpp | 62 +++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/sound/mods/soundfx.cpp b/sound/mods/soundfx.cpp index 057541307a..b1b10321ba 100644 --- a/sound/mods/soundfx.cpp +++ b/sound/mods/soundfx.cpp @@ -62,7 +62,6 @@ protected: void updateEffects(int ch); void handleTick(); - void enablePaulaChannel(uint8 channel); void disablePaulaChannel(uint8 channel); void setupPaulaChannel(uint8 channel, const int8 *data, uint16 len, uint16 repeatPos, uint16 repeatLen); @@ -176,38 +175,39 @@ void SoundFx::play() { void SoundFx::handlePattern(int ch, uint32 pat) { uint16 note1 = pat >> 16; uint16 note2 = pat & 0xFFFF; - if (note1 != 0xFFFD) { - int ins = (note2 & 0xF000) >> 12; - if (ins != 0) { - SoundFxInstrument *i = &_instruments[ins - 1]; - setupPaulaChannel(ch, i->data, i->len, i->repeatPos, i->repeatLen); - int effect = (note2 & 0xF00) >> 8; - int volume = i->volume; - switch (effect) { - case 5: // volume up - volume += (note2 & 0xFF); - if (volume > 63) { - volume = 63; - } - break; - case 6: // volume down - volume -= (note2 & 0xFF); - if (volume < 0) { - volume = 0; - } - break; - } - setChannelVolume(ch, volume); - } - } - _effects[ch] = note2; if (note1 == 0xFFFD) { // PIC _effects[ch] = 0; - } else if (note1 == 0xFFFE) { // STP + return; + } + _effects[ch] = note2; + if (note1 == 0xFFFE) { // STP disablePaulaChannel(ch); - } else if (note1 != 0) { + return; + } + int ins = (note2 & 0xF000) >> 12; + if (ins != 0) { + SoundFxInstrument *i = &_instruments[ins - 1]; + setupPaulaChannel(ch, i->data, i->len, i->repeatPos, i->repeatLen); + int effect = (note2 & 0xF00) >> 8; + int volume = i->volume; + switch (effect) { + case 5: // volume up + volume += (note2 & 0xFF); + if (volume > 63) { + volume = 63; + } + break; + case 6: // volume down + volume -= (note2 & 0xFF); + if (volume < 0) { + volume = 0; + } + break; + } + setChannelVolume(ch, volume); + } + if (note1 != 0) { setChannelPeriod(ch, note1); - enablePaulaChannel(ch); } } @@ -251,10 +251,6 @@ void SoundFx::handleTick() { } } -void SoundFx::enablePaulaChannel(uint8 channel) { - // FIXME: Is this empty on purpose?!? -} - void SoundFx::disablePaulaChannel(uint8 channel) { setChannelPeriod(channel, 0); } -- cgit v1.2.3