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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jul 10 21:58:26 CEST 2010


Revision: 50790
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50790&view=rev
Author:   m_kiewitz
Date:     2010-07-10 19:58:25 +0000 (Sat, 10 Jul 2010)

Log Message:
-----------
SCI: removing hoyle workaround from kAbs & signature and adding it into workaround table

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kmath.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2010-07-10 19:24:12 UTC (rev 50789)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2010-07-10 19:58:25 UTC (rev 50790)
@@ -242,6 +242,14 @@
 // .* -> any parameters afterwards (or none)
 
 //    gameID,       scriptNr,lvl,         object-name, method-name,    call, index,   replace
+static const SciWorkaroundEntry kAbs_workarounds[] = {
+	{ GID_HOYLE1,          1,  0,              "room1", "doit",           -1,    0, { 2, 0x3e9 } }, // crazy eights - called with objects instead of integers
+	{ GID_HOYLE1,          2,  0,              "room2", "doit",           -1,    0, { 2, 0x3e9 } }, // old maid - called with objects instead of integers
+	{ GID_HOYLE1,          3,  0,              "room3", "doit",           -1,    0, { 2, 0x3e9 } }, // hearts - called with objects instead of integers
+	SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+//    gameID,       scriptNr,lvl,         object-name, method-name,    call, index,   replace
 static const SciWorkaroundEntry kDisposeScript_workarounds[] = {
 	{ GID_QFG1,           64,  0,               "rm64", "dispose",        -1,    0, { 1,    0 } }, // parameter 0 is an object when leaving graveyard
 	SCI_WORKAROUNDENTRY_TERMINATOR
@@ -412,8 +420,7 @@
 
 //    name,                        version/platform,         signature,              sub-signatures,  workarounds
 static SciKernelMapEntry s_kernelMap[] = {
-    { MAP_CALL(Abs),               SIG_EVERYWHERE,           "[io]",                  NULL,            NULL },
-	//  ^^ FIXME hoyle
+    { MAP_CALL(Abs),               SIG_EVERYWHERE,           "i",                     NULL,            kAbs_workarounds },
     { MAP_CALL(AddAfter),          SIG_EVERYWHERE,           "lnn",                   NULL,            NULL },
     { MAP_CALL(AddMenu),           SIG_EVERYWHERE,           "rr",                    NULL,            NULL },
     { MAP_CALL(AddToEnd),          SIG_EVERYWHERE,           "ln",                    NULL,            NULL },

Modified: scummvm/trunk/engines/sci/engine/kmath.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmath.cpp	2010-07-10 19:24:12 UTC (rev 50789)
+++ scummvm/trunk/engines/sci/engine/kmath.cpp	2010-07-10 19:58:25 UTC (rev 50790)
@@ -36,12 +36,6 @@
 }
 
 reg_t kAbs(EngineState *s, int argc, reg_t *argv) {
-	if (g_sci->getGameId() == GID_HOYLE1) {
-		// This is a hack, but so is the code in Hoyle1 that needs it.
-		// FIXME: where is this exactly needed?
-		if (argv[0].segment)
-			return make_reg(0, 0x3e9); // Yes people, this is an object
-	}
 	return make_reg(0, abs(argv[0].toSint16()));
 }
 

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-07-10 19:24:12 UTC (rev 50789)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-07-10 19:58:25 UTC (rev 50790)
@@ -796,6 +796,8 @@
 			error("[VM] k%s[%x]: signature mismatch via method %s::%s (script %d, localCall %x)", kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, originReply.localCallOffset);
 		}
 		// FIXME: implement some real workaround type logic - ignore call, still do call etc.
+		if (workaround.segment == 2)
+			s->r_acc = make_reg(0, workaround.offset);
 		if (workaround.segment)
 			return;
 	}
@@ -838,6 +840,8 @@
 				error("[VM] k%s: signature mismatch via method %s::%s (script %d, localCall %x)", kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, originReply.localCallOffset);
 			}
 			// FIXME: implement some real workaround type logic - ignore call, still do call etc.
+			if (workaround.segment == 2)
+				s->r_acc = make_reg(0, workaround.offset);
 			if (workaround.segment)
 				return;
 		}


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