aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhewg2011-03-26 10:32:07 +0100
committerdhewg2011-03-26 11:11:17 +0100
commit41762892e03695bbc0fa0cc556cf4cb83ec3768f (patch)
tree8cc13aa5acfa05a901f82c104adf94541f8a8724
parentcc074b013f36338d070699b9e5916debe6b93ff8 (diff)
downloadscummvm-rg350-41762892e03695bbc0fa0cc556cf4cb83ec3768f.tar.gz
scummvm-rg350-41762892e03695bbc0fa0cc556cf4cb83ec3768f.tar.bz2
scummvm-rg350-41762892e03695bbc0fa0cc556cf4cb83ec3768f.zip
ANDROID: Fix MIDI packet size
Instruments are now not reset to the grand piano due to trailing zeroes. Thanks to waltervn for noticing this.
-rw-r--r--audio/softsynth/eas.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp
index c5c60b253d..9d6cf97297 100644
--- a/audio/softsynth/eas.cpp
+++ b/audio/softsynth/eas.cpp
@@ -304,9 +304,13 @@ void MidiDriver_EAS::close() {
void MidiDriver_EAS::send(uint32 b) {
byte buf[4];
- WRITE_UINT32(buf, b);
+ WRITE_LE_UINT32(buf, b);
- int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, 4);
+ int32 len = 3;
+ if ((buf[0] >> 4) == 0xC || (buf[0] >> 4) == 0xD)
+ len = 2;
+
+ int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, len);
if (res)
warning("error writing to EAS MIDI stream: %d", res);
}