Auto convert old Simon 1/2 targets

svn-id: r14392
This commit is contained in:
Travis Howell 2004-07-31 13:56:04 +00:00
parent 6e6edb8c0d
commit aa62bc65ee
4 changed files with 52 additions and 53 deletions

9
README
View File

@ -185,15 +185,6 @@ any answer. Chances are that it will work.
3.2) Simon the Sorcerer 1 and 2 notes:
---- ---------------------------------
The following three game targets were removed in ScummVM 0.7.x:
simon1win - Used for Simon the Sorcerer 1 Talkie (Windows)
simon2win - Used for Simon the Sorcerer 2 Talkie (Windows)
simon2mac - Used for Simon the Sorcerer 2 Talkie (Amiga or Mac)
If you were using these three targets the games will no longer load or
error out. Each game should be removed and added again via the launcher
to correct the targets used.
The current game targets are:
simon1acorn - Use for Simon the Sorcerer 1 for Acorn (CD)
simon1dos - Use for Simon the Sorcerer 1 for DOS (Disk)

View File

@ -1,16 +1,4 @@
\subsection{Simon the Sorcerer 1 and 2 notes}
The following three game targets were removed in ScummVM 0.7.x:
\begin{tabular}{ll}
simon1win - Used for Simon the Sorcerer 1 Talkie (Windows)\\
simon2win - Used for Simon the Sorcerer 2 Talkie (Windows)\\
simon2mac - Used for Simon the Sorcerer 2 Talkie (Amiga or Mac)\\
\end{tabular}
If you were using these three targets the games will no longer load or
error out. Each game should be removed and added again via the launcher
to correct the targets used.
The current game targets are:
\begin{tabular}{ll}

View File

@ -163,6 +163,8 @@ enum {
GAME_SIMON2DOS = GF_SIMON2,
GAME_SIMON1TALKIE = GF_TALKIE,
GAME_SIMON2TALKIE = GF_SIMON2 | GF_TALKIE,
GAME_SIMON1WIN = GF_WIN | GF_TALKIE,
GAME_SIMON2WIN = GF_SIMON2 | GF_WIN | GF_TALKIE,
GAME_SIMON1DEMO = GF_DEMO | GF_OLD_BUNDLE,
GAME_SIMON1AMIGA = GF_AMIGA | GF_OLD_BUNDLE,
GAME_SIMON1CD32 = GF_TALKIE | GF_AMIGA | GF_OLD_BUNDLE,

View File

@ -68,7 +68,10 @@ static const SimonGameSettings simon_settings[] = {
{"simon1amiga", "Simon the Sorcerer 1 (Amiga)", GAME_SIMON1AMIGA, "gameamiga"},
{"simon2dos", "Simon the Sorcerer 2 (DOS)", GAME_SIMON2DOS, "GAME32"},
{"simon1talkie", "Simon the Sorcerer 1 Talkie", GAME_SIMON1TALKIE, "GAMEPC"},
{"simon1win", "Simon the Sorcerer 1 Talkie (Windows)", GAME_SIMON1WIN, 0},
{"simon2talkie", "Simon the Sorcerer 2 Talkie", GAME_SIMON2TALKIE, "GSPTR30"},
{"simon2win", "Simon the Sorcerer 2 Talkie (Windows)", GAME_SIMON2WIN, 0},
{"simon2mac", "Simon the Sorcerer 2 Talkie (Amiga or Mac)", GAME_SIMON2WIN, 0},
{"simon1cd32", "Simon the Sorcerer 1 Talkie (Amiga CD32)", GAME_SIMON1CD32, "gameamiga"},
{"simon1demo", "Simon the Sorcerer 1 (DOS Demo)", GAME_SIMON1DEMO, "GDEMO"},
@ -101,6 +104,9 @@ DetectedGameList Engine_SIMON_detectGames(const FSList &fslist) {
StringSet fileSet;
for (g = simon_settings; g->name; ++g) {
if (g->detectname == NULL)
continue;
strcpy(detectName, g->detectname);
strcpy(detectName2, g->detectname);
strcat(detectName2, ".");
@ -287,41 +293,53 @@ 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);
// Convert older targets
if (g->detectname == NULL) {
if (!strcmp("simon1win", g->name)) {
ConfMan.set("gameid", "simon1talkie");
ConfMan.set("platform", "Windows");
} else if (!strcmp("simon2win", g->name) || !strcmp("simon2mac", g->name)) {
ConfMan.set("gameid", "simon2talkie");
ConfMan.set("platform", "Windows");
}
ConfMan.flushToDisk();
} else {
#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];
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");
}
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) {