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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Jul 14 13:29:56 CEST 2010


Revision: 50878
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50878&view=rev
Author:   m_kiewitz
Date:     2010-07-14 11:29:55 +0000 (Wed, 14 Jul 2010)

Log Message:
-----------
SCI: adding sound version 2.1, to properly add sci2.1 signature for kDoSound(play)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/features.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/sound/midiparser_sci.cpp

Modified: scummvm/trunk/engines/sci/engine/features.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/features.cpp	2010-07-14 11:10:33 UTC (rev 50877)
+++ scummvm/trunk/engines/sci/engine/features.cpp	2010-07-14 11:29:55 UTC (rev 50878)
@@ -140,6 +140,10 @@
 			// This game is using early SCI0 sound code (different headers than
 			// SCI0 late)
 			_doSoundType = SCI_VERSION_0_EARLY;
+#ifdef ENABLE_SCI32
+		} else if (getSciVersion() >= SCI_VERSION_2_1) {
+			_doSoundType = SCI_VERSION_2_1;
+#endif
 		} else if (SELECTOR(nodePtr) == -1) {
 			// No nodePtr selector, so this game is definitely using newer
 			// SCI0 sound code (i.e. SCI_VERSION_0_LATE)

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2010-07-14 11:10:33 UTC (rev 50877)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2010-07-14 11:29:55 UTC (rev 50878)
@@ -306,6 +306,7 @@
 #define SIG_SOUNDSCI0      SCI_VERSION_0_EARLY, SCI_VERSION_0_LATE
 #define SIG_SOUNDSCI1EARLY SCI_VERSION_1_EARLY, SCI_VERSION_1_EARLY
 #define SIG_SOUNDSCI1LATE  SCI_VERSION_1_LATE, SCI_VERSION_1_LATE
+#define SIG_SOUNDSCI21     SCI_VERSION_2_1, SCI_VERSION_2_1
 
 #define SIGFOR_ALL   0x3f
 #define SIGFOR_DOS   1 << 0
@@ -364,12 +365,7 @@
     { SIG_SOUNDSCI1LATE,   5, MAP_CALL(DoSoundSuspend),            "i",                    NULL },
     { SIG_SOUNDSCI1LATE,   6, MAP_CALL(DoSoundInit),               NULL,                   NULL },
     { SIG_SOUNDSCI1LATE,   7, MAP_CALL(DoSoundDispose),            NULL,                   NULL },
-    { SIG_SOUNDSCI1LATE,   8, MAP_CALL(DoSoundPlay),               "o(i)",                 NULL },
-    // ^^ HACK: In SCI2, the playBed method is removed (thus the second parameter
-    //  is now meaningless, but it's still passed and needed), and in SCI2.1 the second parameter is removed
-    //  altogether. We should actually create a new sound version called SCI21 to change the signature only
-    //  for this version and above. There should be no signature here at all, so that the signature for SCI1LATE
-    //  is taken from SCI1EARLY.
+    { SIG_SOUNDSCI1LATE,   8, MAP_CALL(DoSoundPlay),               NULL,                   NULL },
     { SIG_SOUNDSCI1LATE,   9, MAP_CALL(DoSoundStop),               NULL,                   NULL },
     { SIG_SOUNDSCI1LATE,  10, MAP_CALL(DoSoundPause),              NULL,                   NULL },
     { SIG_SOUNDSCI1LATE,  11, MAP_CALL(DoSoundFade),               "oiiii(i)",             kDoSoundFade_workarounds },
@@ -382,6 +378,30 @@
     { SIG_SOUNDSCI1LATE,  18, MAP_CALL(DoSoundSendMidi),           NULL,                   NULL },
     { SIG_SOUNDSCI1LATE,  19, MAP_CALL(DoSoundReverb),             NULL,                   NULL },
     { SIG_SOUNDSCI1LATE,  20, MAP_CALL(DoSoundUpdate),             NULL,                   NULL },
+    { SIG_SOUNDSCI21,      0, MAP_CALL(DoSoundMasterVolume),       NULL,                   NULL },
+    { SIG_SOUNDSCI21,      1, MAP_CALL(DoSoundMute),               NULL,                   NULL },
+    { SIG_SOUNDSCI21,      2, MAP_CALL(DoSoundDummy),              NULL,                   NULL },
+    { SIG_SOUNDSCI21,      3, MAP_CALL(DoSoundGetPolyphony),       NULL,                   NULL },
+    { SIG_SOUNDSCI21,      4, MAP_CALL(DoSoundGetAudioCapability), NULL,                   NULL },
+    { SIG_SOUNDSCI21,      5, MAP_CALL(DoSoundSuspend),            NULL,                   NULL },
+    { SIG_SOUNDSCI21,      6, MAP_CALL(DoSoundInit),               NULL,                   NULL },
+    { SIG_SOUNDSCI21,      7, MAP_CALL(DoSoundDispose),            NULL,                   NULL },
+    { SIG_SOUNDSCI21,      8, MAP_CALL(DoSoundPlay),               "o",                    NULL },
+    // ^^ TODO: if this is really the only change between SCI1LATE AND SCI21, we could rename the
+    //     SIG_SOUNDSCI1LATE #define to SIG_SINCE_SOUNDSCI1LATE and make it being SCI1LATE+. Although
+    //     I guess there are many more changes somewhere
+    { SIG_SOUNDSCI21,      9, MAP_CALL(DoSoundStop),               NULL,                   NULL },
+    { SIG_SOUNDSCI21,     10, MAP_CALL(DoSoundPause),              NULL,                   NULL },
+    { SIG_SOUNDSCI21,     11, MAP_CALL(DoSoundFade),               NULL,                   NULL },
+    { SIG_SOUNDSCI21,     12, MAP_CALL(DoSoundSetHold),            NULL,                   NULL },
+    { SIG_SOUNDSCI21,     13, MAP_CALL(DoSoundDummy),              NULL,                   NULL },
+    { SIG_SOUNDSCI21,     14, MAP_CALL(DoSoundSetVolume),          NULL,                   NULL },
+    { SIG_SOUNDSCI21,     15, MAP_CALL(DoSoundSetPriority),        NULL,                   NULL },
+    { SIG_SOUNDSCI21,     16, MAP_CALL(DoSoundSetLoop),            NULL,                   NULL },
+    { SIG_SOUNDSCI21,     17, MAP_CALL(DoSoundUpdateCues),         NULL,                   NULL },
+    { SIG_SOUNDSCI21,     18, MAP_CALL(DoSoundSendMidi),           NULL,                   NULL },
+    { SIG_SOUNDSCI21,     19, MAP_CALL(DoSoundReverb),             NULL,                   NULL },
+    { SIG_SOUNDSCI21,     20, MAP_CALL(DoSoundUpdate),             NULL,                   NULL },
     SCI_SUBOPENTRY_TERMINATOR
 };
 

Modified: scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.cpp	2010-07-14 11:10:33 UTC (rev 50877)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.cpp	2010-07-14 11:29:55 UTC (rev 50878)
@@ -516,6 +516,7 @@
 					break;
 				case SCI_VERSION_1_EARLY:
 				case SCI_VERSION_1_LATE:
+				case SCI_VERSION_2_1:
 					_dataincToAdd = 1;
 					break;
 				default:
@@ -672,6 +673,7 @@
 
 	case SCI_VERSION_1_EARLY:
 	case SCI_VERSION_1_LATE:
+	case SCI_VERSION_2_1:
 		// Send previous channel volumes again to actually update the volume
 		for (int i = 0; i < 15; i++)
 			if (_channelRemap[i] != -1)


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