aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-04-05 09:08:48 +0000
committerJohannes Schickel2010-04-05 09:08:48 +0000
commite77985d1fd34673e2963134855260540b63c74fc (patch)
tree66b54382428b5ca4336a5fc88e3dec985c9919fd
parent4aacbc5351bebbb4d9a2683fa2713e8270fc3cd1 (diff)
downloadscummvm-rg350-e77985d1fd34673e2963134855260540b63c74fc.tar.gz
scummvm-rg350-e77985d1fd34673e2963134855260540b63c74fc.tar.bz2
scummvm-rg350-e77985d1fd34673e2963134855260540b63c74fc.zip
Fix bug #2982014 "BASS: MT-32 warning on Intro skipping" by properly delaying the sysEx events.
svn-id: r48536
-rw-r--r--engines/sky/music/mt32music.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp
index 0051998188..ce2a29dad8 100644
--- a/engines/sky/music/mt32music.cpp
+++ b/engines/sky/music/mt32music.cpp
@@ -113,7 +113,10 @@ bool MT32Music::processPatchSysEx(uint8 *sysExData) {
crc -= sysExBuf[cnt];
sysExBuf[14] = crc & 0x7F; // crc
_midiDrv->sysEx(sysExBuf, 15);
- g_system->delayMillis(40);
+ // We delay the time it takes to send the sysEx plus an
+ // additional 40ms, which is required for MT-32 rev00,
+ // to assure no buffer overflow or missing bytes
+ g_system->delayMillis(17 * 1000 / 3125 + 40);
return true;
}
@@ -162,7 +165,10 @@ void MT32Music::startDriver() {
sendBuf[len] = crc & 0x7F;
len++;
_midiDrv->sysEx(sendBuf, len);
- g_system->delayMillis(40);
+ // We delay the time it takes to send the sysEx plus an
+ // additional 40ms, which is required for MT-32 rev00,
+ // to assure no buffer overflow or missing bytes
+ g_system->delayMillis((len + 2) * 1000 / 3125 + 40);
}
while (processPatchSysEx(sysExData))