aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound_adlib.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-10-29 02:50:52 +0200
committerJohannes Schickel2011-10-29 02:50:52 +0200
commita588d6e3e219e7fd6119f573b50465653648d021 (patch)
treeb14b933206f3aff3f622d5e45e5d32132a58807f /engines/kyra/sound_adlib.cpp
parent488fb5c14b99f6cf7e6c1040ec56e3fbe5432be1 (diff)
downloadscummvm-rg350-a588d6e3e219e7fd6119f573b50465653648d021.tar.gz
scummvm-rg350-a588d6e3e219e7fd6119f573b50465653648d021.tar.bz2
scummvm-rg350-a588d6e3e219e7fd6119f573b50465653648d021.zip
KYRA: Add another delay for new tracks in the AdLib driver.
This is to play really safe and to avoid messing up of sound data.
Diffstat (limited to 'engines/kyra/sound_adlib.cpp')
-rw-r--r--engines/kyra/sound_adlib.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index 46d407a640..b04abea080 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -618,6 +618,11 @@ void AdLibDriver::setupPrograms() {
channel.volumeModifier = _sfxVolume;
unkOutput2(chan);
+
+ // We need to wait two callback calls till we can start another track.
+ // This is (probably) required to assure that the sfx are started with
+ // the correct priority and velocity.
+ _programStartTimeout = 2;
}
}
@@ -1331,6 +1336,9 @@ int AdLibDriver::update_setupProgram(uint8 *&dataptr, Channel &channel, uint8 va
Channel &channel2 = _channels[chan];
if (priority >= channel2.priority) {
+ // We keep new tracks from being started for two further iterations of
+ // the callback. This assures the correct velocity is used for this
+ // program.
_programStartTimeout = 2;
initChannel(channel2);
channel2.priority = priority;