diff options
author | athrxx | 2019-03-03 19:13:38 +0100 |
---|---|---|
committer | athrxx | 2019-03-06 20:48:28 +0100 |
commit | ec640a069a76326ac4cd909bf69423f12d37c1e6 (patch) | |
tree | 5ee784f54499f1587f2d283563003f5ba7b5b936 | |
parent | 379df2b9e3cc85e825c74bf12239adf1ed004b11 (diff) | |
download | scummvm-rg350-ec640a069a76326ac4cd909bf69423f12d37c1e6.tar.gz scummvm-rg350-ec640a069a76326ac4cd909bf69423f12d37c1e6.tar.bz2 scummvm-rg350-ec640a069a76326ac4cd909bf69423f12d37c1e6.zip |
KYRA: (EOB1/Amiga) - fix Amiga cps decompression
-rw-r--r-- | engines/kyra/graphics/screen.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/graphics/screen.h | 2 | ||||
-rw-r--r-- | engines/kyra/sound/sound_amiga_eob.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp index 2a5e51162e..44b6fadb00 100644 --- a/engines/kyra/graphics/screen.cpp +++ b/engines/kyra/graphics/screen.cpp @@ -2364,12 +2364,12 @@ uint16 Screen::decodeEGAGetCode(const uint8 *&pos, uint8 &nib) { return res; } -void Screen::decodeFrame3(const uint8 *src, uint8 *dst, uint32 size) { +void Screen::decodeFrame3(const uint8 *src, uint8 *dst, uint32 size, bool isAmiga) { const uint8 *dstEnd = dst + size; while (dst < dstEnd) { int8 code = *src++; if (code == 0) { - uint16 sz = READ_BE_UINT16(src); + uint16 sz = isAmiga ? READ_LE_UINT16(src) : READ_BE_UINT16(src); src += 2; memset(dst, *src++, sz); dst += sz; @@ -3258,7 +3258,7 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, Palette Screen::decodeFrame1(srcPtr, dstData, imgSize); break; case 3: - Screen::decodeFrame3(srcPtr, dstData, imgSize); + Screen::decodeFrame3(srcPtr, dstData, imgSize, _isAmiga); break; case 4: Screen::decodeFrame4(srcPtr, dstData, imgSize); diff --git a/engines/kyra/graphics/screen.h b/engines/kyra/graphics/screen.h index 23bce6296b..5a746a0956 100644 --- a/engines/kyra/graphics/screen.h +++ b/engines/kyra/graphics/screen.h @@ -630,7 +630,7 @@ public: static void decodeFrame1(const uint8 *src, uint8 *dst, uint32 size); static uint16 decodeEGAGetCode(const uint8 *&pos, uint8 &nib); - static void decodeFrame3(const uint8 *src, uint8 *dst, uint32 size); + static void decodeFrame3(const uint8 *src, uint8 *dst, uint32 size, bool isAmiga); static uint decodeFrame4(const uint8 *src, uint8 *dst, uint32 dstSize); static void decodeFrameDelta(uint8 *dst, const uint8 *src, bool noXor = false); static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, const int pitch, bool noXor); diff --git a/engines/kyra/sound/sound_amiga_eob.cpp b/engines/kyra/sound/sound_amiga_eob.cpp index 800772408f..82f2512ad7 100644 --- a/engines/kyra/sound/sound_amiga_eob.cpp +++ b/engines/kyra/sound/sound_amiga_eob.cpp @@ -120,7 +120,7 @@ void SoundAmiga_EoB::loadSoundFile(Common::String file) { assert(readSize == outSize); memcpy(buf, _fileBuffer, outSize); } else if (cmp == 3) { - Screen::decodeFrame3(_fileBuffer, buf, outSize); + Screen::decodeFrame3(_fileBuffer, buf, outSize, true); } else if (cmp == 4) { Screen::decodeFrame4(_fileBuffer, buf, outSize); } else { @@ -142,6 +142,8 @@ void SoundAmiga_EoB::playTrack(uint8 track) { newSound = "NEWINTRO1.SMUS"; else if (track == 20) newSound = "CHARGEN1.SMUS"; + } else if (_currentResourceSet == kMusicFinale) { + newSound = "FINALE.SMUS"; } } else if (_vm->game() == GI_EOB2) { |