aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/detection.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-09-01 17:09:59 +0000
committerFilippos Karapetis2009-09-01 17:09:59 +0000
commit2e04dcb133e450b84983da5b680d1695fdf639bd (patch)
treedf9cc660d3d11850ecf17d0a13b9cba9033bed73 /engines/sci/detection.cpp
parent3d0e8a568c804a7807ccd3c5de7040502718ec1b (diff)
downloadscummvm-rg350-2e04dcb133e450b84983da5b680d1695fdf639bd.tar.gz
scummvm-rg350-2e04dcb133e450b84983da5b680d1695fdf639bd.tar.bz2
scummvm-rg350-2e04dcb133e450b84983da5b680d1695fdf639bd.zip
- Moved the Sierra game ID conversion code inside game.cpp, so that any game-specific workarounds are tested against ScummVM IDs
- Added detection for the EcoQuest 1 demo in the fallback detector - Partially reverted my previous "fix" for EcoQuest 1 CD, and turned it into a script-specific hack for that game, for now - Added handling of kDisposeScript calls made with 2 parameters, e.g. in KQ5CD and others (still untested, haven't found a test case) svn-id: r43887
Diffstat (limited to 'engines/sci/detection.cpp')
-rw-r--r--engines/sci/detection.cpp131
1 files changed, 1 insertions, 130 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index d2615e8b4e..6f9e5a1c1b 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -29,6 +29,7 @@
#include "sci/sci.h"
#include "sci/engine/kernel.h"
#include "sci/engine/seg_manager.h"
+#include "sci/engine/vm.h" // for convertSierraGameId
namespace Sci {
@@ -163,136 +164,6 @@ public:
const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const;
};
-struct OldNewIdTableEntry {
- const char *oldId;
- const char *newId;
- bool demo;
-};
-
-static const OldNewIdTableEntry s_oldNewTable[] = {
- { "demo", "christmas1988", false },
- // iceman is the same
- { "icedemo", "iceman", true },
- // longbow is the same
- { "rh", "longbow", true },
- { "eco", "ecoquest", false },
- { "eco2", "ecoquest2", true }, // EcoQuest 2 demo
- { "rain", "ecoquest2", false }, // EcoQuest 2 full
- { "fp", "freddypharkas", false },
- { "emc", "funseeker", false },
- { "gk", "gk1", false },
- { "hoyledemo", "hoyle1", true },
- { "cardgames", "hoyle1", false },
- { "solitare", "hoyle2", false },
- // hoyle3 is the same
- // hoyle4 is the same
- { "demo000", "kq1sci", true },
- { "kq1", "kq1sci", false },
- { "kq4", "kq4sci", false },
- { "ll1", "lsl1sci", true },
- { "lsl1", "lsl1sci", false },
- // lsl2 is the same
- { "ll5", "lsl5", true },
- // lsl5 is the same
- // lsl6 is the same
- { "mg", "mothergoose", false },
- { "cb1", "laurabow", false },
- { "lb2", "laurabow2", false },
- { "twisty", "pepper", false },
- { "pq", "pq2", false },
- { "trial", "qfg2", false },
- { "hq2demo", "qfg2", true },
- { "thegame", "slater", false },
- { "sq1demo", "sq1sci", true },
- { "sq1", "sq1sci", false },
- // sq5 is the same
-
- { 0, 0, 0 }
-};
-
-static const char *convertSierraGameId(const char *gameName, uint32 *gameFlags) {
- // Convert the id to lower case, so that we match all upper/lower case variants.
- Common::String sierraId = gameName;
- sierraId.toLowercase();
-
- // TODO: SCI32 IDs
-
- for (const OldNewIdTableEntry *cur = s_oldNewTable; cur->oldId != 0; ++cur) {
- if (sierraId == cur->oldId) {
- if (cur->demo)
- *gameFlags |= ADGF_DEMO;
- return cur->newId;
- }
- }
-
- if (sierraId == "card") {
- // This could either be christmas1990 or christmas1992
- // christmas1990 has a "resource.001" file, whereas
- // christmas1992 has a "resource.000" file
- return (Common::File::exists("resource.001")) ? "christmas1990" : "christmas1992";
- }
- if (sierraId == "arthur") {
- if (!Common::File::exists("resource.002"))
- *gameFlags |= ADGF_DEMO;
- return "camelot";
- }
- if (sierraId == "brain") {
- // This could either be The Castle of Dr. Brain, or The Island of Dr. Brain
- // castlebrain has resource.001, whereas islandbrain doesn't
- return (Common::File::exists("resource.001")) ? "castlebrain" : "islandbrain";
- }
- if (sierraId == "lsl3") {
- if (!Common::File::exists("resource.003"))
- *gameFlags |= ADGF_DEMO;
- return "lsl3";
- }
- // TODO: lslcasino
- if (sierraId == "tales") {
- if (!Common::File::exists("resource.002"))
- *gameFlags |= ADGF_DEMO;
- return "fairytales";
- }
- // TODO: pq1sci (its resources can't be read)
- if (sierraId == "pq3") {
- // The pq3 demo comes with resource.000 and resource.001
- // The full version was released with several resource.* files,
- // or one big resource.000 file
- if (Common::File::exists("resource.000") && Common::File::exists("resource.001") &&
- !Common::File::exists("resource.002"))
- *gameFlags |= ADGF_DEMO;
- return "pq3";
- }
- if (sierraId == "glory" || sierraId == "hq") {
- // This could either be qfg1 or qfg3 or qfg4
- // qfg3 has resource.aud, qfg4 has resource.sfx
- if (Common::File::exists("resource.aud"))
- return "qfg3";
- else if (Common::File::exists("resource.sfx"))
- return "qfg4";
- else
- return "qfg1";
- }
- // TODO: qfg1 VGA (its resources can't be read)
- if (sierraId == "sq3") {
- // Both SQ3 and the separately released subgame, Astro Chicken,
- // have internal ID "sq3", but Astro Chicken only has "resource.map"
- // and "resource.001". Detect if it's SQ3 by the existence of
- // "resource.002"
- return (Common::File::exists("resource.002")) ? "sq3" : "astrochicken";
- }
- if (sierraId == "sq4") {
- // Both SQ4 and the separately released subgame, Ms. Astro Chicken,
- // have internal ID "sq4", but Astro Chicken only has "resource.map"
- // and "resource.001". Detect if it's SQ4 by the existence of
- // "resource.000" (which exists in both SQ4 floppy and CD, but not in
- // the subgame)
- return (Common::File::exists("resource.000")) ? "sq4" : "msastrochicken";
- }
-
- // FIXME: Evil use of strdup here (we are leaking that memory, too)
- return strdup(sierraId.c_str());
-}
-
Common::Language charToScummVMLanguage(const char c) {
switch (c) {
case 'F':