[Scummvm-cvs-logs] SF.net SVN: scummvm: [24280] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Wed Oct 11 16:59:24 CEST 2006


Revision: 24280
          http://svn.sourceforge.net/scummvm/?rev=24280&view=rev
Author:   kirben
Date:     2006-10-11 07:59:16 -0700 (Wed, 11 Oct 2006)

Log Message:
-----------
Add AtariST version of Elvira 1 and cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/game.cpp
    scummvm/trunk/engines/agos/res.cpp
    scummvm/trunk/engines/agos/vga.cpp

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2006-10-11 14:17:53 UTC (rev 24279)
+++ scummvm/trunk/engines/agos/agos.cpp	2006-10-11 14:59:16 UTC (rev 24280)
@@ -2311,10 +2311,12 @@
 	addTimeEvent(0, 1);
 	openGameFile();
 
-	if (getGameType() == GType_FF)
-		loadIconData();
-	else if (getGameType() != GType_PP)
-		loadIconFile();
+	if (getFileName(GAME_ICONFILE) != NULL) {
+		if (getGameType() == GType_FF)
+			loadIconData();
+		else
+			loadIconFile();
+	}
 
 	vc34_setMouseOff();
 
@@ -2475,7 +2477,15 @@
 void AGOSEngine::loadMusic(uint music) {
 	char buf[4];
 
-	if (getGameType() == GType_SIMON2) {        // Simon 2 music
+	if (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST) {
+		if (getFeatures() & GF_CRUNCHED) {
+			// TODO Add support for decruncher
+			debug(5,"loadMusic - Decrunch %dtune attempt", music);
+		}
+		// TODO Add Protracker support for simon1amiga/cd32
+		debug(5,"playMusic - Load %dtune attempt", music);
+		return;
+	} else if (getGameType() == GType_SIMON2) {
 		midi.stop();
 		_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
 		_gameFile->read(buf, 4);
@@ -2489,17 +2499,7 @@
 
 		_lastMusicPlayed = music;
 		_nextMusicToPlay = -1;
-	} else if (getGameType() == GType_SIMON1) {        // Simon 1 music
-		if (getPlatform() == Common::kPlatformAmiga) {
-			if (getFeatures() & GF_CRUNCHED) {
-				// TODO Add support for decruncher
-				debug(5,"loadMusic - Decrunch %dtune attempt", music);
-			}
-			// TODO Add Protracker support for simon1amiga/cd32
-			debug(5,"playMusic - Load %dtune attempt", music);
-			return;
-		}
-
+	} else if (getGameType() == GType_SIMON1) {
 		midi.stop();
 		midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.)
 
@@ -2538,11 +2538,8 @@
 
 		midi.startTrack (0);
 	} else {
-		if (getPlatform() == Common::kPlatformAmiga)
-			return;
-
 		midi.stop();
-		midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.)
+		midi.setLoop (true); // Must do this BEFORE loading music.
 
 		char filename[15];
 		File f;

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2006-10-11 14:17:53 UTC (rev 24279)
+++ scummvm/trunk/engines/agos/agos.h	2006-10-11 14:59:16 UTC (rev 24280)
@@ -182,7 +182,7 @@
 			if (_gameDescription->desc.filesDescriptions[i].fileType == type)
 				return _gameDescription->desc.filesDescriptions[i].fileName; 
 		}
-		error("getFileName: Invalid type %d", type);
+		return NULL;
 	}
 
 protected:

Modified: scummvm/trunk/engines/agos/game.cpp
===================================================================
--- scummvm/trunk/engines/agos/game.cpp	2006-10-11 14:17:53 UTC (rev 24279)
+++ scummvm/trunk/engines/agos/game.cpp	2006-10-11 14:59:16 UTC (rev 24280)
@@ -169,14 +169,20 @@
 using Common::ADGameFileDescription;
 using Common::ADGameDescription;
 
+static const ADGameFileDescription ELVIRA1AMIGA_GameFiles[] = {
+	{ "gameamiga",		GAME_BASEFILE,	"7bdaff4a118d8035047cf9b1393b3fa0"},
+	{ "icon.dat",		GAME_ICONFILE,	"2db931e84f1ca01f0816dddfae3f49e1"},
+};
+
 static const ADGameFileDescription ELVIRA1AMIGADEMO_GameFiles[] = {
 	{ "englishdemo",	GAME_BASEFILE,	"7bbc2dfe8619ef579004ff57674c6e92"},
 	{ "icon.dat",		GAME_ICONFILE,	"68b329da9893e34099c7d8ad5cb9c940"},
 };
 
