aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorJohannes Schickel2012-11-22 02:22:25 +0100
committerJohannes Schickel2012-11-22 02:22:25 +0100
commit761a98997c0ad74a760a224d84acb72073641b31 (patch)
tree7236b31737478d3450a63f727fe5ff272e6bfc2f /audio
parent689497f06e8563d7fc02df268e47dc36a576cd61 (diff)
downloadscummvm-rg350-761a98997c0ad74a760a224d84acb72073641b31.tar.gz
scummvm-rg350-761a98997c0ad74a760a224d84acb72073641b31.tar.bz2
scummvm-rg350-761a98997c0ad74a760a224d84acb72073641b31.zip
AUDIO: Disallow custom percussion instruments in MIDI->AdLib code.
Diffstat (limited to 'audio')
-rw-r--r--audio/softsynth/adlib.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp
index 2fd620ac1b..85311dd3a5 100644
--- a/audio/softsynth/adlib.cpp
+++ b/audio/softsynth/adlib.cpp
@@ -1303,9 +1303,16 @@ void AdLibPercussionChannel::noteOn(byte note, byte velocity) {
const AdLibInstrument *sec = NULL;
// The custom instruments have priority over the default mapping
- inst = _customInstruments[note];
- if (inst)
- note = _notes[note];
+ // We do not support custom instruments in OPL3 mode though.
+#ifdef ENABLE_OPL3
+ if (!_owner->_opl3Mode) {
+#endif
+ inst = _customInstruments[note];
+ if (inst)
+ note = _notes[note];
+#ifdef ENABLE_OPL3
+ }
+#endif
if (!inst) {
// Use the default GM to FM mapping as a fallback
@@ -1333,6 +1340,14 @@ void AdLibPercussionChannel::noteOn(byte note, byte velocity) {
}
void AdLibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *instr) {
+ // We do not allow custom instruments in OPL3 mode right now.
+#ifdef ENABLE_OPL3
+ if (_owner->_opl3Mode) {
+ warning("AdLibPercussionChannel::sysEx_customInstrument: Used in OPL3 mode");
+ return;
+ }
+#endif
+
if (type == 'ADLP') {
byte note = instr[0];
_notes[note] = instr[1];