[Scummvm-cvs-logs] CVS: scummvm/simon intern.h,1.31,1.32 simon.cpp,1.447,1.448

Travis Howell kirben at users.sourceforge.net
Sat Jul 31 06:57:09 CEST 2004


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25916/simon

Modified Files:
	intern.h simon.cpp 
Log Message:

Auto convert old Simon 1/2 targets


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/intern.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- intern.h	30 Jul 2004 09:00:28 -0000	1.31
+++ intern.h	31 Jul 2004 13:56:04 -0000	1.32
@@ -163,6 +163,8 @@
 	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,

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.447
retrieving revision 1.448
diff -u -d -r1.447 -r1.448
--- simon.cpp	31 Jul 2004 10:14:05 -0000	1.447
+++ simon.cpp	31 Jul 2004 13:56:04 -0000	1.448
@@ -68,7 +68,10 @@
 	{"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 @@
 	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 @@
 
 	_game = game.features;
 
+	// 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];
+		// 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);
+		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);
-		}
+		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");
-	}
+			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) {





More information about the Scummvm-git-logs mailing list