Skip to content

Commit

Permalink
SCI: Add script patch for Laura Bow 1 easter egg
Browse files Browse the repository at this point in the history
Fixes view-loop for PC version
  • Loading branch information
Martin Kiewitz committed Feb 21, 2016
1 parent 516d3f2 commit 923f97d
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion engines/sci/engine/script_patches.cpp
Expand Up @@ -102,6 +102,7 @@ static const char *const selectorNameTable[] = {
"startAudio", // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
"modNum", // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
"cycler", // Space Quest 4 / system selector
"setLoop", // Laura Bow 1 Colonel's Bequest
NULL
};

Expand Down Expand Up @@ -129,7 +130,8 @@ enum ScriptPatcherSelectors {
SELECTOR_startText,
SELECTOR_startAudio,
SELECTOR_modNum,
SELECTOR_cycler
SELECTOR_cycler,
SELECTOR_setLoop
};

// ===========================================================================
Expand Down Expand Up @@ -1540,6 +1542,43 @@ static const SciScriptPatcherEntry larry6Signatures[] = {
SCI_SIGNATUREENTRY_TERMINATOR
};

// ===========================================================================
// Laura Bow 1 - Colonel's Bequest
//
// This is basically just a broken easter egg in Colonel's Bequest.
// A plane can show up in room 4, but that only happens really rarely.
// Anyway the Sierra developer seems to have just entered the wrong loop,
// which is why the statue view is used instead (loop 0).
// We fix it to use the correct loop.
//
// This is only broken in the PC version. It was fixed for Amiga + Atari ST.
//
// Credits to OmerMor, for finding it.

// Applies to at least: English PC Floppy
// Responsible method: room4::init
static const uint16 laurabow1SignatureEasterEggViewFix[] = {
0x78, // push1
0x76, // push0
SIG_MAGICDWORD,
0x38, SIG_SELECTOR16(setLoop), // pushi "setLoop"
0x78, // push1
0x39, 0x03, // pushi 3 (loop 3, view only has 3 loops)
SIG_END
};

static const uint16 laurabow1PatchEasterEggViewFix[] = {
PATCH_ADDTOOFFSET(+7),
0x02, // change loop to 2
PATCH_END
};

// script, description, signature patch
static const SciScriptPatcherEntry laurabow1Signatures[] = {
{ true, 4, "easter egg view fix", 1, laurabow1SignatureEasterEggViewFix, laurabow1PatchEasterEggViewFix },
SCI_SIGNATUREENTRY_TERMINATOR
};

// ===========================================================================
// Laura Bow 2
//
Expand Down Expand Up @@ -3798,6 +3837,9 @@ void ScriptPatcher::processScript(uint16 scriptNr, byte *scriptData, const uint3
case GID_KQ6:
signatureTable = kq6Signatures;
break;
case GID_LAURABOW:
signatureTable = laurabow1Signatures;
break;
case GID_LAURABOW2:
signatureTable = laurabow2Signatures;
break;
Expand Down

0 comments on commit 923f97d

Please sign in to comment.