From 9b594965330cede661db9c022c33c1daa42ed123 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 5 Sep 2010 20:04:46 +0000 Subject: SCI: adding patch for script bug in pharkas/cd patches out bad code that would dispose score sound immediately, "score" sound plays now for pharkas/cd - finally fixes bug #3037161 svn-id: r52570 --- engines/sci/engine/script_patches.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index fbd58cf20c..810e47b379 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -183,6 +183,31 @@ const SciScriptSignature ecoquest2Signatures[] = { }; // =========================================================================== +// script 0 of freddy pharkas/CD PointsSound::check waits for a signal and if +// no signal received will call kDoSound(0xD) which is a dummy in sierra sci +// and ScummVM and will use acc (which is not set by the dummy) to trigger +// sound disposal. This somewhat worked in sierra sci, because the sample +// was already playing in the sound driver. In our case we would also stop +// the sample from playing, so we patch it out +// The "score" code is already buggy and sets volume to 0 when playing +const byte freddypharkasSignatureScoreDisposal[] = { + 10, + 0x67, 0x32, // pTos 32 (selector theAudCount) + 0x78, // push1 + 0x39, 0x0d, // pushi 0d + 0x43, 0x75, 0x02, // call kDoAudio + 0x1c, // ne? + 0x31, // bnt (-> to skip disposal) + 0 +}; + +const uint16 freddypharkasPatchScoreDisposal[] = { + 0x34, 0x00, 0x00, // ldi 0000 + 0x34, 0x00, 0x00, // ldi 0000 + 0x34, 0x00, 0x00, // ldi 0000 + PATCH_END +}; + // script 215 of freddy pharkas lowerLadder::doit and highLadder::doit actually // process keyboard-presses when the ladder is on the screen in that room. // They strangely also call kGetEvent. Because the main User::doit also calls @@ -219,9 +244,10 @@ const uint16 freddypharkasPatchLadderEvent[] = { // script, description, magic DWORD, adjust const SciScriptSignature freddypharkasSignatures[] = { + { 0, "CD: score early disposal", PATCH_MAGICDWORD(0x39, 0x0d, 0x43, 0x75), -3, freddypharkasSignatureScoreDisposal, freddypharkasPatchScoreDisposal }, // this is not a typo, both lowerLadder::doit and highLadder::doit have the same event code - { 320, "lower ladder event issue", PATCH_MAGICDWORD(0x6d, 0x76, 0x38, 0xf5), -1, freddypharkasSignatureLadderEvent, freddypharkasPatchLadderEvent }, - { 320, "high ladder event issue", PATCH_MAGICDWORD(0x6d, 0x76, 0x38, 0xf5), -1, freddypharkasSignatureLadderEvent, freddypharkasPatchLadderEvent }, + { 320, "lower ladder event issue", PATCH_MAGICDWORD(0x6d, 0x76, 0x38, 0xf5), -1, freddypharkasSignatureLadderEvent, freddypharkasPatchLadderEvent }, + { 320, "high ladder event issue", PATCH_MAGICDWORD(0x6d, 0x76, 0x38, 0xf5), -1, freddypharkasSignatureLadderEvent, freddypharkasPatchLadderEvent }, SCI_SIGNATUREENTRY_TERMINATOR }; -- cgit v1.2.3