Skip to content

Commit

Permalink
SCI32: Fix GK1 fortune teller messages, bug #10819 (#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
sluicebox authored and bluegr committed Nov 28, 2018
1 parent 3f77b0a commit 8eb334a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
35 changes: 35 additions & 0 deletions engines/sci/engine/script_patches.cpp
Expand Up @@ -1990,6 +1990,40 @@ static const uint16 gk1GranChairFlickerPatch[] = {
PATCH_END
};

// Using the money on the fortune teller Lorelei is scripted to respond with
// a different message depending on whether she's sitting or dancing. This
// feature manages to have three bugs which all occur in Sierra's interpreter.
//
// Bug 1: The script transposes the sitting and dancing responses.
// We reverse the test so that the right messages are attempted.
//
// Bug 2: The script passes the wrong message tuple when Lorelei is sitting
// and so a missing message error occurs. We pass the right tuple.
//
// Bug 3: The audio36 resource for message 420 2 32 0 1 has the wrong tuple and
// so no audio plays when using the money on Lorelei while dancing.
// This is a CD resource bug which we fix in the audio loader.
//
// Applies to: All PC Floppy and CD versions. TODO: Test Mac, should apply
// Responsible method: lorelei:doVerb(32)
// Fixes bug #10819
static const uint16 gk1LoreleiMoneySignature[] = {
0x30, SIG_UINT16(0x000d), // bnt 000d [ lorelei is sitting ]
SIG_ADDTOOFFSET(+19),
SIG_MAGICDWORD,
0x7a, // pushi2 [ noun ]
0x8f, 0x01, // lsp 01 [ verb (32d) ]
0x39, 0x03, // pushi 03 [ cond ]
SIG_END
};

static const uint16 gk1LoreleiMoneyPatch[] = {
0x2e, PATCH_UINT16(0x000d), // bt 000d [ lorelei is dancing ]
PATCH_ADDTOOFFSET(+22),
0x39, 0x02, // pushi 02 [ correct cond ]
PATCH_END
};

// Using "Operate" on the fortune teller Lorelei's right chair causes a
// missing message error when she's standing in english pc floppy.
// We fix the message tuple as Sierra did in later versions.
Expand Down Expand Up @@ -2057,6 +2091,7 @@ static const SciScriptPatcherEntry gk1Signatures[] = {
{ true, 410, "fix day 2 binoculars lockup", 1, gk1Day2BinocularsLockupSignature, gk1Day2BinocularsLockupPatch },
{ true, 410, "fix artist veve photocopy missing message", 1, gk1ArtistVeveCopySignature, gk1ArtistVeveCopyPatch },
{ true, 420, "fix lorelei chair missing message", 1, gk1OperateLoreleiChairSignature, gk1OperateLoreleiChairPatch },
{ true, 420, "fix lorelei money messages", 1, gk1LoreleiMoneySignature, gk1LoreleiMoneyPatch },
{ true, 710, "fix day 9 vine swing speech playing", 1, gk1Day9VineSwingSignature, gk1Day9VineSwingPatch },
{ true, 800, "fix day 10 honfour unlock door lockup", 1, gk1HonfourUnlockDoorSignature, gk1HonfourUnlockDoorPatch },
{ true, 64908, "disable video benchmarking", 1, sci2BenchmarkSignature, sci2BenchmarkPatch },
Expand Down
7 changes: 7 additions & 0 deletions engines/sci/resource_audio.cpp
Expand Up @@ -454,6 +454,13 @@ int ResourceManager::readAudioMapSCI11(IntMapResourceSource *map) {
break;
}

// GK1CD has a message whose audio36 resource has the wrong tuple and never plays.
// The message tuple is 420 2 32 0 1 but the audio36 tuple is 420 2 32 3 1. bug #10819
if (g_sci->getGameId() == GID_GK1 && g_sci->isCD() &&
map->_mapNumber == 420 && n == 0x02200301) {
n = 0x02200001;
}

if (isEarly) {
offset = ptr.getUint32LE();
ptr += 4;
Expand Down

0 comments on commit 8eb334a

Please sign in to comment.