aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/imuse/sysex_scumm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/imuse/sysex_scumm.cpp')
-rw-r--r--engines/scumm/imuse/sysex_scumm.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp
index c3bec93a60..160cdf500a 100644
--- a/engines/scumm/imuse/sysex_scumm.cpp
+++ b/engines/scumm/imuse/sysex_scumm.cpp
@@ -91,8 +91,16 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
// 0 is a valid program number. MI2 tests show that in such
// cases, a regular program change message always seems to follow
// anyway.
- if (player->_isMIDI)
+ if (player->_isMIDI) {
part->_instrument.program((p[15] & 0x0F) << 4 |(p[16] & 0x0F), player->_isMT32);
+ } else {
+ // FIXME/HACK: This is only needed here, since when we use the following line:
+ // se->copyGlobalAdLibInstrument((p[15] & 0x0F) << 4 |(p[16] & 0x0F), &part->_instrument);
+ // We would not get any instrument for PC Speaker. Because we don't default to an
+ // "empty" instrument in case the global instrument specified is not set up.
+ byte empty[23] = {0};
+ part->_instrument.pcspk(empty);
+ }
part->sendAll();
}
}
@@ -116,8 +124,10 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
if (len == 62) {
player->decode_sysex_bytes(p, buf, len - 2);
part->set_instrument((byte *)buf);
- } else {
- // SPK tracks have len == 48 here, and are not supported
+ } else if (len == 48) {
+ player->decode_sysex_bytes(p, buf, len - 2);
+ part->set_instrument_pcspk((byte *)buf);
+ } else {
part->programChange(254); // Must be invalid, but not 255 (which is reserved)
}
}
@@ -127,7 +137,10 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
p += 2; // Skip hardware type and... whatever came right before it
a = *p++;
player->decode_sysex_bytes(p, buf, len - 3);
- se->setGlobalAdLibInstrument(a, buf);
+ if (len == 63)
+ se->setGlobalAdLibInstrument(a, buf);
+ else if (len == 49)
+ se->setGlobalPcSpkInstrument(a, buf);
break;
case 33: // Parameter adjust