diff options
author | Matthew Hoops | 2010-01-27 05:10:38 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-01-27 05:10:38 +0000 |
commit | 9f2a619c06851429e261264c7f4b18a75cd4d7fd (patch) | |
tree | 69e289929a9e77b0a78ec993c829d2a264155a58 | |
parent | 0717491b5b4a4fd8de15445562f51fe20fe03eb6 (diff) | |
download | scummvm-rg350-9f2a619c06851429e261264c7f4b18a75cd4d7fd.tar.gz scummvm-rg350-9f2a619c06851429e261264c7f4b18a75cd4d7fd.tar.bz2 scummvm-rg350-9f2a619c06851429e261264c7f4b18a75cd4d7fd.zip |
SCI2.1 and onwards uses the 'new' DPCM8 which differs only by order. This fixes sound in the GK2 demo slideshow. Also, fix a logic bug with endianness in the DPCM decoders.
svn-id: r47590
-rw-r--r-- | engines/sci/sound/audio.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index d80d4cd348..9c8ddacd90 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -124,17 +124,23 @@ static void deDPCM16(byte *soundBuf, Common::SeekableReadStream &audioStream, ui s += tableDPCM16[b]; s = CLIP<int32>(s, -32768, 32767); - *out++ = s; + *out++ = TO_LE_16(s); } } static void deDPCM8Nibble(byte *soundBuf, int32 &s, byte b) { - if (b & 8) - s -= tableDPCM8[7 - (b & 7)]; - else + if (b & 8) { +#ifdef ENABLE_SCI32 + // SCI2.1 reverses the order of the table values here + if (getSciVersion() >= SCI_VERSION_2_1) + s -= tableDPCM8[b & 7]; + else +#endif + s -= tableDPCM8[7 - (b & 7)]; + } else s += tableDPCM8[b & 7]; s = CLIP<int32>(s, 0, 255); - *soundBuf = TO_LE_16(s); + *soundBuf = s; } static void deDPCM8(byte *soundBuf, Common::SeekableReadStream &audioStream, uint32 n) { |