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

m-kiewitz m_kiewitz at users.sourceforge.net
Sun May 31 01:05:19 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:
bdd0a63b49 SHERLOCK: adlib: fix "in-use" usage voiceOnOff()


Commit: bdd0a63b49379c2546b8e95dc5c4ea4195a1b26a
    https://github.com/scummvm/scummvm/commit/bdd0a63b49379c2546b8e95dc5c4ea4195a1b26a
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-05-31T01:04:24+02:00

Commit Message:
SHERLOCK: adlib: fix "in-use" usage voiceOnOff()

Changed paths:
    engines/sherlock/scalpel/drivers/adlib.cpp



diff --git a/engines/sherlock/scalpel/drivers/adlib.cpp b/engines/sherlock/scalpel/drivers/adlib.cpp
index 8dee501..29ca1ba 100644
--- a/engines/sherlock/scalpel/drivers/adlib.cpp
+++ b/engines/sherlock/scalpel/drivers/adlib.cpp
@@ -479,7 +479,9 @@ void MidiDriver_AdLib::noteOn(byte MIDIchannel, byte note, byte velocity) {
 		if (oldestInUseChannel >= 0) {
 			// channel found
 			warning("used In-Use channel");
-			voiceOnOff(oldestInUseChannel, false, 0, 0);
+			// original driver used note 0, we use the current note
+			// because using note 0 could create a bad note (out of index) and we check that. Original driver didn't.
+			voiceOnOff(oldestInUseChannel, false, _channels[oldestInUseChannel].currentNote, 0);
 
 			_channels[oldestInUseChannel].inUse       = true;
 			_channels[oldestInUseChannel].inUseTimer  = 0; // safety, original driver also did this
@@ -542,7 +544,8 @@ void MidiDriver_AdLib::voiceOnOff(byte FMvoiceChannel, bool keyOn, byte note, by
 		frequencyOffset = note;
 	}
 	if (frequencyOffset >= SHERLOCK_ADLIB_NOTES_COUNT) {
-		error("bad note!");
+		warning("CRITICAL - bad note!!!");
+		return;
 	}
 	frequency = adlib_FrequencyLookUpTable[frequencyOffset];
 






More information about the Scummvm-git-logs mailing list