aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJamieson Christian2003-05-31 23:14:36 +0000
committerJamieson Christian2003-05-31 23:14:36 +0000
commit5cfb556d676bf57e61bd69dca2614a1dee23275d (patch)
treee214df76c1c2e2c491e065b420da3beff785d15d /backends
parentef198afd7cfc096e66fd99b5bcc9efa262bc08a3 (diff)
downloadscummvm-rg350-5cfb556d676bf57e61bd69dca2614a1dee23275d.tar.gz
scummvm-rg350-5cfb556d676bf57e61bd69dca2614a1dee23275d.tar.bz2
scummvm-rg350-5cfb556d676bf57e61bd69dca2614a1dee23275d.zip
EV_SYSEX based SysEx for -eseq
svn-id: r8197
Diffstat (limited to 'backends')
-rw-r--r--backends/midi/seq.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index b77ee579f2..0e6982e3ae 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -141,8 +141,8 @@ void MidiDriver_SEQ::sysEx (byte *msg, uint16 length) {
unsigned char buf [1024];
int position = 0;
byte *chr = msg;
-
- // Should be we using EV_SYSEX instead of SEQ_MIDIPUTC?
+/*
+ // Should we be using EV_SYSEX instead of SEQ_MIDIPUTC?
// I'm not sure how to send EV_SYSEX.
buf[position++] = SEQ_MIDIPUTC;
buf[position++] = 0xFF;
@@ -158,6 +158,25 @@ void MidiDriver_SEQ::sysEx (byte *msg, uint16 length) {
buf[position++] = 0xF7;
buf[position++] = _device_num;
buf[position++] = 0;
+*/
+ buf[position++] = EV_SYSEX;
+ buf[position++] = _device_num;
+ buf[position++] = 0xF0;
+ for (; length; --length, ++chr) {
+ if (position % 8 == 0) {
+ buf[position++] = EV_SYSEX;
+ buf[position++] = _device_num;
+ }
+ buf[position++] = *chr & 0x7F;
+ }
+ if (position % 8 == 0) {
+ buf[position++] = EV_SYSEX;
+ buf[position++] = _device_num;
+ }
+ buf[position++] = 0xF7;
+ while (position % 8 != 0)
+ buf[position++] = 0;
+
write (device, buf, position);
}