[Scummvm-cvs-logs] CVS: tools md5.txt,NONE,1.1 md5table.c,NONE,1.1 Makefile,1.28,1.29 convbdf.c,1.2,1.3

Max Horn fingolfin at users.sourceforge.net
Tue Dec 30 08:34:03 CET 2003


Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv567

Modified Files:
	Makefile convbdf.c 
Added Files:
	md5.txt md5table.c 
Log Message:
added md5table util, which converts an MD5 table from stdin to either PHP or C++ code on stdout (wip, needs command line options to switch between PHP and C++ code generation etc.)

--- NEW FILE: md5.txt ---
Maniac Mansion
	V1	DOS	en	7f45ddd6dbfbf8f80c0c0efea4c295bc	maniac
	V2	DOS	en	b250d0f9cc83f80ced56fe11a4fb057c	maniac
	V2	DOS	de	183d7464902d40d00800e8ee1f04117c	maniac

	V2	DOS	fr	114acdc2659a273c220f86ee9edb24c1	maniac	Nicolas Sauzède
	V2 (DOTT)	DOS	fr	99a3699f80b8f776efae592b44b9b991	maniac	Nicolas Sauzède
	V2	Amiga	en	e781230da44a44e2f0770edb2b3b3633	maniac	dhewg

Zak McKracken and the Alien Mindbenders
	V1	DOS	en	7020931d5a2be0a49d68e7a1882363e4	zak
	V2 Demo	Atari	en	8299d9b8a1b0e7b881bae7a9971dc5e2	zak
	V2	DOS	en	debe337f73d660e951ece7c1f1c81add	zak
	V2 (w/o copy protection)	DOS	de	cdd760228cf1010c2903f37e788ea31c	zak	Max Horn
	V2 (from 5\"25 floppies)	DOS	de	d06fbe28818fef7bfc45c2cdf0c0849d	zak	Nicolas Sauzède
	V2	Amiga	en	e94c7cc3686fce406d3c91b5eae5a72d	zak	dhweg
	FmTowns	FmTowns	en	2d4536a56e01da4b02eb021e7770afa2	zak
	FmTowns	FmTowns	jp	ce3edc99cd4f478c5b37104d70c68ca5	zak	khalek

Indiana Jones and the Last Crusade
	EGA	DOS	en	5fbe557049892eb4b709d90916ec97ca	indy3EGA
	EGA	Mac	en	1dd7aa088e09f96d06818aa9a9deabe0	indy3EGA
	EGA	DOS	de	6f6ef668c608c7f534fea6e6d3878dde	indy3EGA	dhewg
	EGA	Amiga	en	9c0fee288ad564a7d25ec3e841810d79	indy3EGA	dhewg
	EGA	Amiga	de	330f631502e381a4e199a3f7cb483c20	indy3EGA	dhewg

	EGA Demo	DOS	en	b597e0403cc0002f69170e6caba7edd9	indy3EGA

	VGA	DOS	en	1875b90fade138c9253a8e967007031a	indy3
	VGA	DOS	de	399b217b0c8d65d0398076da486363a9	indy3

	FmTowns	FmTowns	en	04687cdf7f975a89d2474929f7b80946	indy3towns
	FmTowns	FmTowns	jp	3a0c35f3c147b98a2bdf8d400cfc4ab5	indy3towns	Paul Priest
	FmTowns Demo	FmTowns	en	3938ee1aa4433fca9d9308c9891172b1	zaktowns

Loom
	Demo	DOS	en	5a35e36fd777e9c37a49c5b2faca52f9	loom
	Floppy	Mac	en	6f0be328c64d689bb606d22a389e1b0f	loom
	Floppy	DOS	en	28ef68ee3ed76d7e2ee8ee13c15fbd5b	loom
	Floppy	DOS	de	fa127d7c4bb47d05bb1c33ddcaa9f767	loom
	Talkie/CD	DOS	en	5d88b9d6a88e6f8e90cded9d01b7f082	loomcd
	FmTowns	FmTowns	en	c5d10e190d4b4d59114b824f2fdbd00e	loomTowns	dhewg
	FmTowns	FmTowns	jp	31b8fda4c8c7413fa6b39997e776eba4	loomTowns	khalek

The Secret of Monkey Island
	EGA	DOS	en	49210e124e4c2b30f1290a9ef6306301	monkeyega
	EGA Demo	DOS	en	71523b539491527d9860f4407faf0411	monkeyega
	EGA Demo	DOS	de	771bc18ec6f93837b839c992b211904b	monkeyega	khalek

	VGA	DOS	en	15e03ffbfeddb9c2aebc13dcb2a4a8f4	monkeyvga
	VGA	DOS	de	d0b531227a27c6662018d2bd05aac52a	monkeyvga
	VGA	DOS	es	45152f7cf2ba8f43cf8a8ea2e740ae09	monkeyvga
	VGA	Amiga	en	6c2bff0e327f2962e809c2e1a82d7309	monkeyvga	dhweg
	VGA Demo	Amiga	en	54a936ad06161ff7bfefcb96200f7bff	monkeyvga	khalek

	CD	DOS	en	2d1e891fe52df707c30185e52c50cd92	monkey
	CD	DOS	de	305d3dd57c96c65b017bc70c8c7cfb5e	monkey
	CD	DOS	es	f049e38c1f8302b5db6170f1872af89a	monkey	Andrej Sinicyn
	CD	DOS	it	da6269b18fcb08189c0aa9c95533cce2	monkey	Andrej Sinicyn
	CD	DOS	fr	aa8a0cb65f3afbbe2c14c3f9f92775a3	monkey	Andrej Sinicyn

	-	DOS	fr	aa8a0cb65f3afbbe2c14c3f9f92775a3	monkey1	Nicolas Sauzède
	-	Mac	en	2ccd8891ce4d3f1a334d21bff6a88ca2	monkey
	-	SEGA	en	c13225cb1bbd3bc9fe578301696d8021	game
	-	Mac	en	2ccd8891ce4d3f1a334d21bff6a88ca2	monkey

	FmTowns	FmTowns	en	8eb84cee9b429314c7f0bdcf560723eb	monkey	Paul Priest
	FmTowns	FmTowns	jp	e17db1ddf91b39ca6bbc8ad3ed19e883	monkey	Paul Priest

Misc demos
	Passport to Adventure	DOS	en	e6cd81b25ab1453a8a6d3482118c391e	pass

	indy/loom non-interactive	FmTowns	en	2d388339d6050d8ccaa757b64633954e	zakTowns	khalek
	zak/loom non-interactive	FmTowns	en	77f5c9cc0986eb729c1a6b4c8823bbae	zakTowns	khalek
	indy/zak non-interactive	FmTowns	en	3938ee1aa4433fca9d9308c9891172b1	zakTowns	khalek

Monkey Island 2: LeChuck's revenge
	-	Amiga	en	132bff65e6367c09cc69318ce1b59333	monkey2
	-	Mac	en	4cb9c3618f71668f8e4346c8f323fa82	monkey2
	-	DOS	en	3686cf8f89e102ececf4366e1d2c8126	monkey2
	-	DOS	de	6886e5d08cee329b1f2e743ae2e3ceed	monkey2
	-	DOS	fr	8e4ee4db46954bfe2912e259a16fad82	monkey2	Nicolas Sauzède
	FmTowns	FmTowns	en	da09e666fc8f5b78d7b0ac65d1a3b56e	monkey2	dhewg
	Demo (non-interactive)	DOS	en	387a544b8b10b26912d8413bab63a853	monkey2	khalek

Indiana Jones 4 and the Fate of Atlantis
	Talkie	DOS	en	182344899c2e2998fca0bebcd82aa81a	atlantis
	Non-Talkie	Mac	en	d6dd0646404768a63e963891a96daadd	atlantis
	Non-Talkie	DOS	de	1fbebd7b2b692df5297870447a80cfed	atlantis
	Non-Talkie	DOS	fr	edfdb24a499d92c59f824c52987c0eec	atlantis	Nicolas Sauzède
	Non-Talkie	Amiga	en	3a03dab514e4038df192d8a8de469788	atlantis	dhewg
	FmTowns	FmTowns	en	c7be10f775404fd9785a8b92a06d240c	indy4	dhewg
	FmTowns Demo	FmTowns	jp	28d24a33448fab6795850bc9f159a4a2	indydemo	khalek
	Demo	DOS	en	035deab53b47bc43abc763560d0f8d4b	playfate
	Demo (non-interactive)	DOS	en	99b6f822b0b2612415407865438697d6	fate

Day Of The Tentacle
	Floppy Version A ?	All?	en	acad97ab1c6fc2a5b2d98abf6db4a190	tentacle
	Floppy Version B ?	DOS	en	2723fea3dae0cb47768c424b145ae0e7	tentacle	Andrej Sinicyn
	Floppy	DOS	de	57b0d89af79befe1cabce3bece869e7f	tentacle	Andrej Sinicyn

	Talkie	All?	en	4167a92a1d46baa4f4127d918d561f88	tentacle
	Talkie	All?	de	6e959d65358eedf9b68b81e304b97fa4	tentacle
	Talkie	All?	fr	92b078d9d6d9d751da9c26b8b3075779	tentacle	Nicolas Sauzède
	Demo	DOS	en	c83079157ec765a28de445aec9768d60	dottdemo

Sam & Max
	Non-Talkie	DOS	de	f27b1ba0eadaf2a6617b2b58192d1dbf	samnmax	dhewg
	Non-Talkie	DOS	fr	ef347474f3c7be3b29584eaa133cca05	samnmax	Nicolas Sauzède
	Talkie	All?	en	d917f311a448e3cc7239c31bddb00dd2	samnmax
	Talkie	All?	de	0fb73eddfcf584c02ba097984df131ba	samnmax
	Demo	DOS	en	d9d0dd93d16ab4dec55cabc2b86bbd17	samdemo
	Demo	Mac	en	0425954a9db5c340861672892c3e678d	samdemo

	interactive DEMO	DOS	en	c3196c5349e53e387aaff1533d95e53a	snmdemo
	Interactive WIP Demo	DOS	en	0e4c5d54a0ad4b26132e78b5ea76642a	snmidemo

Full Throttle
	Version A	All?	en	09820417db26687bb7fe0c83cc4c553b	ft
	Version B	All?	en	60ba818dc3bede86d40357e3913f8505	ft

	-	All?	de	8bdb0bf87b5e303dd35693afb9351215	ft	dhewg
	-	All?	es	e72bb4c2b613db2cf50f89ff6350e70a	ft
	-	All?	ru	55e4cc866ff9046824e1c638ba2b8c7f	ft

	Demo	DOS	en	32a433dea56b86a55b59e4ff7d755711	ftpcdemo
	Demo	Mac	en	9d7b67be003fea60be4dcbd193611936	ftdemo

The Dig
	-	All	All	d8323015ecb8b10bf53474f6e6b0ae33	dig
	Demo	All	en	362c1d281fb9899254cda66ad246c66a	digdemo

Curse of Monkey Island
	-	All?	All?	fe60d6b5ff51b0553ac59963123b5777	comi
	Demo	All?	All?	8fec68383202d38c0d25e9e3b757c5df	comi

Putt-Putt Joins The Parade
	Demo	DOS	en	31aa57f460a3d12429f0552a46a90b39	puttdemo
	Demo	Windows	en	37ff1b308999c4cca7319edfcc1280a0	puttdemo	khalek
	Demo	Mac	en	f40a7f495f59188ca57a9d1d50301bb6	puttdemo	khalek
	-	DOS	en	9708cf716ed8bcc9ff3fcfc69413b746	puttputt	khalek
	-	Windows	en	6a30a07f353a75cdc602db27d73e1b42	puttputt	khalek
	-	Mac	en	684732efb5799c0f78804c99d8de9aba	Putt-Putt Parade	khalek
	-	3DO	en	7e151c17adf624f1966c8fc5827c95e9	puttputt	khalek

Putt-Putt Goes To The Moon
	Demo	DOS	en	aa6a91b7f6f119d1b7b1f2a4c9e24d59	moondemo
	Demo	Windows	en	9c143c5905055d5df7a0f014ab379aee	moondemo	khalek
	Demo	Mac	en	4af4a6b248103c1fe9edef619677f540	moondemo	khalek
	-	DOS	en	780e4a0ae2ff17dc296f4a79543b44f8	puttmoon	khalek
	-	Windows	en	9c92eeaf517a31b7221ec2546ab669fd	puttmoon	khalek
	-	Mac	en	9dc02577bf50d4cfaf3de3fbac06fbe2	puttmoon	khalek

Putt-Putts Fun Pack
	TODO

Putt-Putt Travels Through Time
	-	All?	en	2108d83dcf09f8adb4bc524669c8cf51	TODO
	Demo	DOS	en	4e5867848ee61bc30d157e2c94eee9b4	TODO
	Demo	DOS	en	0ab19be9e2a3f6938226638b2a3744fe	putttime-demo	khalek

Putt-Putt Enters the Race
	-	DOS	en	981e1e1891f2be7e25a01f50ae55a5af	TODO
	Demo	DOS	en	0ac41e2e3d2174e5a042a6b565328dba	TODO

Putt-Putt Saves the Zoo
	-	DOS	nl	c3b22fa4654bb580b20325ebf4174841	TODO
	-	Mac	en	58fdf4c7ad13540a734e18f8584cad89	Putt-Putt Saves the Zoo	khalek
	Demo	DOS	en	1005456bfe351c1b679e1ff2dc2849e9	puttzoo	khalek
	Demo	DOS	en	f3d55aea441e260e9e9c7d2a187097e0	zoodemo	khalek
	Demo	DOS	en	de4efb910210736813c9a1185384bace	zoodemo	khalek
	Demo	Mac	en	3486ede0f904789267d4bcc5537a46d4	puttzoo	khalek

Fatty Bears Birthday Surprise
	Demo	DOS	en	47e75b1bdcb44c78cb94883d1731ccf8	fbdemo	khalek
	Demo	Windows	en	22c9eb04455440131ffc157aeb8d40a8	fbdemo	khalek
	Demo	Mac	en	6df20c50c1ab19799de9be7ae7716881	Fatty Bear Demo	khalek
	-	DOS	en	3824e60cdf639d22f6df92a03dc4b131	fbear	khalek
	-	Windows	en	179879b6e35c1ead0d93aab26db0951b	fbear	khalek
	-	Mac	en	df6ead57930488bc61e6e41901d0e97	fbear	khalek

Fatty Bears Fun Pack
	TODO

Freddie Fish 4: The Case of the Hogfish Rustlers of Briny Gulch
	Demo	DOS	en	c25755b08a8d0d47695e05f1e2111bfc	TODO

Freddie Fish and the Case of the Stolen Conch Shell
	Demo	DOS	en	cb1559e8405d17a5a278a6b5ad9338d1	TODO

Big Thinkers: Kindergarten
	Demo	DOS	en	695fe0b3963333b7e15b37514db3c745	TODO

Spy Fox in Dry Cereal
	-	DOS	nl	9bda5fee51d2fda5253d02c642016bf4	TODO
	Demo	DOS	en	fbdd947d21e8f5bac6d6f7a316af1c5a	TODO

Pajama Sam 2: Thunder and Lightning Aren't So Frightening
	-	DOS	nl	4fa6870d9bc8c313b65d54b1da5a1891	TODO
	Demo	DOS	en	36a6750e03fb505fc19fc2bf3e4dbe91	TODO

--- NEW FILE: md5table.c ---
/* md5table - Convert a MD5 table to either PHP or C++ code
 * Copyright (C) 2002, 2003  The ScummVM Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /cvsroot/scummvm/tools/md5table.c,v 1.1 2003/12/30 16:33:45 fingolfin Exp $
 *
 */

#include "util.h"

typedef struct {
	const char *key;
	const char *value;
} StringMap;

typedef struct {
	const char *desc;
	const char *platform;
	const char *language;
	const char *md5;
	const char *target;
	const char *infoSource;
} Entry;

/* Map MD5 table platform names to ScummVM constant names.
 * Note: Currently not many constants are defined within ScummVM. However, more
 * will probably be added eventually (see also commented out constants in
 * common/util.h).
 */
static const StringMap platformMap[] = {
	{ "3DO",		"kPlatformUnknown" },
	{ "Amiga",		"kPlatformAmiga" },
	{ "Atari",		"kPlatformAtariST" },
	{ "DOS",		"kPlatformPC" },
	{ "FmTowns",	"kPlatformUnknown" },
	{ "Mac",		"kPlatformMacintosh" },
	{ "SEGA",		"kPlatformUnknown" },
	{ "Windows",	"kPlatformPC" },

	{ "All?",		"kPlatformUnknown" },
	{ "All",		"kPlatformUnknown" },

	{ 0,			"kPlatformUnknown" }
};

static const StringMap langMap[] = {
	{ "en",		"EN_USA" },
	{ "de",		"DE_DEU" },
	{ "fr",		"FR_FRA" },
	{ "it",		"IT_ITA" },
	{ "pt",		"PT_BRA" },
	{ "es",		"ES_ESP" },
	{ "jp",		"JA_JPN" },
	{ "zh",		"ZH_TWN" },
	{ "ko",		"KO_KOR" },
	{ "se",		"SE_SWE" },
	{ "en",		"EN_GRB" },
	{ "hb",		"HB_HEB" },
	{ "ru",		"RU_RUS" },

	{ "All",	"UNK_LANG" },
	{ "All?",	"UNK_LANG" },

	{ 0,		"UNK_LANG" }
};

static void parseEntry(Entry *entry, char *line) {
	assert(entry);
	assert(line);
	
	/* Split at the tabs */
	entry->desc = strsep(&line, "\t\n\r");
	entry->platform = strsep(&line, "\t\n\r");
	entry->language = strsep(&line, "\t\n\r");
	entry->md5 = strsep(&line, "\t\n\r");
	entry->target = strsep(&line, "\t\n\r");
	entry->infoSource = strsep(&line, "\t\n\r");
}

static bool isEmptyLine(const char *line) {
	const char *whitespace = " \t\n\r";
	while (*line) {
		if (!strchr(whitespace, *line))
			return false;
		line++;
	}
	return true;
}

static const char *mapStr(const char *str, const StringMap *map) {
	assert(str);
	assert(map);
	while (map->key) {
		if (0 == strcmp(map->key, str))
			return map->value;
		map++;
	}
	warning("mapStr: unknown string '%s', defaulting to '%s'", str, map->value);
	return map->value;
}

static const char *c_header =
	"struct MD5Table {\n"
	"	const char *md5;\n"
	"	const char *target;\n"
	"	Common::Language language;\n"
	"	Common::Platform platform;\n"
	"};\n"
	"\n"
	"static const MD5Table md5table[] = {\n";

static const char *c_footer =
	"	{ 0, 0, 0, 0 }\n"
	"};\n";

int main(int argc, char *argv[])
{
	FILE *inFile = stdin;
	FILE *outFile = stdout;
	char buffer[1024];
	char section[1024];
	char *line;
	int err;
	int i;

	const int entrySize = 256;
	int numEntries = 0, maxEntries = 1;
	char *entriesBuffer = malloc(maxEntries * entrySize);

	const bool phpOutput = false;

	
	while ((line = fgets(buffer, sizeof(buffer), inFile))) {
		/* Parse line */
		if (line[0] == '#' || isEmptyLine(line))
			continue;	/* Skip comments & empty lines */
		if (line[0] == '\t') {
			Entry entry;
			assert(section[0]);
			parseEntry(&entry, line+1);
			if (phpOutput) {
				fprintf(outFile, "\t\t<?php addEntry(");
				fprintf(outFile, "\"%s\", ", entry.desc);
				fprintf(outFile, "\"%s\", ", entry.platform);
				fprintf(outFile, "\"%s\", ", entry.language);
				fprintf(outFile, "\"%s\", ", entry.md5);
				fprintf(outFile, "\"%s\"", entry.target);
				if (entry.infoSource)
					fprintf(outFile, ", \"%s\"", entry.infoSource);
				fprintf(outFile, "); ?>\n");
			} else if (entry.md5) {
				if (numEntries >= maxEntries) {
					maxEntries *= 2;
					entriesBuffer = realloc(entriesBuffer, maxEntries * entrySize);
				}
				snprintf(entriesBuffer + numEntries * entrySize, entrySize, "\t{ \"%s\", \"%s\", %s, %s },\n",
					entry.md5, entry.target, mapStr(entry.language, langMap), mapStr(entry.platform, platformMap));
				numEntries++;
			}
		} else {
			for (i = 0; buffer[i] && buffer[i] != '\n'; ++i)
				section[i] = buffer[i];
			section[i] = 0;
			if (phpOutput) {
				fprintf(outFile, "\t<tr><td colspan='7'><strong>%s</strong></td></tr>\n", section);
			}
		}
	}

	err = ferror(inFile);
	if (err)
		error("Failed reading from input file, error %d", err);

	if (!phpOutput) {
		/* Printf header */
		fprintf(outFile, c_header);
		/* Now sort the MD5 table (this allows for binary searches) */
		qsort(entriesBuffer, numEntries, entrySize, strcmp);
		/* Output the table */
		for (i = 0; i < numEntries; ++i)
			fprintf(outFile, entriesBuffer + i * entrySize);
		/* Finally, print the footer */
		fprintf(outFile, c_footer);
	}
	
	free(entriesBuffer);

	return 0;
}

Index: Makefile
===================================================================
RCS file: /cvsroot/scummvm/tools/Makefile,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- Makefile	2 Dec 2003 07:31:42 -0000	1.28
+++ Makefile	30 Dec 2003 16:33:45 -0000	1.29
@@ -20,6 +20,7 @@
 	descumm$(EXEEXT) \
 	desword2$(EXEEXT) \
 	extract$(EXEEXT) \
+	md5table$(EXEEXT) \
 	mm_nes_extract$(EXEEXT) \
 	queenrebuild$(EXEEXT) \
 	rescumm$(EXEEXT) \
@@ -40,6 +41,9 @@
 extract$(EXEEXT): extract.o extract-common.o util.o
 	$(CC) $(LFLAGS) -o $@ $+
 
+md5table$(EXEEXT): md5table.o util.o
+	$(CXX) $(LFLAGS) -o $@ $+
+
 mm_nes_extract$(EXEEXT): mm_nes_extract.o
 	$(CC) $(LFLAGS) -o $@ $+
 
@@ -58,7 +62,7 @@
 
 descumm.o descumm6.o descumm-common.o descumm-tool.o: descumm.h util.h
 extract.o simon2mp3.o extract-common.o: util.h extract.h
-desword2.o queenrebuild.o rescumm.o util.o: util.h
+desword2.o md5table.o queenrebuild.o rescumm.o util.o: util.h
 
 clean:
 	rm -f *.o $(TARGETS)

Index: convbdf.c
===================================================================
RCS file: /cvsroot/scummvm/tools/convbdf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- convbdf.c	19 Nov 2003 23:12:49 -0000	1.2
+++ convbdf.c	30 Dec 2003 16:33:45 -0000	1.3
@@ -248,16 +248,11 @@
 {
 	if (!pf)
 		return;
-	if (pf->name)
-		free(pf->name);
-	if (pf->facename)
-		free(pf->facename);
-	if (pf->bits)
-		free(pf->bits);
-	if (pf->offset)
-		free(pf->offset);
-	if (pf->width)
-		free(pf->width);
+	free(pf->name);
+	free(pf->facename);
+	free(pf->bits);
+	free(pf->offset);
+	free(pf->width);
 	free(pf);
 }
 





More information about the Scummvm-git-logs mailing list