mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-14 13:58:01 +00:00
hook up MD5 database (this is still kind of a hack, but at least it shows that the approach works :-)
svn-id: r12035
This commit is contained in:
parent
24fcd71e84
commit
cca644796e
@ -294,6 +294,12 @@ static const ScummGameSettings scumm_settings[] = {
|
|||||||
{NULL, NULL, 0, 0, MDT_NONE, 0, 0}
|
{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)
|
ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs)
|
||||||
: Engine(syst),
|
: Engine(syst),
|
||||||
_gameId(gs.id),
|
_gameId(gs.id),
|
||||||
@ -649,9 +655,19 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (md5_file(buf, md5sum)) {
|
if (md5_file(buf, md5sum)) {
|
||||||
|
char md5str[32+1];
|
||||||
for (int j = 0; j < 16; j++)
|
for (int j = 0; j < 16; j++)
|
||||||
printf("%02x", md5sum[j]);
|
sprintf(md5str+j*2, "%02x", md5sum[j]);
|
||||||
printf(" %s\n", buf);
|
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
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user