diff options
author | Gregory Montoir | 2007-09-30 11:16:25 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-09-30 11:16:25 +0000 |
commit | 28c1f3fbb36ee2febe9f7eb8d289ceae809e5f93 (patch) | |
tree | b57283de31b4af7d11791edda18a0f76d4f5f72f | |
parent | b767eb771b56f48a1e971e1d5fc3ab97c4ae9a14 (diff) | |
download | scummvm-rg350-28c1f3fbb36ee2febe9f7eb8d289ceae809e5f93.tar.gz scummvm-rg350-28c1f3fbb36ee2febe9f7eb8d289ceae809e5f93.tar.bz2 scummvm-rg350-28c1f3fbb36ee2febe9f7eb8d289ceae809e5f93.zip |
removed unused function, simplified handlePattern
svn-id: r29139
-rw-r--r-- | sound/mods/soundfx.cpp | 62 |
1 files 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); } |