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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Dec 28 22:05:32 CET 2010


Revision: 55056
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55056&view=rev
Author:   thebluegr
Date:     2010-12-28 21:05:30 +0000 (Tue, 28 Dec 2010)

Log Message:
-----------
SCI: Fixed script bug #3038870 - "SCI Fanmade - Demo Quest: ScummVM hangs with typo" and
removed a related FIXME

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

Modified: scummvm/trunk/engines/sci/engine/kparse.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kparse.cpp	2010-12-28 13:13:55 UTC (rev 55055)
+++ scummvm/trunk/engines/sci/engine/kparse.cpp	2010-12-28 21:05:30 UTC (rev 55056)
@@ -143,16 +143,8 @@
 	} else {
 
 		s->r_acc = make_reg(0, 0);
-		// FIXME: When typing something wrong in the fanmade game Demo Quest,
-		// after the error dialog, the game checks for claimed to be 0 before
-		// showing a subsequent dialog. The following selector change causes
-		// it to be 1, thus causing the game to hang in an endless loop (bug
-		// #3038870. Thus, this seems to be wrong (since fanmade games use
-		// the original SCI interpreter), but we need to check against
-		// dissassembly. Since kParse is in the process of being dissassembled
-		// again, I'm leaving this FIXME in for now, so that it won't be
-		// forgotten :)
 		writeSelectorValue(segMan, event, SELECTOR(claimed), 1);
+
 		if (error) {
 			s->_segMan->strcpy(s->_segMan->getParserPtr(), error);
 			debugC(2, kDebugLevelParser, "Word unknown: %s", error);

Modified: scummvm/trunk/engines/sci/engine/script_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-12-28 13:13:55 UTC (rev 55055)
+++ scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-12-28 21:05:30 UTC (rev 55056)
@@ -300,6 +300,35 @@
 };
 
 // ===========================================================================
+// EventHandler::handleEvent in Demo Quest has a bug, and it jumps to the
+// wrong address when an incorrect word is typed, therefore leading to an
+// infinite loop. This script bug was not apparent in SSCI, probably because
+// event handling was slightly different there, so it was never discovered.
+// Fixes bug #3038870.
+const byte fanmadeSignatureInfiniteLoop[] = {
+	13,
+	0x38, 0x4c, 0x00,  // pushi 004c
+	0x39, 0x00,        // pushi 00
+	0x87, 0x01,        // lap 01
+	0x4b, 0x04,        // send 04
+	0x18,              // not
+	0x30, 0x2f, 0x00,  // bnt 002f  [06a5]	--> jmp ffbc  [0664] --> BUG! infinite loop
+	0
+};
+
+const uint16 fanmadePatchInfiniteLoop[] = {
+	PATCH_ADDTOOFFSET | +10,
+	0x30, 0x32, 0x00,  // bnt 0032  [06a8] --> pushi 004c
+	PATCH_END
+};
+
+//    script, description,                                      magic DWORD,                                 adjust
+const SciScriptSignature fanmadeSignatures[] = {
+	{    999, "infinite loop on typo",                       1, PATCH_MAGICDWORD(0x18, 0x30, 0x2f, 0x00),    -9, fanmadeSignatureInfiniteLoop, fanmadePatchInfiniteLoop },
+	SCI_SIGNATUREENTRY_TERMINATOR
+};
+
+// ===========================================================================
 //  script 0 of freddy pharkas/CD PointsSound::check waits for a signal and if
 //   no signal received will call kDoSound(0xD) which is a dummy in sierra sci
 //   and ScummVM and will use acc (which is not set by the dummy) to trigger
@@ -1172,6 +1201,9 @@
 	case GID_ECOQUEST2:
 		signatureTable = ecoquest2Signatures;
 		break;
+	case GID_FANMADE:
+		signatureTable = fanmadeSignatures;
+		break;
 	case GID_FREDDYPHARKAS:
 		signatureTable = freddypharkasSignatures;
 		break;


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