diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/charset.cpp | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 60 |
2 files changed, 35 insertions, 27 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 46253071a4..38237bf42a 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -929,7 +929,7 @@ void CharsetRendererV3::setColor(byte color) { _color = color; _shadowColor = (_vm->_features & GF_FMTOWNS) ? 8 : 0; - if (_vm->_features & GF_FMTOWNS) { + if (_vm->_features & GF_FMTOWNS || _vm->_gameId == GID_INDY3_256) { _dropShadow = ((_color & 0x80) != 0); _color &= 0x7f; } else if (_vm->_features & GF_16COLOR) { diff --git a/scumm/sound.cpp b/scumm/sound.cpp index ed660143bd..0bcf8426c9 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -389,34 +389,42 @@ void Sound::playSound(int soundID) { switch(type) { case 0: { // Sound effect - int waveSize = READ_LE_UINT32(ptr + 0x22); - int loopStart = READ_LE_UINT32(ptr + 0x26); - int loopEnd = READ_LE_UINT32(ptr + 0x2A); - rate = (ptr[0x32] == 60) ? 11025 : 22050; // 48 means 22050 - - if (size - 0x36 < waveSize) { - warning("Wrong wave size in sound #%i: %i", soundID, waveSize); - waveSize = size - 0x36; - } - ptr += 0x36; - sound = (char *)malloc(waveSize); - for (int x = 0; x < waveSize; x++) { - int bit = *ptr++; - if (bit < 0x80) - sound[x] = 0x7F - bit; - else - sound[x] = bit; - } + int numInstruments = *(ptr + 0x14); + ptr += 0x16; + size -= 0x16; + while (numInstruments--) { + int waveSize = READ_LE_UINT32(ptr + 0x0C); + int loopStart = READ_LE_UINT32(ptr + 0x10); + int loopEnd = READ_LE_UINT32(ptr + 0x14); + // it's not exactly * 10, maybe it's not even linear, but * 10 sounds ok. + rate = READ_LE_UINT32(ptr + 0x18) * 10; + + ptr += 0x20; + size -= 0x20; + if (size < waveSize) { + warning("Wrong wave size in sound #%i: %i", soundID, waveSize); + waveSize = size - 0x36; + } + sound = (char *)malloc(waveSize); + for (int x = 0; x < waveSize; x++) { + int bit = *ptr++; + if (bit < 0x80) + sound[x] = 0x7F - bit; + else + sound[x] = bit; + } + size -= waveSize; - if (loopEnd > 0) { - flags |= SoundMixer::FLAG_LOOP; - if ((loopEnd < waveSize) || (loopStart > 0)) { - // FIXME: Implement partial loops - warning("Partial loops not implemented. Loop at 0x%X thru 0x%X", loopStart, loopEnd); + if (loopEnd > 0) { + flags |= SoundMixer::FLAG_LOOP; + if ((loopEnd < waveSize) || (loopStart > 0)) { + // FIXME: Implement partial loops + warning("Partial loops not implemented. Loop at 0x%X thru 0x%X", loopStart, loopEnd); + } } - } - _scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID); + _scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID); + } break; } @@ -428,7 +436,7 @@ void Sound::playSound(int soundID) { ptr += (32*4); // Skip preset values (mute, channel, volume, transpose) ptr += 8; // (Unknown) - ptr += numInstruments; // Instrument channel's + ptr += 6; // Instrument channel's. Always 6 bytes according to the disassembly. tuneSize = READ_LE_UINT32(ptr); ptr += 5; |