2009-02-17 15:20:21 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2009-02-15 06:10:59 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
#include "engines/advancedDetector.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
#include "base/plugins.h"
|
|
|
|
|
2009-02-15 11:03:21 +00:00
|
|
|
#include "sci/sci.h"
|
2009-08-18 10:01:18 +00:00
|
|
|
#include "sci/engine/kernel.h"
|
2009-02-19 12:42:32 +00:00
|
|
|
#include "sci/exereader.h"
|
2009-08-17 05:55:21 +00:00
|
|
|
#include "sci/engine/seg_manager.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-20 14:45:28 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-05-14 11:30:21 +00:00
|
|
|
#define GF_FOR_SCI0_BEFORE_629 GF_SCI0_OLDGETTIME
|
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
// Titles of the games
|
|
|
|
static const PlainGameDescriptor SciGameTitles[] = {
|
2009-02-22 14:40:56 +00:00
|
|
|
{"sci", "Sierra SCI Game"},
|
|
|
|
{"sci-fanmade", "Fanmade SCI Game"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"astrochicken", "Astro Chicken"},
|
2009-02-20 23:00:27 +00:00
|
|
|
{"christmas1988", "Christmas Card 1988"},
|
|
|
|
{"christmas1990", "Christmas Card 1990: The Seasoned Professional"},
|
|
|
|
{"christmas1992", "Christmas Card 1992"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"castlebrain", "Castle of Dr. Brain"},
|
|
|
|
{"iceman", "Codename: Iceman"},
|
|
|
|
{"camelot", "Conquests of Camelot: King Arthur, Quest for the Grail"},
|
|
|
|
{"longbow", "Conquests of the Longbow: The Adventures of Robin Hood"},
|
|
|
|
{"ecoquest", "EcoQuest: The Search for Cetus"},
|
2009-02-20 01:48:25 +00:00
|
|
|
{"ecoquest2", "EcoQuest II: Lost Secret of the Rainforest"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"freddypharkas", "Freddy Pharkas: Frontier Pharmacist"},
|
2009-04-03 19:21:31 +00:00
|
|
|
{"funseeker", "Fun Seeker's Guide"},
|
2009-05-02 15:35:57 +00:00
|
|
|
{"hoyle1", "Hoyle Official Book of Games: Volume 1"},
|
|
|
|
{"hoyle2", "Hoyle Official Book of Games: Volume 2"},
|
|
|
|
{"hoyle3", "Hoyle Official Book of Games: Volume 3"},
|
|
|
|
{"hoyle4", "Hoyle Classic Card Games"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"jones", "Jones in the Fast Lane"},
|
|
|
|
{"kq1sci", "King's Quest I: Quest for the Crown"},
|
2009-02-20 03:33:58 +00:00
|
|
|
{"kq4sci", "King's Quest IV: The Perils of Rosella"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"kq5", "King's Quest V: Absence Makes the Heart Go Yonder"},
|
|
|
|
{"kq6", "King's Quest VI: Heir Today, Gone Tomorrow"},
|
|
|
|
{"laurabow", "Laura Bow: The Colonel's Bequest"},
|
|
|
|
{"laurabow2", "Laura Bow 2: The Dagger of Amon Ra"},
|
|
|
|
{"lsl1sci", "Leisure Suit Larry in the Land of the Lounge Lizards"},
|
|
|
|
{"lsl2", "Leisure Suit Larry 2: Goes Looking for Love (in Several Wrong Places)"},
|
|
|
|
{"lsl3", "Leisure Suit Larry 3: Passionate Patti in Pursuit of the Pulsating Pectorals"},
|
|
|
|
{"lsl5", "Leisure Suit Larry 5: Passionate Patti Does a Little Undercover Work"},
|
|
|
|
{"lsl6", "Leisure Suit Larry 6: Shape Up or Slip Out!"},
|
2009-05-02 15:35:57 +00:00
|
|
|
{"lslcasino", "Crazy Nick's Software Picks: Leisure Suit Larry's Casino"},
|
2009-03-31 21:04:48 +00:00
|
|
|
{"fairytales", "Mixed-up Fairy Tales"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"mothergoose", "Mixed-Up Mother Goose"},
|
2009-02-22 23:32:28 +00:00
|
|
|
{"msastrochicken", "Ms. Astro Chicken"},
|
2009-05-17 07:22:07 +00:00
|
|
|
{"pepper", "Pepper's Adventure in Time"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"pq1sci", "Police Quest: In Pursuit of the Death Angel"},
|
|
|
|
{"pq2", "Police Quest II: The Vengeance"},
|
|
|
|
{"pq3", "Police Quest III: The Kindred"},
|
|
|
|
{"qfg1", "Quest for Glory I: So You Want to Be a Hero"},
|
|
|
|
{"qfg2", "Quest for Glory II: Trial by Fire"},
|
|
|
|
{"qfg3", "Quest for Glory III: Wages of War"},
|
2009-05-17 10:40:28 +00:00
|
|
|
{"slater", "Slater & Charlie Go Camping"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"sq1sci", "Space Quest I: The Sarien Encounter"},
|
|
|
|
{"sq3", "Space Quest III: The Pirates of Pestulon"},
|
|
|
|
{"sq4", "Space Quest IV: Roger Wilco and the Time Rippers"},
|
|
|
|
{"sq5", "Space Quest V: The Next Mutation"},
|
|
|
|
{"islandbrain", "The Island of Dr. Brain"},
|
2009-03-30 07:53:32 +00:00
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
{"gk1", "Gabriel Knight: Sins of the Fathers"},
|
|
|
|
{"gk2", "The Beast Within: A Gabriel Knight Mystery"},
|
|
|
|
{"kq7", "King's Quest VII: The Princeless Bride"},
|
|
|
|
{"lsl7", "Leisure Suit Larry 7: Love for Sail!"},
|
|
|
|
{"lighthouse", "Lighthouse: The Dark Being"},
|
|
|
|
{"phantasmagoria", "Phantasmagoria"},
|
|
|
|
{"phantasmagoria2", "Phantasmagoria II: A Puzzle of Flesh"},
|
|
|
|
{"pq4", "Police Quest IV: Open Season"},
|
2009-05-02 15:35:57 +00:00
|
|
|
{"pqswat", "Police Quest: SWAT"},
|
2009-03-30 07:53:32 +00:00
|
|
|
{"qfg4", "Quest for Glory IV: Shadows of Darkness"},
|
|
|
|
{"rama", "RAMA"},
|
|
|
|
{"shivers", "Shivers"},
|
2009-05-17 10:40:28 +00:00
|
|
|
{"shivers2", "Shivers II: Harvest of Souls"},
|
2009-03-30 07:53:32 +00:00
|
|
|
{"sq6", "Space Quest 6: The Spinal Frontier"},
|
2009-02-15 06:10:59 +00:00
|
|
|
{"torin", "Torin's Passage"},
|
2009-05-02 15:35:57 +00:00
|
|
|
#endif // ENABLE_SCI32
|
2009-02-15 06:10:59 +00:00
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
2009-08-24 07:57:04 +00:00
|
|
|
#include "sci/detection_tables.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-19 02:04:31 +00:00
|
|
|
/**
|
|
|
|
* The fallback game descriptor used by the SCI engine's fallbackDetector.
|
|
|
|
* Contents of this struct are to be overwritten by the fallbackDetector.
|
|
|
|
*/
|
2009-05-26 11:30:21 +00:00
|
|
|
static SciGameDescription s_fallbackDesc = {
|
2009-02-19 02:04:31 +00:00
|
|
|
{
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
|
|
|
|
Common::UNK_LANG,
|
|
|
|
Common::kPlatformPC,
|
2009-06-06 17:56:41 +00:00
|
|
|
ADGF_NO_FLAGS,
|
2009-08-24 07:57:04 +00:00
|
|
|
Common::GUIO_NONE
|
2009-02-19 02:04:31 +00:00
|
|
|
},
|
2009-08-16 19:18:19 +00:00
|
|
|
0
|
2009-02-19 02:04:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
static const ADParams detectionParams = {
|
2009-02-15 06:10:59 +00:00
|
|
|
// Pointer to ADGameDescription or its superset structure
|
2009-08-24 07:57:04 +00:00
|
|
|
(const byte *)Sci::SciGameDescriptions,
|
2009-02-15 06:10:59 +00:00
|
|
|
// Size of that superset structure
|
|
|
|
sizeof(SciGameDescription),
|
|
|
|
// Number of bytes to compute MD5 sum for
|
|
|
|
5000,
|
|
|
|
// List of all engine targets
|
|
|
|
SciGameTitles,
|
|
|
|
// Structure for autoupgrading obsolete targets
|
|
|
|
0,
|
|
|
|
// Name of single gameid (optional)
|
|
|
|
"sci",
|
|
|
|
// List of files for file-based fallback detection (optional)
|
2009-02-18 21:05:05 +00:00
|
|
|
0,
|
2009-02-15 06:10:59 +00:00
|
|
|
// Flags
|
2009-06-06 17:56:41 +00:00
|
|
|
0,
|
|
|
|
// Additional GUI options (for every game}
|
|
|
|
Common::GUIO_NONE
|
2009-02-15 06:10:59 +00:00
|
|
|
};
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
class SciMetaEngine : public AdvancedMetaEngine {
|
2009-02-15 06:10:59 +00:00
|
|
|
public:
|
2009-02-15 08:20:53 +00:00
|
|
|
SciMetaEngine() : AdvancedMetaEngine(detectionParams) {}
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
virtual const char *getName() const {
|
2009-03-30 07:53:32 +00:00
|
|
|
return "SCI Engine [SCI0, SCI01, SCI10, SCI11"
|
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
", SCI32"
|
|
|
|
#endif
|
|
|
|
"]";
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-03-05 12:04:58 +00:00
|
|
|
virtual const char *getOriginalCopyright() const {
|
2009-02-15 06:10:59 +00:00
|
|
|
return "Sierra's Creative Interpreter (C) Sierra Online";
|
|
|
|
}
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
|
2009-02-18 21:05:05 +00:00
|
|
|
const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const;
|
2009-02-15 06:10:59 +00:00
|
|
|
};
|
|
|
|
|
2009-08-18 12:49:34 +00:00
|
|
|
Common::String convertSierraGameId(Common::String sierraId) {
|
|
|
|
// TODO: SCI32 IDs
|
|
|
|
|
2009-08-23 21:57:30 +00:00
|
|
|
// TODO: The internal id of christmas1988 is "demo"
|
|
|
|
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";
|
|
|
|
}
|
2009-08-18 12:49:34 +00:00
|
|
|
if (sierraId == "arthur")
|
|
|
|
return "camelot";
|
2009-08-23 21:57:30 +00:00
|
|
|
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";
|
|
|
|
}
|
2009-08-18 12:49:34 +00:00
|
|
|
// iceman is the same
|
|
|
|
// longbow is the same
|
|
|
|
if (sierraId == "eco")
|
|
|
|
return "ecoquest";
|
|
|
|
if (sierraId == "rain")
|
|
|
|
return "ecoquest2";
|
|
|
|
if (sierraId == "fp")
|
|
|
|
return "freddypharkas";
|
|
|
|
if (sierraId == "emc")
|
|
|
|
return "funseeker";
|
|
|
|
if (sierraId == "cardgames")
|
|
|
|
return "hoyle1";
|
|
|
|
if (sierraId == "solitare")
|
|
|
|
return "hoyle2";
|
2009-08-23 21:57:30 +00:00
|
|
|
// hoyle3 is the same
|
|
|
|
// hoyle4 is the same
|
2009-08-18 12:49:34 +00:00
|
|
|
if (sierraId == "kq1")
|
|
|
|
return "kq1sci";
|
|
|
|
if (sierraId == "kq4")
|
|
|
|
return "kq4sci";
|
|
|
|
if (sierraId == "lsl1")
|
|
|
|
return "lsl1sci";
|
|
|
|
// lsl2 is the same
|
|
|
|
// lsl3 is the same
|
|
|
|
// lsl5 is the same
|
|
|
|
// lsl6 is the same
|
|
|
|
// TODO: lslcasino
|
2009-08-23 21:57:30 +00:00
|
|
|
if (sierraId == "tales")
|
|
|
|
return "fairytales";
|
|
|
|
if (sierraId == "mg")
|
|
|
|
return "mothergoose";
|
2009-08-18 12:49:34 +00:00
|
|
|
if (sierraId == "cb1")
|
|
|
|
return "laurabow";
|
|
|
|
if (sierraId == "lb2")
|
|
|
|
return "laurabow2";
|
|
|
|
// TODO: lb2 floppy (its resources can't be read)
|
|
|
|
if (sierraId == "twisty")
|
|
|
|
return "pepper";
|
|
|
|
// TODO: pq1sci (its resources can't be read)
|
|
|
|
if (sierraId == "pq")
|
|
|
|
return "pq2";
|
|
|
|
// pq3 is the same
|
|
|
|
if (sierraId == "glory")
|
|
|
|
return "qfg1";
|
|
|
|
// TODO: qfg1 VGA (its resources can't be read)
|
|
|
|
if (sierraId == "trial")
|
|
|
|
return "qfg2";
|
|
|
|
if (sierraId == "qfg1")
|
|
|
|
return "qfg3";
|
2009-08-23 21:57:30 +00:00
|
|
|
if (sierraId == "thegame")
|
|
|
|
return "slater";
|
2009-08-18 12:49:34 +00:00
|
|
|
if (sierraId == "sq1")
|
|
|
|
return "sq1sci";
|
2009-08-23 21:57:30 +00:00
|
|
|
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";
|
|
|
|
}
|
2009-08-18 12:49:34 +00:00
|
|
|
// sq4 is the same
|
|
|
|
// sq5 is the same
|
|
|
|
|
|
|
|
return sierraId;
|
|
|
|
}
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-18 21:05:05 +00:00
|
|
|
const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fslist) const {
|
2009-02-19 02:04:31 +00:00
|
|
|
bool foundResMap = false;
|
|
|
|
bool foundRes000 = false;
|
2009-02-20 14:45:28 +00:00
|
|
|
Common::Platform exePlatform = Common::kPlatformUnknown;
|
|
|
|
Common::String exeVersionString;
|
2009-02-18 22:20:28 +00:00
|
|
|
|
|
|
|
// First grab all filenames
|
|
|
|
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
|
2009-02-20 14:45:28 +00:00
|
|
|
if (file->isDirectory())
|
|
|
|
continue;
|
|
|
|
|
2009-02-18 22:20:28 +00:00
|
|
|
Common::String filename = file->getName();
|
|
|
|
filename.toLowercase();
|
2009-02-20 14:45:28 +00:00
|
|
|
|
2009-08-18 10:01:18 +00:00
|
|
|
if (filename.contains("resource.map") || filename.contains("resmap.000")) {
|
2009-08-18 12:49:34 +00:00
|
|
|
// HACK: resource.map is located in the same directory as the other resource files,
|
2009-08-18 10:01:18 +00:00
|
|
|
// therefore add the directory here, so that the game files can be opened later on
|
2009-08-21 22:25:55 +00:00
|
|
|
// We now add the parent directory temporary to our SearchMan so the engine code
|
|
|
|
// used in the detection can access all files via Common::File without any problems.
|
|
|
|
// In all branches returning from this function, we need to have a call to
|
|
|
|
// SearchMan.remove to remove it from the default directory pool again.
|
|
|
|
//
|
|
|
|
// A proper solution to remove this hack would be to have the code, which is needed
|
|
|
|
// for detection, to operate on Stream objects, so they can be easily called from
|
|
|
|
// the detection code. This might be easily to achieve through refactoring the
|
|
|
|
// code needed for detection.
|
|
|
|
assert(!SearchMan.hasArchive("SCI_detection"));
|
|
|
|
SearchMan.addDirectory("SCI_detection", file->getParent());
|
2009-02-19 02:04:31 +00:00
|
|
|
foundResMap = true;
|
2009-08-18 10:01:18 +00:00
|
|
|
}
|
2009-02-20 14:45:28 +00:00
|
|
|
|
2009-02-19 02:04:31 +00:00
|
|
|
if (filename.contains("resource.000") || filename.contains("resource.001")
|
|
|
|
|| filename.contains("ressci.000") || filename.contains("ressci.001"))
|
|
|
|
foundRes000 = true;
|
2009-02-18 22:20:28 +00:00
|
|
|
|
2009-02-19 12:42:32 +00:00
|
|
|
// Check if it's a known executable name
|
2009-04-05 12:59:54 +00:00
|
|
|
// Note: "sier" matches "sier.exe", "sierra.exe", "sierw.exe" and "sierw5.exe"
|
|
|
|
if (filename.contains("scidhuv") || filename.contains("sciduv") ||
|
|
|
|
filename.contains("sciv") || filename.contains("sciw") ||
|
2009-03-12 18:15:51 +00:00
|
|
|
filename.contains("prog") || filename.contains("sier")) {
|
2009-02-20 14:45:28 +00:00
|
|
|
|
|
|
|
// We already found a valid exe, no need to check this one.
|
2009-02-22 01:11:06 +00:00
|
|
|
if (!exeVersionString.empty())
|
2009-02-19 23:01:04 +00:00
|
|
|
continue;
|
2009-02-20 14:45:28 +00:00
|
|
|
|
2009-02-19 12:42:32 +00:00
|
|
|
// Is it really an executable file?
|
|
|
|
Common::SeekableReadStream *fileStream = file->createReadStream();
|
2009-02-20 14:45:28 +00:00
|
|
|
exePlatform = getGameExePlatform(fileStream);
|
|
|
|
|
|
|
|
// It's a valid exe, read the interpreter version string
|
|
|
|
if (exePlatform != Common::kPlatformUnknown)
|
2009-02-22 01:11:06 +00:00
|
|
|
exeVersionString = readSciVersionFromExe(fileStream, exePlatform);
|
2009-02-19 12:42:32 +00:00
|
|
|
|
2009-02-19 20:47:06 +00:00
|
|
|
delete fileStream;
|
2009-02-19 12:42:32 +00:00
|
|
|
}
|
2009-02-18 22:20:28 +00:00
|
|
|
}
|
2009-02-20 14:45:28 +00:00
|
|
|
|
2009-02-19 02:04:31 +00:00
|
|
|
// If these files aren't found, it can't be SCI
|
2009-08-21 22:25:55 +00:00
|
|
|
if (!foundResMap && !foundRes000) {
|
|
|
|
SearchMan.remove("SCI_detection");
|
2009-02-19 02:04:31 +00:00
|
|
|
return 0;
|
2009-08-21 22:25:55 +00:00
|
|
|
}
|
2009-02-20 14:45:28 +00:00
|
|
|
|
2009-02-19 02:04:31 +00:00
|
|
|
// Set some defaults
|
2009-05-26 11:30:21 +00:00
|
|
|
s_fallbackDesc.desc.extra = "";
|
|
|
|
s_fallbackDesc.desc.language = Common::UNK_LANG;
|
|
|
|
s_fallbackDesc.desc.platform = exePlatform;
|
|
|
|
s_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
|
2009-02-18 22:20:28 +00:00
|
|
|
|
2009-08-17 05:55:21 +00:00
|
|
|
// Determine the game id
|
2009-08-18 14:10:31 +00:00
|
|
|
ResourceManager *resMgr = new ResourceManager(fslist);
|
2009-08-17 05:55:21 +00:00
|
|
|
SciVersion version = resMgr->sciVersion();
|
2009-08-23 21:57:30 +00:00
|
|
|
SegManager *segManager = new SegManager(resMgr, version);
|
|
|
|
if (!script_instantiate(resMgr, segManager, version, 0)) {
|
2009-08-18 10:01:18 +00:00
|
|
|
warning("fallbackDetect(): Could not instantiate script 0");
|
2009-08-21 22:25:55 +00:00
|
|
|
SearchMan.remove("SCI_detection");
|
2009-08-18 10:01:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2009-08-17 05:55:21 +00:00
|
|
|
reg_t game_obj = script_lookup_export(segManager, 0, 0);
|
2009-08-18 14:10:31 +00:00
|
|
|
Common::String gameName = obj_get_name(segManager, version, game_obj);
|
|
|
|
debug(2, "Detected ID: \"%s\" at %04x:%04x", gameName.c_str(), PRINT_REG(game_obj));
|
2009-08-18 10:01:18 +00:00
|
|
|
gameName.toLowercase();
|
2009-08-18 12:49:34 +00:00
|
|
|
s_fallbackDesc.desc.gameid = strdup(convertSierraGameId(gameName).c_str());
|
2009-08-17 05:55:21 +00:00
|
|
|
delete segManager;
|
|
|
|
delete resMgr;
|
|
|
|
|
2009-02-18 22:20:28 +00:00
|
|
|
printf("If this is *NOT* a fan-modified version (in particular, not a fan-made\n");
|
|
|
|
printf("translation), please, report the data above, including the following\n");
|
|
|
|
printf("version number, from the game's executable:\n");
|
2009-08-15 12:09:47 +00:00
|
|
|
printf("Version: %s\n\n", exeVersionString.empty() ? "not found" : exeVersionString.c_str());
|
2009-02-18 21:05:05 +00:00
|
|
|
|
2009-08-21 22:25:55 +00:00
|
|
|
SearchMan.remove("SCI_detection");
|
|
|
|
|
2009-08-15 12:09:47 +00:00
|
|
|
return (const ADGameDescription *)&s_fallbackDesc;
|
2009-02-18 21:05:05 +00:00
|
|
|
}
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
bool SciMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
|
2009-02-15 06:10:59 +00:00
|
|
|
const SciGameDescription *desc = (const SciGameDescription *)gd;
|
|
|
|
|
|
|
|
*engine = new SciEngine(syst, desc);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-02-20 14:45:28 +00:00
|
|
|
} // End of namespace Sci
|
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
#if PLUGIN_ENABLED_DYNAMIC(SCI)
|
2009-02-20 14:45:28 +00:00
|
|
|
REGISTER_PLUGIN_DYNAMIC(SCI, PLUGIN_TYPE_ENGINE, Sci::SciMetaEngine);
|
2009-02-15 06:10:59 +00:00
|
|
|
#else
|
2009-02-20 14:45:28 +00:00
|
|
|
REGISTER_PLUGIN_STATIC(SCI, PLUGIN_TYPE_ENGINE, Sci::SciMetaEngine);
|
2009-02-15 06:10:59 +00:00
|
|
|
#endif
|