2005-11-12 06:01:24 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-05-05 00:42:37 +00:00
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2001-2006 The ScummVM project
|
2005-11-12 06:01:24 +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.
|
|
|
|
*
|
2006-02-11 12:46:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2005-11-12 06:01:24 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/stdafx.h"
|
|
|
|
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
2007-01-21 16:57:13 +00:00
|
|
|
#include "common/advancedDetector.h"
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
#include "agos/agos.h"
|
2006-03-09 14:30:43 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2007-01-21 16:57:13 +00:00
|
|
|
|
|
|
|
struct AGOSGameDescription {
|
|
|
|
Common::ADGameDescription desc;
|
|
|
|
|
|
|
|
int gameType;
|
|
|
|
int gameId;
|
|
|
|
uint32 features;
|
|
|
|
};
|
|
|
|
|
2007-01-20 21:27:57 +00:00
|
|
|
static GameList GAME_detectGames(const FSList &fslist);
|
2006-03-09 14:30:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Conversion table mapping old obsolete target names to the
|
|
|
|
* corresponding new target and platform combination.
|
|
|
|
*
|
|
|
|
*/
|
2006-11-10 22:43:10 +00:00
|
|
|
static const Common::ADObsoleteGameID obsoleteGameIDsTable[] = {
|
2006-03-09 14:30:43 +00:00
|
|
|
{"simon1acorn", "simon1", Common::kPlatformAcorn},
|
|
|
|
{"simon1amiga", "simon1", Common::kPlatformAmiga},
|
|
|
|
{"simon1cd32", "simon1", Common::kPlatformAmiga},
|
2006-05-04 06:55:35 +00:00
|
|
|
{"simon1demo", "simon1", Common::kPlatformPC},
|
2006-03-09 14:30:43 +00:00
|
|
|
{"simon1dos", "simon1", Common::kPlatformPC},
|
|
|
|
{"simon1talkie", "simon1", Common::kPlatformPC},
|
|
|
|
{"simon1win", "simon1", Common::kPlatformWindows},
|
|
|
|
{"simon2dos", "simon2", Common::kPlatformPC},
|
|
|
|
{"simon2talkie", "simon2", Common::kPlatformPC},
|
|
|
|
{"simon2mac", "simon2", Common::kPlatformMacintosh},
|
|
|
|
{"simon2win", "simon2", Common::kPlatformWindows},
|
2006-11-12 03:23:29 +00:00
|
|
|
{0, 0, Common::kPlatformUnknown}
|
2006-03-09 14:30:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const PlainGameDescriptor simonGames[] = {
|
2006-10-06 05:17:54 +00:00
|
|
|
{"elvira1", "Elvira - Mistress of the Dark"},
|
2006-10-06 09:21:34 +00:00
|
|
|
{"elvira2", "Elvira II - The Jaws of Cerberus"},
|
2006-09-29 03:44:55 +00:00
|
|
|
{"waxworks", "Waxworks"},
|
|
|
|
{"simon1", "Simon the Sorcerer 1"},
|
|
|
|
{"simon2", "Simon the Sorcerer 2"},
|
|
|
|
{"feeble", "The Feeble Files"},
|
2006-09-29 05:33:22 +00:00
|
|
|
{"dimp", "Demon in my Pocket"},
|
2006-09-28 23:22:07 +00:00
|
|
|
{"jumble", "Jumble"},
|
2006-09-29 04:48:04 +00:00
|
|
|
{"puzzle", "NoPatience"},
|
2006-09-28 23:22:07 +00:00
|
|
|
{"swampy", "Swampy Adventures"},
|
2006-11-12 03:23:29 +00:00
|
|
|
{0, 0}
|
2006-03-09 14:30:43 +00:00
|
|
|
};
|
|
|
|
|
2007-01-24 22:24:52 +00:00
|
|
|
namespace AGOS {
|
|
|
|
|
|
|
|
#include "agosgame.cpp"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static const Common::ADParams detectionParams = {
|
|
|
|
// Pointer to ADGameDescription or its superset structure
|
|
|
|
(const byte *)AGOS::gameDescriptions,
|
|
|
|
// Size of that superset structure
|
|
|
|
sizeof(AGOS::AGOSGameDescription),
|
|
|
|
// Number of bytes to compute MD5 sum for
|
|
|
|
5000,
|
|
|
|
// List of all engine targets
|
|
|
|
simonGames,
|
|
|
|
// Structure for autoupgrading obsolete targets
|
2007-01-28 07:31:26 +00:00
|
|
|
obsoleteGameIDsTable,
|
|
|
|
// Name of single gameid (optional)
|
|
|
|
0,
|
2007-02-04 03:10:27 +00:00
|
|
|
// List of files for file-based fallback detection (optional)
|
|
|
|
0,
|
2007-01-28 07:31:26 +00:00
|
|
|
// Flags
|
2007-02-13 13:17:46 +00:00
|
|
|
Common::kADFlagAugmentPreferredTarget
|
2007-01-24 22:24:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, AGOS::AGOSEngine, AGOS::GAME_detectGames, detectionParams);
|
2006-03-09 14:30:43 +00:00
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
|
2006-03-09 14:30:43 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2006-11-12 03:23:29 +00:00
|
|
|
bool AGOSEngine::initGame() {
|
2007-01-25 21:16:57 +00:00
|
|
|
int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
|
|
if (i < 0)
|
|
|
|
return false;
|
2007-01-24 22:24:52 +00:00
|
|
|
|
2006-11-12 03:23:29 +00:00
|
|
|
_gameDescription = &gameDescriptions[i];
|
|
|
|
return true;
|
|
|
|
}
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2007-01-20 21:27:57 +00:00
|
|
|
GameList GAME_detectGames(const FSList &fslist) {
|
2007-01-25 21:16:57 +00:00
|
|
|
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
2006-11-12 03:23:29 +00:00
|
|
|
}
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2007-01-21 16:57:13 +00:00
|
|
|
int AGOSEngine::getGameId() const {
|
|
|
|
return _gameDescription->gameId;
|
|
|
|
}
|
|
|
|
|
|
|
|
int AGOSEngine::getGameType() const {
|
|
|
|
return _gameDescription->gameType;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 AGOSEngine::getFeatures() const {
|
|
|
|
return _gameDescription->features;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *AGOSEngine::getExtra() const {
|
|
|
|
return _gameDescription->desc.extra;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Language AGOSEngine::getLanguage() const {
|
|
|
|
return _gameDescription->desc.language;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Platform AGOSEngine::getPlatform() const {
|
|
|
|
return _gameDescription->desc.platform;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *AGOSEngine::getFileName(int type) const {
|
|
|
|
for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileType; i++) {
|
|
|
|
if (_gameDescription->desc.filesDescriptions[i].fileType == type)
|
|
|
|
return _gameDescription->desc.filesDescriptions[i].fileName;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
} // End of namespace AGOS
|