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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri Oct 6 07:13:22 CEST 2006


Revision: 24133
          http://svn.sourceforge.net/scummvm/?rev=24133&view=rev
Author:   kirben
Date:     2006-10-05 22:13:09 -0700 (Thu, 05 Oct 2006)

Log Message:
-----------
Add Amiga demo of Elvira, and switch to elvira1 for Elvira

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/debug.cpp
    scummvm/trunk/engines/agos/draw.cpp
    scummvm/trunk/engines/agos/game.cpp
    scummvm/trunk/engines/agos/intern.h
    scummvm/trunk/engines/agos/items.cpp
    scummvm/trunk/engines/agos/res.cpp
    scummvm/trunk/engines/agos/subroutine.cpp
    scummvm/trunk/engines/agos/vga.cpp

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/agos.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -637,7 +637,7 @@
 		_frameRate = 4;
 		_vgaBaseDelay = 1;
 		_numVars = 255;
-	} else if (getGameType() == GType_ELVIRA) {
+	} else if (getGameType() == GType_ELVIRA1) {
 		gss = PTR(simon1_settings);
 		_numTextBoxes = 20;
 		_numVideoOpcodes = 57;
@@ -867,7 +867,7 @@
 }
 
 uint AGOSEngine::getVarOrByte() {
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		return getVarOrWord();
 	} else {
 		uint a = *_codePtr++;
@@ -893,7 +893,7 @@
 }
 
 uint AGOSEngine::getVarWrapper() {
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_PP)
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_PP)
 		return getVarOrWord();
 	else
 		return getVarOrByte();
