[Scummvm-cvs-logs] SF.net SVN: scummvm: [29139] scummvm/trunk/sound/mods/soundfx.cpp
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Sun Sep 30 13:16:26 CEST 2007
Revision: 29139
http://scummvm.svn.sourceforge.net/scummvm/?rev=29139&view=rev
Author: cyx
Date: 2007-09-30 04:16:25 -0700 (Sun, 30 Sep 2007)
Log Message:
-----------
removed unused function, simplified handlePattern
Modified Paths:
--------------
scummvm/trunk/sound/mods/soundfx.cpp
Modified: scummvm/trunk/sound/mods/soundfx.cpp
===================================================================
--- scummvm/trunk/sound/mods/soundfx.cpp 2007-09-30 11:16:01 UTC (rev 29138)
+++ scummvm/trunk/sound/mods/soundfx.cpp 2007-09-30 11:16:25 UTC (rev 29139)
@@ -62,7 +62,6 @@
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::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::enablePaulaChannel(uint8 channel) {
- // FIXME: Is this empty on purpose?!?
-}
-
void SoundFx::disablePaulaChannel(uint8 channel) {
setChannelPeriod(channel, 0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list