aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-16 16:21:17 +0000
committerFilippos Karapetis2010-01-16 16:21:17 +0000
commit0588e483b23df68a44394bb543352653474ea579 (patch)
treeca641ac4d04af3a2e32a52f3560d6ba4ad5e4032 /engines
parente29c4e7af7b925bf5d04d80fa7deaaf8bcaa4005 (diff)
downloadscummvm-rg350-0588e483b23df68a44394bb543352653474ea579.tar.gz
scummvm-rg350-0588e483b23df68a44394bb543352653474ea579.tar.bz2
scummvm-rg350-0588e483b23df68a44394bb543352653474ea579.zip
Added detection for the appropriate GM music channel play mask
svn-id: r47323
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sound/softseq/midi.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/sci/sound/softseq/midi.cpp b/engines/sci/sound/softseq/midi.cpp
index 84a3d62df7..2dda7ae3ce 100644
--- a/engines/sci/sound/softseq/midi.cpp
+++ b/engines/sci/sound/softseq/midi.cpp
@@ -86,6 +86,7 @@ private:
};
bool _isMt32;
+ bool _isOldPatchFormat;
bool _hasReverb;
bool _playSwitch;
int _masterVolume;
@@ -102,7 +103,7 @@ private:
byte _sysExBuf[kMaxSysExSize];
};
-MidiPlayer_Midi::MidiPlayer_Midi() : _playSwitch(true), _masterVolume(15), _isMt32(false), _hasReverb(false) {
+MidiPlayer_Midi::MidiPlayer_Midi() : _playSwitch(true), _masterVolume(15), _isMt32(false), _hasReverb(false), _isOldPatchFormat(false) {
MidiDriverType midiType = MidiDriver::detectMusicDriver(MDT_MIDI);
_driver = createMidi(midiType);
@@ -511,6 +512,13 @@ int MidiPlayer_Midi::open(ResourceManager *resMan) {
res = resMan->findResource(ResourceId(kResourceTypePatch, 4), 0);
if (!res)
warning("Failed to locate GM patch, attempting to load MT-32 patch");
+
+ // Detect the format of patch 1, so that we know what play mask to use
+ Resource *resPatch1 = resMan->findResource(ResourceId(kResourceTypePatch, 1), 0);
+ if (!resPatch1)
+ _isOldPatchFormat = false;
+ else
+ _isOldPatchFormat = !isMt32GmPatch(resPatch1->data, resPatch1->size);
}
if (!res) {
@@ -576,7 +584,7 @@ byte MidiPlayer_Midi::getPlayId(SciVersion soundVersion) {
if (_isMt32)
return 0x0c;
else
- return 0x07;
+ return _isOldPatchFormat ? 0x0c : 0x07;
}
}