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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Aug 24 11:11:54 CEST 2010


Revision: 52320
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52320&view=rev
Author:   m_kiewitz
Date:     2010-08-24 09:11:53 +0000 (Tue, 24 Aug 2010)

Log Message:
-----------
SCI: changing signature of kRestoreGame

and changing patch code accordingly

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel_tables.h
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel_tables.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel_tables.h	2010-08-24 09:05:54 UTC (rev 52319)
+++ scummvm/trunk/engines/sci/engine/kernel_tables.h	2010-08-24 09:11:53 UTC (rev 52320)
@@ -412,7 +412,7 @@
     { MAP_CALL(ResCheck),          SIG_EVERYWHERE,           "ii(iiii)",              NULL,            NULL },
     { MAP_CALL(RespondsTo),        SIG_EVERYWHERE,           ".i",                    NULL,            NULL },
     { MAP_CALL(RestartGame),       SIG_EVERYWHERE,           "",                      NULL,            NULL },
-    { MAP_CALL(RestoreGame),       SIG_EVERYWHERE,           "[r0]i(r)",              NULL,            NULL },
+    { MAP_CALL(RestoreGame),       SIG_EVERYWHERE,           "[r0]i[r0]",             NULL,            NULL },
     { MAP_CALL(Said),              SIG_EVERYWHERE,           "[r0]",                  NULL,            NULL },
     { MAP_CALL(SaveGame),          SIG_EVERYWHERE,           "rir(r)",                NULL,            NULL },
     { MAP_CALL(ScriptID),          SIG_EVERYWHERE,           "[io](i)",               NULL,            NULL },

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2010-08-24 09:05:54 UTC (rev 52319)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2010-08-24 09:11:53 UTC (rev 52320)
@@ -655,6 +655,8 @@
 		}
 		// don't adjust ID of the saved game, it's already correct
 	} else {
+		if (argv[2].isNull())
+			error("kRestoreGame: called with parameter 2 being NULL");
 		// Real call from script, we need to adjust ID
 		if ((savegameId < SAVEGAMEID_OFFICIALRANGE_START) || (savegameId > SAVEGAMEID_OFFICIALRANGE_END)) {
 			warning("Savegame ID %d is not allowed", savegameId);

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-08-24 09:05:54 UTC (rev 52319)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-08-24 09:11:53 UTC (rev 52320)
@@ -331,10 +331,11 @@
 }
 
 static byte patchGameRestore[] = {
-	0x39, 0x02,        // pushi 02
+	0x39, 0x03,        // pushi 03
 	0x76,              // push0
 	0x38, 0xff, 0xff,  // pushi -1
-	0x43, 0xff, 0x04,  // call kRestoreGame (will get fixed directly)
+	0x76,              // push0
+	0x43, 0xff, 0x06,  // call kRestoreGame (will get fixed directly)
 	0x48,              // ret
 };
 
@@ -382,7 +383,7 @@
 		// Now patch in our code
 		byte *patchPtr = (byte *)scriptRestorePtr;
 		memcpy(patchPtr, patchGameRestore, sizeof(patchGameRestore));
-		patchPtr[7] = kernelIdRestore;
+		patchPtr[8] = kernelIdRestore;
 	}
 }
 


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