aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2013-04-01 21:23:44 +0300
committerFilippos Karapetis2013-04-01 21:31:50 +0300
commit2e93ee2b8301cf48e86c799c429f5e09fd09f051 (patch)
treeaa511239ce8601df0e2c9435aa5bfb2f41bd290e /engines/sci
parentf81ce4d228e528f95cdc3329435aa4ed1eb79fe5 (diff)
downloadscummvm-rg350-2e93ee2b8301cf48e86c799c429f5e09fd09f051.tar.gz
scummvm-rg350-2e93ee2b8301cf48e86c799c429f5e09fd09f051.tar.bz2
scummvm-rg350-2e93ee2b8301cf48e86c799c429f5e09fd09f051.zip
SCI: Fix bug #3605269 - "SCI: KQ5 Windows CD - Game Hangs Before Final Battle"
This is caused because songs 1840, 1843 and 1849 are all missing their special SCI signaling channel (channel 15), so the game scripts wait indefinitely for signals which are never set
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/soundcmd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 4d12d95dc7..c0de7fe90d 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -177,6 +177,18 @@ void SoundCommandParser::processPlaySound(reg_t obj) {
writeSelectorValue(_segMan, obj, SELECTOR(state), kSoundPlaying);
}
+ // WORKAROUND: Songs 1840, 1843 and 1849 in the Windows version of KQ5CD
+ // are all missing their channel 15 (all played during its ending
+ // sequences, when fighting with Mordack). This makes the game scripts
+ // wait indefinitely for the missing signals in these songs. In the
+ // original interpreter, this bug manifests as an "Out of heap" error. We
+ // signal the game scripts to stop waiting forever by setting the song's
+ // dataInc selector to something other than 0. This causes Mordack's
+ // appearing animation to occur a bit earlier than expected, but at least
+ // the game doesn't freeze at that point. Fixes bug #3605269.
+ if (g_sci->getGameId() == GID_KQ5 && (resourceId == 1840 || resourceId == 1843 || resourceId == 1849))
+ writeSelectorValue(_segMan, obj, SELECTOR(dataInc), 1);
+
musicSlot->loop = readSelectorValue(_segMan, obj, SELECTOR(loop));
musicSlot->priority = readSelectorValue(_segMan, obj, SELECTOR(priority));
// Reset hold when starting a new song. kDoSoundSetHold is always called after