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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jul 4 18:30:21 CEST 2009


Revision: 42097
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42097&view=rev
Author:   thebluegr
Date:     2009-07-04 16:30:20 +0000 (Sat, 04 Jul 2009)

Log Message:
-----------
- Merged the "early" and "late" SCI1 versions - these are functionally equivalent, and the code that does the version check is unreliable (e.g. it sets SQ1 VGA to SCI1 "late" and EcoQuest 1 to SCI1 "early")
- Cleanup of the vocabulary setting functions
- Cleanup of the cursor manipulation code

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/script.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/resource.h
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sci.h

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-07-04 16:30:20 UTC (rev 42097)
@@ -386,6 +386,7 @@
 
 		Common::String tmp((const char *)r->data + offset + 2, len);
 		_selectorNames.push_back(tmp);
+		//printf("%s\n", tmp.c_str());	// debug
 
 		// Early SCI versions used the LSB in the selector ID as a read/write
 		// toggle. To compensate for that, we add every selector name twice.
@@ -751,6 +752,11 @@
 			offset = 4;
 		}
 	}
+
+	if (_resmgr->_sciVersion == SCI_VERSION_1_1) {
+		// KQ6CD calls unimplemented function 0x26
+		_kernelNames[0x26] = "Dummy";
+	}
 }
 
 #ifdef ENABLE_SCI32
@@ -788,14 +794,9 @@
 	case SCI_VERSION_01:
 	case SCI_VERSION_01_VGA:
 	case SCI_VERSION_01_VGA_ODD:
-	case SCI_VERSION_1_EARLY:
-	case SCI_VERSION_1_LATE:
+	case SCI_VERSION_1:
 	case SCI_VERSION_1_1:
 		setDefaultKernelNames();
-		if (_resmgr->_sciVersion == SCI_VERSION_1_1) {
-			// KQ6CD calls unimplemented function 0x26
-			_kernelNames[0x26] = "Dummy";
-		}
 		break;
 #ifdef ENABLE_SCI32
 	case SCI_VERSION_32:

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-07-04 16:30:20 UTC (rev 42097)
@@ -304,7 +304,9 @@
 reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	switch (argc) {
 	case 1 :
-		if (s->_version < SCI_VERSION_1_1) {
+		if (s->_version < SCI_VERSION_1) {
+			GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, argv[0].toSint16()));
+		} else if (s->_version == SCI_VERSION_1) {
 			if (argv[0].toSint16() <= 1) {
 				// Newer (SCI1.1) semantics: show/hide cursor
 				CursorMan.showMouse(argv[0].toSint16() != 0);
@@ -312,13 +314,16 @@
 				// Pre-SCI1.1: set cursor according to the first parameter
 				GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, argv[0].toSint16()));
 			}
-		} else {
+		} else if (s->_version >= SCI_VERSION_1_1) {
 			// SCI1.1: Show/hide cursor
 			CursorMan.showMouse(argv[0].toSint16() != 0);
 		}
 		break;
 	case 2 :
-		if (s->_version < SCI_VERSION_1_1) {
+		if (s->_version < SCI_VERSION_1) {
+			GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, 
+						argv[1].toSint16() == 0 ? GFXOP_NO_POINTER : argv[0].toSint16()));
+		} else if (s->_version == SCI_VERSION_1) {
 			// Pre-SCI1.1: set cursor according to the first parameter, and toggle its
 			// visibility based on the second parameter
 			// Some late SCI1 games actually use the SCI1.1 version of this call (EcoQuest 1
@@ -337,7 +342,7 @@
 				GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, 
 							Common::Point(argv[0].toUint16(), argv[1].toUint16())));
 			}
-		} else {
+		} else if (s->_version >= SCI_VERSION_1_1) {
 			// SCI1.1 and newer: set pointer position
 			GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, 
 						Common::Point(argv[0].toUint16(), argv[1].toUint16())));

Modified: scummvm/trunk/engines/sci/engine/script.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script.cpp	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/engine/script.cpp	2009-07-04 16:30:20 UTC (rev 42097)
@@ -97,8 +97,7 @@
 		break;
 	case SCI_VERSION_01_VGA:
 	case SCI_VERSION_01_VGA_ODD:
