2008-11-14 21:32:20 +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.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "groovie/groovie.h"
|
2009-11-23 23:53:25 +00:00
|
|
|
#include "groovie/detection.h"
|
2009-01-13 23:22:47 +00:00
|
|
|
#include "groovie/saveload.h"
|
2008-11-14 21:32:20 +00:00
|
|
|
|
2010-06-07 17:14:42 +00:00
|
|
|
#include "common/system.h"
|
|
|
|
|
2008-11-14 21:32:20 +00:00
|
|
|
namespace Groovie {
|
|
|
|
|
|
|
|
static const PlainGameDescriptor groovieGames[] = {
|
|
|
|
// Games
|
|
|
|
{"t7g", "The 7th Guest"},
|
|
|
|
|
2009-08-31 01:52:16 +00:00
|
|
|
#ifdef ENABLE_GROOVIE2
|
2009-11-03 21:51:24 +00:00
|
|
|
{"11h", "The 11th Hour: The Sequel to The 7th Guest"},
|
2008-11-14 21:32:20 +00:00
|
|
|
{"clandestiny", "Clandestiny"},
|
|
|
|
{"unclehenry", "Uncle Henry's Playhouse"},
|
|
|
|
{"tlc", "Tender Loving Care"},
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Unknown
|
|
|
|
{"groovie", "Groovie engine game"},
|
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const GroovieGameDescription gameDescriptions[] = {
|
|
|
|
|
|
|
|
// The 7th Guest DOS English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
|
|
|
"t7g", "",
|
|
|
|
AD_ENTRY1s("script.grv", "d1b8033b40aa67c076039881eccce90d", 16659),
|
2010-09-08 09:37:33 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS,
|
|
|
|
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieT7G, 0
|
|
|
|
},
|
|
|
|
|
|
|
|
// The 7th Guest Mac English
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"t7g", "",
|
2010-05-11 15:41:31 +00:00
|
|
|
AD_ENTRY1s("T7GMac", "a139540fa2be2247005ccf888b7231e3", 1830783),
|
2010-09-08 09:37:33 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK,
|
|
|
|
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieT7G, 0
|
|
|
|
},
|
|
|
|
|
2008-12-29 16:58:48 +00:00
|
|
|
// The 7th Guest DOS Russian (Akella)
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-12-29 16:58:48 +00:00
|
|
|
{
|
|
|
|
"t7g", "",
|
|
|
|
{
|
|
|
|
{ "script.grv", 0, "d1b8033b40aa67c076039881eccce90d", 16659},
|
|
|
|
{ "intro.gjd", 0, NULL, 31711554},
|
|
|
|
{ NULL, 0, NULL, 0}
|
|
|
|
},
|
2010-09-08 09:37:33 +00:00
|
|
|
Common::RU_RUS, Common::kPlatformPC, ADGF_NO_FLAGS,
|
|
|
|
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
|
2008-12-29 16:58:48 +00:00
|
|
|
},
|
|
|
|
kGroovieT7G, 0
|
|
|
|
},
|
|
|
|
|
2009-08-31 01:52:16 +00:00
|
|
|
#ifdef ENABLE_GROOVIE2
|
2008-11-14 21:32:20 +00:00
|
|
|
// The 11th Hour DOS English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
|
|
|
"11h", "",
|
|
|
|
AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227),
|
2010-09-08 09:37:33 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS,
|
|
|
|
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieV2, 1
|
|
|
|
},
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-12-21 17:53:38 +00:00
|
|
|
// The 11th Hour DOS Demo English
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"11h", "Demo",
|
2008-12-23 21:17:39 +00:00
|
|
|
AD_ENTRY1s("disk.1", "aacb32ce07e0df2894bd83a3dee40c12", 70),
|
2010-09-08 09:37:33 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, Common::GUIO_NOLAUNCHLOAD |
|
|
|
|
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
|
2008-12-21 17:53:38 +00:00
|
|
|
},
|
2008-12-23 21:17:39 +00:00
|
|
|
kGroovieV2, 1
|
2008-12-21 17:53:38 +00:00
|
|
|
},
|
2008-11-14 21:32:20 +00:00
|
|
|
|
|
|
|
// The Making of The 11th Hour DOS English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
2009-03-14 11:26:46 +00:00
|
|
|
"11h", "Making Of",
|
2008-11-14 21:32:20 +00:00
|
|
|
AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227),
|
2009-06-14 22:10:17 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieV2, 2
|
|
|
|
},
|
|
|
|
|
|
|
|
// Clandestiny Trailer DOS English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
2009-03-14 11:26:46 +00:00
|
|
|
"clandestiny", "Trailer",
|
2008-11-14 21:32:20 +00:00
|
|
|
AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227),
|
2009-06-14 22:10:17 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieV2, 3
|
|
|
|
},
|
|
|
|
|
|
|
|
// Clandestiny DOS English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
|
|
|
"clandestiny", "",
|
|
|
|
AD_ENTRY1s("disk.1", "f79fc1515174540fef6a34132efc4c53", 76),
|
2009-06-14 22:10:17 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieV2, 1
|
|
|
|
},
|
|
|
|
|
|
|
|
// Uncle Henry's Playhouse PC English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
|
|
|
"unclehenry", "",
|
|
|
|
AD_ENTRY1s("disk.1", "0e1b1d3cecc4fc7efa62a968844d1f7a", 72),
|
2009-06-14 22:10:17 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieV2, 1
|
|
|
|
},
|
|
|
|
|
|
|
|
// Tender Loving Care PC English
|
2009-01-01 15:06:43 +00:00
|
|
|
{
|
2008-11-14 21:32:20 +00:00
|
|
|
{
|
|
|
|
"tlc", "",
|
|
|
|
AD_ENTRY1s("disk.1", "32a1afa68478f1f9d2b25eeea427f2e3", 84),
|
2009-06-14 22:10:17 +00:00
|
|
|
Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI
|
2008-11-14 21:32:20 +00:00
|
|
|
},
|
|
|
|
kGroovieV2, 1
|
|
|
|
},
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{AD_TABLE_END_MARKER, kGroovieT7G, 0}
|
|
|
|
};
|
|
|
|
|
2009-01-29 22:13:01 +00:00
|
|
|
static const ADParams detectionParams = {
|
2008-11-14 21:32:20 +00:00
|
|
|
// Pointer to ADGameDescription or its superset structure
|
|
|
|
(const byte *)gameDescriptions,
|
|
|
|
// Size of that superset structure
|
|
|
|
sizeof(GroovieGameDescription),
|
|
|
|
// Number of bytes to compute MD5 sum for
|
|
|
|
5000,
|
|
|
|
// List of all engine targets
|
|
|
|
groovieGames,
|
|
|
|
// Structure for autoupgrading obsolete targets
|
|
|
|
0,
|
|
|
|
// Name of single gameid (optional)
|
2009-03-14 10:55:52 +00:00
|
|
|
"groovie",
|
2008-11-14 21:32:20 +00:00
|
|
|
// List of files for file-based fallback detection (optional)
|
|
|
|
0,
|
|
|
|
// Flags
|
2009-06-06 17:56:41 +00:00
|
|
|
kADFlagUseExtraAsHint,
|
|
|
|
// Additional GUI options (for every game}
|
2010-06-14 14:50:23 +00:00
|
|
|
Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX,
|
|
|
|
// Maximum directory depth
|
2010-06-15 10:59:23 +00:00
|
|
|
1,
|
|
|
|
// List of directory globs
|
|
|
|
0
|
2008-11-14 21:32:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-01-29 22:13:01 +00:00
|
|
|
class GroovieMetaEngine : public AdvancedMetaEngine {
|
2008-11-14 21:32:20 +00:00
|
|
|
public:
|
2009-01-29 22:13:01 +00:00
|
|
|
GroovieMetaEngine() : AdvancedMetaEngine(detectionParams) {}
|
2008-11-14 21:32:20 +00:00
|
|
|
|
|
|
|
const char *getName() const {
|
|
|
|
return "Groovie Engine";
|
|
|
|
}
|
|
|
|
|
2009-03-05 12:04:58 +00:00
|
|
|
const char *getOriginalCopyright() const {
|
2008-11-14 21:32:20 +00:00
|
|
|
return "Groovie Engine (C) 1990-1996 Trilobyte";
|
|
|
|
}
|
|
|
|
|
2009-01-29 22:13:01 +00:00
|
|
|
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
|
2008-11-14 21:32:20 +00:00
|
|
|
|
|
|
|
bool hasFeature(MetaEngineFeature f) const;
|
|
|
|
SaveStateList listSaves(const char *target) const;
|
2008-11-15 10:50:57 +00:00
|
|
|
int getMaximumSaveSlot() const;
|
2008-11-14 21:32:20 +00:00
|
|
|
void removeSaveState(const char *target, int slot) const;
|
2009-01-13 23:22:47 +00:00
|
|
|
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
|
2008-11-14 21:32:20 +00:00
|
|
|
};
|
|
|
|
|
2009-01-29 22:13:01 +00:00
|
|
|
bool GroovieMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
|
2008-11-14 21:32:20 +00:00
|
|
|
if (gd) {
|
2009-02-15 10:32:06 +00:00
|
|
|
*engine = new GroovieEngine(syst, (const GroovieGameDescription *)gd);
|
2008-11-14 21:32:20 +00:00
|
|
|
}
|
|
|
|
return gd != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GroovieMetaEngine::hasFeature(MetaEngineFeature f) const {
|
|
|
|
return
|
|
|
|
(f == kSupportsListSaves) ||
|
|
|
|
(f == kSupportsLoadingDuringStartup) ||
|
2009-01-13 23:22:47 +00:00
|
|
|
(f == kSupportsDeleteSave) ||
|
|
|
|
(f == kSavesSupportMetaInfo);
|
2008-11-14 21:32:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SaveStateList GroovieMetaEngine::listSaves(const char *target) const {
|
2009-01-13 23:22:47 +00:00
|
|
|
return SaveLoad::listValidSaves(target);
|
2008-11-14 21:32:20 +00:00
|
|
|
}
|
|
|
|
|
2008-11-15 10:50:57 +00:00
|
|
|
int GroovieMetaEngine::getMaximumSaveSlot() const {
|
2009-01-13 23:22:47 +00:00
|
|
|
return SaveLoad::getMaximumSlot();
|
2008-11-15 10:50:57 +00:00
|
|
|
}
|
|
|
|
|
2008-11-14 21:32:20 +00:00
|
|
|
void GroovieMetaEngine::removeSaveState(const char *target, int slot) const {
|
2009-01-13 23:22:47 +00:00
|
|
|
if (!SaveLoad::isSlotValid(slot)) {
|
2008-11-14 21:32:20 +00:00
|
|
|
// Invalid slot, do nothing
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-01-13 23:22:47 +00:00
|
|
|
Common::String filename = SaveLoad::getSlotSaveName(target, slot);
|
2009-05-29 14:38:22 +00:00
|
|
|
g_system->getSavefileManager()->removeSavefile(filename);
|
2009-01-13 23:22:47 +00:00
|
|
|
}
|
2008-11-14 21:32:20 +00:00
|
|
|
|
2009-01-13 23:22:47 +00:00
|
|
|
SaveStateDescriptor GroovieMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
|
|
|
|
SaveStateDescriptor desc;
|
2008-11-14 21:32:20 +00:00
|
|
|
|
2009-01-13 23:22:47 +00:00
|
|
|
Common::InSaveFile *savefile = SaveLoad::openForLoading(target, slot, &desc);
|
2010-01-03 19:37:43 +00:00
|
|
|
delete savefile;
|
2009-01-13 23:22:47 +00:00
|
|
|
|
|
|
|
return desc;
|
2008-11-14 21:32:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Groovie
|
|
|
|
|
|
|
|
#if PLUGIN_ENABLED_DYNAMIC(GROOVIE)
|
|
|
|
REGISTER_PLUGIN_DYNAMIC(GROOVIE, PLUGIN_TYPE_ENGINE, Groovie::GroovieMetaEngine);
|
|
|
|
#else
|
|
|
|
REGISTER_PLUGIN_STATIC(GROOVIE, PLUGIN_TYPE_ENGINE, Groovie::GroovieMetaEngine);
|
|
|
|
#endif
|