Unify SAGA/AGOS detection code so other engines could also reuse it

without further code duplication.

svn-id: r24083
This commit is contained in:
Eugene Sandulenko 2006-10-02 22:21:57 +00:00
parent 574665be4b
commit 988ddf2b36
10 changed files with 751 additions and 683 deletions

191
common/advancedDetector.cpp Normal file
View File

@ -0,0 +1,191 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2004-2006 The ScummVM project
*
* 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 "common/stdafx.h"
#include "common/util.h"
#include "common/hash-str.h"
#include "common/file.h"
#include "common/md5.h"
#include "common/advancedDetector.h"
namespace Common {
AdvancedDetector::AdvancedDetector() {
_fileMD5Bytes = 0;
}
String AdvancedDetector::getDescription(int num) {
char tmp[256];
ADGameDescription *g = _gameDescriptions[num];
snprintf(tmp, 256, "%s (%s %s/%s)", g->name, g->extra,
getPlatformDescription(g->platform), getLanguageDescription(g->language));
return String(tmp);
}
ADList AdvancedDetector::detectGame(const FSList *fslist, Language language, Platform platform) {
int filesCount;
typedef HashMap<String, bool, CaseSensitiveString_Hash, CaseSensitiveString_EqualTo> StringSet;
StringSet filesList;
typedef StringMap StringMap;
StringMap filesMD5;
String tstr, tstr2;
uint i;
int j;
char md5str[32+1];
uint8 md5sum[16];
int *matched;
uint matchedCount = 0;
bool fileMissing;
ADGameFileDescription *fileDesc;
assert(_gameDescriptions.size());
matched = (int *)malloc(_gameDescriptions.size() * sizeof(int));
// First we compose list of files which we need MD5s for
for (i = 0; i < _gameDescriptions.size(); i++) {
for (j = 0; j < _gameDescriptions[i]->filesCount; j++) {
tstr = String(_gameDescriptions[i]->filesDescriptions[j].fileName);
tstr.toLowercase();
tstr2 = tstr + ".";
filesList[tstr] = true;
filesList[tstr2] = true;
}
}
if (fslist != NULL) {
for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
if (file->isDirectory()) continue;
tstr = file->name();
tstr.toLowercase();
tstr2 = tstr + ".";
if (!filesList.contains(tstr) && !filesList.contains(tstr2)) continue;
if (!md5_file(*file, md5sum, _fileMD5Bytes)) continue;
for (j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
}
filesMD5[tstr] = String(md5str);
filesMD5[tstr2] = String(md5str);
}
} else {
File testFile;
for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
tstr = file->_key;
tstr.toLowercase();
if (!filesMD5.contains(tstr)) {
if (testFile.open(file->_key)) {
testFile.close();
if (md5_file(file->_key.c_str(), md5sum, _fileMD5Bytes)) {
for (j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
}
filesMD5[tstr] = String(md5str);
}
}
}
}
}
for (i = 0; i < _gameDescriptions.size(); i++) {
filesCount = _gameDescriptions[i]->filesCount;
fileMissing = false;
// Try to open all files for this game
for (j = 0; j < filesCount; j++) {
fileDesc = &_gameDescriptions[i]->filesDescriptions[j];
tstr = fileDesc->fileName;
tstr.toLowercase();
tstr2 = tstr + ".";
if (!filesMD5.contains(tstr) && !filesMD5.contains(tstr2)) {
fileMissing = true;
break;
}
if (strcmp(fileDesc->md5, filesMD5[tstr].c_str()) && strcmp(fileDesc->md5, filesMD5[tstr2].c_str())) {
fileMissing = true;
break;
}
}
if (!fileMissing) {
debug(2, "Found game: %s", getDescription(i).c_str());
matched[matchedCount++] = i;
}
}
if (!filesMD5.empty() && (matchedCount == 0)) {
printf("MD5s of your game version are unknown. Please, report following data to\n");
printf("ScummVM team along with your game name and version:\n");
for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file)
printf("%s: %s\n", file->_key.c_str(), file->_value.c_str());
}
// We have some resource sets which are superpositions of other
// Now remove lesser set if bigger matches too
if (matchedCount > 1) {
// Search max number
int maxcount = 0;
for (i = 0; i < matchedCount; i++) {
maxcount = MAX(_gameDescriptions[matched[i]]->filesCount, maxcount);
}
// Now purge targets with number of files lesser than max
for (i = 0; i < matchedCount; i++) {
if ((_gameDescriptions[matched[i]]->language != language && language != UNK_LANG) ||
(_gameDescriptions[matched[i]]->platform != platform && platform != kPlatformUnknown)) {
debug(2, "Purged %s", getDescription(matched[i]).c_str());
matched[i] = -1;
continue;
}
if (_gameDescriptions[matched[i]]->filesCount < maxcount) {
debug(2, "Purged: %s", getDescription(matched[i]).c_str());
matched[i] = -1;
}
}
}
ADList *returnMatches = new ADList;
j = 0;
for (i = 0; i < matchedCount; i++)
if (matched[i] != -1)
returnMatches->push_back(matched[i]);
return *returnMatches;
}
} // End of namespace Common

90
common/advancedDetector.h Normal file
View File

@ -0,0 +1,90 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2005-2006 The ScummVM project
*
* 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$
*
*/
#ifndef COMMON_ADVANCED_DETECTOR_H
#define COMMON_ADVANCED_DETECTOR_H
#include "common/fs.h"
namespace Common {
struct ADGameFileDescription {
const char *fileName;
uint16 fileType;
const char *md5;
};
struct ADGameDescription {
const char *name;
int gameType;
int gameId;
const char *extra;
int filesCount;
ADGameFileDescription *filesDescriptions;
uint32 features;
Language language;
Platform platform;
};
typedef Array<int> ADList;
typedef Array<ADGameDescription*> ADGameDescList;
class AdvancedDetector {
public:
AdvancedDetector();
~AdvancedDetector() {};
void registerGameDescriptions(Array<ADGameDescription*> gameDescriptions) {
_gameDescriptions = gameDescriptions;
}
/**
* Specify number of bytes which are used to calculate MD5
* Default value is 0 which means whole file
*/
void setFileMD5Bytes(int bytes) { _fileMD5Bytes = bytes; }
/**
* Detect games in specified directory.
* Parameters language and platform are used to pass on values
* specified by the user. I.e. this is used to restrict search scope
*
* @param fslist: FSList to scan or NULL for scanning all specified
* default directories.
* @param language: restrict results to specified language only
* @param platform: restrict results to specified platform only
* @return: list of indexes to GameDescriptions of matched games
*/
ADList detectGame(const FSList *fslist, Language language, Platform platform);
private:
ADGameDescList _gameDescriptions;
int _fileMD5Bytes;
String getDescription(int num);
};
} // End of namespace Common
#endif