-	case SCI_VERSION_1_EARLY:
-	case SCI_VERSION_1_LATE:
+	case SCI_VERSION_1:
 	case SCI_VERSION_1_1:
 		g_opcode_formats[op_lofsa][0] = Script_Offset;
 		g_opcode_formats[op_lofss][0] = Script_Offset;

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-07-04 16:30:20 UTC (rev 42097)
@@ -534,7 +534,7 @@
 			view = gfxr_draw_view0(resid, viewRes->data, viewRes->size, -1);
 		else if (_version == SCI_VERSION_01 || !_isVGA)
 			view = gfxr_draw_view0(resid, viewRes->data, viewRes->size, palette);
-		else if (_version >= SCI_VERSION_01_VGA && _version <= SCI_VERSION_1_LATE)
+		else if (_version >= SCI_VERSION_01_VGA && _version <= SCI_VERSION_1)
 			view = gfxr_draw_view1(resid, viewRes->data, viewRes->size, _staticPalette, false);
 		else if (_version >= SCI_VERSION_1_1)
 			view = gfxr_draw_view1(resid, viewRes->data, viewRes->size, 0, true);

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-07-04 16:30:20 UTC (rev 42097)
@@ -509,16 +509,9 @@
 		case SCI_VERSION_01_VGA_ODD:
 			version = _mapVersion;
 			break;
-		case SCI_VERSION_1: {
-			Resource *res = testResource(ResourceId(kResourceTypeScript, 0));
-
-			_sciVersion = version = SCI_VERSION_1_EARLY;
-			loadResource(res);
-
-			if (res->status == kResStatusNoMalloc)
-				version = SCI_VERSION_1_LATE;
+		case SCI_VERSION_1:
+			_sciVersion = version = SCI_VERSION_1;
 			break;
-		}
 		case SCI_VERSION_1_1:
 			// No need to handle SCI 1.1 here - it was done in resource_map.cpp
 			version = SCI_VERSION_1_1;
@@ -542,12 +535,9 @@
 	case SCI_VERSION_01_VGA_ODD:
 		debug("Resmgr: Detected SCI01VGA - Jones/CD or similar");
 		break;
-	case SCI_VERSION_1_EARLY:
-		debug("Resmgr: Detected SCI1 Early");
+	case SCI_VERSION_1:
+		debug("Resmgr: Detected SCI1");
 		break;
-	case SCI_VERSION_1_LATE:
-		debug("Resmgr: Detected SCI1 Late");
-		break;
 	case SCI_VERSION_1_1:
 		debug("Resmgr: Detected SCI1.1");
 		break;

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/resource.h	2009-07-04 16:30:20 UTC (rev 42097)
@@ -66,8 +66,6 @@
 	/* the first critical error number */
 };
 
-#define SCI_VERSION_1 SCI_VERSION_1_EARLY
-
 #define MAX_OPENED_VOLUMES 5 // Max number of simultaneously opened volumes
 
 enum ResSourceType {

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-07-04 16:30:20 UTC (rev 42097)
@@ -147,13 +147,13 @@
 	_gamestate = new EngineState(_resmgr, version, flags);
 
 	// Verify that we haven't got an invalid game detection entry
-	if (version < SCI_VERSION_1_EARLY) {
+	if (version < SCI_VERSION_1) {
 		// SCI0/SCI01
 		if (flags & GF_SCI1_EGA ||
 			flags & GF_SCI1_LOFSABSOLUTE) {
 			error("This game entry is erroneous. It's marked as SCI0/SCI01, but it has SCI1 flags set");
 		}
-	} else if (version >= SCI_VERSION_1_EARLY && version <= SCI_VERSION_1_LATE) {
+	} else if (version == SCI_VERSION_1) {
 		// SCI1
 
 		if (flags & GF_SCI0_OLD ||

Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h	2009-07-04 16:24:15 UTC (rev 42096)
+++ scummvm/trunk/engines/sci/sci.h	2009-07-04 16:30:20 UTC (rev 42097)
@@ -73,8 +73,7 @@
 	SCI_VERSION_01 = 2,
 	SCI_VERSION_01_VGA = 3,
 	SCI_VERSION_01_VGA_ODD = 4,
-	SCI_VERSION_1_EARLY = 5,
-	SCI_VERSION_1_LATE = 6,
+	SCI_VERSION_1 = 5,
 	SCI_VERSION_1_1 = 7,
 	SCI_VERSION_32 = 8
 };


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