@@ -1768,7 +1768,7 @@
 			}
 		}
 		if (_exitCutscene) {
-			if (getGameType() == GType_ELVIRA) {
+			if (getGameType() == GType_ELVIRA1) {
 				if (_variableArray[105] == 0) {
 					_variableArray[105] = 255;
 					break;
@@ -2070,7 +2070,7 @@
 	vsp->y = y;
 	vsp->x = x;
 	vsp->image = 0;
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
 		vsp->palette = 0;
 	else
 		vsp->palette = palette;

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/agos.h	2006-10-06 05:13:09 UTC (rev 24133)
@@ -111,7 +111,7 @@
 };
 
 enum SIMONGameType {
-	GType_ELVIRA = 0,
+	GType_ELVIRA1 = 0,
 	GType_ELVIRA2 = 1,
 	GType_WW = 2,
 	GType_SIMON1 = 3,

Modified: scummvm/trunk/engines/agos/debug.cpp
===================================================================
--- scummvm/trunk/engines/agos/debug.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/debug.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -37,7 +37,7 @@
 	uint opcode;
 	const char *s, *st;
 
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		opcode = READ_BE_UINT16(p);
 		p += 2;
 		if (opcode == 10000)

Modified: scummvm/trunk/engines/agos/draw.cpp
===================================================================
--- scummvm/trunk/engines/agos/draw.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/draw.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -85,7 +85,7 @@
 		_vgaCurSpritePriority = vsp->priority;
 
 		params[0] = readUint16Wrapper(&vsp->image);
-		if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+		if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
 			params[1] = readUint16Wrapper(&vsp->x);
 			params[2] = readUint16Wrapper(&vsp->y);
 			params[3] = READ_BE_UINT16(&vsp->flags);
@@ -138,7 +138,7 @@
 			printf("id:%5d image:%3d base-color:%3d x:%3d y:%3d flags:%x\n",
 							vsp->id, vsp->image, vsp->palette, vsp->x, vsp->y, vsp->flags);
 		params[0] = readUint16Wrapper(&vsp->image);
-		if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+		if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
 			params[1] = readUint16Wrapper(&vsp->x);
 			params[2] = readUint16Wrapper(&vsp->y);
 			params[3] = READ_BE_UINT16(&vsp->flags);

Modified: scummvm/trunk/engines/agos/game.cpp
===================================================================
--- scummvm/trunk/engines/agos/game.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/game.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -67,7 +67,7 @@
 };
 
 static const PlainGameDescriptor simonGames[] = {
-	{"elvira", "Elvira"},
+	{"elvira1", "Elvira"},
 	{"elvira2", "Elvira 2"},
 	{"waxworks", "Waxworks"},
 	{"simon1", "Simon the Sorcerer 1"},
@@ -169,6 +169,11 @@
 using Common::ADGameFileDescription;
 using Common::ADGameDescription;
 
+static ADGameFileDescription ELVIRA1AMIGADEMO_GameFiles[] = {
+	{ "englishdemo",	GAME_BASEFILE,	"7bbc2dfe8619ef579004ff57674c6e92"},
+	{ "icon.dat",		GAME_ICONFILE,	"68b329da9893e34099c7d8ad5cb9c940"},
+};
+
 static ADGameFileDescription ELVIRA1AMIGA_GameFiles[] = {
 	{ "gameamiga",		GAME_BASEFILE,	"7bdaff4a118d8035047cf9b1393b3fa0"},
 	{ "icon.dat",		GAME_ICONFILE,	"2db931e84f1ca01f0816dddfae3f49e1"},
@@ -671,7 +676,7 @@
 	// Elvira - English Amiga Floppy
 	{
 		{
-			"elvira",
+			"elvira1",
 			"Floppy",
 			ARRAYSIZE(ELVIRA1AMIGA_GameFiles),
 			ELVIRA1AMIGA_GameFiles,
@@ -679,15 +684,31 @@
 			Common::kPlatformAmiga,
 		},
 
-		GType_ELVIRA,
-		GID_ELVIRA,
+		GType_ELVIRA1,
+		GID_ELVIRA1,
 		GF_OLD_BUNDLE | GF_CRUNCHED,
 	},
 
+	// Elvira - English Amiga Demo
+	{
+		{
+			"elvira1",
+			"Floppy",
+			ARRAYSIZE(ELVIRA1AMIGADEMO_GameFiles),
+			ELVIRA1AMIGADEMO_GameFiles,
+			Common::EN_ANY,
+			Common::kPlatformAmiga,
+		},
+
+		GType_ELVIRA1,
+		GID_ELVIRA1DEMO,
+		GF_OLD_BUNDLE | GF_CRUNCHED,
+	},
+
 	// Elvira - English DOS Floppy
 	{
 		{
-			"elvira",
+			"elvira1",
 			"Floppy",
 			ARRAYSIZE(ELVIRA1DOS_GameFiles),
 			ELVIRA1DOS_GameFiles,
@@ -695,15 +716,15 @@
 			Common::kPlatformPC,
 		},
 
-		GType_ELVIRA,
-		GID_ELVIRA,
+		GType_ELVIRA1,
+		GID_ELVIRA1,
 		GF_OLD_BUNDLE,
 	},
 
 	// Elvira - English DOS Floppy Alternative?
 	{
 		{
-			"elvira",
+			"elvira1",
 			"Floppy",
 			ARRAYSIZE(ELVIRA1DOS2_GameFiles),
 			ELVIRA1DOS2_GameFiles,
@@ -711,8 +732,8 @@
 			Common::kPlatformPC,
 		},
 
-		GType_ELVIRA,
-		GID_ELVIRA,
+		GType_ELVIRA1,
+		GID_ELVIRA1,
 		GF_OLD_BUNDLE,
 	},
 

Modified: scummvm/trunk/engines/agos/intern.h
===================================================================
--- scummvm/trunk/engines/agos/intern.h	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/intern.h	2006-10-06 05:13:09 UTC (rev 24133)
@@ -223,7 +223,8 @@
 };
 
 enum GameIds {
-	GID_ELVIRA,
+	GID_ELVIRA1,
+	GID_ELVIRA1DEMO,
 	GID_ELVIRA2,
 	GID_WAXWORKS,
 

Modified: scummvm/trunk/engines/agos/items.cpp
===================================================================
--- scummvm/trunk/engines/agos/items.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/items.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -541,7 +541,7 @@
 	_numOpcodes = ARRAYSIZE(opcode_table);
 
 	switch (getGameType()) {
-	case GType_ELVIRA:
+	case GType_ELVIRA1:
 		setupElvira1Opcodes(opcode_table);
 		break;
 	case GType_ELVIRA2:
@@ -1107,7 +1107,7 @@
 
 	_lockWord |= 0x80;
 
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 ||
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 ||
 		getGameType() == GType_WW) {
 		vc27_resetSprite();
 		vc29_stopAllSounds();
@@ -2755,7 +2755,7 @@
 		if (_continousMainScript)
 			dumpOpcode(_codePtr);
 
-		if (getGameType() == GType_ELVIRA) {
+		if (getGameType() == GType_ELVIRA1) {
 			opcode = getVarOrWord();
 			if (opcode == 10000)
 				return 0;
@@ -2771,7 +2771,7 @@
 
 		/* Invert condition? */
 		flag = false;
-		if (getGameType() == GType_ELVIRA) {
+		if (getGameType() == GType_ELVIRA1) {
 			if (opcode == 203) {
 				flag = true;
 				opcode = getVarOrWord();

Modified: scummvm/trunk/engines/agos/res.cpp
===================================================================
--- scummvm/trunk/engines/agos/res.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/res.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -118,7 +118,7 @@
 	item_array_inited = in->readUint32BE();
 	stringtable_num = in->readUint32BE();
 
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2) {
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) {
 		item_array_size += 2;
 		item_array_inited = item_array_size;
 	} else {
@@ -171,7 +171,7 @@
 
 	in.close();
 
-	if ((getGameType() == GType_ELVIRA && getPlatform() == Common::kPlatformAmiga) ||
+	if ((getGameType() == GType_ELVIRA1 && getPlatform() == Common::kPlatformAmiga) ||
 		getGameType() == GType_PP)
 		return;
 
@@ -194,7 +194,7 @@
 	_tablesHeapPtrOrg = _tablesHeapPtr;
 	_tablesHeapCurPosOrg = _tablesHeapCurPos;
 
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_FF)
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_FF)
 		return;
 
 	/* Read list of TEXT resources */
@@ -261,7 +261,7 @@
 void AGOSEngine::readItemFromGamePc(Common::File *in, Item *item) {
 	uint32 type;
 
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		item->itemName = (uint16)in->readUint32BE();
 		item->adjective = in->readUint16BE();
 		item->noun = in->readUint16BE();
@@ -309,7 +309,7 @@
 
 void AGOSEngine::readItemChildren(Common::File *in, Item *item, uint type) {
 	if (type == 1) {
-		if (getGameType() == GType_ELVIRA) {
+		if (getGameType() == GType_ELVIRA1) {
 			SubRoom *subRoom = (SubRoom *)allocateChildBlock(item, 1, sizeof(SubRoom));
 			subRoom->roomShort = in->readUint32BE();
 			subRoom->roomLong = in->readUint32BE();
@@ -335,7 +335,7 @@
 					subRoom->roomExit[k++] = (uint16)fileReadItemID(in);
 		}
 	} else if (type == 2) {
-		if (getGameType() == GType_ELVIRA) {
+		if (getGameType() == GType_ELVIRA1) {
 			SubObject *subObject = (SubObject *)allocateChildBlock(item, 2, sizeof(SubObject));
 			in->readUint32BE();
 			in->readUint32BE();
@@ -393,7 +393,7 @@
 
 			for (i = k = 0; i != j; i++)
 					subSuperRoom->roomExit[k++] = in->readUint16BE();
-		} else if (getGameType() == GType_ELVIRA) {
+		} else if (getGameType() == GType_ELVIRA1) {
 			SubGenExit *genExit = (SubGenExit *)allocateChildBlock(item, 4, sizeof(SubGenExit));
 			genExit->dest[0] = (uint16)fileReadItemID(in);
 			genExit->dest[1] = (uint16)fileReadItemID(in);
@@ -420,7 +420,7 @@
 		setUserFlag(item, 1, in->readUint16BE());
 		setUserFlag(item, 2, in->readUint16BE());
 		setUserFlag(item, 3, in->readUint16BE());
-		if (getGameType() == GType_ELVIRA) {
+		if (getGameType() == GType_ELVIRA1) {
 			setUserFlag(item, 4, in->readUint16BE());
 			setUserFlag(item, 5, in->readUint16BE());
 			setUserFlag(item, 6, in->readUint16BE());
@@ -666,14 +666,18 @@
 		decompressData(filename, dst, offs, srcSize, dstSize);
 	} else if (getFeatures() & GF_OLD_BUNDLE) {
 		if (getPlatform() == Common::kPlatformAmiga) {
-			if (getFeatures() & GF_TALKIE)
+			if (getFeatures() & GF_TALKIE) {
 				sprintf(filename, "%.3d%d.out", id, type);
-			else if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2)
-				sprintf(filename, "%.2d%d.pkd", id, type);
-			else
+			} else if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) {
+				if (getGameId() == GID_ELVIRA1DEMO)
+					sprintf(filename, "%.1d%d.out", id, type);
+				else 
+					sprintf(filename, "%.2d%d.pkd", id, type);
+			} else {
 				sprintf(filename, "%.3d%d.pkd", id, type);
+			}
 		} else {
-			if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+			if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
 				sprintf(filename, "%.2d%d.VGA", id, type);
 			} else {
 				sprintf(filename, "%.3d%d.VGA", id, type);

Modified: scummvm/trunk/engines/agos/subroutine.cpp
===================================================================
--- scummvm/trunk/engines/agos/subroutine.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/subroutine.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -251,7 +251,7 @@
 }
 
 bool AGOSEngine::loadTablesIntoMem(uint subr_id) {
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2)
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2)
 		return loadTablesOldIntoMem(subr_id);
 	else
 		return loadTablesNewIntoMem(subr_id);
@@ -581,13 +581,13 @@
 		sl->verb = in->readUint16BE();
 		sl->noun1 = in->readUint16BE();
 		sl->noun2 = in->readUint16BE();
-	} else if (getGameType() == GType_ELVIRA) {
+	} else if (getGameType() == GType_ELVIRA1) {
 		in->readUint16BE();
 		in->readUint16BE();
 		in->readUint16BE();
 	}
 
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		int16 tmp = in->readUint16BE();
 		WRITE_BE_UINT16(q, tmp);
 		while (tmp != 10000) {
@@ -642,7 +642,7 @@
 		table = opcode_arg_table_elvira1;
 
 	i = 0;
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		opcode = READ_BE_UINT16(ptr);
 		ptr += 2;
 	} else {
@@ -673,7 +673,7 @@
 			break;
 
 		case 'B':
-			if (getGameType() == GType_ELVIRA) {
+			if (getGameType() == GType_ELVIRA1) {
 				val = in->readUint16BE();
 				WRITE_BE_UINT16(ptr, val); ptr += 2;
 			} else {

Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp	2006-10-06 04:56:25 UTC (rev 24132)
+++ scummvm/trunk/engines/agos/vga.cpp	2006-10-06 05:13:09 UTC (rev 24133)
@@ -185,7 +185,7 @@
 	_vga_opcode_table = vga_opcode_table;
 
 	switch (getGameType()) {
-	case GType_ELVIRA:
+	case GType_ELVIRA1:
 		setupElvira1VideoOpcodes(vga_opcode_table);
 		break;
 	case GType_ELVIRA2:
@@ -289,7 +289,7 @@
 }
 
 int AGOSEngine::vcReadVarOrWord() {
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		return vcReadNextWord();
 	} else {
 		int16 var = vcReadNextWord();
@@ -542,7 +542,7 @@
 	while (vsp->id)
 		vsp++;
 
-	if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
+	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
 		vsp->palette = 0;
 	else
 		vsp->palette = palette;
@@ -1277,7 +1277,7 @@
 		return;
 
 	uint offs, offs2;
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		//if (_windowNum != 2 && _windowNum != 3) {
 		//	offs = ((vlut[0] - _video_windows[16]) * 2 + state->x) * 8;
 		//	offs2 = (vlut[1] - _video_windows[17] + state->y);
@@ -1765,7 +1765,7 @@
 	byte *offs, *palptr, *src;
 	uint16 a = 0, b, num, palSize;
 
-	if (getGameType() != GType_ELVIRA && getGameType() != GType_ELVIRA2 && getGameType() != GType_WW)
+	if (getGameType() != GType_ELVIRA1 && getGameType() != GType_ELVIRA2 && getGameType() != GType_WW)
 		a = vcReadNextWord();
 	b = vcReadNextWord();
 
@@ -1788,7 +1788,7 @@
 		palptr = _displayPalette;
 		offs = _curVgaFile1 + READ_BE_UINT16(_curVgaFile1 + 6);
 
-		if (getGameType() == GType_ELVIRA) {
+		if (getGameType() == GType_ELVIRA1) {
 			if (b >= 1000) {
 				b -= 1000;
 			} else {
@@ -1800,7 +1800,7 @@
 	src = offs + b * palSize;
 
 	do {
-		if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+		if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
 			uint16 color = READ_BE_UINT16(src);
 			palptr[0] = ((color & 0xf00) >> 8) * 32;
 			palptr[1] = ((color & 0x0f0) >> 4) * 32;
@@ -2266,7 +2266,7 @@
 void AGOSEngine::vc52_playSound() {
 	bool ambient = false;
 
-	if (getGameType() == GType_ELVIRA) {
+	if (getGameType() == GType_ELVIRA1) {
 		_vcPtr += 8;
 		return;
 	}


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