[Scummvm-cvs-logs] SF.net SVN: scummvm:[48537] scummvm/branches/branch-1-1-0/engines/sky/music /mt32music.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Apr 5 11:13:15 CEST 2010


Revision: 48537
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48537&view=rev
Author:   lordhoto
Date:     2010-04-05 09:13:12 +0000 (Mon, 05 Apr 2010)

Log Message:
-----------
Backport of r48536: "Fix for bug #2982014".

Modified Paths:
--------------
    scummvm/branches/branch-1-1-0/engines/sky/music/mt32music.cpp

Modified: scummvm/branches/branch-1-1-0/engines/sky/music/mt32music.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/sky/music/mt32music.cpp	2010-04-05 09:08:48 UTC (rev 48536)
+++ scummvm/branches/branch-1-1-0/engines/sky/music/mt32music.cpp	2010-04-05 09:13:12 UTC (rev 48537)
@@ -113,7 +113,10 @@
 		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 @@
 		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))


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list