2009-12-29 23:18:24 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
|
|
|
#include "engines/advancedDetector.h"
|
|
|
|
#include "common/savefile.h"
|
2011-04-24 08:34:27 +00:00
|
|
|
#include "common/system.h"
|
2011-04-28 17:24:24 +00:00
|
|
|
#include "common/textconsole.h"
|
2009-12-29 23:18:24 +00:00
|
|
|
|
|
|
|
#include "mohawk/livingbooks.h"
|
2011-03-28 19:31:14 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_CSTIME
|
2011-01-20 21:35:00 +00:00
|
|
|
#include "mohawk/cstime.h"
|
2011-03-28 19:31:14 +00:00
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
|
2011-03-28 19:20:30 +00:00
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
#include "mohawk/myst.h"
|
|
|
|
#endif
|
|
|
|
|
2011-03-28 19:43:57 +00:00
|
|
|
#ifdef ENABLE_RIVEN
|
|
|
|
#include "mohawk/riven.h"
|
|
|
|
#endif
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
namespace Mohawk {
|
|
|
|
|
|
|
|
struct MohawkGameDescription {
|
|
|
|
ADGameDescription desc;
|
|
|
|
|
|
|
|
uint8 gameType;
|
|
|
|
uint32 features;
|
2010-11-24 21:12:21 +00:00
|
|
|
const char *appName;
|
2009-12-29 23:18:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const char* MohawkEngine::getGameId() const {
|
|
|
|
return _gameDescription->desc.gameid;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MohawkEngine::getFeatures() const {
|
|
|
|
return _gameDescription->features;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Platform MohawkEngine::getPlatform() const {
|
|
|
|
return _gameDescription->desc.platform;
|
|
|
|
}
|
|
|
|
|
2010-11-24 21:12:21 +00:00
|
|
|
const char *MohawkEngine::getAppName() const {
|
|
|
|
return _gameDescription->appName;
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2009-12-30 23:02:14 +00:00
|
|
|
uint8 MohawkEngine::getGameType() const {
|
2009-12-29 23:18:24 +00:00
|
|
|
return _gameDescription->gameType;
|
|
|
|
}
|
|
|
|
|
2009-12-30 23:02:14 +00:00
|
|
|
Common::String MohawkEngine_LivingBooks::getBookInfoFileName() const {
|
2009-12-29 23:18:24 +00:00
|
|
|
return _gameDescription->desc.filesDescriptions[0].fileName;
|
|
|
|
}
|
|
|
|
|
2009-12-30 23:02:14 +00:00
|
|
|
Common::Language MohawkEngine::getLanguage() const {
|
2009-12-29 23:18:24 +00:00
|
|
|
return _gameDescription->desc.language;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MohawkEngine::hasFeature(EngineFeature f) const {
|
|
|
|
return
|
|
|
|
(f == kSupportsRTL);
|
|
|
|
}
|
|
|
|
|
2011-03-28 19:20:30 +00:00
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
bool MohawkEngine_Myst::hasFeature(EngineFeature f) const {
|
2010-01-25 01:39:44 +00:00
|
|
|
return
|
2009-12-29 23:18:24 +00:00
|
|
|
MohawkEngine::hasFeature(f)
|
|
|
|
|| (f == kSupportsLoadingDuringRuntime)
|
|
|
|
|| (f == kSupportsSavingDuringRuntime);
|
|
|
|
}
|
|
|
|
|
2011-03-28 19:20:30 +00:00
|
|
|
#endif
|
|
|
|
|
2011-03-28 19:43:57 +00:00
|
|
|
#ifdef ENABLE_RIVEN
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
|
2010-01-25 01:39:44 +00:00
|
|
|
return
|
2009-12-29 23:18:24 +00:00
|
|
|
MohawkEngine::hasFeature(f)
|
|
|
|
|| (f == kSupportsLoadingDuringRuntime)
|
|
|
|
|| (f == kSupportsSavingDuringRuntime);
|
|
|
|
}
|
|
|
|
|
2011-03-28 19:43:57 +00:00
|
|
|
#endif
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
} // End of Namespace Mohawk
|
|
|
|
|
|
|
|
static const PlainGameDescriptor mohawkGames[] = {
|
|
|
|
{"mohawk", "Mohawk Game"},
|
|
|
|
{"myst", "Myst"},
|
|
|
|
{"MakingOfMyst", "The Making of Myst"},
|
|
|
|
{"riven", "Riven: The Sequel to Myst"},
|
2010-12-25 19:52:24 +00:00
|
|
|
{"zoombini", "Logical Journey of the Zoombinis"},
|
2011-01-03 22:53:12 +00:00
|
|
|
{"cstime", "Where in Time is Carmen Sandiego?"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"csworld", "Where in the World is Carmen Sandiego?"},
|
|
|
|
{"csamtrak", "Where in America is Carmen Sandiego? (The Great Amtrak Train Adventure)"},
|
2011-01-31 23:10:18 +00:00
|
|
|
{"carmentq", "Carmen Sandiego's ThinkQuick Challenge"},
|
2011-04-07 22:13:32 +00:00
|
|
|
{"carmentqc", "Carmen Sandiego's ThinkQuick Challenge Custom Question Creator"},
|
2010-11-29 06:35:50 +00:00
|
|
|
{"maggiesfa", "Maggie's Farmyard Adventure"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"jamesmath", "James Discovers/Explores Math"},
|
|
|
|
{"treehouse", "The Treehouse"},
|
|
|
|
{"greeneggs", "Green Eggs and Ham"},
|
2011-03-27 15:44:02 +00:00
|
|
|
{"seussabc", "Dr Seuss's ABC"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"1stdegree", "In the 1st Degree"},
|
|
|
|
{"csusa", "Where in the USA is Carmen Sandiego?"},
|
|
|
|
{"tortoise", "Aesop's Fables: The Tortoise and the Hare"},
|
2011-04-02 15:08:05 +00:00
|
|
|
{"arthur", "Arthur's Teacher Trouble"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"grandma", "Just Grandma and Me"},
|
|
|
|
{"ruff", "Ruff's Bone"},
|
|
|
|
{"newkid", "The New Kid on the Block"},
|
|
|
|
{"arthurrace", "Arthur's Reading Race"},
|
2010-07-09 22:10:22 +00:00
|
|
|
{"arthurbday", "Arthur's Birthday"},
|
|
|
|
{"lilmonster", "Little Monster at School"},
|
2011-01-26 18:40:28 +00:00
|
|
|
{"catinthehat", "The Cat in the Hat"},
|
2010-12-25 18:45:29 +00:00
|
|
|
{"rugrats", "Rugrats Adventure Game"},
|
2011-01-27 19:20:27 +00:00
|
|
|
{"lbsampler", "Living Books Sampler"},
|
2011-02-01 02:47:24 +00:00
|
|
|
{"bearfight", "The Berenstain Bears Get in a Fight"},
|
2011-04-24 10:10:07 +00:00
|
|
|
{"beardark", "The Berenstain Bears In The Dark"},
|
2011-02-01 02:54:51 +00:00
|
|
|
{"arthurcomp", "Arthur's Computer Adventure"},
|
2011-02-20 10:54:45 +00:00
|
|
|
{"harryhh","Harry and the Haunted House"},
|
2011-03-29 21:53:10 +00:00
|
|
|
{"stellaluna", "Stellaluna"},
|
|
|
|
{"sheila", "Sheila Rae, the Brave"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
2010-06-14 14:52:49 +00:00
|
|
|
#include "mohawk/detection_tables.h"
|
2009-12-29 23:18:24 +00:00
|
|
|
|
2010-06-15 10:59:43 +00:00
|
|
|
static const char *directoryGlobs[] = {
|
|
|
|
"all",
|
|
|
|
"assets1",
|
|
|
|
"data",
|
2010-12-25 18:45:29 +00:00
|
|
|
"program",
|
2011-01-31 23:10:18 +00:00
|
|
|
"95instal",
|
2010-12-25 18:45:29 +00:00
|
|
|
"Rugrats Adventure Game",
|
2010-06-15 10:59:43 +00:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
class MohawkMetaEngine : public AdvancedMetaEngine {
|
|
|
|
public:
|
2011-06-10 13:53:54 +00:00
|
|
|
MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) {
|
2011-06-11 15:52:32 +00:00
|
|
|
_singleid = "mohawk";
|
|
|
|
_maxScanDepth = 2;
|
|
|
|
_directoryGlobs = directoryGlobs;
|
2011-06-10 13:53:54 +00:00
|
|
|
}
|
2011-06-14 16:11:14 +00:00
|
|
|
|
|
|
|
virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
|
|
|
|
return detectGameFilebased(allFiles, Mohawk::fileBased);
|
|
|
|
}
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
virtual const char *getName() const {
|
2011-05-15 14:50:09 +00:00
|
|
|
return "Mohawk";
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual const char *getOriginalCopyright() const {
|
|
|
|
return "Myst and Riven (C) Cyan Worlds\nMohawk OS (C) Ubisoft";
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool hasFeature(MetaEngineFeature f) const;
|
|
|
|
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
|
|
|
|
virtual SaveStateList listSaves(const char *target) const;
|
|
|
|
virtual int getMaximumSaveSlot() const { return 999; }
|
|
|
|
virtual void removeSaveState(const char *target, int slot) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool MohawkMetaEngine::hasFeature(MetaEngineFeature f) const {
|
2010-01-25 01:39:44 +00:00
|
|
|
return
|
2009-12-29 23:18:24 +00:00
|
|
|
(f == kSupportsListSaves)
|
|
|
|
|| (f == kSupportsLoadingDuringStartup)
|
|
|
|
|| (f == kSupportsDeleteSave);
|
|
|
|
}
|
|
|
|
|
|
|
|
SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
|
2010-03-18 15:54:40 +00:00
|
|
|
Common::StringArray filenames;
|
2009-12-29 23:18:24 +00:00
|
|
|
SaveStateList saveList;
|
|
|
|
|
|
|
|
// Loading games is only supported in Myst/Riven currently.
|
|
|
|
if (strstr(target, "myst")) {
|
|
|
|
filenames = g_system->getSavefileManager()->listSavefiles("*.mys");
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
for (uint32 i = 0; i < filenames.size(); i++)
|
|
|
|
saveList.push_back(SaveStateDescriptor(i, filenames[i]));
|
|
|
|
} else if (strstr(target, "riven")) {
|
|
|
|
filenames = g_system->getSavefileManager()->listSavefiles("*.rvn");
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
for (uint32 i = 0; i < filenames.size(); i++)
|
|
|
|
saveList.push_back(SaveStateDescriptor(i, filenames[i]));
|
2010-01-25 01:39:44 +00:00
|
|
|
}
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
return saveList;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MohawkMetaEngine::removeSaveState(const char *target, int slot) const {
|
|
|
|
// Removing saved games is only supported in Myst/Riven currently.
|
|
|
|
if (strstr(target, "myst")) {
|
2010-03-18 15:54:40 +00:00
|
|
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles("*.mys");
|
2009-12-29 23:18:24 +00:00
|
|
|
g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
|
|
|
|
} else if (strstr(target, "riven")) {
|
2010-03-18 15:54:40 +00:00
|
|
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles("*.rvn");
|
2009-12-29 23:18:24 +00:00
|
|
|
g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
|
|
|
|
const Mohawk::MohawkGameDescription *gd = (const Mohawk::MohawkGameDescription *)desc;
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
if (gd) {
|
|
|
|
switch (gd->gameType) {
|
|
|
|
case Mohawk::GType_MYST:
|
|
|
|
case Mohawk::GType_MAKINGOF:
|
2011-03-28 19:20:30 +00:00
|
|
|
#ifdef ENABLE_MYST
|
2009-12-29 23:18:24 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_Myst(syst, gd);
|
|
|
|
break;
|
2011-03-28 19:20:30 +00:00
|
|
|
#else
|
|
|
|
warning("Myst support not compiled in");
|
|
|
|
return false;
|
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
case Mohawk::GType_RIVEN:
|
2011-03-28 19:43:57 +00:00
|
|
|
#ifdef ENABLE_RIVEN
|
2009-12-29 23:18:24 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_Riven(syst, gd);
|
|
|
|
break;
|
2011-03-28 19:43:57 +00:00
|
|
|
#else
|
|
|
|
warning("Riven support not compiled in");
|
|
|
|
return false;
|
|
|
|
#endif
|
2010-01-22 03:43:57 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV1:
|
2010-11-29 12:51:53 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV2:
|
2010-01-22 03:43:57 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV3:
|
2011-01-31 23:10:18 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV4:
|
|
|
|
case Mohawk::GType_LIVINGBOOKSV5:
|
2009-12-29 23:18:24 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_LivingBooks(syst, gd);
|
|
|
|
break;
|
2011-01-03 22:53:12 +00:00
|
|
|
case Mohawk::GType_CSTIME:
|
2011-03-28 19:31:14 +00:00
|
|
|
#ifdef ENABLE_CSTIME
|
2011-01-20 21:35:00 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_CSTime(syst, gd);
|
|
|
|
break;
|
2011-03-28 19:31:14 +00:00
|
|
|
#else
|
|
|
|
warning("CSTime support not compiled in");
|
|
|
|
return false;
|
|
|
|
#endif
|
2011-01-20 21:35:00 +00:00
|
|
|
case Mohawk::GType_ZOOMBINI:
|
2009-12-29 23:18:24 +00:00
|
|
|
case Mohawk::GType_CSWORLD:
|
|
|
|
case Mohawk::GType_CSAMTRAK:
|
|
|
|
case Mohawk::GType_JAMESMATH:
|
|
|
|
case Mohawk::GType_TREEHOUSE:
|
|
|
|
case Mohawk::GType_1STDEGREE:
|
|
|
|
case Mohawk::GType_CSUSA:
|
2011-03-28 19:31:14 +00:00
|
|
|
warning("Unsupported Mohawk Engine");
|
|
|
|
return false;
|
2009-12-29 23:18:24 +00:00
|
|
|
default:
|
2011-03-28 19:20:30 +00:00
|
|
|
error("Unknown Mohawk Engine");
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return (gd != 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if PLUGIN_ENABLED_DYNAMIC(MOHAWK)
|
|
|
|
REGISTER_PLUGIN_DYNAMIC(MOHAWK, PLUGIN_TYPE_ENGINE, MohawkMetaEngine);
|
|
|
|
#else
|
|
|
|
REGISTER_PLUGIN_STATIC(MOHAWK, PLUGIN_TYPE_ENGINE, MohawkMetaEngine);
|
|
|
|
#endif
|