aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-02-02 23:27:59 +0000
committerFilippos Karapetis2011-02-02 23:27:59 +0000
commit9b8c04045bad8422ce8da7d6a7b30c03f1ceb2a5 (patch)
treeced52fa37ee628ad13f9d60ba882b550ea02b21b /engines
parent149082c9e98e80140d2c8143b918ddfca20cdf7e (diff)
downloadscummvm-rg350-9b8c04045bad8422ce8da7d6a7b30c03f1ceb2a5.tar.gz
scummvm-rg350-9b8c04045bad8422ce8da7d6a7b30c03f1ceb2a5.tar.bz2
scummvm-rg350-9b8c04045bad8422ce8da7d6a7b30c03f1ceb2a5.zip
MIDI: Fix for bug #3170988 - "MONKEY2: Messed up MT-32 music"
This is a regression from r55256. Apparently, SCUMM has issues when sending a sustain off on a notes off event. Thus, this has been turned into a feature, which is disabled by default. Since MADE, SAGA and tinsel all share the same music code and play regular MIDI files, and this feature fixes hanging notes for them, it has been enabled for them. Also, applied a patch for a bug regarding the notes off event in MADE and tinsel, which has been applied in SAGA already svn-id: r55746
Diffstat (limited to 'engines')
-rw-r--r--engines/made/music.cpp7
-rw-r--r--engines/saga/music.cpp1
-rw-r--r--engines/tinsel/music.cpp7
3 files changed, 9 insertions, 6 deletions
diff --git a/engines/made/music.cpp b/engines/made/music.cpp
index 4e2789e5fa..3124fc069e 100644
--- a/engines/made/music.cpp
+++ b/engines/made/music.cpp
@@ -113,9 +113,9 @@ void MusicPlayer::send(uint32 b) {
b = (b & 0xFFFF00FF) | MidiDriver::_mt32ToGm[(b >> 8) & 0xFF] << 8;
}
else if ((b & 0xFFF0) == 0x007BB0) {
- //Only respond to All Notes Off if this channel
- //has currently been allocated
- if (_channel[b & 0x0F])
+ // Only respond to All Notes Off if this channel
+ // has currently been allocated
+ if (!_channel[b & 0x0F])
return;
}
@@ -165,6 +165,7 @@ void MusicPlayer::playXMIDI(GenericResource *midiResource, MusicFlags flags) {
parser->setMidiDriver(this);
parser->setTimerRate(getBaseTempo());
parser->property(MidiParser::mpCenterPitchWheelOnUnload, 1);
+ parser->property(MidiParser::mpSendSustainOffOnNotesOff, 1);
_parser = parser;
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 081fe955fc..3c0ce75db0 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -184,6 +184,7 @@ Music::Music(SagaEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
_parser->setMidiDriver(_driver);
_parser->setTimerRate(_driver->getBaseTempo());
_parser->property(MidiParser::mpCenterPitchWheelOnUnload, 1);
+ _parser->property(MidiParser::mpSendSustainOffOnNotesOff, 1);
_digitalMusic = false;
}
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index ad09631260..23ef28a99c 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -466,9 +466,9 @@ void MidiMusicPlayer::send(uint32 b) {
volume = volume * _masterVolume / 255;
b = (b & 0xFF00FFFF) | (volume << 16);
} else if ((b & 0xFFF0) == 0x007BB0) {
- //Only respond to All Notes Off if this channel
- //has currently been allocated
- if (_channel[b & 0x0F])
+ // Only respond to All Notes Off if this channel
+ // has currently been allocated
+ if (!_channel[b & 0x0F])
return;
}
@@ -533,6 +533,7 @@ void MidiMusicPlayer::playXMIDI(byte *midiData, uint32 size, bool loop) {
parser->setMidiDriver(this);
parser->setTimerRate(getBaseTempo());
parser->property(MidiParser::mpCenterPitchWheelOnUnload, 1);
+ parser->property(MidiParser::mpSendSustainOffOnNotesOff, 1);
_parser = parser;