aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2016-09-18 15:59:38 +0200
committerMartin Kiewitz2016-09-18 15:59:38 +0200
commit2bec9c5a0cfc9f339ce04460c9d6bd3b8633f1b2 (patch)
tree92055aa84a2234b4e90cc7ed5196b9945cb6cfcd /engines/sci
parent8668f6765b5b3472257b4d19fbdcb722d2c40ec7 (diff)
downloadscummvm-rg350-2bec9c5a0cfc9f339ce04460c9d6bd3b8633f1b2.tar.gz
scummvm-rg350-2bec9c5a0cfc9f339ce04460c9d6bd3b8633f1b2.tar.bz2
scummvm-rg350-2bec9c5a0cfc9f339ce04460c9d6bd3b8633f1b2.zip
SCI: Add qfg1vga script patch to fix bug #9558
This solves a game bug, that also happens when using the original interpreter, during the time where Brutus and Bruno meet at the shooting range.
Diffstat (limited to 'engines/sci')
-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 c1a4b12292..664e7fa0c4 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -3181,10 +3181,41 @@ static const uint16 qfg1vgaPatchWhiteStagDagger[] = {
PATCH_END
};
+// The dagger range has a script bug that can freeze the game or cause Brutus to kill you even after you've killed him.
+// This is a bug in the original game.
+//
+// When Bruno leaves, a 300 tick countdown starts. If you kill Brutus or leave room 73 within those 300 ticks then
+// the game is left in a broken state. For the rest of the game, if you ever return to the dagger range from the
+// east or west during the first half of the day then the game will freeze or Brutus will come back to life
+// and kill you, even if you already killed him.
+//
+// Special thanks, credits and kudos to sluicebox, who did a ton of research on this and even found this game bug originally.
+//
+// Applies to at least: English floppy, Mac floppy
+// Responsible method: brutusWaits::changeState
+// Fixes bug #9558
+static const uint16 qfg1vgaSignatureBrutusScriptFreeze[] = {
+ 0x78, // push1
+ 0x38, SIG_UINT16(0x144), // pushi 144h (324d)
+ 0x45, 0x05, 0x02, // call export 5 of script 0
+ SIG_MAGICDWORD,
+ 0x34, SIG_UINT16(0x12c), // ldi 12Ch (300d)
+ 0x65, 0x20, // aTop ticks
+ SIG_END
+};
+
+static const uint16 qfg1vgaPatchBrutusScriptFreeze[] = {
+ 0x34, PATCH_UINT16(0), // ldi 0 (waste 7 bytes)
+ 0x35, 0x00, // ldi 0
+ 0x35, 0x00, // ldi 0
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry qfg1vgaSignatures[] = {
{ true, 41, "moving to castle gate", 1, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate },
{ true, 55, "healer's hut, no delay for buy/steal", 1, qfg1vgaSignatureHealerHutNoDelay, qfg1vgaPatchHealerHutNoDelay },
+ { true, 73, "brutus script freeze glitch", 1, qfg1vgaSignatureBrutusScriptFreeze, qfg1vgaPatchBrutusScriptFreeze },
{ true, 77, "white stag dagger throw animation glitch", 1, qfg1vgaSignatureWhiteStagDagger, qfg1vgaPatchWhiteStagDagger },
{ true, 96, "funny room script bug fixed", 1, qfg1vgaSignatureFunnyRoomFix, qfg1vgaPatchFunnyRoomFix },
{ true, 210, "cheetaur description fixed", 1, qfg1vgaSignatureCheetaurDescription, qfg1vgaPatchCheetaurDescription },