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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Dec 21 16:32:00 CET 2010


Revision: 54984
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54984&view=rev
Author:   thebluegr
Date:     2010-12-21 15:31:59 +0000 (Tue, 21 Dec 2010)

Log Message:
-----------
SCI: Fixed bug #3092115 - "ECOQUEST2: Initial text not cleared during ecorder intro"

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

Modified: scummvm/trunk/engines/sci/engine/script_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-12-21 07:53:34 UTC (rev 54983)
+++ scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-12-21 15:31:59 UTC (rev 54984)
@@ -231,9 +231,71 @@
 	PATCH_END
 };
 
+// ===========================================================================
+// Same patch as above for the ecorder introduction. Fixes bug #3092115.
+// Two workarounds are needed for this patch in workarounds.cpp (when calling
+// kGraphFillBoxAny and kGraphUpdateBox), as there isn't enough space to patch
+// the function otherwise.
+const byte ecoquest2SignatureEcorderTutorial[] = {
+	36,
+	0x30, 0x23, 0x00,  // bnt [next state]
+	0x39, 0x0a,        // pushi 0a
+	0x5b, 0x04, 0x1f,  // lea temp[1f]
+	0x36,              // push
+	0x39, 0x64,        // pushi 64
+	0x39, 0x7d,        // pushi 7d
+	0x39, 0x32,        // pushi 32
+	0x39, 0x66,        // pushi 66
+	0x39, 0x17,        // pushi 17
+	0x39, 0x69,        // pushi 69
+	0x38, 0x31, 0x26,  // pushi 2631
+	0x39, 0x6a,        // pushi 6a
+	0x39, 0x64,        // pushi 64
+	0x43, 0x1b, 0x14,  // call kDisplay
+	0x35, 0x1e,        // ldi 1e
+	0x65, 0x20,        // aTop ticks
+	0x32,              // jmp [end]
+	// 2 extra bytes, jmp offset
+	0
+};
+
+const uint16 ecoquest2PatchEcorderTutorial[] = {
+	0x31, 0x23,        // bnt [next state] (save 1 byte)
+	// The parameter count below should be 7, but we're out of bytes 
+	// to patch! A workaround has been added because of this
+	0x78,              // push1 (parameter count)
+	//0x39, 0x07,        // pushi 07 (parameter count)
+	0x39, 0x0b,        // push (FillBoxAny)
+	0x39, 0x1d,        // pushi 29d
+	0x39, 0x73,        // pushi 115d
+	0x39, 0x5e,        // pushi 94d
+	0x38, 0xd7, 0x00,  // pushi 215d
+	0x78,              // push1 (visual screen)
+	0x39, 0x17,        // pushi 17 (color)
+	0x43, 0x6c, 0x0e,  // call kGraph
+	// The parameter count below should be 5, but we're out of bytes 
+	// to patch! A workaround has been added because of this
+	0x78,              // push1 (parameter count)
+	//0x39, 0x05,        // pushi 05 (parameter count)
+	0x39, 0x0c,        // pushi 12d (UpdateBox)
+	0x39, 0x1d,        // pushi 29d
+	0x39, 0x73,        // pushi 115d
+	0x39, 0x5e,        // pushi 94d
+	0x38, 0xd7, 0x00,  // pushi 215d
+	0x43, 0x6c, 0x0a,  // call kGraph
+	// We are out of bytes to patch at this point,
+	// so we skip 494 (0x1EE) bytes to reuse this code:
+	// ldi 1e
+	// aTop 20
+	// jmp 030e (jump to end)
+	0x32, 0xee, 0x01,  // skip 494 (0x1EE) bytes
+	PATCH_END
+};
+
 //    script, description,                                      magic DWORD,                                 adjust
 const SciScriptSignature ecoquest2Signatures[] = {
 	{     50, "initial text not removed on ecorder",         1, PATCH_MAGICDWORD(0x39, 0x64, 0x39, 0x7d),    -8, ecoquest2SignatureEcorder, ecoquest2PatchEcorder },
+	{    333, "initial text not removed on ecorder tutorial",1, PATCH_MAGICDWORD(0x39, 0x64, 0x39, 0x7d),    -9, ecoquest2SignatureEcorderTutorial, ecoquest2PatchEcorderTutorial },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 

Modified: scummvm/trunk/engines/sci/engine/workarounds.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-12-21 07:53:34 UTC (rev 54983)
+++ scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-12-21 15:31:59 UTC (rev 54984)
@@ -335,6 +335,7 @@
 
 //    gameID,           room,script,lvl,          object-name, method-name,    call,index,                workaround
 const SciWorkaroundEntry kGraphFillBoxAny_workarounds[] = {
+	{ GID_ECOQUEST2,     100,   333,  0,        "showEcorder", "changeState",    -1,    0, { WORKAROUND_STILLCALL, 0 } }, // necessary workaround for our ecorder script patch, because there isn't enough space to patch the function
 	{ GID_SQ4,            -1,   818,  0,     "iconTextSwitch", "show",           -1,    0, { WORKAROUND_STILLCALL, 0 } }, // CD: game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
@@ -357,6 +358,7 @@
 
 //    gameID,           room,script,lvl,          object-name, method-name,    call,index,                workaround
 const SciWorkaroundEntry kGraphUpdateBox_workarounds[] = {
+	{ GID_ECOQUEST2,     100,   333,  0,        "showEcorder", "changeState",    -1,    0, { WORKAROUND_STILLCALL, 0 } }, // necessary workaround for our ecorder script patch, because there isn't enough space to patch the function
 	{ GID_PQ3,           202,   202,  0,            "MapEdit", "movePt",         -1,    0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077
 	{ GID_PQ3,           202,   202,  0,            "MapEdit",  "addPt",         -1,    0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077
 	SCI_WORKAROUNDENTRY_TERMINATOR


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