diff options
author | Colin Snover | 2017-07-26 18:14:16 -0500 |
---|---|---|
committer | Colin Snover | 2017-07-26 22:02:37 -0500 |
commit | 85194cdf750d67dda1ef1e12141f69c1004f8373 (patch) | |
tree | 7df87fecac863fc2c02bc786269d7690660e8dd8 /engines/sci/engine | |
parent | 4357809ce8238cfd0bc5d8c92b6da28068607d55 (diff) | |
download | scummvm-rg350-85194cdf750d67dda1ef1e12141f69c1004f8373.tar.gz scummvm-rg350-85194cdf750d67dda1ef1e12141f69c1004f8373.tar.bz2 scummvm-rg350-85194cdf750d67dda1ef1e12141f69c1004f8373.zip |
SCI32: Patch bad version retrieval in Phant2
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 48ddf9706b..873002403a 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -117,6 +117,7 @@ static const char *const selectorNameTable[] = { "set", // Torin "clear", // Torin "masterVolume", // SCI2 master volume reset + "data", // Phant2 #endif NULL }; @@ -160,7 +161,8 @@ enum ScriptPatcherSelectors { SELECTOR_get, SELECTOR_set, SELECTOR_clear, - SELECTOR_masterVolume + SELECTOR_masterVolume, + SELECTOR_data #endif }; @@ -3733,9 +3735,56 @@ static const uint16 phant2CompSlideDoorsPatch[] = { PATCH_END }; +// When reading the VERSION file, Phant2 sends a Str object instead of a +// reference to a string (kernel signature violation), and flips the file handle +// and size arguments, so the version file data never actually makes it into the +// game. +// Applies to at least: Phant2 US English CD +static const uint16 phant2GetVersionSignature[] = { + 0x36, // push + 0x35, 0xff, // ldi $ff + 0x1c, // ne? + 0x31, 0x0e, // bnt $e + 0x39, 0x04, // pushi 4 + 0x39, 0x05, // pushi 5 + SIG_MAGICDWORD, + 0x89, 0x1b, // lsg $1b + 0x8d, 0x05, // lst 5 + 0x39, 0x09, // pushi 9 + 0x43, 0x5d, SIG_UINT16(0x08), // callk FileIO, 8 + 0x7a, // push2 + 0x78, // push1 + 0x8d, 0x05, // lst 5 + 0x43, 0x5d, SIG_UINT16(0x04), // callk FileIO, 4 + 0x35, 0x01, // ldi 1 + 0xa1, 0xd8, // sag $d8 + SIG_END +}; + +static const uint16 phant2GetVersionPatch[] = { + 0x39, 0x04, // pushi 4 + 0x39, 0x05, // pushi 5 + 0x81, 0x1b, // lag $1b + 0x39, PATCH_SELECTOR8(data), // pushi data + 0x76, // push0 + 0x4a, PATCH_UINT16(4), // send 4 + 0x36, // push + 0x39, 0x09, // pushi 9 + 0x8d, 0x05, // lst 5 + 0x43, 0x5d, PATCH_UINT16(0x08), // callk FileIO, 8 + 0x7a, // push2 + 0x78, // push1 + 0x8d, 0x05, // lst 5 + 0x43, 0x5d, PATCH_UINT16(0x04), // callk FileIO, 4 + 0x78, // push1 + 0xa9, 0xd8, // ssg $d8 + PATCH_END +}; + // script, description, signature patch static const SciScriptPatcherEntry phantasmagoria2Signatures[] = { { true, 0, "slow interface fades", 3, phant2SlowIFadeSignature, phant2SlowIFadePatch }, + { true, 0, "bad arguments to get game version", 1, phant2GetVersionSignature, phant2GetVersionPatch }, { true, 63016, "non-responsive mouse during music fades", 1, phant2Wait4FadeSignature, phant2Wait4FadePatch }, { true, 63019, "non-responsive mouse during computer load", 1, phant2CompSlideDoorsSignature, phant2CompSlideDoorsPatch }, SCI_SIGNATUREENTRY_TERMINATOR |