aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-12-25 18:25:15 +0000
committerMartin Kiewitz2009-12-25 18:25:15 +0000
commitc2f17f9bb93787ec419b9b08659c6a6138c2b903 (patch)
treea6e73c7aa80bd15050c22d1fba6f0a015fecb866
parent113c0941ae8d79f23eb6ea54aaf9e784ecd670cd (diff)
downloadscummvm-rg350-c2f17f9bb93787ec419b9b08659c6a6138c2b903.tar.gz
scummvm-rg350-c2f17f9bb93787ec419b9b08659c6a6138c2b903.tar.bz2
scummvm-rg350-c2f17f9bb93787ec419b9b08659c6a6138c2b903.zip
SCI/newmusic: support for early sound resource format, early kq4 version now gets music, is not filtered yet
svn-id: r46561
-rw-r--r--engines/sci/resource.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index d7f08187e6..9a4a49a01c 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1822,6 +1822,7 @@ SoundResource::SoundResource(uint32 resNumber, ResourceManager *resMan, SciVersi
switch (_soundVersion) {
case SCI_VERSION_0_EARLY:
case SCI_VERSION_0_LATE:
+ // SCI0 only has a header of 0x11/0x21 byte length and the actual miditrack follows afterwards
_trackCount = 1;
_tracks = new Track[_trackCount];
_tracks->nDigital = 0xFF;
@@ -1829,8 +1830,16 @@ SoundResource::SoundResource(uint32 resNumber, ResourceManager *resMan, SciVersi
_tracks->channelCount = 1;
_tracks->channels = new Channel[_tracks->channelCount];
channel = _tracks->channels;
- channel->data = resource->data + 0x21;
- channel->size = resource->size - 0x21;
+ switch (_soundVersion) {
+ case SCI_VERSION_0_EARLY:
+ channel->data = resource->data + 0x11;
+ channel->size = resource->size - 0x11;
+ break;
+ case SCI_VERSION_0_LATE:
+ channel->data = resource->data + 0x21;
+ channel->size = resource->size - 0x21;
+ break;
+ }
channel->number = 0;
channel->poly = 0;
channel->time = channel->prev = 0;
@@ -1850,7 +1859,6 @@ SoundResource::SoundResource(uint32 resNumber, ResourceManager *resMan, SciVersi
_tracks = new Track[_trackCount];
data = resource->data;
for (trackNr = 0; trackNr < _trackCount; trackNr++) {
- // SCI01/SCI1/SCI11
// Track info starts with track-type:BYTE
// Then channel-information gets appeneded Unknown:WORD, ChannelOffset:WORD, ChannelSize:WORD
// 0xFF:BYTE as terminator to end that track and begin with another track-type
@@ -1932,7 +1940,12 @@ int SoundResource::getChannelFilterMask(int hardwareMask) {
byte *data = _innerResource->data;
int channelMask = 0;
- if (_soundVersion <= SCI_VERSION_0_LATE) {
+ switch (_soundVersion) {
+ case SCI_VERSION_0_EARLY:
+ channelMask = 0xFFFF;
+ break;
+
+ case SCI_VERSION_0_LATE:
data++; // Skip over digital sample flag
for (int channelNr = 0; channelNr < 16; channelNr++) {
data++;
@@ -1945,6 +1958,7 @@ int SoundResource::getChannelFilterMask(int hardwareMask) {
}
// Play channel 15 anytime (control channel)
channelMask |= 0x8000;
+ break;
}
return channelMask;
}