diff options
author | Walter van Niftrik | 2010-06-19 01:16:25 +0000 |
---|---|---|
committer | Walter van Niftrik | 2010-06-19 01:16:25 +0000 |
commit | f4b700c4c45e601a5d1571f980ec7e5636e0f166 (patch) | |
tree | 33f6dbd9139be6f8806cd6fbfa977a11046bf346 /engines/sci | |
parent | 25c86e8b03574163d7c6df6e54d00cbffc66b4ef (diff) | |
download | scummvm-rg350-f4b700c4c45e601a5d1571f980ec7e5636e0f166.tar.gz scummvm-rg350-f4b700c4c45e601a5d1571f980ec7e5636e0f166.tar.bz2 scummvm-rg350-f4b700c4c45e601a5d1571f980ec7e5636e0f166.zip |
SCI: AdLib: add dummy instruments when there are only 48 in the patch
svn-id: r50035
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sound/drivers/adlib.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index c2cc49e336..55c3640c9d 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -703,11 +703,8 @@ void MidiDriver_AdLib::setVelocityReg(int regOffset, int velocity, int kbScaleLe void MidiDriver_AdLib::setPatch(int voice, int patch) { if ((patch < 0) || ((uint)patch >= _patches.size())) { - // This happens with songs 1 and 23 in PQ2. Song 1 (the title song) uses an invalid - // instrument 80, and song 23 (car horn when the car runs over you at the airport, - // rooms 14/15) an invalid instrument 89. These are probably leftovers from MT32. - warning("ADLIB: Invalid patch %i requested (patch.003 contains %d instruments)", - patch, _patches.size()); + warning("ADLIB: Invalid patch %i requested", patch); + // Substitute instrument 0 patch = 0; } @@ -760,10 +757,16 @@ bool MidiDriver_AdLib::loadResource(const byte *data, uint size) { for (int i = 0; i < 48; i++) loadInstrument(data + (28 * i)); - if (size == 2690) { + if (size == 1344) { + byte dummy[28] = {0}; + + // Only 48 instruments, add dummies + for (int i = 0; i < 48; i++) + loadInstrument(dummy); + } else if (size == 2690) { for (int i = 48; i < 96; i++) loadInstrument(data + 2 + (28 * i)); - } else if (size == 5382) { + } else { // SCI1.1 and later for (int i = 48; i < 190; i++) loadInstrument(data + (28 * i)); |