From e77985d1fd34673e2963134855260540b63c74fc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 5 Apr 2010 09:08:48 +0000 Subject: Fix bug #2982014 "BASS: MT-32 warning on Intro skipping" by properly delaying the sysEx events. svn-id: r48536 --- engines/sky/music/mt32music.cpp | 10 ++++++++-- 1 file 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)) -- cgit v1.2.3