From c2346309312f61597d39d3934096265c2d72fe66 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 4 May 2018 12:16:06 +0200 Subject: PRINCE: Initial support for packed Russian version --- engines/prince/archive.cpp | 6 +++--- engines/prince/detection.cpp | 4 ++-- engines/prince/prince.cpp | 9 ++++++--- engines/prince/prince.h | 4 +++- engines/prince/sound.cpp | 3 +++ 5 files changed, 17 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/prince/archive.cpp b/engines/prince/archive.cpp index 984c078bfb..3eb37b643a 100644 --- a/engines/prince/archive.cpp +++ b/engines/prince/archive.cpp @@ -55,8 +55,8 @@ bool PtcArchive::open(const Common::String &filename) { uint32 fileTableOffset = _stream->readUint32LE() ^ 0x4D4F4B2D; // MOK- uint32 fileTableSize = _stream->readUint32LE() ^ 0x534F4654; // SOFT - //debug("fileTableOffset : %08X", fileTableOffset); - //debug("fileTableSize: %08X", fileTableSize); + debug(8, "fileTableOffset : %08X", fileTableOffset); + debug(8, "fileTableSize: %08X", fileTableSize); _stream->seek(fileTableOffset); @@ -70,7 +70,7 @@ bool PtcArchive::open(const Common::String &filename) { Common::String name = (const char*)fileItem; item._offset = READ_LE_UINT32(fileItem + 24); item._size = READ_LE_UINT32(fileItem + 28); - //debug("%12s %8X %d", name.c_str(), item._offset, item._size); + debug(8, "%12s %8X %d", name.c_str(), item._offset, item._size); _items[name] = item; } diff --git a/engines/prince/detection.cpp b/engines/prince/detection.cpp index e38234612f..8fb63ddeb3 100644 --- a/engines/prince/detection.cpp +++ b/engines/prince/detection.cpp @@ -86,7 +86,7 @@ static const PrinceGameDescription gameDescriptions[] = { AD_ENTRY1s("talktxt.dat", "02bb2372f19aca3c65896ed81b2cefb3", 125702), Common::RU_RUS, Common::kPlatformWindows, - ADGF_TESTING, + ADGF_TESTING | GF_EXTRACTED, GUIO1(GUIO_NONE) }, kPrinceDataDE @@ -98,7 +98,7 @@ static const PrinceGameDescription gameDescriptions[] = { AD_ENTRY1s("databank.ptc", "a67b55730f3d7064921bd2a59e1063a3", 3892982), Common::RU_RUS, Common::kPlatformWindows, - ADGF_TESTING, + ADGF_TESTING | GF_NOVOICES, GUIO1(GUIO_NONE) }, kPrinceDataPL diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index f29b8c2bae..a8448a0aed 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -208,14 +208,17 @@ void PrinceEngine::init() { debugEngine("Adding all path: %s", gameDataDir.getPath().c_str()); - if (getLanguage() != Common::RU_RUS) { + if (!(getFeatures() & GF_EXTRACTED)) { PtcArchive *all = new PtcArchive(); if (!all->open("all/databank.ptc")) error("Can't open all/databank.ptc"); PtcArchive *voices = new PtcArchive(); - if (!voices->open("voices/databank.ptc")) - error("Can't open voices/databank.ptc"); + + if (!(getFeatures() & GF_NOVOICES)) { + if (!voices->open("voices/databank.ptc")) + error("Can't open voices/databank.ptc"); + } PtcArchive *sound = new PtcArchive(); if (!sound->open("sound/databank.ptc")) diff --git a/engines/prince/prince.h b/engines/prince/prince.h index 8ff71dbd8d..fcab7ebb41 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -77,7 +77,9 @@ class Room; class Pscr; enum { - GF_TRANSLATED = 1 << 0 + GF_TRANSLATED = 1 << 0, + GF_EXTRACTED = 1 << 1, + GF_NOVOICES = 1 << 2 }; struct SavegameHeader { diff --git a/engines/prince/sound.cpp b/engines/prince/sound.cpp index 54eebdcc8b..c062c428ca 100644 --- a/engines/prince/sound.cpp +++ b/engines/prince/sound.cpp @@ -89,6 +89,9 @@ bool PrinceEngine::loadSample(uint32 sampleSlot, const Common::String &streamNam } bool PrinceEngine::loadVoice(uint32 slot, uint32 sampleSlot, const Common::String &streamName) { + if (getFeatures() & GF_NOVOICES) + return false; + debugEngine("Loading wav %s slot %d", streamName.c_str(), slot); if (slot >= kMaxTexts) { -- cgit v1.2.3