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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Aug 10 17:18:19 CEST 2010


Revision: 51951
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51951&view=rev
Author:   m_kiewitz
Date:     2010-08-10 15:18:18 +0000 (Tue, 10 Aug 2010)

Log Message:
-----------
SCI: adding patch for eq1cd

fixes ego swimming left/right of room 660 and getting a "message not found" error and a GE? signature mismatch - in sierra sci this also resulted in "message not found" and a hang afterwards - bug #3038387

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/script.cpp
    scummvm/trunk/engines/sci/engine/script_patches.cpp

Modified: scummvm/trunk/engines/sci/engine/script.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script.cpp	2010-08-10 13:18:13 UTC (rev 51950)
+++ scummvm/trunk/engines/sci/engine/script.cpp	2010-08-10 15:18:18 UTC (rev 51951)
@@ -332,6 +332,8 @@
 	if (offset == 0) {
 		// Check if the game has a second export table (e.g. script 912 in Camelot)
 		// Fixes bug #3039785
+		if (g_sci->getGameId() == GID_ECOQUEST) // cheap fix in here for eco quest 1, [md5] plz look into this TODO FIXME
+			return offset;
 		const uint16 *secondExportTable = (const uint16 *)findBlock(SCI_OBJ_EXPORTS, 0);
 
 		if (secondExportTable) {

Modified: scummvm/trunk/engines/sci/engine/script_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-08-10 13:18:13 UTC (rev 51950)
+++ scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-08-10 15:18:18 UTC (rev 51951)
@@ -51,7 +51,71 @@
 //  - if not EOS, an adjust offset and the actual bytes
 //  - rinse and repeat
 
+// stayAndHelp::changeState (0) is called when ego swims to the left or right
+//  boundaries of room 660. Normally a textbox is supposed to get on screen
+//  but the call is wrong, so not only do we get an error message the script
+//  is also hanging because the cue won't get sent out
+//  This also happens in sierra sci - ffs. bug #3038387
+const byte ecoquest1SignatureStayAndHelp[] = {
+	40,
+	0x3f, 0x01,        // link 01
+	0x87, 0x01,        // lap param[1]
+	0x65, 0x14,        // aTop state
+	0x36,              // push
+	0x3c,              // dup
+	0x35, 0x00,        // ldi 00
+	0x1a,              // eq?
+	0x31, 0x1c,        // bnt [next state]
+	0x76,              // push0
+	0x45, 0x01, 0x00,  // callb export1 from script 0 (switching control off)
+	0x38, 0x22, 0x01,  // pushi 0122
+	0x78,              // push1
+	0x76,              // push0
+	0x81, 0x00,        // lag global[0]
+	0x4a, 0x06,        // send 06 - ego::setMotion(0)
+	0x39, 0x6e,        // pushi 6e (selector init)
+	0x39, 0x04,        // pushi 04
+	0x76,              // push0
+	0x76,              // push0
+	0x39, 0x17,        // pushi 17
+	0x7c,              // pushSelf
+	0x51, 0x82,        // class EcoNarrator
+	0x4a, 0x0c,        // send 0c - EcoNarrator::init(0, 0, 23, self) (BADLY BROKEN!)
+	0x33,              // jmp [end]
+	0
+};
 
+const uint16 ecoquest1PatchStayAndHelp[] = {
+	0x87, 0x01,        // lap param[1]
+	0x65, 0x14,        // aTop state
+	0x36,              // push
+	0x2f, 0x22,        // bt [next state] (this optimization saves 6 bytes)
+	0x39, 0x00,        // pushi 0 (wasting 1 byte here)
+	0x45, 0x01, 0x00,  // callb export1 from script 0 (switching control off)
+	0x38, 0x22, 0x01,  // pushi 0122
+	0x78,              // push1
+	0x76,              // push0
+	0x81, 0x00,        // lag global[0]
+	0x4a, 0x06,        // send 06 - ego::setMotion(0)
+	0x39, 0x6e,        // pushi 6e (selector init)
+	0x39, 0x06,        // pushi 06
+	0x39, 0x02,        // pushi 02 (additional 2 bytes)
+	0x76,              // push0
+	0x76,              // push0
+	0x39, 0x17,        // pushi 17
+	0x7c,              // pushSelf
+	0x38, 0x80, 0x02,  // pushi 280 (additional 3 bytes)
+	0x51, 0x82,        // class EcoNarrator
+	0x4a, 0x10,        // send 10 - EcoNarrator::init(2, 0, 0, 23, self, 640)
+	PATCH_END
+};
+
+//    script, description,                                   magic DWORD,                                 adjust
+const SciScriptSignature ecoquest1Signatures[] = {
+    {    660, "CD: bad messagebox and freeze",               PATCH_MAGICDWORD(0x38, 0x22, 0x01, 0x78),   -17, ecoquest1SignatureStayAndHelp, ecoquest1PatchStayAndHelp },
+    {      0, NULL,                                          0,                                            0, NULL,                          NULL }
+};
+
 // daySixBeignet::changeState (4) is called when the cop goes out and sets cycles to 220.
 //  this is not enough time to get to the door, so we patch that to 23 seconds
 const byte gk1SignatureDay6PoliceBeignet[] = {
@@ -346,6 +410,8 @@
 
 void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uint32 scriptSize) {
 	const SciScriptSignature *signatureTable = NULL;
+	if (g_sci->getGameId() == GID_ECOQUEST)
+		signatureTable = ecoquest1Signatures;
 	if (g_sci->getGameId() == GID_GK1)
 		signatureTable = gk1Signatures;
 // hoyle4 now works due workaround inside GfxPorts


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