diff options
author | Colin Snover | 2017-08-04 23:57:47 -0500 |
---|---|---|
committer | Colin Snover | 2017-09-03 20:58:07 -0500 |
commit | ebd5139653961a1c69f0b84644352839c10b4ed2 (patch) | |
tree | 29528d4ed853e64a8e01e3114a002d4b37f297ee /engines | |
parent | 7545bb7133099400245ef5db5cecc015e57acd56 (diff) | |
download | scummvm-rg350-ebd5139653961a1c69f0b84644352839c10b4ed2.tar.gz scummvm-rg350-ebd5139653961a1c69f0b84644352839c10b4ed2.tar.bz2 scummvm-rg350-ebd5139653961a1c69f0b84644352839c10b4ed2.zip |
SCI32: Fix crash after credits in Lighthouse
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 04150993f6..3d59adbcfc 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -2286,6 +2286,33 @@ static const SciScriptPatcherEntry kq7Signatures[] = { SCI_SIGNATUREENTRY_TERMINATOR }; +#pragma mark - +#pragma mark Lighthouse + +// When going to room 5 (the sierra logo & menu room) from room 380 (the credits +// room), the game tries to clear flags from 0 (global 116 bit 0) to 1423 +// (global 204 bit 15), but global 201 is not a flag global (it holds a +// reference to theInvisCursor). This patch stops clearing after 1359 (global +// 200 bit 15). Hopefully that is good enough to not break the game. +// Applies to at least: English 1.0 & 2.0 +static const uint16 lighthouseFlagResetSignature[] = { + SIG_MAGICDWORD, + 0x34, SIG_UINT16(0x58f), // ldi 1423 + 0x24, // le? + SIG_END +}; + +static const uint16 lighthouseFlagResetPatch[] = { + 0x34, PATCH_UINT16(0x54f), // ldi 1359 + PATCH_END +}; + +// script, description, signature patch +static const SciScriptPatcherEntry lighthouseSignatures[] = { + { true, 5, "fix bad globals clear after credits", 1, lighthouseFlagResetSignature, lighthouseFlagResetPatch }, + SCI_SIGNATUREENTRY_TERMINATOR +}; + #endif // =========================================================================== @@ -6741,6 +6768,11 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) { case GID_LAURABOW2: signatureTable = laurabow2Signatures; break; +#ifdef ENABLE_SCI32 + case GID_LIGHTHOUSE: + signatureTable = lighthouseSignatures; + break; +#endif case GID_LONGBOW: signatureTable = longbowSignatures; break; |