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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Aug 4 20:11:11 CEST 2010


Revision: 51743
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51743&view=rev
Author:   mthreepwood
Date:     2010-08-04 18:11:11 +0000 (Wed, 04 Aug 2010)

Log Message:
-----------
SCI: Fix bug #3038913 - SCI Fanmade - The Legend of the Lost Jewel: Crash by bugs

Added workaround for calling mul with an object and kSetAngle with two objects as parameters.

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

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-08-04 17:50:09 UTC (rev 51742)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-08-04 18:11:11 UTC (rev 51743)
@@ -1063,7 +1063,7 @@
 			if (validate_signedInteger(s->r_acc, value1) && validate_signedInteger(r_temp, value2))
 				s->r_acc = make_reg(0, value1 * value2);
 			else
-				s->r_acc = arithmetic_lookForWorkaround(opcode, NULL, s->r_acc, r_temp);
+				s->r_acc = arithmetic_lookForWorkaround(opcode, opcodeMulWorkarounds, s->r_acc, r_temp);
 			break;
 		}
 

Modified: scummvm/trunk/engines/sci/engine/workarounds.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-08-04 17:50:09 UTC (rev 51742)
+++ scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-08-04 18:11:11 UTC (rev 51743)
@@ -53,6 +53,12 @@
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,    call,index,             workaround
+const SciWorkaroundEntry opcodeMulWorkarounds[] = {
+	{ GID_FANMADE,        516,  983,  0,             "Wander", "setTarget",      -1,    0, { WORKAROUND_FAKE,   0 } }, // The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #3038913
+	SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+//    gameID,           room,script,lvl,          object-name, method-name,    call,index,             workaround
 const SciWorkaroundEntry opcodeOrWorkarounds[] = {
 	{ GID_ECOQUEST2,      100,    0,  0,               "Rain", "points",      0xcc6,    0, { WORKAROUND_FAKE,   0 } }, // when giving the papers to the customs officer, gets called against a pointer instead of a number - bug #3034464
 	SCI_WORKAROUNDENTRY_TERMINATOR
@@ -202,6 +208,7 @@
 
 //    gameID,           room,script,lvl,          object-name, method-name,    call,index,                workaround
 const SciWorkaroundEntry kGetAngle_workarounds[] = {
+	{ GID_FANMADE,       516,   992,  0,             "Motion", "init",           -1,    0, { WORKAROUND_IGNORE,    0 } }, // The Legend of the Lost Jewel Demo (fan made): called with third/fourth parameters as objects
 	{ GID_KQ6,           740,   752,  0,        "throwDazzle", "changeState",    -1,    0, { WORKAROUND_STILLCALL, 0 } }, // after the Genie is exposed in the Palace (short and long ending), it starts shooting lightning bolts around. An extra 5th parameter is passed - bug #3034610
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };

Modified: scummvm/trunk/engines/sci/engine/workarounds.h
===================================================================
--- scummvm/trunk/engines/sci/engine/workarounds.h	2010-08-04 17:50:09 UTC (rev 51742)
+++ scummvm/trunk/engines/sci/engine/workarounds.h	2010-08-04 18:11:11 UTC (rev 51743)
@@ -71,6 +71,7 @@
 extern const SciWorkaroundEntry opcodeDivWorkarounds[];
 extern const SciWorkaroundEntry opcodeDptoaWorkarounds[];
 extern const SciWorkaroundEntry opcodeGeWorkarounds[];
+extern const SciWorkaroundEntry opcodeMulWorkarounds[];
 extern const SciWorkaroundEntry opcodeOrWorkarounds[];
 extern const SciWorkaroundEntry uninitializedReadWorkarounds[];
 extern const SciWorkaroundEntry kAbs_workarounds[];


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