aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-28 08:25:45 +0000
committerMartin Kiewitz2010-06-28 08:25:45 +0000
commit253036ec4d76492dde59d52264ade1c5730a9643 (patch)
tree8b3a7ce745df794a81a4f1b934ffa7006174a32a /engines/sci/sound
parent52ddc711d0bcea3f447c46d25f8c5c959c5ad558 (diff)
downloadscummvm-rg350-253036ec4d76492dde59d52264ade1c5730a9643.tar.gz
scummvm-rg350-253036ec4d76492dde59d52264ade1c5730a9643.tar.bz2
scummvm-rg350-253036ec4d76492dde59d52264ade1c5730a9643.zip
SCI: regression from implementing channel remapping and r50405 - center pitch wheels and hold pedal on init instead of unloadMusic(), fixes lsl5 piano scene
svn-id: r50413
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/midiparser_sci.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 9cedb86349..cdc2050f8b 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -127,6 +127,14 @@ void MidiParser_SCI::sendInitCommands() {
if (_channelUsed[i])
sendToDriver(0xB0 | i, 0x4E, 0); // Reset velocity
}
+
+ // Center the pitch wheels and hold pedal in preparation for the next piece of music
+ for (int i = 0; i < 16; ++i) {
+ if (_channelUsed[i]) {
+ sendToDriver(0xE0 | i, 0, 0x40); // Reset pitch wheel
+ sendToDriver(0xB0 | i, 0x40, 0); // Reset hold pedal
+ }
+ }
}
void MidiParser_SCI::unloadMusic() {
@@ -142,17 +150,6 @@ void MidiParser_SCI::unloadMusic() {
delete[] _mixedData;
_mixedData = NULL;
}
-
- // Center the pitch wheels and hold pedal in preparation for the next piece of music
- if (_driver && _pSnd) {
- for (int i = 0; i < 16; ++i) {
- int16 realChannel = _channelRemap[i];
- if (realChannel != -1) {
- _driver->send(0xE0 | realChannel, 0, 0x40); // Reset pitch wheel
- _driver->send(0xB0 | realChannel, 0x40, 0); // Reset hold pedal
- }
- }
- }
}
// this is used for scripts sending midi commands to us. we verify in that case that the channel is actually