diff options
author | Martin Kiewitz | 2015-06-29 02:18:31 +0200 |
---|---|---|
committer | Martin Kiewitz | 2015-06-29 02:18:31 +0200 |
commit | e8986239c5153d3956da115523a6095d6710be39 (patch) | |
tree | 1d1e5e95f5a49f61524a1504b33cc0c4250d5ccb | |
parent | a041aec839911793bc34a74f6e88fd37fe8adf3c (diff) | |
download | scummvm-rg350-e8986239c5153d3956da115523a6095d6710be39.tar.gz scummvm-rg350-e8986239c5153d3956da115523a6095d6710be39.tar.bz2 scummvm-rg350-e8986239c5153d3956da115523a6095d6710be39.zip |
AUDIO: Miles Audio MT32: fix patch addresses
also add warnings in case there are non-existant instruments
or no-non-protected timbre slots are available
-rw-r--r-- | audio/miles_mt32.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/miles_mt32.cpp b/audio/miles_mt32.cpp index 79406175e7..768647ce32 100644 --- a/audio/miles_mt32.cpp +++ b/audio/miles_mt32.cpp @@ -592,6 +592,7 @@ int16 MidiDriver_Miles_MT32::installCustomTimbre(byte patchBank, byte patchId) { // Check, if requested instrument is actually available instrumentPtr = searchCustomInstrument(patchBank, patchId); if (!instrumentPtr) { + warning("MILES-MT32: instrument not found during installCustomTimbre()"); return -1; // not found -> bail out } @@ -619,6 +620,7 @@ int16 MidiDriver_Miles_MT32::installCustomTimbre(byte patchBank, byte patchId) { // no empty slot found, check if we got a least used non-protected slot if (leastUsedTimbreId < 0) { // everything is protected, bail out + warning("MILES-MT32: no non-protected timbre slots available during installCustomTimbre()"); return -1; } customTimbreId = leastUsedTimbreId; @@ -665,7 +667,7 @@ void MidiDriver_Miles_MT32::writePatchTimbre(byte patchId, byte timbreGroup, byt byte sysExData[3]; uint32 targetAddress = 0; - targetAddress = ((patchId << 3) << 16) | 0x000500; + targetAddress = 0x050000 + (patchId << 3); sysExData[0] = timbreGroup; sysExData[1] = timbreId; @@ -678,7 +680,7 @@ void MidiDriver_Miles_MT32::writePatchByte(byte patchId, byte index, byte patchV byte sysExData[2]; uint32 targetAddress = 0; - targetAddress = (((patchId << 3) + index ) << 16) | 0x000500; + targetAddress = 0x050000 + ((patchId << 3) + index ); sysExData[0] = patchValue; sysExData[1] = MILES_MT32_SYSEX_TERMINATOR; // terminator |