aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-12-30 19:08:45 +0000
committerMax Horn2003-12-30 19:08:45 +0000
commitcca644796ef72d12a049152f4777fb819d74b3da (patch)
treecc8fbb927adbed3e100caa6d914b3971d52e09e9 /scumm
parent24fcd71e8474f05462a99704ff2f7c18e1ee73f2 (diff)
downloadscummvm-rg350-cca644796ef72d12a049152f4777fb819d74b3da.tar.gz
scummvm-rg350-cca644796ef72d12a049152f4777fb819d74b3da.tar.bz2
scummvm-rg350-cca644796ef72d12a049152f4777fb819d74b3da.zip
hook up MD5 database (this is still kind of a hack, but at least it shows that the approach works :-)
svn-id: r12035
Diffstat (limited to 'scumm')
-rw-r--r--scumm/scummvm.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 615a53d0c4..a918c49550 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -294,6 +294,12 @@ static const ScummGameSettings scumm_settings[] = {
{NULL, NULL, 0, 0, MDT_NONE, 0, 0}
};
+static int compareMD5Table(const void *a, const void *b) {
+ const char *key = (const char *)a;
+ const MD5Table *elem = (const MD5Table *)b;
+ return strcmp(key, elem->md5);
+}
+
ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs)
: Engine(syst),
_gameId(gs.id),
@@ -649,9 +655,19 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
}
if (md5_file(buf, md5sum)) {
+ char md5str[32+1];
for (int j = 0; j < 16; j++)
- printf("%02x", md5sum[j]);
- printf(" %s\n", buf);
+ sprintf(md5str+j*2, "%02x", md5sum[j]);
+ md5str[32] = 0;
+ printf("%s %s\n", md5str, buf);
+ const MD5Table *elem;
+ elem = (const MD5Table *)bsearch(md5str, md5table, ARRAYSIZE(md5table)-1, sizeof(MD5Table), compareMD5Table);
+ if (elem)
+ printf("Match found in database: target %s, language %s, platform %s\n",
+ elem->target, Common::getLanguageDescription(elem->language), Common::getPlatformDescription(elem->platform));
+ else
+ printf("Unknown MD5! Please report the details (language, platform, etc.) of this game to the ScummVM team\n");
+
}
#endif