diff options
author | Filippos Karapetis | 2010-12-22 22:18:21 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-12-22 22:18:21 +0000 |
commit | 8e26ae0f92ded60f6241c68349812770b8d3c3fe (patch) | |
tree | 559cf03ad7e31dc3d6c23626c0aba7b6f19d5e0a | |
parent | cc30fa378ed9b17952c095c1c8fd187d98ac423e (diff) | |
download | scummvm-rg350-8e26ae0f92ded60f6241c68349812770b8d3c3fe.tar.gz scummvm-rg350-8e26ae0f92ded60f6241c68349812770b8d3c3fe.tar.bz2 scummvm-rg350-8e26ae0f92ded60f6241c68349812770b8d3c3fe.zip |
SCI: Fixed bug #3037618 - "PQ2 : Restoring in Scuba Van causes Parser Issues"
svn-id: r55017
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index d5d6ff6189..48bc945e0d 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -719,6 +719,32 @@ const SciScriptSignature mothergoose256Signatures[] = { }; // =========================================================================== +// PQ2 does not call SetSynonyms in Game::replay() (i.e. when loading a game). +// This results in invalid synonyms in some rooms. We patch Game::replay() to +// call SetSynonyms properly, by replacing the kDoSoundResumeAfterRestore +// kernel call, which is a stub in ScummVM. Fixes bug #3037618. +const byte pq2SignatureReplay[] = { + 6, + 0x78, // push1 + 0x39, 0x07, // pushi 07 + 0x43, 0x31, 0x02, // callk DoSound[31] 02 + 0 +}; + +const uint16 pq2PatchReplay[] = { + 0x78, // push1 (parameter count) + 0x89, 0x06, // lsg 06 + 0x43, 0x26, 0x02, // callk SetSynonyms[26] 02 + PATCH_END +}; + +// script, description, magic DWORD, adjust +const SciScriptSignature pq2Signatures[] = { + { 994, "replay synonyms issue", 1, PATCH_MAGICDWORD(0x39, 0x07, 0x43, 0x31), -1, pq2SignatureReplay, pq2PatchReplay }, + SCI_SIGNATUREENTRY_TERMINATOR +}; + +// =========================================================================== // script 215 of qfg1vga pointBox::doit actually processes button-presses // during fighting with monsters. It strangely also calls kGetEvent. Because // the main User::doit also calls kGetEvent it's pure luck, where the event @@ -1196,6 +1222,9 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin case GID_MOTHERGOOSE256: signatureTable = mothergoose256Signatures; break; + case GID_PQ2: + signatureTable = pq2Signatures; + break; case GID_QFG1VGA: signatureTable = qfg1vgaSignatures; break; |