From 839707f2233e00d3c62f3020bccf494bd1e8e9ee Mon Sep 17 00:00:00 2001 From: neuromancer Date: Sun, 20 Jun 2021 17:23:30 +0200 Subject: [PATCH] PRIVATE: basic support for the uncompressed/installed MacOS release --- engines/private/detection.cpp | 10 ++++++++++ engines/private/private.cpp | 26 +++++++++++++++----------- engines/private/private.h | 1 + 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp index aaef2806399..34a8ccde922 100644 --- a/engines/private/detection.cpp +++ b/engines/private/detection.cpp @@ -148,6 +148,16 @@ static const ADGameDescription gameDescriptions[] = { ADGF_DEMO | ADGF_UNSTABLE, GUIO1(GUIO_NOMIDI) }, + { + "private-eye", // MacOS release (US) + 0, + AD_ENTRY1s("Private Eye Demo Installer", "e7665ddc5e6d932c4a65598ecc4ec7d2", 1626393), + Common::EN_USA, + Common::kPlatformMacintosh, + ADGF_UNSTABLE, + GUIO1(GUIO_NOMIDI) + }, + AD_TABLE_END_MARKER }; } // End of namespace Private diff --git a/engines/private/private.cpp b/engines/private/private.cpp index 9d8c578103f..af3b1a3b9d6 100644 --- a/engines/private/private.cpp +++ b/engines/private/private.cpp @@ -130,6 +130,8 @@ Common::SeekableReadStream *PrivateEngine::loadAssets() { file = test; else if (test->open("SUPPORT/ASSETS/GAME.WIN")) { file = test; + } else if (test->open("SUPPORT/GAME.MAC")) { + file = test; } else { delete test; assert(_installerArchive.open("SUPPORT/ASSETS.Z")); @@ -162,6 +164,9 @@ Common::SeekableReadStream *PrivateEngine::loadAssets() { Common::Error PrivateEngine::run() { + _language = Common::parseLanguage(ConfMan.get("language")); + _platform = Common::parsePlatform(ConfMan.get("platform")); + Common::SeekableReadStream *file = loadAssets(); // Read assets file const uint32 fileSize = file->size(); @@ -169,7 +174,7 @@ Common::Error PrivateEngine::run() { file->read(buf, fileSize); buf[fileSize] = '\0'; - Decompiler decomp(buf, fileSize, false); + Decompiler decomp(buf, fileSize, _platform == Common::kPlatformMacintosh); free(buf); buf = (char *)decomp.getResult().c_str(); @@ -206,7 +211,6 @@ Common::Error PrivateEngine::run() { Common::Event event; Common::Point mousePos; _videoDecoder = nullptr; - _language = Common::parseLanguage(ConfMan.get("language")); int saveSlot = ConfMan.getInt("save_slot"); if (saveSlot >= 0) { // load the savegame loadGameState(saveSlot); @@ -495,28 +499,28 @@ bool PrivateEngine::cursorPauseMovie(Common::Point mousePos) { } Common::String PrivateEngine::getPauseMovieSetting() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kPauseMovie"; return "k3"; } Common::String PrivateEngine::getGoIntroSetting() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kGoIntro"; return "k1"; } Common::String PrivateEngine::getAlternateGameVariable() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kAlternateGame"; return "k2"; } Common::String PrivateEngine::getMainDesktopSetting() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kMainDesktop"; if (isDemo()) @@ -526,35 +530,35 @@ Common::String PrivateEngine::getMainDesktopSetting() { } Common::String PrivateEngine::getPoliceIndexVariable() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kPoliceIndex"; return "k0"; } Common::String PrivateEngine::getPOGoBustMovieSetting() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kPOGoBustMovie"; return "k7"; } Common::String PrivateEngine::getPoliceBustFromMOSetting() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kPoliceBustFromMO"; return "k6"; } Common::String PrivateEngine::getExitCursor() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kExit"; return "k5"; } Common::String PrivateEngine::getInventoryCursor() { - if (_language == Common::EN_USA) + if (_language == Common::EN_USA && _platform != Common::kPlatformMacintosh) return "kInventory"; return "k7"; diff --git a/engines/private/private.h b/engines/private/private.h index 953c809f682..f4610fd03bf 100644 --- a/engines/private/private.h +++ b/engines/private/private.h @@ -146,6 +146,7 @@ public: const ADGameDescription *_gameDescription; bool isDemo() const; Common::Language _language; + Common::Platform _platform; SymbolMaps maps;