aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorLars Skovlund2011-04-02 19:53:26 +0200
committerLars Skovlund2011-04-02 19:54:53 +0200
commit3ea76f39f90e4bfa6fab7f1021a5614d70b5571d (patch)
tree278163aab826ac8c806cdae769acc772faf0d82d /engines/sci/engine
parent71bfe714c184169723ad47eb64e47b4f3f44c2d6 (diff)
downloadscummvm-rg350-3ea76f39f90e4bfa6fab7f1021a5614d70b5571d.tar.gz
scummvm-rg350-3ea76f39f90e4bfa6fab7f1021a5614d70b5571d.tar.bz2
scummvm-rg350-3ea76f39f90e4bfa6fab7f1021a5614d70b5571d.zip
SCI: Fix SQ1 droid zapping issue with a script patch, thanks to
dhewg for reporting.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/script_patches.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 33e62b21ae..54ae88a17e 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -994,6 +994,53 @@ const SciScriptSignature sq4Signatures[] = {
SCI_SIGNATUREENTRY_TERMINATOR
};
+const byte sq1vgaSignatureEgoShowsCard[] = {
+ 25,
+ 0x38, 0x46, 0x02, // push 0x246 (set up send frame to set timesShownID)
+ 0x78, // push1
+ 0x38, 0x46, 0x02, // push 0x246 (set up send frame to get timesShownID)
+ 0x76, // push0
+ 0x51, 0x7c, // class DeltaurRegion
+ 0x4a, 0x04, // send 0x04 (get timesShownID)
+ 0x36, // push
+ 0x35, 0x01, // ldi 1
+ 0x02, // add
+ 0x36, // push
+ 0x51, 0x7c, // class DeltaurRegion
+ 0x4a, 0x06, // send 0x06 (set timesShownID)
+ 0x36, // push (wrong, acc clobbered by class, above)
+ 0x35, 0x03, // ldi 0x03
+ 0x22, // lt?
+ 0};
+
+// Note that this script patch is merely a reordering of the
+// instructions in the original script.
+const uint16 sq1vgaPatchEgoShowsCard[] = {
+ 0x38, 0x46, 0x02, // push 0x246 (set up send frame to get timesShownID)
+ 0x76, // push0
+ 0x51, 0x7c, // class DeltaurRegion
+ 0x4a, 0x04, // send 0x04 (get timesShownID)
+ 0x36, // push
+ 0x35, 0x01, // ldi 1
+ 0x02, // add
+ 0x36, // push (this push corresponds to the wrong one above)
+ 0x38, 0x46, 0x02, // push 0x246 (set up send frame to set timesShownID)
+ 0x78, // push1
+ 0x36, // push
+ 0x51, 0x7c, // class DeltaurRegion
+ 0x4a, 0x06, // send 0x06 (set timesShownID)
+ 0x35, 0x03, // ldi 0x03
+ 0x22, // lt?
+ PATCH_END};
+
+
+// script, description, magic DWORD, adjust
+const SciScriptSignature sq1vgaSignatures[] = {
+ { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70,
+ sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard },
+
+ SCI_SIGNATUREENTRY_TERMINATOR};
+
// will actually patch previously found signature area
void Script::applyPatch(const uint16 *patch, byte *scriptData, const uint32 scriptSize, int32 signatureOffset) {
byte orgData[PATCH_VALUELIMIT];
@@ -1128,6 +1175,9 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin
case GID_QFG3:
signatureTable = qfg3Signatures;
break;
+ case GID_SQ1:
+ signatureTable = sq1vgaSignatures;
+ break;
case GID_SQ4:
signatureTable = sq4Signatures;
break;