diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 2aa46a9dd3e..1d05a94288d 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -9385,6 +9385,38 @@ static const uint16 larry5PatchPokerJackpotInit[] = { PATCH_END }; +// The way LSL5's Talker is written, there is a small recurring chance that +// text boxes will time out immediately, and an even smaller chance that they +// won't time out at all. This was fixed in the German, French, Spanis, and +// Italian versions of the game, though it seems we can't rely on the global +// variable the way they do so we go with a slightly different fix that still +// calls the GetTime kernel function. +// +// Applies to: English VGA version +// Responsible method: Talker::doit in script 928 + +static const uint16 larry5SignatureTalkerDisposeWhenDone[] = { + SIG_MAGICDWORD, + 0x1e, // gt? + 0x30, 0x08, 0x00, // bnt 0008 + SIG_END +}; + +static const uint16 larry5PatchTalkerDisposeWhenDone[] = { + 0x04, // sub + 0x36, // push + 0x35, 0x00, // ldi 00 + PATCH_GETORIGINALBYTE(0), + 0x31, 0x07, // bnt 07 + PATCH_GETORIGINALBYTES(4, 5), + 0x33, 0x14, // jmp 14 + PATCH_GETORIGINALBYTES(12, 2), + 0x31, 0x07, // bnt 07 + PATCH_GETORIGINALBYTES(17, 9), + 0x31, 0x07, // bnt 07 + PATCH_END +}; + // script, description, signature patch static const SciScriptPatcherEntry larry5Signatures[] = { { true, 0, "update stopGroop client", 1, larry5SignatureUpdateStopGroopClient, larry5PatchUpdateStopGroopClient }, @@ -9395,6 +9427,7 @@ static const SciScriptPatcherEntry larry5Signatures[] = { { true, 280, "English-only: fix green card limo bug", 1, larry5SignatureGreenCardLimoBug, larry5PatchGreenCardLimoBug }, { true, 380, "German-only: Enlarge Patti Textbox", 1, larry5SignatureGermanEndingPattiTalker, larry5PatchGermanEndingPattiTalker }, { true, 500, "speed up palette animation", 1, larry5SignatureRoom500PaletteAnimation, larry5PatchRoom500PaletteAnimation }, + { true, 928, "English-only: fix text box timeout", 1, larry5SignatureTalkerDisposeWhenDone, larry5PatchTalkerDisposeWhenDone }, SCI_SIGNATUREENTRY_TERMINATOR };