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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Dec 25 22:51:03 CET 2009


Revision: 46564
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46564&view=rev
Author:   m_kiewitz
Date:     2009-12-25 21:51:02 +0000 (Fri, 25 Dec 2009)

Log Message:
-----------
SCI/newmusic: Change to channel filtering for sci0early to reflect actual sierra driver behaviour

Modified Paths:
--------------
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
    scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp
    scummvm/trunk/engines/sci/sfx/softseq/pcjr.cpp

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-12-25 18:59:15 UTC (rev 46563)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-12-25 21:51:02 UTC (rev 46564)
@@ -1939,15 +1939,30 @@
 int SoundResource::getChannelFilterMask(int hardwareMask) {
 	byte *data = _innerResource->data;
 	int channelMask = 0;
+	int reverseHardwareMask = 0;
 
 	switch (_soundVersion) {
 	case SCI_VERSION_0_EARLY:
+		// TODO: MT32 driver uses no hardwaremask at all and uses all channels
+		switch (hardwareMask) {
+		case 0x01: // Adlib needs an additional reverse check against bit 3
+			reverseHardwareMask = 0x08;
+			break;
+		}
+		// Control-Channel -> where bit 0 is not set, bit 3 is set
 		data++; // Skip over digital sample flag
 		for (int channelNr = 0; channelNr < 16; channelNr++) {
 			channelMask = channelMask >> 1;
 			if (*data & hardwareMask) {
-				// this Channel is supposed to get played for hardware
+				if ((reverseHardwareMask == 0) || ((*data & reverseHardwareMask) == 0)) {
+					// this Channel is supposed to get played for hardware
+					channelMask |= 0x8000;
+				}
+			}
+			if ((*data & 0x08) && ((*data & 0x01) == 0)) {
+				// this channel is control channel, so don't filter it
 				channelMask |= 0x8000;
+				// TODO: We need to accept this channel in parseNextEvent() for events
 			}
 			data++;
 		}

Modified: scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp	2009-12-25 18:59:15 UTC (rev 46563)
+++ scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp	2009-12-25 21:51:02 UTC (rev 46564)
@@ -814,7 +814,7 @@
 int MidiPlayer_Adlib::getPlayMask(SciVersion soundVersion) {
 	switch (soundVersion) {
 	case SCI_VERSION_0_EARLY:
-		return 0x10; // FIXME: Not correct
+		return 0x01;
 	}
 	return 0x04;
 }

Modified: scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp	2009-12-25 18:59:15 UTC (rev 46563)
+++ scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp	2009-12-25 21:51:02 UTC (rev 46564)
@@ -666,7 +666,7 @@
 int MidiPlayer_Amiga::getPlayMask(SciVersion soundVersion) {
 	switch (soundVersion) {
 	case SCI_VERSION_0_EARLY:
-		return 0x40; // FIXME: Not correct
+		error("No amiga support for sci0early");
 	}
 	return 0x40;
 }

Modified: scummvm/trunk/engines/sci/sfx/softseq/pcjr.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/pcjr.cpp	2009-12-25 18:59:15 UTC (rev 46563)
+++ scummvm/trunk/engines/sci/sfx/softseq/pcjr.cpp	2009-12-25 21:51:02 UTC (rev 46564)
@@ -203,7 +203,7 @@
 int MidiPlayer_PCSpeaker::getPlayMask(SciVersion soundVersion) {
 	switch (soundVersion) {
 	case SCI_VERSION_0_EARLY:
-		return 0x20; // FIXME: Not correct
+		return 0x02;
 	}
 	return 0x20;
 }


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