aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-12-25 21:51:02 +0000
committerMartin Kiewitz2009-12-25 21:51:02 +0000
commit9255d43a16e1c3e65e46d198ec606fcef07ff71a (patch)
treeaf3474235996fcb073153be20cae7fa0adeb19e5
parent2f5f625b98230b345371c666a93602c4fec6ba7c (diff)
downloadscummvm-rg350-9255d43a16e1c3e65e46d198ec606fcef07ff71a.tar.gz
scummvm-rg350-9255d43a16e1c3e65e46d198ec606fcef07ff71a.tar.bz2
scummvm-rg350-9255d43a16e1c3e65e46d198ec606fcef07ff71a.zip
SCI/newmusic: Change to channel filtering for sci0early to reflect actual sierra driver behaviour
svn-id: r46564
-rw-r--r--engines/sci/resource.cpp17
-rw-r--r--engines/sci/sfx/softseq/adlib.cpp2
-rw-r--r--engines/sci/sfx/softseq/amiga.cpp2
-rw-r--r--engines/sci/sfx/softseq/pcjr.cpp2
4 files changed, 19 insertions, 4 deletions
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;
}