aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authormd52011-04-15 11:19:28 +0300
committermd52011-04-15 11:20:07 +0300
commit9a987001d4ea2d637f230f8a280ce2fa162d18b9 (patch)
treeba1613e1a37172bec49718a9d885284f53019d61 /engines/sci
parent6c4f09c058d15e18e4e95d9eeda60719a35c2343 (diff)
downloadscummvm-rg350-9a987001d4ea2d637f230f8a280ce2fa162d18b9.tar.gz
scummvm-rg350-9a987001d4ea2d637f230f8a280ce2fa162d18b9.tar.bz2
scummvm-rg350-9a987001d4ea2d637f230f8a280ce2fa162d18b9.zip
SCI: Some initial work on supporting patch.005 in KQ1 Amiga
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/drivers/amigamac.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp
index d64dfac23c..030b095cc9 100644
--- a/engines/sci/sound/drivers/amigamac.cpp
+++ b/engines/sci/sound/drivers/amigamac.cpp
@@ -132,6 +132,7 @@ private:
};
bool _isSci1;
+ bool _isSci1Early; // KQ1 Amiga, patch 5
bool _playSwitch;
int _masterVolume;
int _frequency;
@@ -557,6 +558,7 @@ uint32 MidiDriver_AmigaMac::property(int prop, uint32 param) {
int MidiDriver_AmigaMac::open() {
_isSci1 = false;
+ _isSci1Early = false;
for (int i = 0; i < 48; i++)
_freqTable[i] = pow(2, i / (double)48);
@@ -589,9 +591,15 @@ int MidiDriver_AmigaMac::open() {
} else {
ResourceManager *resMan = g_sci->getResMan();
- Resource *resource = resMan->findResource(ResourceId(kResourceTypePatch, 7), false);
+ Resource *resource = resMan->findResource(ResourceId(kResourceTypePatch, 7), false); // Mac
if (!resource)
- resource = resMan->findResource(ResourceId(kResourceTypePatch, 9), false);
+ resource = resMan->findResource(ResourceId(kResourceTypePatch, 9), false); // Amiga
+
+ if (!resource) {
+ resource = resMan->findResource(ResourceId(kResourceTypePatch, 5), false); // KQ1 Amiga
+ if (resource)
+ _isSci1Early = true;
+ }
// If we have a patch by this point, it's SCI1
if (resource)
@@ -896,6 +904,9 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI0Mac(Common::SeekableReadStream &fil
bool MidiDriver_AmigaMac::loadInstrumentsSCI1(Common::SeekableReadStream &file) {
_bank.size = 128;
+ if (_isSci1Early)
+ file.skip(4); // TODO: What is this offset for?
+
Common::Array<uint32> instrumentOffsets;
instrumentOffsets.resize(_bank.size);
_bank.instruments.resize(_bank.size);
@@ -908,11 +919,17 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI1(Common::SeekableReadStream &file)
if (instrumentOffsets[i] == 0)
continue;
- file.seek(instrumentOffsets[i]);
+ file.seek(instrumentOffsets[i] + (_isSci1Early ? 4 : 0));
// Read in the instrument name
file.read(_bank.instruments[i].name, 10); // last two bytes are always 0
+ // TODO: Finish off support of SCI1 early patches (patch.005 - KQ1 Amiga)
+ if (_isSci1Early) {
+ warning("Music patch 5 isn't supported yet - ignoring instrument %d", i);
+ continue;
+ }
+
for (uint32 j = 0; ; j++) {
InstrumentSample *sample = new InstrumentSample;
memset(sample, 0, sizeof(InstrumentSample));