View File

@ -1,6 +1,7 @@
MODULE := common
MODULE_OBJS := \
advancedDetector.o \
config-file.o \
config-manager.o \
file.o \

View File

@ -33,6 +33,7 @@
#include "agos/midi.h"
#include "agos/sound.h"
#include "agos/vga.h"
#include "common/advancedDetector.h"
namespace AGOS {
@ -119,24 +120,6 @@ enum SIMONGameType {
GType_PP = 7
};
struct GameFileDescription {
const char *fileName;
uint16 fileType;
const char *md5;
};
struct GameDescription {
const char *name;
SIMONGameType gameType;
GameIds gameId;
const char *extra;
int filesCount;
GameFileDescription *filesDescriptions;
uint32 features;
Common::Language language;
Common::Platform platform;
};
struct GameSpecificSettings;
class Debugger;
@ -176,7 +159,7 @@ class AGOSEngine : public Engine {
void setupFeebleVideoOpcodes(VgaOpcodeProc *op);
public:
GameDescription *_gameDescription;
Common::ADGameDescription *_gameDescription;
bool initGame(void);
void setupGame();

View File

@ -166,26 +166,29 @@ namespace AGOS {
#define FILE_MD5_BYTES 5000
static GameFileDescription ELVIRA1DOS_GameFiles[] = {
using Common::ADGameFileDescription;
using Common::ADGameDescription;
static ADGameFileDescription ELVIRA1DOS_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "a49e132a1f18306dd5d1ec2fe435e178"},
{ "icon.dat", GAME_ICONFILE, "fda48c9da7f3e72d0313e2f5f760fc45"},
{ "tbllist", GAME_TBLFILE, "319f6b227c7822a551f57d24e70f8149"},
};
static GameFileDescription ELVIRA1DOS2_GameFiles[] = {
static ADGameFileDescription ELVIRA1DOS2_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "9076d507d60cc454df662316438ec843"},
{ "icon.dat", GAME_ICONFILE, "fda48c9da7f3e72d0313e2f5f760fc45"},
{ "tbllist", GAME_TBLFILE, "319f6b227c7822a551f57d24e70f8149"},
};
static GameFileDescription ELVIRA2DOS_GameFiles[] = {
static ADGameFileDescription ELVIRA2DOS_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "3313254722031b22d833a2cf45a91fd7"},
{ "icon.dat", GAME_ICONFILE, "83a7278bff55c82fbb3aef92981866c9"},
{ "stripped.txt", GAME_STRFILE, "c2533277b7ff11f5495967d55355ea17"},
{ "tbllist", GAME_TBLFILE, "8252660df0edbdbc3e6377e155bbd0c5"},
};
static GameFileDescription WAXWORKSDOS_GameFiles[] = {
static ADGameFileDescription WAXWORKSDOS_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "7751e9358e894e32ef40ef3b3bae0f2a"},
{ "icon.dat", GAME_ICONFILE, "ef1b8ad3494cf103dc10a99fe152ef9a"},
{ "roomslst", GAME_RMSLFILE, "e3758c46ab8f3c23a1ac012bd607108d"},
@ -194,7 +197,7 @@ static GameFileDescription WAXWORKSDOS_GameFiles[] = {
{ "xtbllist", GAME_XTBLFILE, "6c7b3db345d46349a5226f695c03e20f"},
};
static GameFileDescription SIMON1ACORNDEMO_GameFiles[] = {
static ADGameFileDescription SIMON1ACORNDEMO_GameFiles[] = {
{ "data", GAME_GMEFILE, "b4a7526ced425ba8ad0d548d0ec69900"},
{ "gamebase", GAME_BASEFILE, "425c7d1957699d35abca7e12a08c7422"},
{ "icondata", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
@ -202,7 +205,7 @@ static GameFileDescription SIMON1ACORNDEMO_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1ACORN_GameFiles[] = {
static ADGameFileDescription SIMON1ACORN_GameFiles[] = {
{ "data", GAME_GMEFILE, "64958b3a38afdcb85da1eeed85169806"},
{ "gamebase", GAME_BASEFILE, "28261b99cd9da1242189b4f6f2841bd6"},
{ "icondata", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
@ -210,112 +213,112 @@ static GameFileDescription SIMON1ACORN_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1AMIGA_GameFiles[] = {
static ADGameFileDescription SIMON1AMIGA_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "6c9ad2ff571d34a4cf0c696cf4e13500"},
{ "icon.pkd", GAME_ICONFILE, "565ef7a98dcc21ef526a2bb10b6f42ed"},
{ "stripped.txt", GAME_STRFILE, "c649fcc0439766810e5097ee7e81d4c8"},
{ "tbllist", GAME_TBLFILE, "f9d5bf2ce09f82289c791c3ca26e1e4b"},
};
static GameFileDescription SIMON1AMIGA_FR_GameFiles[] = {
static ADGameFileDescription SIMON1AMIGA_FR_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "bd9828b9d4e5d89b50fe8c47a8e6bc07"},
{ "icon.pkd", GAME_ICONFILE, "565ef7a98dcc21ef526a2bb10b6f42ed"},
{ "stripped.txt", GAME_STRFILE, "2297baec985617d0d5612a0124bac359"},
{ "tbllist", GAME_TBLFILE, "f9d5bf2ce09f82289c791c3ca26e1e4b"},
};
static GameFileDescription SIMON1AMIGA_DE_GameFiles[] = {
static ADGameFileDescription SIMON1AMIGA_DE_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "a2de9553f3b73064369948b5af38bb30"},
{ "icon.pkd", GAME_ICONFILE, "565ef7a98dcc21ef526a2bb10b6f42ed"},
{ "stripped.txt", GAME_STRFILE, "c649fcc0439766810e5097ee7e81d4c8"},
{ "tbllist", GAME_TBLFILE, "f9d5bf2ce09f82289c791c3ca26e1e4b"},
};
static GameFileDescription SIMON1AMIGADEMO_GameFiles[] = {
static ADGameFileDescription SIMON1AMIGADEMO_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "a12b696170f14eca5ff75f1549829251"}, // Unpacked version
{ "icon.pkd", GAME_ICONFILE, "ebc96af15bfaf75ba8210326b9260d2f"},
{ "stripped.txt", GAME_STRFILE, "8edde5b9498dc9f31da1093028da467c"},
{ "tbllist", GAME_TBLFILE, "1247e024e1f13ca54c1e354120c7519c"},
};
static GameFileDescription SIMON1CD32_GameFiles[] = {
static ADGameFileDescription SIMON1CD32_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "bab7f19237cf7d7619b6c73631da1854"},
{ "icon.pkd", GAME_ICONFILE, "565ef7a98dcc21ef526a2bb10b6f42ed"},
{ "stripped.txt", GAME_STRFILE, "59be788020441e21861e284236fd08c1"},
{ "tbllist", GAME_TBLFILE, "f9d5bf2ce09f82289c791c3ca26e1e4b"},
};
static GameFileDescription SIMON1CD32_2_GameFiles[] = {
static ADGameFileDescription SIMON1CD32_2_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "ec5358680c117f29b128cbbb322111a4"},
{ "icon.pkd", GAME_ICONFILE, "8ce5a46466a4f8f6d0f780b0ef00d5f5"},
{ "stripped.txt", GAME_STRFILE, "59be788020441e21861e284236fd08c1"},
{ "tbllist", GAME_TBLFILE, "f9d5bf2ce09f82289c791c3ca26e1e4b"},
};
static GameFileDescription SIMON1DOS_INF_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_INF_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "9f93d27432ce44a787eef10adb640870"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "2af9affc5981eec44b90d4c556145cb8"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_INF_RU_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_INF_RU_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "605fb866e03ec1c41b10c6a518ddfa49"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "2af9affc5981eec44b90d4c556145cb8"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "c392e494dcabed797b98cbcfc687b33a"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "c95a0a1ee973e19c2a1c5d12026c139f"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_RU_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_RU_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "605fb866e03ec1c41b10c6a518ddfa49"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "c95a0a1ee973e19c2a1c5d12026c139f"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_FR_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_FR_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "34759d0d4285a2f4b21b8e03b8fcefb3"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "aa01e7386057abc0c3e27dbaa9c4ba5b"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_DE_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_DE_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "063015e6ce7d90b570dbc21fe0c667b1"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "c95a0a1ee973e19c2a1c5d12026c139f"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_IT_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_IT_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "65c9b2dea57df84ef55d1eaf384ebd30"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "2af9affc5981eec44b90d4c556145cb8"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DOS_ES_GameFiles[] = {
static ADGameFileDescription SIMON1DOS_ES_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "5374fafdea2068134f33deab225feed3"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "stripped.txt", GAME_STRFILE, "2af9affc5981eec44b90d4c556145cb8"},
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1DEMO_GameFiles[] = {
static ADGameFileDescription SIMON1DEMO_GameFiles[] = {
{ "gdemo", GAME_BASEFILE, "2be4a21bc76e2fdc071867c130651439"},
{ "icon.dat", GAME_ICONFILE, "55af3b4d93972bc58bfee38a86b76c3f"},
{ "stripped.txt", GAME_STRFILE, "33a2e329b97b2a349858d6a093159eb7"},
{ "tbllist", GAME_TBLFILE, "1247e024e1f13ca54c1e354120c7519c"},
};
static GameFileDescription SIMON1TALKIE_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "28261b99cd9da1242189b4f6f2841bd6"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "64958b3a38afdcb85da1eeed85169806"},
@ -323,7 +326,7 @@ static GameFileDescription SIMON1TALKIE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE2_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE2_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "c0b948b6821d2140f8b977144f21027a"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "64f73e94639b63af846ac4a8a94a23d8"},
@ -331,7 +334,7 @@ static GameFileDescription SIMON1TALKIE2_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE_FR_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_FR_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "3cfb9d1ff4ec725af9924140126cf69f"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "638049fa5d41b81fb6fb11671721b871"},
@ -339,7 +342,7 @@ static GameFileDescription SIMON1TALKIE_FR_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE_DE_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_DE_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "48b1f3499e2e0d731047f4d481ff7817"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "7db9912acac4f1d965a64bdcfc370ba1"},
@ -347,7 +350,7 @@ static GameFileDescription SIMON1TALKIE_DE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE_HB_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_HB_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "bc66e9c0b296e1b155a246917133f71a"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "a34b2c8642f2e3676d7088b5c8b3e884"},
@ -355,7 +358,7 @@ static GameFileDescription SIMON1TALKIE_HB_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE_IT_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_IT_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "8d3ca654e158c91b860c7eae31d65312"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "52e315e0e02feca86d15cc82e3306b6c"},
@ -363,7 +366,7 @@ static GameFileDescription SIMON1TALKIE_IT_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE_IT2_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_IT2_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "8d3ca654e158c91b860c7eae31d65312"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "104efd83c8f3edf545982e07d87f66ac"},
@ -371,7 +374,7 @@ static GameFileDescription SIMON1TALKIE_IT2_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1TALKIE_ES_GameFiles[] = {
static ADGameFileDescription SIMON1TALKIE_ES_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "439f801ba52c02c9d1844600d1ce0f5e"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "eff2774a73890b9eac533db90cd1afa1"},
@ -379,7 +382,7 @@ static GameFileDescription SIMON1TALKIE_ES_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1WIN_GameFiles[] = {
static ADGameFileDescription SIMON1WIN_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "c7c12fea7f6d0bfd22af5cdbc8166862"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "b1b18d0731b64c0738c5cc4a2ee792fc"},
@ -387,7 +390,7 @@ static GameFileDescription SIMON1WIN_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1WIN_RU_GameFiles[] = {
static ADGameFileDescription SIMON1WIN_RU_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "4536a706412b36d628f12142bfa97af0"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "b1b18d0731b64c0738c5cc4a2ee792fc"},
@ -395,7 +398,7 @@ static GameFileDescription SIMON1WIN_RU_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON1WIN_DE_GameFiles[] = {
static ADGameFileDescription SIMON1WIN_DE_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "48b1f3499e2e0d731047f4d481ff7817"},
{ "icon.dat", GAME_ICONFILE, "22107c24dfb31b66ac503c28a6e20b19"},
{ "simon.gme", GAME_GMEFILE, "acd9cc438525b142d93b15c77a6f551b"},
@ -403,7 +406,7 @@ static GameFileDescription SIMON1WIN_DE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "d198a80de2c59e4a0cd24b98814849e8"},
};
static GameFileDescription SIMON2DOS_GameFiles[] = {
static ADGameFileDescription SIMON2DOS_GameFiles[] = {
{ "game32", GAME_BASEFILE, "27c8e7feada80c75b70b9c2f6088d519"},
{ "icon.dat", GAME_ICONFILE, "ee92d1f84893195a60449f2430d07285"},
{ "simon2.gme", GAME_GMEFILE, "eefcc32b1f2c0482c1a59a963a146345"},
@ -411,7 +414,7 @@ static GameFileDescription SIMON2DOS_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2DOS_RU_GameFiles[] = {
static ADGameFileDescription SIMON2DOS_RU_GameFiles[] = {
{ "game32", GAME_BASEFILE, "7edfc633dd50f8caa719c478443db70b"},
{ "icon.dat", GAME_ICONFILE, "ee92d1f84893195a60449f2430d07285"},
{ "simon2.gme", GAME_GMEFILE, "eefcc32b1f2c0482c1a59a963a146345"},
@ -419,7 +422,7 @@ static GameFileDescription SIMON2DOS_RU_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2DOS2_GameFiles[] = {
static ADGameFileDescription SIMON2DOS2_GameFiles[] = {
{ "game32", GAME_BASEFILE, "604d04315935e77624bd356ac926e068"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "aa6840420899a31874204f90bb214108"},
@ -427,7 +430,7 @@ static GameFileDescription SIMON2DOS2_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2DOS2_RU_GameFiles[] = {
static ADGameFileDescription SIMON2DOS2_RU_GameFiles[] = {
{ "game32", GAME_BASEFILE, "eb8bde3685842a8fd38f60bc476ef8e9"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "aa6840420899a31874204f90bb214108"},
@ -435,7 +438,7 @@ static GameFileDescription SIMON2DOS2_RU_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2DOS_DE_GameFiles[] = {
static ADGameFileDescription SIMON2DOS_DE_GameFiles[] = {
{ "game32", GAME_BASEFILE, "eb6e3e37fe52993f948d7e2d6b869828"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "5fa9d080b04c610f526bd685be1bf747"},
@ -443,7 +446,7 @@ static GameFileDescription SIMON2DOS_DE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2DOS_IT_GameFiles[] = {
static ADGameFileDescription SIMON2DOS_IT_GameFiles[] = {
{ "game32", GAME_BASEFILE, "3e11d400bea0638f360a724687005cd1"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "f306a397565d7f13bec7ecf14c723de7"},
@ -451,7 +454,7 @@ static GameFileDescription SIMON2DOS_IT_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2DEMO_GameFiles[] = {
static ADGameFileDescription SIMON2DEMO_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "3794c15887539b8578bacab694ccf08a"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "f8c9e6df1e55923a749e115ba74210c4"},
@ -459,7 +462,7 @@ static GameFileDescription SIMON2DEMO_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "a0d5a494b5d3d209d1a1d76cc8d76601"},
};
static GameFileDescription SIMON2TALKIE_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "8c301fb9c4fcf119d2730ccd2a565eb3"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "9c535d403966750ae98bdaf698375a38"},
@ -467,7 +470,7 @@ static GameFileDescription SIMON2TALKIE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2TALKIE2_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE2_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "608e277904d87dd28725fa08eacc2c0d"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "8d6dcc65577e285dbca03ff6d7d9323c"},
@ -475,7 +478,7 @@ static GameFileDescription SIMON2TALKIE2_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "a0d5a494b5d3d209d1a1d76cc8d76601"},
};
static GameFileDescription SIMON2TALKIE_FR_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_FR_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "43b3a04d2f0a0cbd1b024c814856561a"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "8af0e02c0c3344db64dffc12196eb59d"},
@ -483,7 +486,7 @@ static GameFileDescription SIMON2TALKIE_FR_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2TALKIE_DE_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_DE_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "0d05c3f4c06c9a4ceb3d2f5bc0b18e11"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "6c5fdfdd0eab9038767c2d22858406b2"},
@ -491,7 +494,7 @@ static GameFileDescription SIMON2TALKIE_DE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2TALKIE_DE2_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_DE2_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "a76ea940076b5d9316796dea225a9b69"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "ec9f0f24fd895e7ea72e3c8e448c0240"},
@ -499,7 +502,7 @@ static GameFileDescription SIMON2TALKIE_DE2_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2TALKIE_HB_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_HB_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "952a2b1be23c3c609ba8d988a9a1627d"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "a2b249a82ea182af09789eb95fb6c5be"},
@ -507,7 +510,7 @@ static GameFileDescription SIMON2TALKIE_HB_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2TALKIE_IT_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_IT_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "3e11d400bea0638f360a724687005cd1"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "344aca58e5ad5e25c517d5eb1d85c435"},
@ -515,7 +518,7 @@ static GameFileDescription SIMON2TALKIE_IT_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2TALKIE_ES_GameFiles[] = {
static ADGameFileDescription SIMON2TALKIE_ES_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "268dc322aa73bcf27bb016b8e8ceb889"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "4f43bd06b6cc78dbd25a7475ca964eb1"},
@ -523,7 +526,7 @@ static GameFileDescription SIMON2TALKIE_ES_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2WIN_GameFiles[] = {
static ADGameFileDescription SIMON2WIN_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "608e277904d87dd28725fa08eacc2c0d"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "e749c4c103d7e7d51b34620ed76c5a04"},
@ -531,7 +534,7 @@ static GameFileDescription SIMON2WIN_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2WIN_DE_GameFiles[] = {
static ADGameFileDescription SIMON2WIN_DE_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "a76ea940076b5d9316796dea225a9b69"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "9609a933c541fed2e00c6c3479d7c181"},
@ -539,7 +542,7 @@ static GameFileDescription SIMON2WIN_DE_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2WIN_DE2_GameFiles[] = {
static ADGameFileDescription SIMON2WIN_DE2_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "9e858b3bb189c134c3a5f34c3385a8d3"},
{ "icon.dat", GAME_ICONFILE, "ee92d1f84893195a60449f2430d07285"},
{ "simon2.gme", GAME_GMEFILE, "16d574da07e93bcae43cee353dab8c7e"},
@ -547,7 +550,7 @@ static GameFileDescription SIMON2WIN_DE2_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription SIMON2WIN_PL_GameFiles[] = {
static ADGameFileDescription SIMON2WIN_PL_GameFiles[] = {
{ "gsptr30", GAME_BASEFILE, "657fd873f5d0637097ee02315b447e6f"},
{ "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab"},
{ "simon2.gme", GAME_GMEFILE, "7b9afcf82a94722707e0d025c0192be8"},
@ -555,89 +558,89 @@ static GameFileDescription SIMON2WIN_PL_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9"},
};
static GameFileDescription FEEBLEFILES_AMI_DE_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_AMI_DE_GameFiles[] = {
{ "game22", GAME_BASEFILE, "bcd76ac080003eee3649df18db25b60e"},
{ "gfxindex.dat", GAME_GFXIDXFILE,"f550f7915c5ce3a68c9f870f507449c2"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_AMI_UK_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_AMI_UK_GameFiles[] = {
{ "game22", GAME_BASEFILE, "629762ea9ca9ee9ff85f4774d219f5c7"},
{ "gfxindex.dat", GAME_GFXIDXFILE,"f550f7915c5ce3a68c9f870f507449c2"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_MAC_DE_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_MAC_DE_GameFiles[] = {
{ "game22", GAME_BASEFILE, "bcd76ac080003eee3649df18db25b60e"},
{ "graphics.vga", GAME_GFXIDXFILE,"11a4853cb35956846976e9473ee0e41e"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_MAC_FR_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_MAC_FR_GameFiles[] = {
{ "game22", GAME_BASEFILE, "ba90b40a47726039671d9e91630dd7ed"},
{ "graphics.vga", GAME_GFXIDXFILE,"11a4853cb35956846976e9473ee0e41e"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_MAC_ES_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_MAC_ES_GameFiles[] = {
{ "game22", GAME_BASEFILE, "71d7d2d5e479b053c5a9757f1702c9c3"},
{ "graphics.vga", GAME_GFXIDXFILE,"11a4853cb35956846976e9473ee0e41e"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_MAC_UK_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_MAC_UK_GameFiles[] = {
{ "game22", GAME_BASEFILE, "629762ea9ca9ee9ff85f4774d219f5c7"},
{ "graphics.vga", GAME_GFXIDXFILE,"11a4853cb35956846976e9473ee0e41e"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_2CD_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_2CD_GameFiles[] = {
{ "game22", GAME_BASEFILE, "629762ea9ca9ee9ff85f4774d219f5c7"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_4CD_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_4CD_GameFiles[] = {
{ "game22", GAME_BASEFILE, "a8746407a5b20a7da0da0a14c380af1c"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_DE_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_DE_GameFiles[] = {
{ "game22", GAME_BASEFILE, "bcd76ac080003eee3649df18db25b60e"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_FR_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_FR_GameFiles[] = {
{ "game22", GAME_BASEFILE, "ba90b40a47726039671d9e91630dd7ed"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_IT_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_IT_GameFiles[] = {
{ "game22", GAME_BASEFILE, "80576f2e1ed4c912b63921fe77af313e"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription FEEBLEFILES_ES_GameFiles[] = {
static ADGameFileDescription FEEBLEFILES_ES_GameFiles[] = {
{ "game22", GAME_BASEFILE, "71d7d2d5e479b053c5a9757f1702c9c3"},
{ "tbllist", GAME_TBLFILE, "0bbfee8e69739111eb36b0d138da8ddf"},
};
static GameFileDescription DIMP_GameFiles[] = {
static ADGameFileDescription DIMP_GameFiles[] = {
{ "Gdimp", GAME_BASEFILE, "0b1e89ae1dc2e012b7fa7a987b4ac42a"},
};
static GameFileDescription JUMBLE_GameFiles[] = {
static ADGameFileDescription JUMBLE_GameFiles[] = {
{ "Gjumble", GAME_BASEFILE, "d54cce46d339038d1a6b74ea213655bc"},
};
static GameFileDescription PUZZLE_GameFiles[] = {
static ADGameFileDescription PUZZLE_GameFiles[] = {
{ "Gpuzzle", GAME_BASEFILE, "3f80dac8e0d85401a1058a560fe49ab6"},
};
static GameFileDescription SWAMPY_GameFiles[] = {
static ADGameFileDescription SWAMPY_GameFiles[] = {
{ "Gswampy", GAME_BASEFILE, "3a6d4d7b2433e660f2483f9396cc87a2"},
};
static GameDescription gameDescriptions[] = {
static ADGameDescription gameDescriptions[] = {
// Elvira - English Floppy
{
"elvira",
@ -1514,7 +1517,7 @@ static GameDescription gameDescriptions[] = {
};
DetectedGame toDetectedGame(const GameDescription &g) {
DetectedGame toDetectedGame(const ADGameDescription &g) {
const char *title = 0;
const PlainGameDescriptor *sg = simonGames;
@ -1529,154 +1532,15 @@ DetectedGame toDetectedGame(const GameDescription &g) {
return dg;
}
static int detectGame(const FSList *fslist, Common::Language language, Common::Platform platform, int*& returnMatches) {
int gamesCount = ARRAYSIZE(gameDescriptions);
int filesCount;
typedef Common::HashMap<Common::String, bool, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> StringSet;
StringSet filesList;
typedef Common::StringMap StringMap;
StringMap filesMD5;
Common::String tstr, tstr2;
int i, j;
char md5str[32+1];
uint8 md5sum[16];
int matched[ARRAYSIZE(gameDescriptions)];
int matchedCount = 0;
bool fileMissing;
GameFileDescription *fileDesc;
// First we compose list of files which we need MD5s for
for (i = 0; i < gamesCount; i++) {
for (j = 0; j < gameDescriptions[i].filesCount; j++) {
tstr = Common::String(gameDescriptions[i].filesDescriptions[j].fileName);
tstr.toLowercase();
tstr2 = tstr + ".";
filesList[tstr] = true;
filesList[tstr2] = true;
}
}
if (fslist != NULL) {
for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
if (file->isDirectory())
continue;
tstr = file->name();
tstr.toLowercase();
tstr2 = tstr + ".";
if (!filesList.contains(tstr) && !filesList.contains(tstr2))
continue;
if (!Common::md5_file(*file, md5sum, FILE_MD5_BYTES))
continue;
for (j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
}
filesMD5[tstr] = Common::String(md5str);
filesMD5[tstr2] = Common::String(md5str);
}
} else {
Common::File testFile;
for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
tstr = file->_key;
tstr.toLowercase();
if (!filesMD5.contains(tstr)) {
if (testFile.open(file->_key)) {
testFile.close();
if (Common::md5_file(file->_key.c_str(), md5sum, FILE_MD5_BYTES)) {
for (j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
}
filesMD5[tstr] = Common::String(md5str);
}
}
}
}
}
for (i = 0; i < gamesCount; i++) {
filesCount = gameDescriptions[i].filesCount;
fileMissing = false;
// Try to open all files for this game
for (j = 0; j < filesCount; j++) {
fileDesc = &gameDescriptions[i].filesDescriptions[j];
tstr = fileDesc->fileName;
tstr.toLowercase();
tstr2 = tstr + ".";
if (!filesMD5.contains(tstr) && !filesMD5.contains(tstr2)) {
fileMissing = true;
break;
}
if (strcmp(fileDesc->md5, filesMD5[tstr].c_str()) && strcmp(fileDesc->md5, filesMD5[tstr2].c_str())) {
fileMissing = true;
break;
}
}
if (!fileMissing) {
debug(2, "Found game: %s", toDetectedGame(gameDescriptions[i]).description.c_str());
matched[matchedCount++] = i;
}
}
if (!filesMD5.empty() && (matchedCount == 0)) {
printf("MD5s of your game version are unknown. Please, report following data to\n");
printf("ScummVM team along with your game name and version:\n");
for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file)
printf("%s: %s\n", file->_key.c_str(), file->_value.c_str());
}
// We have some resource sets which are superpositions of other
// Now remove lesser set if bigger matches too
if (matchedCount > 1) {
// Search max number
int maxcount = 0;
for (i = 0; i < matchedCount; i++) {
maxcount = MAX(gameDescriptions[matched[i]].filesCount, maxcount);
}
// Now purge targets with number of files lesser than max
for (i = 0; i < matchedCount; i++) {
if ((gameDescriptions[matched[i]].language != language && language != Common::UNK_LANG) ||
(gameDescriptions[matched[i]].platform != platform && platform != Common::kPlatformUnknown)) {
debug(2, "Purged %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
matched[i] = -1;
continue;
}
if (gameDescriptions[matched[i]].filesCount < maxcount) {
debug(2, "Purged: %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
matched[i] = -1;
}
}
}
returnMatches = (int *)malloc(matchedCount * sizeof(int));
j = 0;
for (i = 0; i < matchedCount; i++)
if (matched[i] != -1)
returnMatches[j++] = matched[i];
return j;
}
bool AGOSEngine::initGame() {
uint16 gameCount = ARRAYSIZE(gameDescriptions);
int gameNumber = -1;
DetectedGameList detectedGames;
int count;
int* matches;
Common::AdvancedDetector AdvDetector;
Common::ADList matches;
Common::ADGameDescList descList;
Common::Language language = Common::UNK_LANG;
Common::Platform platform = Common::kPlatformUnknown;
@ -1692,16 +1556,22 @@ bool AGOSEngine::initGame() {
// forgotten which particular version it was, so we have to do it all
// over again...
count = detectGame(NULL, language, platform, matches);
for (int i = 0; i < ARRAYSIZE(gameDescriptions); i++)
descList.push_back(&gameDescriptions[i]);
for (int i = 0; i < count; i++) {
AdvDetector.registerGameDescriptions(descList);
AdvDetector.setFileMD5Bytes(FILE_MD5_BYTES);
matches = AdvDetector.detectGame(NULL, language, platform);
for (uint i = 0; i < matches.size(); i++) {
if (toDetectedGame(gameDescriptions[matches[i]]).gameid == gameid) {
gameNumber = matches[i];
break;
}
}
free(matches);
//delete &matches;
if (gameNumber >= gameCount || gameNumber == -1) {
error("AGOSEngine::loadGame wrong gameNumber");
@ -1716,13 +1586,22 @@ bool AGOSEngine::initGame() {
DetectedGameList GAME_detectGames(const FSList &fslist) {
DetectedGameList detectedGames;
int count;
int* matches;
count = detectGame(&fslist, Common::UNK_LANG, Common::kPlatformUnknown, matches);
Common::AdvancedDetector AdvDetector;
Common::ADList matches;
Common::ADGameDescList descList;
for (int i = 0; i < count; i++)
for (int i = 0; i < ARRAYSIZE(gameDescriptions); i++)
descList.push_back(&gameDescriptions[i]);
AdvDetector.registerGameDescriptions(descList);
AdvDetector.setFileMD5Bytes(FILE_MD5_BYTES);
matches = AdvDetector.detectGame(&fslist, Common::UNK_LANG, Common::kPlatformUnknown);
for (uint i = 0; i < matches.size(); i++)
detectedGames.push_back(toDetectedGame(gameDescriptions[matches[i]]));
free(matches);
//delete &matches;
return detectedGames;
}

View File

@ -32,6 +32,7 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/config-manager.h"
#include "common/advancedDetector.h"
#include "base/plugins.h"
#include "saga/rscfile.h"
@ -105,9 +106,13 @@ PluginError Engine_SAGA_create(OSystem *syst, Engine **engine) {
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
namespace Saga {
using Common::ADGameFileDescription;
using Common::ADGameDescription;
#include "sagagame.cpp"
DetectedGame toDetectedGame(const GameDescription &g) {
DetectedGame toDetectedGame(const ADGameDescription &g) {
const char *title;
title = saga_games[g.gameType].description;
DetectedGame dg(g.name, title, g.language, g.platform);
@ -115,152 +120,15 @@ DetectedGame toDetectedGame(const GameDescription &g) {
return dg;
}
static int detectGame(const FSList *fslist, Common::Language language, Common::Platform platform, int*& returnMatches) {
int gamesCount = ARRAYSIZE(gameDescriptions);
int filesCount;
typedef Common::HashMap<Common::String, bool, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> StringSet;
StringSet filesList;
typedef Common::StringMap StringMap;
StringMap filesMD5;
Common::String tstr;
int i, j;
char md5str[32+1];
uint8 md5sum[16];
int matched[ARRAYSIZE(gameDescriptions)];
int matchedCount = 0;
bool fileMissing;
GameFileDescription *fileDesc;
// First we compose list of files which we need MD5s for
for (i = 0; i < gamesCount; i++) {
for (j = 0; j < gameDescriptions[i].filesCount; j++) {
tstr = Common::String(gameDescriptions[i].filesDescriptions[j].fileName);
tstr.toLowercase();
filesList[tstr] = true;
}
}
if (fslist != NULL) {
for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
if (file->isDirectory()) continue;
tstr = file->name();
tstr.toLowercase();
if (!filesList.contains(tstr)) continue;
if (!Common::md5_file(*file, md5sum, FILE_MD5_BYTES)) continue;
for (j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
}
filesMD5[tstr] = Common::String(md5str);
}
} else {
Common::File testFile;
for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
tstr = file->_key;
tstr.toLowercase();
if (!filesMD5.contains(tstr)) {
if (testFile.open(file->_key)) {
testFile.close();
if (Common::md5_file(file->_key.c_str(), md5sum, FILE_MD5_BYTES)) {
for (j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
}
filesMD5[tstr] = Common::String(md5str);
}
}
}
}
}
for (i = 0; i < gamesCount; i++) {
filesCount = gameDescriptions[i].filesCount;
fileMissing = false;
// Try to open all files for this game
for (j = 0; j < filesCount; j++) {
fileDesc = &gameDescriptions[i].filesDescriptions[j];
tstr = fileDesc->fileName;
tstr.toLowercase();
if (!filesMD5.contains(tstr)) {
if ((fileDesc->fileType & (GAME_SOUNDFILE | GAME_VOICEFILE | GAME_MUSICFILE)) != 0) {
//TODO: find recompressed files
}
fileMissing = true;
break;
}
if (strcmp(fileDesc->md5, filesMD5[tstr].c_str())) {
fileMissing = true;
break;
}
}
if (!fileMissing) {
debug(2, "Found game: %s", toDetectedGame(gameDescriptions[i]).description.c_str());
matched[matchedCount++] = i;
}
}
if (!filesMD5.empty() && (matchedCount == 0)) {
printf("MD5s of your game version are unknown. Please, report following data to\n");
printf("ScummVM team along with your game name and version:\n");
for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file)
printf("%s: %s\n", file->_key.c_str(), file->_value.c_str());
}
// We have some resource sets which are superpositions of other
// Particularly it is ite-demo-linux vs ite-demo-win
// Now remove lesser set if bigger matches too
if (matchedCount > 1) {
// Search max number
int maxcount = 0;
for (i = 0; i < matchedCount; i++) {
maxcount = MAX(gameDescriptions[matched[i]].filesCount, maxcount);
}
// Now purge targets with number of files lesser than max
for (i = 0; i < matchedCount; i++) {
if ((gameDescriptions[matched[i]].language != language && language != Common::UNK_LANG) ||
(gameDescriptions[matched[i]].platform != platform && platform != Common::kPlatformUnknown)) {
debug(2, "Purged %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
matched[i] = -1;
continue;
}
if (gameDescriptions[matched[i]].filesCount < maxcount) {
debug(2, "Purged: %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
matched[i] = -1;
}
}
}
returnMatches = (int *)malloc(matchedCount * sizeof(int));
j = 0;
for (i = 0; i < matchedCount; i++)
if (matched[i] != -1)
returnMatches[j++] = matched[i];
return j;
}
bool SagaEngine::initGame() {
uint16 gameCount = ARRAYSIZE(gameDescriptions);
int gameNumber = -1;
DetectedGameList detectedGames;
int count;
int* matches;
Common::AdvancedDetector AdvDetector;
Common::ADList matches;
Common::ADGameDescList descList;
Common::Language language = Common::UNK_LANG;
Common::Platform platform = Common::kPlatformUnknown;
@ -270,25 +138,31 @@ bool SagaEngine::initGame() {
platform = Common::parsePlatform(ConfMan.get("platform"));
count = detectGame(NULL, language, platform, matches);
for (int i = 0; i < ARRAYSIZE(gameDescriptions); i++)
descList.push_back((ADGameDescription *)&gameDescriptions[i]);
if (count == 0) {
AdvDetector.registerGameDescriptions(descList);
AdvDetector.setFileMD5Bytes(FILE_MD5_BYTES);
matches = AdvDetector.detectGame(NULL, language, platform);
if (matches.size() == 0) {
warning("No valid games were found in the specified directory.");
return false;
}
if (count != 1)
warning("Conflicting targets detected (%d)", count);
if (matches.size() != 1)
warning("Conflicting targets detected (%d)", matches.size());
gameNumber = matches[0];
free(matches);
//delete matches;
if (gameNumber >= gameCount || gameNumber == -1) {
error("SagaEngine::loadGame wrong gameNumber");
}
_gameTitle = toDetectedGame(gameDescriptions[gameNumber]).description;
_gameTitle = toDetectedGame(gameDescriptions[gameNumber].desc).description;
debug(2, "Running %s", _gameTitle.c_str());
_gameNumber = gameNumber;
@ -305,13 +179,22 @@ bool SagaEngine::initGame() {
DetectedGameList GAME_detectGames(const FSList &fslist) {
DetectedGameList detectedGames;
int count;
int* matches;
count = detectGame(&fslist, Common::UNK_LANG, Common::kPlatformUnknown, matches);
Common::AdvancedDetector AdvDetector;
Common::ADList matches;
Common::ADGameDescList descList;
for (int i = 0; i < ARRAYSIZE(gameDescriptions); i++)
descList.push_back((ADGameDescription *)&gameDescriptions[i]);
AdvDetector.registerGameDescriptions(descList);
AdvDetector.setFileMD5Bytes(FILE_MD5_BYTES);
matches = AdvDetector.detectGame(&fslist, Common::UNK_LANG, Common::kPlatformUnknown);
for (uint i = 0; i < matches.size(); i++)
detectedGames.push_back(toDetectedGame(gameDescriptions[matches[i]].desc));
//delete matches;
for (int i = 0; i < count; i++)
detectedGames.push_back(toDetectedGame(gameDescriptions[matches[i]]));
free(matches);
return detectedGames;
}

View File

@ -340,14 +340,14 @@ bool Resource::loadContext(ResourceContext *context) {
bool Resource::createContexts() {
int i;
ResourceContext *context;
_contextsCount = _vm->getGameDescription()->filesCount;
_contextsCount = _vm->getGameDescription()->desc.filesCount;
_contexts = (ResourceContext*)calloc(_contextsCount, sizeof(*_contexts));
for (i = 0; i < _contextsCount; i++) {
context = &_contexts[i];
context->file = new Common::File();
context->fileName = _vm->getGameDescription()->filesDescriptions[i].fileName;
context->fileType = _vm->getGameDescription()->filesDescriptions[i].fileType;
context->fileName = _vm->getGameDescription()->desc.filesDescriptions[i].fileName;
context->fileType = _vm->getGameDescription()->desc.filesDescriptions[i].fileType;
context->serial = 0;
// IHNM has serveral different voice files, so we need to allow

View File

@ -31,6 +31,7 @@
#include "saga/gfx.h"
#include "saga/list.h"
#include "common/advancedDetector.h"
namespace Saga {
@ -359,7 +360,7 @@ public:
//current game description
int _gameNumber;
GameDescription *_gameDescription;
SAGAGameDescription *_gameDescription;
Common::String _gameTitle;
Common::Rect _displayClip;
@ -372,8 +373,8 @@ public:
public:
bool initGame(void);
public:
const GameDescription *getGameDescription() const { return _gameDescription; }
const bool isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
const SAGAGameDescription *getGameDescription() const { return _gameDescription; }
const bool isBigEndian() const { return (_gameDescription->desc.features & GF_BIG_ENDIAN_DATA) != 0; }
const bool isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
const GameResourceDescription *getResourceDescription() { return _gameDescription->resourceDescription; }
const GameSoundInfo *getVoiceInfo() const { return _gameDescription->voiceInfo; }
@ -386,11 +387,11 @@ public:
}
int getFontsCount() const { return _gameDescription->fontsCount; }
int getGameId() const { return _gameDescription->gameId; }
int getGameType() const { return _gameDescription->gameType; }
uint32 getFeatures() const { return _gameDescription->features; }
Common::Language getLanguage() const { return _gameDescription->language; }
Common::Platform getPlatform() const { return _gameDescription->platform; }
int getGameId() const { return _gameDescription->desc.gameId; }
int getGameType() const { return _gameDescription->desc.gameType; }
uint32 getFeatures() const { return _gameDescription->desc.features; }
Common::Language getLanguage() const { return _gameDescription->desc.language; }
Common::Platform getPlatform() const { return _gameDescription->desc.platform; }
int getGameNumber() const { return _gameNumber; }
int getStartSceneNumber() const { return _gameDescription->startSceneNumber; }

File diff suppressed because it is too large Load Diff

View File

@ -191,12 +191,6 @@ enum TextStringIds {
};
struct GameFileDescription {
const char *fileName;
uint16 fileType;
const char *md5;
};
struct GameResourceDescription {
uint32 sceneLUTResourceId;
uint32 moduleLUTResourceId;
@ -332,16 +326,12 @@ struct GamePatchDescription {
GameSoundInfo *soundInfo;
};
struct GameDescription {
const char *name;
SAGAGameType gameType;
GameIds gameId;
const char *extra;
struct SAGAGameDescription {
Common::ADGameDescription desc;
GameDisplayInfo *gameDisplayInfo;
int startSceneNumber;
GameResourceDescription *resourceDescription;
int filesCount;
GameFileDescription *filesDescriptions;
int fontsCount;
GameFontDescription *fontDescriptions;
GameSoundInfo *voiceInfo;
@ -349,9 +339,6 @@ struct GameDescription {
GameSoundInfo *musicInfo;
int patchesCount;
GamePatchDescription *patchDescriptions;
uint32 features;
Common::Language language;
Common::Platform platform;
};
#define FILE_MD5_BYTES 5000