-static const ADGameFileDescription ELVIRA1AMIGA_GameFiles[] = {
-	{ "gameamiga",		GAME_BASEFILE,	"7bdaff4a118d8035047cf9b1393b3fa0"},
+static const ADGameFileDescription ELVIRA1ST_GameFiles[] = {
+	{ "gamest",		GAME_BASEFILE,	"8942859018fcfb2dbed13e83d974d1ab"},
 	{ "icon.dat",		GAME_ICONFILE,	"2db931e84f1ca01f0816dddfae3f49e1"},
+	{ "tbllist",		GAME_TBLFILE,	"5b6ff494bf7e24213758598ef4ac0a8b"},
 };
 
 static const ADGameFileDescription ELVIRA1DOS_GameFiles[] = {
@@ -185,7 +191,7 @@
 	{ "tbllist",		GAME_TBLFILE,	"319f6b227c7822a551f57d24e70f8149"},
 };
 
-static const ADGameFileDescription ELVIRA1DOS2_GameFiles[] = {
+static const ADGameFileDescription ELVIRA1DOS_FR_GameFiles[] = {
 	{ "gamepc",		GAME_BASEFILE,	"9076d507d60cc454df662316438ec843"},
 	{ "icon.dat",		GAME_ICONFILE,	"fda48c9da7f3e72d0313e2f5f760fc45"},
 	{ "tbllist",		GAME_TBLFILE,	"319f6b227c7822a551f57d24e70f8149"},
@@ -712,6 +718,22 @@
 		GF_OLD_BUNDLE | GF_CRUNCHED,
 	},
 
+	// Elvira - English Atari ST Floppy
+	{
+		{
+			"elvira1",
+			"Floppy",
+			ARRAYSIZE(ELVIRA1ST_GameFiles),
+			ELVIRA1ST_GameFiles,
+			Common::EN_ANY,
+			Common::kPlatformAtariST,
+		},
+
+		GType_ELVIRA1,
+		GID_ELVIRA1,
+		GF_OLD_BUNDLE | GF_CRUNCHED,
+	},
+
 	// Elvira - English DOS Floppy
 	{
 		{
@@ -733,8 +755,8 @@
 		{
 			"elvira1",
 			"Floppy",
-			ARRAYSIZE(ELVIRA1DOS2_GameFiles),
-			ELVIRA1DOS2_GameFiles,
+			ARRAYSIZE(ELVIRA1DOS_FR_GameFiles),
+			ELVIRA1DOS_FR_GameFiles,
 			Common::FR_FRA,
 			Common::kPlatformPC,
 		},

Modified: scummvm/trunk/engines/agos/res.cpp
===================================================================
--- scummvm/trunk/engines/agos/res.cpp	2006-10-11 14:17:53 UTC (rev 24279)
+++ scummvm/trunk/engines/agos/res.cpp	2006-10-11 14:59:16 UTC (rev 24280)
@@ -168,48 +168,44 @@
 	}
 
 	readSubroutineBlock(&in);
-
 	in.close();
 
-	if ((getGameType() == GType_ELVIRA1 && getPlatform() == Common::kPlatformAmiga) ||
-		getGameType() == GType_PP)
-		return;
+	if (getFileName(GAME_TBLFILE) != NULL) {
+		/* Read list of TABLE resources */
+		in.open(getFileName(GAME_TBLFILE));
+		if (in.isOpen() == false) {
+			error("loadGamePcFile: Can't load table resources file '%s'", getFileName(GAME_TBLFILE));
+		}
 
-	/* Read list of TABLE resources */
-	in.open(getFileName(GAME_TBLFILE));
-	if (in.isOpen() == false) {
-		error("loadGamePcFile: Can't load table resources file '%s'", getFileName(GAME_TBLFILE));
-	}
+		file_size = in.size();
 
-	file_size = in.size();
+		_tblList = (byte *)malloc(file_size);
+		if (_tblList == NULL)
+			error("loadGamePcFile: Out of memory for strip table list");
+		in.read(_tblList, file_size);
+		in.close();
 
-	_tblList = (byte *)malloc(file_size);
-	if (_tblList == NULL)
-		error("loadGamePcFile: Out of memory for strip table list");
-	in.read(_tblList, file_size);
-	in.close();
+		/* Remember the current state */
+		_subroutineListOrg = _subroutineList;
+		_tablesHeapPtrOrg = _tablesHeapPtr;
+		_tablesHeapCurPosOrg = _tablesHeapCurPos;
+	}
 
-	/* Remember the current state */
-	_subroutineListOrg = _subroutineList;
-	_tablesHeapPtrOrg = _tablesHeapPtr;
-	_tablesHeapCurPosOrg = _tablesHeapCurPos;
+	if (getFileName(GAME_STRFILE) != NULL) {
+		/* Read list of TEXT resources */
+		in.open(getFileName(GAME_STRFILE));
+		if (in.isOpen() == false)
+			error("loadGamePcFile: Can't load text resources file '%s'", getFileName(GAME_STRFILE));
 
-	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_FF)
-		return;
+		file_size = in.size();
+		_strippedTxtMem = (byte *)malloc(file_size);
+		if (_strippedTxtMem == NULL)
+			error("loadGamePcFile: Out of memory for strip text list");
+		in.read(_strippedTxtMem, file_size);
+		in.close();
+	}
 
-	/* Read list of TEXT resources */
-	in.open(getFileName(GAME_STRFILE));
-	if (in.isOpen() == false)
-		error("loadGamePcFile: Can't load text resources file '%s'", getFileName(GAME_STRFILE));
-
-	file_size = in.size();
-	_strippedTxtMem = (byte *)malloc(file_size);
-	if (_strippedTxtMem == NULL)
-		error("loadGamePcFile: Out of memory for strip text list");
-	in.read(_strippedTxtMem, file_size);
-	in.close();
-
-	if (getGameType() == GType_WW && getPlatform() == Common::kPlatformPC) {
+	if (getFileName(GAME_RMSLFILE) != NULL) {
 		/* Read list of ROOM ITEMS resources */
 		in.open(getFileName(GAME_RMSLFILE));
 		if (in.isOpen() == false) {
@@ -225,7 +221,7 @@
 		in.close();
 	}
 
-	if (getGameType() == GType_WW) {
+	if (getFileName(GAME_XTBLFILE) != NULL) {
 		/* Read list of XTABLE resources */
 		in.open(getFileName(GAME_XTBLFILE));
 		if (in.isOpen() == false) {
@@ -665,7 +661,7 @@
 		dst = allocBlock(dstSize + extraBuffer);
 		decompressData(filename, dst, offs, srcSize, dstSize);
 	} else if (getFeatures() & GF_OLD_BUNDLE) {
-		if (getPlatform() == Common::kPlatformAmiga) {
+		if (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST) {
 			if (getFeatures() & GF_TALKIE) {
 				sprintf(filename, "%.3d%d.out", id, type);
 			} else if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) {

Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp	2006-10-11 14:17:53 UTC (rev 24279)
+++ scummvm/trunk/engines/agos/vga.cpp	2006-10-11 14:59:16 UTC (rev 24280)
@@ -1335,8 +1335,6 @@
 				} while (--h);
 			}
 		} while (++w != state->draw_width);
-
-		/* vc10_helper_5 */
 	} else if ((((_lockWord & 0x20) && state->palette == 0) || state->palette == 0xC0) &&
 		(getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
 		getPlatform() != Common::kPlatformAmiga) {
@@ -1407,7 +1405,6 @@
 				src += state->width * 16;
 			} while (--h);
 		}
-		/* vc10_helper_4 */
 	} else {
 		if (getGameType() == GType_SIMON2 && state->flags & kDFUseFrontBuf && getBitFlag(171)) {
 			state->surf_addr = state->surf2_addr;
@@ -1449,7 +1446,6 @@
 				} while (++h != state->draw_height);
 				dstPtr += 2;
 			} while (++w != state->draw_width);
-			/* vc10_helper_6 */
 		} else {
 			const byte *src;
 			byte *dst;


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