[Scummvm-cvs-logs] SF.net SVN: scummvm:[50021] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Jun 18 17:18:15 CEST 2010


Revision: 50021
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50021&view=rev
Author:   thebluegr
Date:     2010-06-18 15:18:14 +0000 (Fri, 18 Jun 2010)

Log Message:
-----------
Fixed show_instruments to ignore instruments in Sierra's special MIDI channel 15, and updated the comment regarding PQ2 accordingly (it only has 2 incorrect instruments)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/sound/drivers/adlib.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-06-18 14:48:39 UTC (rev 50020)
+++ scummvm/trunk/engines/sci/console.cpp	2010-06-18 15:18:14 UTC (rev 50021)
@@ -919,19 +919,21 @@
 			prevEvent = curEvent;
 			command = curEvent >> 4;
 
+			byte channel;
+
 			switch (command) {
 			case 0xC:	// program change
-				{
-				//byte channel = curEvent & 0x0F;
-				byte instrument = *channelData++;
-				if (!firstOneShown)
-					firstOneShown = true;					
-				else
-					DebugPrintf(",");
+				channel = curEvent & 0x0F;
+				if (channel != 15) {	// SCI special
+					byte instrument = *channelData++;
+					if (!firstOneShown)
+						firstOneShown = true;					
+					else
+						DebugPrintf(",");
 
-				DebugPrintf(" %d", instrument);
-				instruments[instrument]++;
-				instrumentsSongs[instrument][itr->getNumber()] = true;
+					DebugPrintf(" %d", instrument);
+					instruments[instrument]++;
+					instrumentsSongs[instrument][itr->getNumber()] = true;
 				}
 				break;
 			case 0xD:

Modified: scummvm/trunk/engines/sci/sound/drivers/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/drivers/adlib.cpp	2010-06-18 14:48:39 UTC (rev 50020)
+++ scummvm/trunk/engines/sci/sound/drivers/adlib.cpp	2010-06-18 15:18:14 UTC (rev 50021)
@@ -703,13 +703,9 @@
 
 void MidiDriver_AdLib::setPatch(int voice, int patch) {
 	if ((patch < 0) || ((uint)patch >= _patches.size())) {
-		// This happens a lot at least in PQ2. This game has a small patch.003 (1344 bytes),
-		// containing 48 instruments. However it has several songs which use instruments
-		// not specified in that patch (namely, songs 1, 3, 5, 9, 15, 16, 17, 23, 25, 27,
-		// 29, 32, 36, 38, 44, 45, 46 all use instruments not specified in patch.003).
-		// These were probably written for MT32. These warnings in PQ2 can probably go away
-		// if a bigger patch.003 file is used (one that contains all the instruments used
-		// by the songs, i.e. 5382 bytes)
+		// This happens with songs 1 and 23 in PQ2. Song 1 (the title song) uses an invalid
+		// instrument 80, and song 23 (car horn when the car runs over you at the airport,
+		// rooms 14/15) an invalid instrument 89. These are probably leftovers from MT32.
 		warning("ADLIB: Invalid patch %i requested (patch.003 contains %d instruments)", 
 			patch, _patches.size());
 		patch = 0;
@@ -768,6 +764,7 @@
 		for (int i = 48; i < 96; i++)
 			loadInstrument(data + 2 + (28 * i));
 	} else if (size == 5382) {
+		// SCI1.1 and later
 		for (int i = 48; i < 190; i++)
 			loadInstrument(data + (28 * i));
 		_rhythmKeyMap = new byte[kRhythmKeys];


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list