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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Jul 12 11:24:19 CEST 2010


Revision: 50814
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50814&view=rev
Author:   m_kiewitz
Date:     2010-07-12 09:24:18 +0000 (Mon, 12 Jul 2010)

Log Message:
-----------
SCI: add workaround for lsl6 restore issue (needs to get further investigated), hunk segment is used but hunk segment isn't existant at that point when restoring the game

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.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-12 08:59:43 UTC (rev 50813)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2010-07-12 09:24:18 UTC (rev 50814)
@@ -262,6 +262,13 @@
 };
 
 //    gameID,       scriptNr,lvl,         object-name, method-name,    call, index,   replace
+static const SciWorkaroundEntry kGraphRestoreBox_workarounds[] = {
+    { GID_LSL6,           86,  0,             "LL6Inv", "show",           -1,    0, { 1,    0 } }, // happens when restoring, is called with hunk segment, but hunk is not allocated at that time
+    // ^^ TODO: check, if this is really a script error or an issue with our restore code
+    SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+//    gameID,       scriptNr,lvl,         object-name, method-name,    call, index,   replace
 static const SciWorkaroundEntry kGraphFillBoxAny_workarounds[] = {
     { GID_SQ4,           818,  0,     "iconTextSwitch", "show",           -1,    0, { 0,    0 } }, // game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack
     SCI_WORKAROUNDENTRY_TERMINATOR
@@ -380,7 +387,7 @@
     // 5 - nop
     // 6 - draw pattern
     { SIG_SCIALL,          7, MAP_CALL(GraphSaveBox),              "iiiii",                NULL },
-    { SIG_SCIALL,          8, MAP_CALL(GraphRestoreBox),           "[r0!]",                NULL },
+    { SIG_SCIALL,          8, MAP_CALL(GraphRestoreBox),           "[r0!]",                kGraphRestoreBox_workarounds },
     // ^ this may get called with invalid references, we check them within restoreBits() and sierra sci behaves the same
     { SIG_SCIALL,          9, MAP_CALL(GraphFillBoxBackground),    "iiii",                 NULL },
     { SIG_SCIALL,         10, MAP_CALL(GraphFillBoxForeground),    "iiii",                 NULL },
@@ -504,7 +511,7 @@
     { MAP_CALL(GetTime),           SIG_EVERYWHERE,           "(i)",                   NULL,            NULL },
     { MAP_CALL(GlobalToLocal),     SIG_SCI32, SIGFOR_ALL,    "oo",                    NULL,            NULL },
     { MAP_CALL(GlobalToLocal),     SIG_EVERYWHERE,           "o",                     NULL,            NULL },
-    { MAP_CALL(Graph),             SIG_EVERYWHERE,           "i([!.]*)",              kGraph_subops,   NULL },
+    { MAP_CALL(Graph),             SIG_EVERYWHERE,           NULL,                    kGraph_subops,   NULL },
     { MAP_CALL(HaveMouse),         SIG_EVERYWHERE,           "",                      NULL,            NULL },
     { MAP_CALL(HiliteControl),     SIG_EVERYWHERE,           "o",                     NULL,            NULL },
     { MAP_CALL(InitBresen),        SIG_EVERYWHERE,           "o(i)",                  NULL,            NULL },
@@ -726,6 +733,10 @@
 	bool optional = false;
 	bool hadOptional = false;
 
+	// No signature given? no signature out
+	if (!writtenSig)
+		return NULL;
+
 	// First, we check how many bytes the result will be
 	//  we also check, if the written signature makes any sense
 	curPos = writtenSig;

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-07-12 08:59:43 UTC (rev 50813)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-07-12 09:24:18 UTC (rev 50814)
@@ -839,6 +839,8 @@
 		// Sub-functions available, check signature and call that one directly
 		if (argc < 1)
 			error("[VM] k%s[%x]: no subfunction-id parameter given", kernelCall.name, kernelCallNr);
+		if (argv[0].segment)
+			error("[VM] k%s[%x]: given subfunction-id is actually a pointer", kernelCall.name, kernelCallNr);
 		const uint16 subId = argv[0].toUint16();
 		// Skip over subfunction-id
 		argc--;


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