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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Aug 13 00:25:15 CEST 2010


Revision: 52046
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52046&view=rev
Author:   m_kiewitz
Date:     2010-08-12 22:25:15 +0000 (Thu, 12 Aug 2010)

Log Message:
-----------
SCI: adding patch for sq4/floppy

fixing endless flight, is actually a script data bug - there is an additional property, which is not included in property count. It's used. We return 0 in that case, because we don't know about that property, resulting in nest::x never get changed and the scripts check that for advancing

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

Modified: scummvm/trunk/engines/sci/engine/script_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-08-12 21:33:23 UTC (rev 52045)
+++ scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-08-12 22:25:15 UTC (rev 52046)
@@ -393,6 +393,35 @@
 };
 
 // ===========================================================================
+//  script 298 of sq4/floppy has an issue. object "nest" uses another property
+//   which isn't included in property count. We return 0 in that case, the game
+//   adds it to nest::x. The problem is that the script also checks if x exceeds
+//   we never reach that of course, so the pterodactyl-flight will go endlessly
+//   we could either calculate property count differently somehow fixing this
+//   but I think just patching it out is cleaner
+const byte sq4FloppySignatureEndlessFlight[] = {
+	8,
+	0x39, 0x04,       // pushi 04 (selector x)
+	0x78,             // push1
+	0x67, 0x08,       // pTos 08 (property x)
+	0x63, 0x44,       // pToa 44 (invalid property)
+	0x02,             // add
+	0
+};
+
+const uint16 sq4FloppyPatchEndlessFlight[] = {
+	PATCH_ADDTOOFFSET | +5,
+	0x35, 0x03,       // ldi 03 (which would be the content of the property)
+	PATCH_END
+};
+
+//    script, description,                                   magic DWORD,                                  adjust
+const SciScriptSignature sq4Signatures[] = {
+    {    298, "Floppy: endless flight",                      PATCH_MAGICDWORD(0x67, 0x08, 0x63, 0x44),    -3, sq4FloppySignatureEndlessFlight, sq4FloppyPatchEndlessFlight },
+    {      0, NULL,                                          0,                                            0, NULL,                            NULL }
+};
+
+// ===========================================================================
 // It seems to scripts warp ego outside the screen somehow (or maybe kDoBresen?)
 //  ego::mover is set to 0 and rm119::doit will crash in that case. This here
 //  fixes part of the problem and actually checks ego::mover to be 0 and skips
@@ -513,6 +542,8 @@
 		signatureTable = laurabow2Signatures;
 	if (g_sci->getGameId() == GID_LSL6)
 		signatureTable = larry6Signatures;
+	if (g_sci->getGameId() == GID_SQ4)
+		signatureTable = sq4Signatures;
 	if (g_sci->getGameId() == GID_SQ5)
 		signatureTable = sq5Signatures;
 


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