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

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Fri May 15 00:33:31 CEST 2009


Revision: 40575
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40575&view=rev
Author:   waltervn
Date:     2009-05-14 22:33:31 +0000 (Thu, 14 May 2009)

Log Message:
-----------
SCI: A provisional fix for the "invalid selector" problem in KQ6 and other
SCI1.1 games.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/vm.h

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-05-14 21:51:36 UTC (rev 40574)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-05-14 22:33:31 UTC (rev 40575)
@@ -863,8 +863,16 @@
 #endif
 
 		// Copy base from species class, as we need its selector IDs
-		obj->_variables[6] = INST_LOOKUP_CLASS(obj->_variables[6].offset);
+		obj->_variables[SCRIPT_SUPERCLASS_SELECTOR] = INST_LOOKUP_CLASS(obj->_variables[SCRIPT_SUPERCLASS_SELECTOR].offset);
 
+		// Set the -classScript- selector to the script number.
+		// FIXME: As this selector is filled in at run-time, it is likely
+		// that it is supposed to hold a pointer. The Obj::isKindOf method
+		// uses this selector together with -propDict- to compare classes.
+		// For the purpose of Obj::isKindOf, using the script number appears
+		// to be sufficient.
+		obj->_variables[SCRIPT_CLASSSCRIPT_SELECTOR] = make_reg(0, scr->nr);
+
 		seeker += READ_LE_UINT16(seeker + 2) * 2;
 	}
 }

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2009-05-14 21:51:36 UTC (rev 40574)
+++ scummvm/trunk/engines/sci/engine/vm.h	2009-05-14 22:33:31 UTC (rev 40575)
@@ -203,6 +203,7 @@
 /*---------------------------------*/
 #define SCRIPT_SPECIES_SELECTOR (s->version < SCI_VERSION(1,001,000) ? 0 : 5)
 #define SCRIPT_SUPERCLASS_SELECTOR (s->version < SCI_VERSION(1,001,000) ? 1 : 6)
+#define SCRIPT_CLASSSCRIPT_SELECTOR 4
 
 /** Magic adjustment value for lofsa and lofss */
 #define SCRIPT_LOFS_MAGIC 3


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