diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/console.cpp | 6 | ||||
-rw-r--r-- | engines/sci/sound/drivers/midi.cpp | 24 |
2 files changed, 17 insertions, 13 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 40e3aae9a7..8ad144e1f8 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1046,8 +1046,12 @@ bool Console::cmdMapInstrument(int argc, const char **argv) { if (argc != 4) { DebugPrintf("Maps an MT-32 custom instrument to a GM instrument on the fly\n\n"); DebugPrintf("Usage %s <MT-32 instrument name> <GM instrument> <GM rhythm key>\n", argv[0]); - DebugPrintf("Each MT-32 instrument is mapped to either a GM instrument, or a GM rhythm key\n"); + DebugPrintf("Each MT-32 instrument is always 10 characters and is mapped to either a GM instrument, or a GM rhythm key\n"); + DebugPrintf("A value of 255 (0xff) signifies an unmapped instrument\n"); DebugPrintf("Please replace the spaces in the instrument name with underscores (\"_\"). They'll be converted to spaces afterwards\n\n"); + DebugPrintf("Example: %s test_0__XX 1 255\n", argv[0]); + DebugPrintf("The above example will map the MT-32 instument \"test 0 XX\" to GM instrument 1\n\n"); + Example } else { if (Mt32dynamicMappings != NULL) { Mt32ToGmMap newMapping; diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp index d119be32b3..52ddb5ab8a 100644 --- a/engines/sci/sound/drivers/midi.cpp +++ b/engines/sci/sound/drivers/midi.cpp @@ -628,12 +628,6 @@ void MidiPlayer_Midi::readMt32DrvData() { byte MidiPlayer_Midi::lookupGmInstrument(const char *iname) { int i = 0; - while (Mt32MemoryTimbreMaps[i].name) { - if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0) - return getGmInstrument(Mt32MemoryTimbreMaps[i]); - i++; - } - if (Mt32dynamicMappings != NULL) { const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end(); for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) { @@ -642,18 +636,18 @@ byte MidiPlayer_Midi::lookupGmInstrument(const char *iname) { } } + while (Mt32MemoryTimbreMaps[i].name) { + if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0) + return getGmInstrument(Mt32MemoryTimbreMaps[i]); + i++; + } + return MIDI_UNMAPPED; } byte MidiPlayer_Midi::lookupGmRhythmKey(const char *iname) { int i = 0; - while (Mt32MemoryTimbreMaps[i].name) { - if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0) - return Mt32MemoryTimbreMaps[i].gmRhythmKey; - i++; - } - if (Mt32dynamicMappings != NULL) { const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end(); for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) { @@ -662,6 +656,12 @@ byte MidiPlayer_Midi::lookupGmRhythmKey(const char *iname) { } } + while (Mt32MemoryTimbreMaps[i].name) { + if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0) + return Mt32MemoryTimbreMaps[i].gmRhythmKey; + i++; + } + return MIDI_UNMAPPED; } |