diff options
author | sluicebox | 2019-11-20 14:10:24 -0800 |
---|---|---|
committer | sluicebox | 2019-11-20 14:12:54 -0800 |
commit | 1c97fa435801193f420051d22dc86f5bb20ae3b1 (patch) | |
tree | 9eee83651f0d404ea73e2f3a7f7e62e8b1fb90cf /engines/sci/engine | |
parent | 11065630c0f7913d6023c92035641ffde1cb6a5f (diff) | |
download | scummvm-rg350-1c97fa435801193f420051d22dc86f5bb20ae3b1.tar.gz scummvm-rg350-1c97fa435801193f420051d22dc86f5bb20ae3b1.tar.bz2 scummvm-rg350-1c97fa435801193f420051d22dc86f5bb20ae3b1.zip |
SCI: Fix CAMELOT dropped events while sword is drawn
Fixes bug #11269
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 7e0567fe4d..753b25636b 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -812,10 +812,45 @@ static const uint16 camelotPatchSwordSheathing[] = { PATCH_END }; +// When Arthur's sword is drawn, ARTHUR:doit calls kGetEvent a second time on +// each cycle to test if a shift key is pressed, causing input events to be +// frequently dropped. This is similar to Freddy Pharkas and QFG1VGA where this +// technique just happened to usually work in Sierra's interpreter. We fix this +// in the same way by using the current event instead of consuming a new one. +// +// Applies to: All versions +// Responsible method: ARTHUR:doit +// Fixes bug: #11269 +static const uint16 camelotSignatureSwordEvents[] = { + 0x30, SIG_MAGICDWORD, // bnt 0045 + SIG_UINT16(0x0045), + 0x39, SIG_SELECTOR8(new), // pushi new + 0x76, // push0 + 0x51, 0x07, // class Event + 0x4a, 0x04, // send 04 [ Event new: ] + 0xa5, 0x01, // sat 01 [ temp1 = Event new: ] + SIG_ADDTOOFFSET(+53), + 0x39, SIG_SELECTOR8(dispose), // pushi dispose + 0x76, // push0 + 0x85, 0x01, // lat 01 + 0x4a, 0x04, // send 04 [ temp1 dispose: ] + SIG_END +}; + +static const uint16 camelotPatchSwordEvents[] = { + 0x31, 0x46, // bnt 46 + 0x38, PATCH_SELECTOR16(curEvent), // pushi curEvent + 0x76, // push0 + 0x51, 0x30, // class User [ User: curEvent ] + PATCH_ADDTOOFFSET(+57), + 0x33, 0x05, // jmp 05 [ don't dispose event ] + PATCH_END +}; // script, description, signature patch static const SciScriptPatcherEntry camelotSignatures[] = { { true, 0, "fix sword sheathing", 1, camelotSignatureSwordSheathing, camelotPatchSwordSheathing }, + { true, 0, "fix sword events", 1, camelotSignatureSwordEvents, camelotPatchSwordEvents }, { true, 11, "fix hunter missing points", 1, camelotSignatureHunterMissingPoints, camelotPatchHunterMissingPoints }, { true, 62, "fix peepingTom Sierra bug", 1, camelotSignaturePeepingTom, camelotPatchPeepingTom }, { true, 64, "fix Fatima room messages", 2, camelotSignatureFatimaRoomMessages, camelotPatchFatimaRoomMessages }, |