diff options
author | Johannes Schickel | 2011-10-29 02:50:52 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-10-29 02:50:52 +0200 |
commit | a588d6e3e219e7fd6119f573b50465653648d021 (patch) | |
tree | b14b933206f3aff3f622d5e45e5d32132a58807f | |
parent | 488fb5c14b99f6cf7e6c1040ec56e3fbe5432be1 (diff) | |
download | scummvm-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.
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 8 |
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; |