From 9255d43a16e1c3e65e46d198ec606fcef07ff71a Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 25 Dec 2009 21:51:02 +0000 Subject: SCI/newmusic: Change to channel filtering for sci0early to reflect actual sierra driver behaviour svn-id: r46564 --- engines/sci/resource.cpp | 17 ++++++++++++++++- engines/sci/sfx/softseq/adlib.cpp | 2 +- engines/sci/sfx/softseq/amiga.cpp | 2 +- engines/sci/sfx/softseq/pcjr.cpp | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index f6121bd951..3eb1eb3672 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1939,15 +1939,30 @@ SoundResource::Track* SoundResource::getTrackByType(TrackType type) { int SoundResource::getChannelFilterMask(int hardwareMask) { byte *data = _innerResource->data; int channelMask = 0; + int reverseHardwareMask = 0; switch (_soundVersion) { case SCI_VERSION_0_EARLY: + // TODO: MT32 driver uses no hardwaremask at all and uses all channels + switch (hardwareMask) { + case 0x01: // Adlib needs an additional reverse check against bit 3 + reverseHardwareMask = 0x08; + break; + } + // Control-Channel -> where bit 0 is not set, bit 3 is set data++; // Skip over digital sample flag for (int channelNr = 0; channelNr < 16; channelNr++) { channelMask = channelMask >> 1; if (*data & hardwareMask) { - // this Channel is supposed to get played for hardware + if ((reverseHardwareMask == 0) || ((*data & reverseHardwareMask) == 0)) { + // this Channel is supposed to get played for hardware + channelMask |= 0x8000; + } + } + if ((*data & 0x08) && ((*data & 0x01) == 0)) { + // this channel is control channel, so don't filter it channelMask |= 0x8000; + // TODO: We need to accept this channel in parseNextEvent() for events } data++; } diff --git a/engines/sci/sfx/softseq/adlib.cpp b/engines/sci/sfx/softseq/adlib.cpp index 77e1f5f370..b14fdfdb1f 100644 --- a/engines/sci/sfx/softseq/adlib.cpp +++ b/engines/sci/sfx/softseq/adlib.cpp @@ -814,7 +814,7 @@ int MidiPlayer_Adlib::open(ResourceManager *resMan) { int MidiPlayer_Adlib::getPlayMask(SciVersion soundVersion) { switch (soundVersion) { case SCI_VERSION_0_EARLY: - return 0x10; // FIXME: Not correct + return 0x01; } return 0x04; } diff --git a/engines/sci/sfx/softseq/amiga.cpp b/engines/sci/sfx/softseq/amiga.cpp index e0141153ac..bc401da21e 100644 --- a/engines/sci/sfx/softseq/amiga.cpp +++ b/engines/sci/sfx/softseq/amiga.cpp @@ -666,7 +666,7 @@ MidiPlayer *MidiPlayer_Amiga_create() { int MidiPlayer_Amiga::getPlayMask(SciVersion soundVersion) { switch (soundVersion) { case SCI_VERSION_0_EARLY: - return 0x40; // FIXME: Not correct + error("No amiga support for sci0early"); } return 0x40; } diff --git a/engines/sci/sfx/softseq/pcjr.cpp b/engines/sci/sfx/softseq/pcjr.cpp index b9118eb678..3049263594 100644 --- a/engines/sci/sfx/softseq/pcjr.cpp +++ b/engines/sci/sfx/softseq/pcjr.cpp @@ -203,7 +203,7 @@ int MidiPlayer_PCJr::getPlayMask(SciVersion soundVersion) { int MidiPlayer_PCSpeaker::getPlayMask(SciVersion soundVersion) { switch (soundVersion) { case SCI_VERSION_0_EARLY: - return 0x20; // FIXME: Not correct + return 0x02; } return 0x20; } -- cgit v1.2.3