diff options
author | Colin Snover | 2016-11-06 15:08:29 -0600 |
---|---|---|
committer | Colin Snover | 2016-11-19 19:06:04 -0600 |
commit | 774713564d212b42804b896cb2a03d3e5e248384 (patch) | |
tree | 52acc57cb3cd3debb25e5ddcdd1f5c6c1a443f1f /engines/sci | |
parent | 11ee0f90ac67a3ee0a36506c35e35af6a11f7936 (diff) | |
download | scummvm-rg350-774713564d212b42804b896cb2a03d3e5e248384.tar.gz scummvm-rg350-774713564d212b42804b896cb2a03d3e5e248384.tar.bz2 scummvm-rg350-774713564d212b42804b896cb2a03d3e5e248384.zip |
SCI32: Add script patch for Shivers room 35170
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 5f3370bad5..dbc351d8f2 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -4553,6 +4553,40 @@ static const SciScriptPatcherEntry sq5Signatures[] = { #ifdef ENABLE_SCI32 #pragma mark - +#pragma mark Shivers + +// In room 35170, there is a CCTV control station with a joystick that must be +// clicked and dragged to pan the camera. In order to enable dragging, on +// mousedown, the vJoystick::handleEvent method calls vJoystick::doVerb(1), +// which enables the drag functionality of the joystick. However, +// vJoystick::handleEvent then makes a super call to ShiversProp::handleEvent, +// which calls vJoystick::doVerb(). This second call, which fails to pass an +// argument, causes an uninitialized read off the stack for the first parameter. +// In SSCI, this happens to work because the uninitialized value on the stack +// happens to be 1. Disabling the super call avoids the bad doVerb call without +// any apparent ill effect. +static const uint16 shiversSignatureJoystickFix[] = { + SIG_MAGICDWORD, + 0x38, SIG_UINT16(0xa5), // pushi handleEvent + 0x78, // push1 + 0x8f, 0x01, // lsp 1 + 0x59, 0x02, // &rest 2 + 0x57, 0x7f, SIG_UINT16(6), // super ShiversProp[7f], 6 + SIG_END +}; + +static const uint16 shiversPatchJoystickFix[] = { + 0x48, // ret + PATCH_END +}; + +// script, description, signature patch +static const SciScriptPatcherEntry shiversSignatures[] = { + { true, 35170, "fix CCTV joystick interaction", 1, shiversSignatureJoystickFix, shiversPatchJoystickFix }, + SCI_SIGNATUREENTRY_TERMINATOR +}; + +#pragma mark - #pragma mark Space Quest 6 // After the explosion in the Quarters of Deepship 86, the game tries to perform @@ -5119,6 +5153,9 @@ void ScriptPatcher::processScript(uint16 scriptNr, byte *scriptData, const uint3 case GID_QFG4: signatureTable = qfg4Signatures; break; + case GID_SHIVERS: + signatureTable = shiversSignatures; + break; #endif case GID_SQ1: signatureTable = sq1vgaSignatures; |