aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/soundcmd.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2013-04-02 10:03:15 +0300
committerFilippos Karapetis2013-04-02 10:03:48 +0300
commitc6320a28e483e52b489cae8e86774008e030492b (patch)
treeae0152880df8d95ea8f3dc109167fa156a404146 /engines/sci/sound/soundcmd.cpp
parenta1168e932c498f806f664e73f9ffe2bd8ecc1c12 (diff)
downloadscummvm-rg350-c6320a28e483e52b489cae8e86774008e030492b.tar.gz
scummvm-rg350-c6320a28e483e52b489cae8e86774008e030492b.tar.bz2
scummvm-rg350-c6320a28e483e52b489cae8e86774008e030492b.zip
SCI: Add a more generic solution for the problem found in bug #3605269
We now accept signals from all channels if channel 15 is missing. This is a very rare edge case, but our behavior is now somewhat closer to what the original interpreter seems to be doing. Mordack's appearance animation is now synced properly. The more generic workaround works for songs 1840 and 1843, but not for 1849, which is still problematic and we still resort to manually changing its dataInc selector
Diffstat (limited to 'engines/sci/sound/soundcmd.cpp')
-rw-r--r--engines/sci/sound/soundcmd.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 9450e7796d..db357054d4 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -177,16 +177,11 @@ 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))
+ // WORKAROUND: Song 1849 in the Windows version of KQ5CD does not have
+ // correct signalling data, causing the game scripts to wait indefinitely
+ // for the missing signal. We signal the game scripts to stop waiting
+ // forever by setting the song's dataInc selector to something other than 0
+ if (g_sci->getGameId() == GID_KQ5 && resourceId == 1849)
writeSelectorValue(_segMan, obj, SELECTOR(dataInc), 1);
musicSlot->loop = readSelectorValue(_segMan, obj, SELECTOR(loop));