[Scummvm-cvs-logs] scummvm master -> e8986239c5153d3956da115523a6095d6710be39

m-kiewitz m_kiewitz at users.sourceforge.net
Mon Jun 29 02:18:03 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e8986239c5 AUDIO: Miles Audio MT32: fix patch addresses


Commit: e8986239c5153d3956da115523a6095d6710be39
    https://github.com/scummvm/scummvm/commit/e8986239c5153d3956da115523a6095d6710be39
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-06-29T02:18:31+02:00

Commit Message:
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

Changed paths:
    audio/miles_mt32.cpp



diff --git a/audio/miles_mt32.cpp b/audio/miles_mt32.cpp
index 7940617..768647c 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






More information about the Scummvm-git-logs mailing list