aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2011-07-10 17:58:41 +0200
committerJohannes Schickel2011-07-10 17:58:41 +0200
commit5edb6f9e4a331049e49c04441aa36b67053f605c (patch)
treeb546bf574c981b3e3627fbb5b23c0a0a552791d3 /engines/scumm
parent781b7215c43ffc54ce571fb5ba830aa9dff3fcf9 (diff)
downloadscummvm-rg350-5edb6f9e4a331049e49c04441aa36b67053f605c.tar.gz
scummvm-rg350-5edb6f9e4a331049e49c04441aa36b67053f605c.tar.bz2
scummvm-rg350-5edb6f9e4a331049e49c04441aa36b67053f605c.zip
SCUMM: Fix priority settings in iMuse allocate part sysEx command.
Formerly we ever only used the lower 4 bit of the priority setting for a new part. The original used a full 8 bit setting though (based on the Indy4 PC Speaker output driver). This fixes missing notes in the Indy4 intro with PC Speaker output. This might affect other outputs too! And could cause regressions in case other outputs implemented priority settings differently.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/imuse/sysex_scumm.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp
index 0987ab5553..98b8ed934e 100644
--- a/engines/scumm/imuse/sysex_scumm.cpp
+++ b/engines/scumm/imuse/sysex_scumm.cpp
@@ -54,7 +54,8 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
// BYTE 00: Channel #
// BYTE 02: BIT 01(0x01): Part on?(1 = yes)
// BIT 02(0x02): Reverb? (1 = yes) [bug #1088045]
- // BYTE 04: Priority adjustment [guessing]
+ // BYTE 03: Priority adjustment(upper 4 bits)
+ // BYTE 04: Priority adjustment(lower 4 bits)
// BYTE 05: Volume(upper 4 bits) [guessing]
// BYTE 06: Volume(lower 4 bits) [guessing]
// BYTE 07: Pan(upper 4 bits) [bug #1088045]
@@ -73,7 +74,7 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
if (part) {
part->set_onoff(p[2] & 0x01);
part->effectLevel((p[2] & 0x02) ? 127 : 0);
- part->set_pri(p[4]);
+ part->set_pri((p[3] << 4) | p[4]);
part->volume((p[5] & 0x0F) << 4 |(p[6] & 0x0F));
part->set_pan((p[7] & 0x0F) << 4 | (p[8] & 0x0F));
part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false;