[Scummvm-cvs-logs] CVS: scummvm/backends/midi alsa.cpp,1.8,1.9

Jonathan Gray khalek at users.sourceforge.net
Sat May 31 20:26:11 CEST 2003


Update of /cvsroot/scummvm/scummvm/backends/midi
In directory sc8-pr-cvs1:/tmp/cvs-serv7702

Modified Files:
	alsa.cpp 
Log Message:
give alsa sysex more chance of working, still broken though

Index: alsa.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/midi/alsa.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- alsa.cpp	1 Jun 2003 02:08:47 -0000	1.8
+++ alsa.cpp	1 Jun 2003 03:25:14 -0000	1.9
@@ -30,6 +30,7 @@
 #include "stdafx.h"
 #include "common/engine.h"	// for warning/error/debug
 #include <alsa/asoundlib.h>
+#include "common/util.h" // for hexdump
 
 /*
  *     ALSA sequencer driver
@@ -187,7 +188,17 @@
 }
 
 void MidiDriver_ALSA::sysEx(byte *msg, uint16 length) {
-	snd_seq_ev_set_sysex(&ev, length, msg);
+	unsigned char buf[1024];
+
+	if (length > 254) {
+		warning("Cannot send SysEx block - data too large");
+		return;
+	}
+	buf[0] = 0xF0;
+	memcpy(&buf[1], msg, length);
+	buf[length + 1] = 0xF7;
+	// hexdump(buf, length + 2);
+	snd_seq_ev_set_sysex(&ev, length + 2, &buf);
 }
 
 int MidiDriver_ALSA::parse_addr(char *arg, int *client, int *port) {





More information about the Scummvm-git-logs mailing list