diff options
author | Filippos Karapetis | 2010-12-21 15:31:59 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-12-21 15:31:59 +0000 |
commit | 3a14a7760e0fb2b59e9666cb14d227b276e29f6d (patch) | |
tree | e48e849d7d7966a4710659560b4460cafa60a7cf | |
parent | 75649f89038add203e483f43bac0f4d13870704b (diff) | |
download | scummvm-rg350-3a14a7760e0fb2b59e9666cb14d227b276e29f6d.tar.gz scummvm-rg350-3a14a7760e0fb2b59e9666cb14d227b276e29f6d.tar.bz2 scummvm-rg350-3a14a7760e0fb2b59e9666cb14d227b276e29f6d.zip |
SCI: Fixed bug #3092115 - "ECOQUEST2: Initial text not cleared during ecorder intro"
svn-id: r54984
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 62 | ||||
-rw-r--r-- | engines/sci/engine/workarounds.cpp | 2 |
2 files changed, 64 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 1b0c6b4550..d5d6ff6189 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -231,9 +231,71 @@ const uint16 ecoquest2PatchEcorder[] = { PATCH_END }; +// =========================================================================== +// Same patch as above for the ecorder introduction. Fixes bug #3092115. +// Two workarounds are needed for this patch in workarounds.cpp (when calling +// kGraphFillBoxAny and kGraphUpdateBox), as there isn't enough space to patch +// the function otherwise. +const byte ecoquest2SignatureEcorderTutorial[] = { + 36, + 0x30, 0x23, 0x00, // bnt [next state] + 0x39, 0x0a, // pushi 0a + 0x5b, 0x04, 0x1f, // lea temp[1f] + 0x36, // push + 0x39, 0x64, // pushi 64 + 0x39, 0x7d, // pushi 7d + 0x39, 0x32, // pushi 32 + 0x39, 0x66, // pushi 66 + 0x39, 0x17, // pushi 17 + 0x39, 0x69, // pushi 69 + 0x38, 0x31, 0x26, // pushi 2631 + 0x39, 0x6a, // pushi 6a + 0x39, 0x64, // pushi 64 + 0x43, 0x1b, 0x14, // call kDisplay + 0x35, 0x1e, // ldi 1e + 0x65, 0x20, // aTop ticks + 0x32, // jmp [end] + // 2 extra bytes, jmp offset + 0 +}; + +const uint16 ecoquest2PatchEcorderTutorial[] = { + 0x31, 0x23, // bnt [next state] (save 1 byte) + // The parameter count below should be 7, but we're out of bytes + // to patch! A workaround has been added because of this + 0x78, // push1 (parameter count) + //0x39, 0x07, // pushi 07 (parameter count) + 0x39, 0x0b, // push (FillBoxAny) + 0x39, 0x1d, // pushi 29d + 0x39, 0x73, // pushi 115d + 0x39, 0x5e, // pushi 94d + 0x38, 0xd7, 0x00, // pushi 215d + 0x78, // push1 (visual screen) + 0x39, 0x17, // pushi 17 (color) + 0x43, 0x6c, 0x0e, // call kGraph + // The parameter count below should be 5, but we're out of bytes + // to patch! A workaround has been added because of this + 0x78, // push1 (parameter count) + //0x39, 0x05, // pushi 05 (parameter count) + 0x39, 0x0c, // pushi 12d (UpdateBox) + 0x39, 0x1d, // pushi 29d + 0x39, 0x73, // pushi 115d + 0x39, 0x5e, // pushi 94d + 0x38, 0xd7, 0x00, // pushi 215d + 0x43, 0x6c, 0x0a, // call kGraph + // We are out of bytes to patch at this point, + // so we skip 494 (0x1EE) bytes to reuse this code: + // ldi 1e + // aTop 20 + // jmp 030e (jump to end) + 0x32, 0xee, 0x01, // skip 494 (0x1EE) bytes + PATCH_END +}; + // script, description, magic DWORD, adjust const SciScriptSignature ecoquest2Signatures[] = { { 50, "initial text not removed on ecorder", 1, PATCH_MAGICDWORD(0x39, 0x64, 0x39, 0x7d), -8, ecoquest2SignatureEcorder, ecoquest2PatchEcorder }, + { 333, "initial text not removed on ecorder tutorial",1, PATCH_MAGICDWORD(0x39, 0x64, 0x39, 0x7d), -9, ecoquest2SignatureEcorderTutorial, ecoquest2PatchEcorderTutorial }, SCI_SIGNATUREENTRY_TERMINATOR }; diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 571605da49..9c536f1694 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -335,6 +335,7 @@ const SciWorkaroundEntry kGraphFillBoxForeground_workarounds[] = { // gameID, room,script,lvl, object-name, method-name, call,index, workaround const SciWorkaroundEntry kGraphFillBoxAny_workarounds[] = { + { GID_ECOQUEST2, 100, 333, 0, "showEcorder", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // necessary workaround for our ecorder script patch, because there isn't enough space to patch the function { GID_SQ4, -1, 818, 0, "iconTextSwitch", "show", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // CD: game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack SCI_WORKAROUNDENTRY_TERMINATOR }; @@ -357,6 +358,7 @@ const SciWorkaroundEntry kGraphRedrawBox_workarounds[] = { // gameID, room,script,lvl, object-name, method-name, call,index, workaround const SciWorkaroundEntry kGraphUpdateBox_workarounds[] = { + { GID_ECOQUEST2, 100, 333, 0, "showEcorder", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // necessary workaround for our ecorder script patch, because there isn't enough space to patch the function { GID_PQ3, 202, 202, 0, "MapEdit", "movePt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077 { GID_PQ3, 202, 202, 0, "MapEdit", "addPt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077 SCI_WORKAROUNDENTRY_TERMINATOR |