diff options
author | Travis Howell | 2004-07-30 11:02:47 +0000 |
---|---|---|
committer | Travis Howell | 2004-07-30 11:02:47 +0000 |
commit | 069f5f839a3d2891dc3013db9d4c611465fdf506 (patch) | |
tree | a0ee4a067f07197191b6e604d911e1c0f51c67cd | |
parent | b33331acde104f630a465a62fb184c62c90dbf2b (diff) | |
download | scummvm-rg350-069f5f839a3d2891dc3013db9d4c611465fdf506.tar.gz scummvm-rg350-069f5f839a3d2891dc3013db9d4c611465fdf506.tar.bz2 scummvm-rg350-069f5f839a3d2891dc3013db9d4c611465fdf506.zip |
Re-use old md5 hack to gather checksums from users.
svn-id: r14366
-rw-r--r-- | simon/simon.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index c21539005b..2b48a0bb42 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -218,7 +218,7 @@ static const GameSpecificSettings simon1demo_settings = { "", // voc_filename "", // mp3_filename "", // vorbis_filename - "", // flac_filename + "", // flac_filename "", // voc_effects_filename "", // mp3_effects_filename "", // vorbis_effects_filename @@ -246,7 +246,7 @@ static const GameSpecificSettings simon2dos_settings = { "", // voc_filename "", // mp3_filename "", // vorbis_filename - "", // flac_filename + "", // flac_filename "", // voc_effects_filename "", // mp3_effects_filename "", // vorbis_effects_filename @@ -287,8 +287,44 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) _game = game.features; +#if 1 + // HACK HACK HACK + // This is not how, and where, MD5 computation should be done in the + // real world. Rather this is meant as a proof-of-concept hack. + // It's quick, it's dirty, and it'll go again eventually :-) + char buf[100]; + uint8 md5sum[16]; + + sprintf(buf, g->detectname); + + if (md5_file(buf, md5sum)) { + // HACK : changed to this code since PalmOS doesn't handle correctly %02x. + // It returns only 8 chars string in upper case so i need to use hex[], + // copy last 2 chars to md5str and convert result to lower case + int j; + char md5str[32+1]; + char hex[8+1]; + for (j = 0; j < 16; j++) { + sprintf(hex, "%02x", (int)md5sum[j]); + memcpy(md5str+j*2, hex + strlen(hex) - 2, 2); + } + + for (j = 0; j < 32; j++) + md5str[j] = tolower(md5str[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 + + VGA_DELAY_BASE = 1; if (_game & GF_SIMON2) { - VGA_DELAY_BASE = 1; TABLE_INDEX_BASE = 1580 / 4; TEXT_INDEX_BASE = 1500 / 4; NUM_VIDEO_OP_CODES = 75; @@ -304,7 +340,6 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) MUSIC_INDEX_BASE = 1128 / 4; SOUND_INDEX_BASE = 1660 / 4; } else { - VGA_DELAY_BASE = 1; TABLE_INDEX_BASE = 1576 / 4; TEXT_INDEX_BASE = 1460 / 4; NUM_VIDEO_OP_CODES = 64; |