aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/detection.cpp
diff options
context:
space:
mode:
authorMax Horn2009-07-30 21:56:04 +0000
committerMax Horn2009-07-30 21:56:04 +0000
commit91434bd9c522f7d2c998d9f503916dc77015f26c (patch)
tree3797521b06598db73343bf12ff68239d28fb047c /engines/scumm/detection.cpp
parent3f673b899df123feb4a659e44a49116fc2d8c1da (diff)
downloadscummvm-rg350-91434bd9c522f7d2c998d9f503916dc77015f26c.tar.gz
scummvm-rg350-91434bd9c522f7d2c998d9f503916dc77015f26c.tar.bz2
scummvm-rg350-91434bd9c522f7d2c998d9f503916dc77015f26c.zip
SCUMM: Properly detect & distinguish the three FM-TOWNS double-demos
svn-id: r42951
Diffstat (limited to 'engines/scumm/detection.cpp')
-rw-r--r--engines/scumm/detection.cpp72
1 files changed, 49 insertions, 23 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 5fa74d22c3..8beb2ef720 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -723,6 +723,32 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
return AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
}
+static Common::String generatePreferredTarget(const DetectorResult &x) {
+ Common::String res(x.game.gameid);
+
+ if (x.game.preferredTag) {
+ res = res + "-" + x.game.preferredTag;
+ }
+
+ if (x.game.features & GF_DEMO) {
+ res = res + "-demo";
+ }
+
+ // Append the platform, if a non-standard one has been specified.
+ if (x.game.platform != Common::kPlatformPC && x.game.platform != Common::kPlatformUnknown) {
+ // HACK: For CoMI, it's pointless to encode the fact that it's for Windows
+ if (x.game.id != GID_CMI)
+ res = res + "-" + Common::getPlatformAbbrev(x.game.platform);
+ }
+
+ // Append the language, if a non-standard one has been specified
+ if (x.language != Common::EN_ANY && x.language != Common::UNK_LANG) {
+ res = res + "-" + Common::getLanguageCode(x.language);
+ }
+
+ return res;
+}
+
GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const {
GameList detectedGames;
Common::List<DetectorResult> results;
@@ -737,34 +763,34 @@ GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const {
const PlainGameDescriptor *g = findPlainGameDescriptor(x->game.gameid, gameDescriptions);
assert(g);
GameDescriptor dg(x->game.gameid, g->description, x->language, x->game.platform);
- dg.updateDesc(x->extra); // Append additional information, if set, to the description.
+
+ // Append additional information, if set, to the description.
+ dg.updateDesc(x->extra);
// Compute and set the preferred target name for this game.
// Based on generateComplexID() in advancedDetector.cpp.
- Common::String res(x->game.gameid);
-
- if (x->game.preferredTag) {
- res = res + "-" + x->game.preferredTag;
- }
-
- if (x->game.features & GF_DEMO) {
- res = res + "-demo";
- }
-
- // Append the platform, if a non-standard one has been specified.
- if (x->game.platform != Common::kPlatformPC && x->game.platform != Common::kPlatformUnknown) {
- // HACK: For CoMI, it's pointless to encode the fact that it's for Windows
- if (x->game.id != GID_CMI)
- res = res + "-" + Common::getPlatformAbbrev(x->game.platform);
- }
-
- // Append the language, if a non-standard one has been specified
- if (x->language != Common::EN_ANY && x->language != Common::UNK_LANG) {
- res = res + "-" + Common::getLanguageCode(x->language);
+ dg["preferredtarget"] = generatePreferredTarget(*x);
+
+ // HACK: Detect and distinguish the FM-TOWNS demos
+ if (x->game.platform == Common::kPlatformFMTowns && (x->game.features & GF_DEMO)) {
+ if (x->md5 == "2d388339d6050d8ccaa757b64633954e") {
+ // Indy + Loom demo
+ dg.description() = "Indiana Jones and the Last Crusade & Loom";
+ dg.updateDesc(x->extra);
+ dg["preferredtarget"] = "indyloom";
+ } else if (x->md5 == "77f5c9cc0986eb729c1a6b4c8823bbae") {
+ // Zak + Loom demo
+ dg.description() = "Zak McKracken & Loom";
+ dg.updateDesc(x->extra);
+ dg["preferredtarget"] = "zakloom";
+ } else if (x->md5 == "3938ee1aa4433fca9d9308c9891172b1") {
+ // Indy + Zak demo
+ dg.description() = "Indiana Jones and the Last Crusade & Zak McKracken";
+ dg.updateDesc(x->extra);
+ dg["preferredtarget"] = "indyzak";
+ }
}
- dg["preferredtarget"] = res;
-
dg.setGUIOptions(x->game.guioptions);
detectedGames.push_back(dg);