aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2010-08-12 22:25:15 +0000
committerMartin Kiewitz2010-08-12 22:25:15 +0000
commit4309d8c00c05def81b921f76ece023cf6d3ab7bc (patch)
tree44dd5ba6dc4909ea07473d128c9544b2d849cc74 /engines
parentf1ad1f1738976fc33c0797f60eb89475bd70b39e (diff)
downloadscummvm-rg350-4309d8c00c05def81b921f76ece023cf6d3ab7bc.tar.gz
scummvm-rg350-4309d8c00c05def81b921f76ece023cf6d3ab7bc.tar.bz2
scummvm-rg350-4309d8c00c05def81b921f76ece023cf6d3ab7bc.zip
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 svn-id: r52046
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/script_patches.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 3ec5e7331e..88411c1b98 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -393,6 +393,35 @@ const SciScriptSignature laurabow2Signatures[] = {
};
// ===========================================================================
+// 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 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin
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;