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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jul 4 01:37:08 CEST 2009


Revision: 42081
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42081&view=rev
Author:   thebluegr
Date:     2009-07-03 23:37:08 +0000 (Fri, 03 Jul 2009)

Log Message:
-----------
SCI0 games using older graphics functions are automatically detected now, from the presence of the "TimesSin" and "SinMult" kernel functions. Removed the GF_SCI0_OLDGFXFUNCS game flag

Modified Paths:
--------------
    scummvm/trunk/engines/sci/detection.cpp
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sci.h

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/detection.cpp	2009-07-03 23:37:08 UTC (rev 42081)
@@ -31,9 +31,7 @@
 
 namespace Sci {
 
-// The 4 SCI0 engine generations (pre-395, pre-502, pre-629 and post-629)
-#define GF_FOR_SCI0_BEFORE_395 (GF_SCI0_OLD | GF_SCI0_OLDGFXFUNCS | GF_SCI0_OLDGETTIME)
-#define GF_FOR_SCI0_BEFORE_502 (GF_SCI0_OLDGFXFUNCS | GF_SCI0_OLDGETTIME)
+#define GF_FOR_SCI0_BEFORE_395 (GF_SCI0_OLD | GF_SCI0_OLDGETTIME)
 #define GF_FOR_SCI0_BEFORE_629 GF_SCI0_OLDGETTIME
 
 // SCI1
@@ -134,7 +132,7 @@
 		{"resource.map", 0, "f3d1be7752d30ba60614533d531e2e98", 474},
 		{"resource.001", 0, "6fd05926c2199af0af6f72f90d0d7260", 126895},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -1578,7 +1576,7 @@
 		{"resource.map", 0, "03dba704bb77da55a91ad27b5a3cac09", 528},
 		{"resource.001", 0, "9f5520f0297206928df0b0b36493cd33", 127532},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -1594,7 +1592,7 @@
 		{"resource.005", 0, "4a24443a25e2b1492462a52809605dc2", 277732},
 		{"resource.006", 0, "4a24443a25e2b1492462a52809605dc2", 345683},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2272,7 +2270,7 @@
 		{"resource.map", 0, "8b77d0d4650c2052b356cece28294b58", 576},
 		{"resource.001", 0, "376ef6d6eaaeed66e1424bd219c4b9ab", 215398},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2288,7 +2286,7 @@
 		{"resource.005", 0, "77f02def3094af804fd2371db25b7100", 349899},
 		{"resource.006", 0, "77f02def3094af804fd2371db25b7100", 354991},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2301,7 +2299,7 @@
 		{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 546000},
 		{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 591851},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2314,7 +2312,7 @@
 		{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 542897},
 		{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 586857},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2914,7 +2912,7 @@
 		{"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 746496},
 		{"resource.004", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 761984},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_0,
 		SCI_VERSION_0
 	},
@@ -2941,7 +2939,7 @@
 		{"resource.map", 0, "ec66ac2b1ce58b2575ba00b65058de1a", 612},
 		{"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 180245},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2954,7 +2952,7 @@
 		{"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720244},
 		{"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688367},
 		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},
@@ -2984,7 +2982,7 @@
 		{"resource.006", 0, "9107c2aa5398e28b5c5406df13491f85", 320643},
 		{"resource.007", 0, "9107c2aa5398e28b5c5406df13491f85", 344287},
 		{NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
-		GF_FOR_SCI0_BEFORE_502,
+		GF_FOR_SCI0_BEFORE_629,
 		SCI_VERSION_AUTODETECT,
 		SCI_VERSION_0
 	},

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-07-03 23:37:08 UTC (rev 42081)
@@ -89,7 +89,7 @@
 
 	s->priority_first = 42; // Priority zone 0 ends here
 
-	if (s->_flags & GF_SCI0_OLDGFXFUNCS)
+	if (s->_kernel->usesOldGfxFunctions())
 		s->priority_last = 200;
 	else
 		s->priority_last = 190;

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-07-03 23:37:08 UTC (rev 42081)
@@ -369,6 +369,10 @@
 
 	// Map a few special selectors for later use
 	mapSelectors();
+
+	// SCI0 games using old graphics functions (before version 0.000.502) have the TimesSin
+	// kernel function, whereas newer games have the SinMult kernel function in its place
+	_oldGfxFunctions = !hasKernelFunction("SinMult");
 }
 
 Kernel::~Kernel() {

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-07-03 23:37:08 UTC (rev 42081)
@@ -83,6 +83,14 @@
 	*/
 	bool hasKernelFunction(const char *functionName) const;
 
+	/* Applies to all versions before 0.000.502
+	** Old SCI versions used to interpret the third DrawPic() parameter inversely,
+	** with the opposite default value (obviously).
+	** Also, they used 15 priority zones from 42 to 200 instead of 14 priority
+	** zones from 42 to 190.
+	*/
+	bool usesOldGfxFunctions() const { return _oldGfxFunctions; }
+
 	// Script dissection/dumping functions
 	void dissectScript(int scriptNumber, Vocabulary *vocab);
 	void dumpScriptObject(char *data, int seeker, int objsize);
@@ -126,6 +134,7 @@
 	bool loadOpcodes();
 
 	ResourceManager *_resmgr;
+	bool _oldGfxFunctions;
 
 	// Kernel-related lists
 	/**

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-07-03 23:37:08 UTC (rev 42081)
@@ -164,7 +164,7 @@
 				return j;
 		return 14; // Maximum
 	} else {
-		if (!(s->_flags & GF_SCI0_OLDGFXFUNCS))
+		if (!s->_kernel->usesOldGfxFunctions())
 			return SCI0_VIEW_PRIORITY_14_ZONES(y);
 		else
 			return SCI0_VIEW_PRIORITY(y) == 15 ? 14 : SCI0_VIEW_PRIORITY(y);
@@ -172,7 +172,7 @@
 }
 
 int _find_priority_band(EngineState *s, int nr) {
-	if (!(s->_flags & GF_SCI0_OLDGFXFUNCS) && (nr < 0 || nr > 14)) {
+	if (!s->_kernel->usesOldGfxFunctions() && (nr < 0 || nr > 14)) {
 		if (nr == 15)
 			return 0xffff;
 		else {
@@ -181,7 +181,7 @@
 		return 0;
 	}
 
-	if ((s->_flags & GF_SCI0_OLDGFXFUNCS) && (nr < 0 || nr > 15)) {
+	if (s->_kernel->usesOldGfxFunctions() && (nr < 0 || nr > 15)) {
 		warning("Attempt to get priority band %d", nr);
 		return 0;
 	}
@@ -191,7 +191,7 @@
 	else {
 		int retval;
 
-		if (!(s->_flags & GF_SCI0_OLDGFXFUNCS))
+		if (!s->_kernel->usesOldGfxFunctions())
 			retval = SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr);
 		else
 			retval = SCI0_PRIORITY_BAND_FIRST(nr);
@@ -998,7 +998,7 @@
 	gfx_color_t transparent = s->wm_port->_bgcolor;
 	int picFlags = DRAWPIC01_FLAG_FILL_NORMALLY;
 
-	if (s->_flags & GF_SCI0_OLDGFXFUNCS)
+	if (s->_kernel->usesOldGfxFunctions())
 		add_to_pic = (argc > 2) ? argv[2].toSint16() : false;
 
 	dp.nr = argv[0].toSint16();
@@ -1052,7 +1052,7 @@
 
 	s->priority_first = 42;
 
-	if (s->_flags & GF_SCI0_OLDGFXFUNCS)
+	if (s->_kernel->usesOldGfxFunctions())
 		s->priority_last = 200;
 	else
 		s->priority_last = 190;

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-07-03 23:37:08 UTC (rev 42081)
@@ -158,7 +158,6 @@
 		// SCI1
 
 		if (flags & GF_SCI0_OLD ||
-			flags & GF_SCI0_OLDGFXFUNCS ||
 			flags & GF_SCI0_OLDGETTIME) {
 			error("This game entry is erroneous. It's marked as SCI1, but it has SCI0 flags set");
 		}
@@ -170,7 +169,6 @@
 		}
 
 		if (flags & GF_SCI0_OLD ||
-			flags & GF_SCI0_OLDGFXFUNCS ||
 			flags & GF_SCI0_OLDGETTIME) {
 			error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI0 flags set");
 		}

Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h	2009-07-03 23:02:37 UTC (rev 42080)
+++ scummvm/trunk/engines/sci/sci.h	2009-07-03 23:37:08 UTC (rev 42081)
@@ -96,18 +96,10 @@
 	*/
 	GF_SCI0_OLD				= (1 << 0),
 
-	/* Applies to all versions before 0.000.502
-	** Old SCI versions used to interpret the third DrawPic() parameter inversely,
-	** with the opposite default value (obviously).
-	** Also, they used 15 priority zones from 42 to 200 instead of 14 priority
-	** zones from 42 to 190.
-	*/
-	GF_SCI0_OLDGFXFUNCS		= (1 << 1),
-
 	/* Applies to all versions before 0.000.629
 	** Older SCI versions had simpler code for GetTime()
 	*/
-	GF_SCI0_OLDGETTIME		= (1 << 2),
+	GF_SCI0_OLDGETTIME		= (1 << 1),
 
 	// ----------------------------------------------------------------------------
 
@@ -118,18 +110,18 @@
 	/*
 	** Used to distinguish SCI1 EGA games
 	*/
-	GF_SCI1_EGA				= (1 << 3),
+	GF_SCI1_EGA				= (1 << 2),
 
 	/* Applies to all SCI1 versions after 1.000.200
     ** In late SCI1 versions, the argument of lofs[as] instructions
 	** is absolute rather than relative.
 	*/
-	GF_SCI1_LOFSABSOLUTE	= (1 << 4),
+	GF_SCI1_LOFSABSOLUTE	= (1 << 3),
 
 	/* Applies to all versions from 1.000.510 onwards
 	** kDoSound() is different than in earlier SCI1 versions.
 	*/
-	GF_SCI1_NEWDOSOUND		= (1 << 5)
+	GF_SCI1_NEWDOSOUND		= (1 << 4)
 };
 
 class SciEngine : public Engine {


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