aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-10-28 13:00:21 +0000
committerFilippos Karapetis2010-10-28 13:00:21 +0000
commita7b5133903ef4a50a52b5d6ecd5264ec6e69b62c (patch)
treea2e6cef6408687fe657b1a70a99d813b964082ed /engines
parent3a4647dc50aebfa89dd495d12573198b46b78893 (diff)
downloadscummvm-rg350-a7b5133903ef4a50a52b5d6ecd5264ec6e69b62c.tar.gz
scummvm-rg350-a7b5133903ef4a50a52b5d6ecd5264ec6e69b62c.tar.bz2
scummvm-rg350-a7b5133903ef4a50a52b5d6ecd5264ec6e69b62c.zip
SCI: Improved the description of the "map_instrument" console command a bit. Also, the dynamic mappings are now checked before the static ones
svn-id: r53903
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/console.cpp6
-rw-r--r--engines/sci/sound/drivers/midi.cpp24
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;
}