[Scummvm-cvs-logs] SF.net SVN: scummvm: [21399] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Tue Mar 21 22:22:07 CET 2006


Revision: 21399
Author:   kirben
Date:     2006-03-21 22:21:17 -0800 (Tue, 21 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21399&view=rev

Log Message:
-----------
Add initial support for Amiga and Macintosh versions of The Feeble Files

Modified Paths:
--------------
    scummvm/trunk/engines/simon/game.cpp
    scummvm/trunk/engines/simon/intern.h
    scummvm/trunk/engines/simon/res.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/vga.cpp
Modified: scummvm/trunk/engines/simon/game.cpp
===================================================================
--- scummvm/trunk/engines/simon/game.cpp	2006-03-22 00:24:10 UTC (rev 21398)
+++ scummvm/trunk/engines/simon/game.cpp	2006-03-22 06:21:17 UTC (rev 21399)
@@ -417,14 +417,42 @@
 	{ GID_SIMON2WIN_PL,    "e229f84d46fa83f99b4a7115679f3fb6", "stripped.txt", false},
 	{ GID_SIMON2WIN_PL,    "2082f8d02075e590300478853a91ffd9", "tbllist", false},
 
-	{ GID_FEEBLEFILES_2CD, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false },
-	{ GID_FEEBLEFILES_2CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+	{ GID_FEEBLEFILES_AMI_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false },
+	{ GID_FEEBLEFILES_AMI_DE, "f550f7915c5ce3a68c9f870f507449c2", "gfxindex.dat", false},
+	{ GID_FEEBLEFILES_AMI_DE, "bdb4cf3eacfeffc3aed4f90bf87c5690", "sfxindex.dat", false},
+	{ GID_FEEBLEFILES_AMI_DE, "e0f9e91213e4b6f684e2a9a67d7a4660", "spindex.dat", false},
+	{ GID_FEEBLEFILES_AMI_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
 
-	{ GID_FEEBLEFILES_4CD, "a8746407a5b20a7da0da0a14c380af1c", "game22", false },
-	{ GID_FEEBLEFILES_4CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+	{ GID_FEEBLEFILES_AMI_UK, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false },
+	{ GID_FEEBLEFILES_AMI_UK, "f550f7915c5ce3a68c9f870f507449c2", "gfxindex.dat", false},
+	{ GID_FEEBLEFILES_AMI_UK, "bdb4cf3eacfeffc3aed4f90bf87c5690", "sfxindex.dat", false},
+	{ GID_FEEBLEFILES_AMI_UK, "e0f9e91213e4b6f684e2a9a67d7a4660", "spindex.dat", false},
+	{ GID_FEEBLEFILES_AMI_UK, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
 
-	{ GID_FEEBLEFILES_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false },
-	{ GID_FEEBLEFILES_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+	{ GID_FEEBLEFILES_MAC_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false },
+	{ GID_FEEBLEFILES_MAC_DE, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false},
+	{ GID_FEEBLEFILES_MAC_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+
+	{ GID_FEEBLEFILES_MAC_FR, "ba90b40a47726039671d9e91630dd7ed", "game22", false },
+	{ GID_FEEBLEFILES_MAC_FR, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false},
+	{ GID_FEEBLEFILES_MAC_FR, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+
+	{ GID_FEEBLEFILES_MAC_SP, "71d7d2d5e479b053c5a9757f1702c9c3", "game22", false },
+	{ GID_FEEBLEFILES_MAC_SP, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false},
+	{ GID_FEEBLEFILES_MAC_SP, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+
+	{ GID_FEEBLEFILES_MAC_UK, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false },
+	{ GID_FEEBLEFILES_MAC_UK, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false},
+	{ GID_FEEBLEFILES_MAC_UK, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+
+	{ GID_FEEBLEFILES_2CD,    "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false },
+	{ GID_FEEBLEFILES_2CD,    "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+
+	{ GID_FEEBLEFILES_4CD,    "a8746407a5b20a7da0da0a14c380af1c", "game22", false },
+	{ GID_FEEBLEFILES_4CD,    "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
+
+	{ GID_FEEBLEFILES_DE,     "bcd76ac080003eee3649df18db25b60e", "game22", false },
+	{ GID_FEEBLEFILES_DE,     "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
 };
 
 // Simon the Sorcerer 1
@@ -488,6 +516,20 @@
 	{"tbllist", GAME_TBLFILE},
 };
 
+static GameFileDescription FEEBLEFILES_AMI_GameFiles[] = {
+	{"game22", GAME_BASEFILE},
+	{"gfxindex.dat", GAME_GFXIDXFILE},
+	{"sfxindex.dat", GAME_SFXIDXFILE},
+	{"spindex.dat", GAME_SPIDXFILE},
+	{"tbllist", GAME_TBLFILE},
+};
+
+static GameFileDescription FEEBLEFILES_MAC_GameFiles[] = {
+	{"game22", GAME_BASEFILE},
+	{"graphics.vga", GAME_GFXIDXFILE},
+	{"tbllist", GAME_TBLFILE},
+};
+
 static GameDescription gameDescriptions[] = {
 	// Simon the Sorcerer 1 - English Acorn CD Demo
 	{
@@ -1076,10 +1118,88 @@
 		Common::kPlatformWindows,
 	},
 
-	// The Feeble Files - English 2CD
+	// The Feeble Files - English Amiga CD
 	{
 		"feeble",
 		GType_FF,
+		GID_FEEBLEFILES_AMI_UK,
+		"CD",
+		ARRAYSIZE(FEEBLEFILES_AMI_GameFiles),
+		FEEBLEFILES_AMI_GameFiles,
+		GF_OLD_BUNDLE | GF_TALKIE,
+		Common::EN_USA,
+		Common::kPlatformAmiga,
+	},
+
+	// The Feeble Files - German Amiga CD
+	{
+		"feeble",
+		GType_FF,
+		GID_FEEBLEFILES_AMI_DE,
+		"CD",
+		ARRAYSIZE(FEEBLEFILES_AMI_GameFiles),
+		FEEBLEFILES_AMI_GameFiles,
+		GF_OLD_BUNDLE | GF_TALKIE,
+		Common::DE_DEU,
+		Common::kPlatformAmiga,
+	},
+
+	// The Feeble Files - English Macintosh CD
+	{
+		"feeble",
+		GType_FF,
+		GID_FEEBLEFILES_MAC_UK,
+		"CD",
+		ARRAYSIZE(FEEBLEFILES_MAC_GameFiles),
+		FEEBLEFILES_MAC_GameFiles,
+		GF_OLD_BUNDLE | GF_TALKIE,
+		Common::EN_USA,
+		Common::kPlatformMacintosh,
+	},
+
+	// The Feeble Files - French Macintosh CD
+	{
+		"feeble",
+		GType_FF,
+		GID_FEEBLEFILES_MAC_FR,
+		"CD",
+		ARRAYSIZE(FEEBLEFILES_MAC_GameFiles),
+		FEEBLEFILES_MAC_GameFiles,
+		GF_OLD_BUNDLE | GF_TALKIE,
+		Common::FR_FRA,
+		Common::kPlatformMacintosh,
+	},
+
+	// The Feeble Files - German Macintosh CD
+	{
+		"feeble",
+		GType_FF,
+		GID_FEEBLEFILES_MAC_DE,
+		"CD",
+		ARRAYSIZE(FEEBLEFILES_MAC_GameFiles),
+		FEEBLEFILES_MAC_GameFiles,
+		GF_OLD_BUNDLE | GF_TALKIE,
+		Common::DE_DEU,
+		Common::kPlatformMacintosh,
+	},
+
+	// The Feeble Files - Spanish Macintosh CD
+	{
+		"feeble",
+		GType_FF,
+		GID_FEEBLEFILES_MAC_SP,
+		"CD",
+		ARRAYSIZE(FEEBLEFILES_MAC_GameFiles),
+		FEEBLEFILES_MAC_GameFiles,
+		GF_OLD_BUNDLE | GF_TALKIE,
+		Common::ES_ESP,
+		Common::kPlatformMacintosh,
+	},
+
+	// The Feeble Files - English Windows 2CD
+	{
+		"feeble",
+		GType_FF,
 		GID_FEEBLEFILES_2CD,
 		"2CD",
 		ARRAYSIZE(FEEBLEFILES_GameFiles),
@@ -1089,7 +1209,7 @@
 		Common::kPlatformWindows,
 	},
 
-	// The Feeble Files - English 4CD
+	// The Feeble Files - English Windows 4CD
 	{
 		"feeble",
 		GType_FF,
@@ -1102,7 +1222,7 @@
 		Common::kPlatformWindows,
 	},
 
-	// The Feeble Files - German 4CD
+	// The Feeble Files - German Windows 4CD
 	{
 		"feeble",
 		GType_FF,

Modified: scummvm/trunk/engines/simon/intern.h
===================================================================
--- scummvm/trunk/engines/simon/intern.h	2006-03-22 00:24:10 UTC (rev 21398)
+++ scummvm/trunk/engines/simon/intern.h	2006-03-22 06:21:17 UTC (rev 21399)
@@ -159,7 +159,11 @@
 	GAME_ICONFILE = 1 << 1,
 	GAME_GMEFILE  = 1 << 2,
 	GAME_STRFILE  = 1 << 3,
-	GAME_TBLFILE  = 1 << 4
+	GAME_TBLFILE  = 1 << 4,
+
+	GAME_GFXIDXFILE = 1 << 5,
+	GAME_SFXIDXFILE = 1 << 6,
+	GAME_SPIDXFILE  = 1 << 7
 };
 
 enum GameIds {
@@ -210,6 +214,12 @@
 	GID_SIMON2WIN_DE2,
 	GID_SIMON2WIN_PL,
 
+	GID_FEEBLEFILES_AMI_DE,
+	GID_FEEBLEFILES_AMI_UK,
+	GID_FEEBLEFILES_MAC_DE,
+	GID_FEEBLEFILES_MAC_FR,
+	GID_FEEBLEFILES_MAC_SP,
+	GID_FEEBLEFILES_MAC_UK,
 	GID_FEEBLEFILES_2CD,
 	GID_FEEBLEFILES_4CD,
 	GID_FEEBLEFILES_DE

Modified: scummvm/trunk/engines/simon/res.cpp
===================================================================
--- scummvm/trunk/engines/simon/res.cpp	2006-03-22 00:24:10 UTC (rev 21398)
+++ scummvm/trunk/engines/simon/res.cpp	2006-03-22 06:21:17 UTC (rev 21399)
@@ -128,6 +128,25 @@
 		return READ_BE_UINT16(src);
 }
 
+void SimonEngine::loadOffsets(const char *filename, int number, uint32 &file, uint32 &offset, uint32 &srcSize, uint32 &dstSize) {
+	Common::File in;
+
+	int offsSize = (getPlatform() == Common::kPlatformAmiga) ? 16 : 12;
+
+	/* read offsets from index */
+	in.open(filename);
+	if (in.isOpen() == false) {
+		error("Can't open index file '%s'", filename);
+	}
+
+	in.seek(number * offsSize, SEEK_SET);
+	offset = in.readUint32LE();
+	dstSize = in.readUint32LE();
+	srcSize = in.readUint32LE();
+	file = in.readUint32LE();
+	in.close();
+}
+
 void SimonEngine::loadGamePcFile(const char *filename) {
 	Common::File in;
 	int num_inited_objects;

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-03-22 00:24:10 UTC (rev 21398)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-03-22 06:21:17 UTC (rev 21399)
@@ -48,6 +48,10 @@
 #include "globals.h"
 #endif
 
+#ifdef USE_ZLIB
+#include <zlib.h>
+#endif
+
 using Common::File;
 
 namespace Simon {
@@ -457,6 +461,17 @@
 	File::addDefaultDirectory(_gameDataPath + "execute/");
 	File::addDefaultDirectory(_gameDataPath + "EXECUTE/");
 
+	// Add default file directories for Amiga & Macintosh
+	// versions of The Feeble Files
+	File::addDefaultDirectory(_gameDataPath + "gfx/");
+	File::addDefaultDirectory(_gameDataPath + "GFX/");
+	File::addDefaultDirectory(_gameDataPath + "movies/");
+	File::addDefaultDirectory(_gameDataPath + "MOVIES/");
+	File::addDefaultDirectory(_gameDataPath + "sfx/");
+	File::addDefaultDirectory(_gameDataPath + "SFX/");
+	File::addDefaultDirectory(_gameDataPath + "speech/");
+	File::addDefaultDirectory(_gameDataPath + "SPEECH/");
+
 	// Detect game
 	if (!initGame()) {
 		return -1;
@@ -2250,8 +2265,11 @@
 
 	vpe->vgaFile1 = read_vga_from_datfile_2(vga_res * 2, 1);
 	vpe->vgaFile2 = read_vga_from_datfile_2(vga_res * 2 + 1, 2);
-	vpe->sfxFile = read_vga_from_datfile_2(vga_res * 2, 3);
 
+	vpe->sfxFile =  NULL;
+	if (getGameType() == GType_FF && getPlatform() == Common::kPlatformWindows)
+		read_vga_from_datfile_2(vga_res * 2, 3);
+
 }
 
 byte *SimonEngine::setup_vga_destination(uint32 size) {
@@ -3676,9 +3694,54 @@
 	// is base on: 2 (lines) * 320 (screen width) * 10 (textheight) -- olki
 	int extraBuffer = (id == 5 ? 6400 : 0);
 
-	if (getFeatures() & GF_OLD_BUNDLE) {
+	if (getGameType() == GType_FF && getPlatform() != Common::kPlatformWindows) {
+#ifdef USE_ZLIB
 		File in;
 		char buf[15];
+		byte *dst = NULL;
+
+		uint32 file, offset, srcSize, dstSize;
+		if (getPlatform() == Common::kPlatformAmiga) {
+			loadOffsets((const char*)"gfxindex.dat", id / 2 * 3 + type, file, offset, srcSize, dstSize);
+		} else {
+			loadOffsets((const char*)"graphics.vga", id / 2 * 3 + type, file, offset, srcSize, dstSize);
+		}
+
+		if (getPlatform() == Common::kPlatformAmiga)
+			sprintf(buf, "GFX%d.VGA", file);
+		else
+			sprintf(buf, "graphics.vga");
+
+		in.open(buf);
+		if (in.isOpen() == false)
+			error("read_vga_from_datfile_2: can't open %s", buf);
+
+		dst = setup_vga_destination(dstSize);
+
+		in.seek(offset, SEEK_SET);
+		if (srcSize != dstSize) {
+			byte *srcBuffer = (byte *)malloc(srcSize);
+
+			if (in.read(srcBuffer, srcSize) != srcSize)
+				error("read_vga_from_datfile_2: read failed");
+
+			unsigned long decompressedSize = dstSize;
+			int result = uncompress(dst, &decompressedSize, srcBuffer, srcSize);
+			if (result != Z_OK)
+				error("read_vga_from_datfile_2() Zlib uncompress error");
+			free(srcBuffer);
+		} else {
+			if (in.read(dst, dstSize) != dstSize)
+				error("read_vga_from_datfile_2: read failed");
+		}
+		in.close();
+#else
+		error("Zlib support is required for Amiga and Macintosh versions");
+#endif
+		return dst;
+	} else if (getFeatures() & GF_OLD_BUNDLE) {
+		File in;
+		char buf[15];
 		uint32 size;
 		byte *dst = NULL;
 

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-03-22 00:24:10 UTC (rev 21398)
+++ scummvm/trunk/engines/simon/simon.h	2006-03-22 06:21:17 UTC (rev 21399)
@@ -456,6 +456,7 @@
 	void readItemChildren(Common::File *in, Item *item, uint tmp);
 	void readItemFromGamePc(Common::File *in, Item *item);
 	void loadGamePcFile(const char *filename);
+	void loadOffsets(const char *filename, int number, uint32 &file, uint32 &offset, uint32 &compressedSize, uint32 &size);
 
 	void palette_fadeout(uint32 *pal_values, uint num);
 	

Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp	2006-03-22 00:24:10 UTC (rev 21398)
+++ scummvm/trunk/engines/simon/vga.cpp	2006-03-22 06:21:17 UTC (rev 21399)
@@ -1881,7 +1881,9 @@
 	if (getGameType() == GType_FF) {
 		uint16 pan = vcReadNextWord();
 		uint16 vol = vcReadNextWord();
-		_sound->playSoundData(_curSfxFile, sound, pan, vol, ambient);
+
+		if (_curSfxFile != NULL)
+			_sound->playSoundData(_curSfxFile, sound, pan, vol, ambient);
 	} else if (getGameType() == GType_SIMON2) {
 		if (ambient) {
 			_sound->playAmbient(sound);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list