[Scummvm-cvs-logs] SF.net SVN: scummvm: [28430] scummvm/branches/branch-0-10-0/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Fri Aug 3 11:43:54 CEST 2007


Revision: 28430
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28430&view=rev
Author:   Kirben
Date:     2007-08-03 02:43:53 -0700 (Fri, 03 Aug 2007)

Log Message:
-----------
Backport fixes for Amiga version of Waxworks.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agos/detection.cpp
    scummvm/branches/branch-0-10-0/engines/agos/res_snd.cpp
    scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp
    scummvm/branches/branch-0-10-0/engines/agos/zones.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agos/detection.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/detection.cpp	2007-08-03 07:47:34 UTC (rev 28429)
+++ scummvm/branches/branch-0-10-0/engines/agos/detection.cpp	2007-08-03 09:43:53 UTC (rev 28430)
@@ -67,7 +67,7 @@
 static const PlainGameDescriptor simonGames[] = {
 	{"elvira1", "Elvira - Mistress of the Dark"},
 	{"elvira2", "Elvira II - The Jaws of Cerberus"},
-//	{"waxworks", "Waxworks"},
+	{"waxworks", "Waxworks"},
 	{"simon1", "Simon the Sorcerer 1"},
 	{"simon2", "Simon the Sorcerer 2"},
 	{"feeble", "The Feeble Files"},

Modified: scummvm/branches/branch-0-10-0/engines/agos/res_snd.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/res_snd.cpp	2007-08-03 07:47:34 UTC (rev 28429)
+++ scummvm/branches/branch-0-10-0/engines/agos/res_snd.cpp	2007-08-03 09:43:53 UTC (rev 28430)
@@ -139,10 +139,57 @@
 	_nextMusicToPlay = -1;
 }
 
+struct ModuleOffs {
+	uint8 tune;
+	uint8 fileNum;
+	uint32 offs;
+};
+
+static const ModuleOffs amigaWaxworksOffs[20] = {
+	// Pyramid
+	{2,   2, 0,   },
+	{3,   2, 50980},
+	{4,   2, 56160},
+	{5,   2, 62364},
+	{6,   2, 73688},
+
+	// Zombie
+	{8,   8, 0},
+	{11,  8, 51156},
+	{12,  8, 56336},
+	{13,  8, 65612},
+	{14,  8, 68744},
+
+	// Mine
+	{9,   9, 0},
+	{15,  9, 47244},
+	{16,  9, 52424},
+	{17,  9, 59652},
+	{18,  9, 62784},
+
+	// Jack
+	{10, 10, 0},
+	{19, 10, 42054},
+	{20, 10, 47234},
+	{21, 10, 49342},
+	{22, 10, 51450},
+};
+
 void AGOSEngine::playModule(uint music) {
 	char filename[15];
 	File f;
+	uint32 offs = 0;
 
+	if (getPlatform() == Common::kPlatformAmiga && getGameType() == GType_WW) {
+		// Multiple tunes are stored in music files for main locations
+		for (uint i = 0; i < 20; i++) {
+			if (amigaWaxworksOffs[i].tune == music) {
+				music = amigaWaxworksOffs[i].fileNum;
+				offs = amigaWaxworksOffs[i].offs;
+			}
+		}
+	}
+
 	if (getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO)
 		sprintf(filename, "elvira2");
 	else if (getPlatform() == Common::kPlatformAcorn)
@@ -159,12 +206,12 @@
 	if (!(getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO) &&
 		getFeatures() & GF_CRUNCHED) {
 
-		uint srcSize = f.size();
+		uint32 srcSize = f.size();
 		byte *srcBuf = (byte *)malloc(srcSize);
 		if (f.read(srcBuf, srcSize) != srcSize)
 			error("playModule: Read failed");
 
-		uint dstSize = READ_BE_UINT32(srcBuf + srcSize - 4);
+		uint32 dstSize = READ_BE_UINT32(srcBuf + srcSize - 4);
 		byte *dstBuf = (byte *)malloc(dstSize);
 		decrunchFile(srcBuf, dstBuf, srcSize);
 		free(srcBuf);

Modified: scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp	2007-08-03 07:47:34 UTC (rev 28429)
+++ scummvm/branches/branch-0-10-0/engines/agos/saveload.cpp	2007-08-03 09:43:53 UTC (rev 28430)
@@ -1173,7 +1173,7 @@
 		addTimeEvent(timeout, subroutine_id);
 	}
 
-	if (getGameType() == GType_WW) {
+	if (getGameType() == GType_WW && getPlatform() == Common::kPlatformPC) {
 		// TODO Load room state data
 		for (uint s = 0; s <= _numRoomStates; s++) {
 			f->readUint16BE();
@@ -1185,7 +1185,8 @@
 	for (num = _itemArrayInited - 1; num; num--) {
 		Item *item = _itemArrayPtr[item_index++], *parent_item;
 
-		if (getGameType() == GType_ELVIRA2) {
+		if ((getGameType() == GType_WW && getPlatform() == Common::kPlatformAmiga) ||
+			getGameType() == GType_ELVIRA2) {
 			parent_item = derefItem(readItemID(f));
 			setItemParent(item, parent_item);
 		} else {
@@ -1228,7 +1229,7 @@
 			}
 		}
 
-		SubUserFlag *u = (SubUserFlag *) findChildOfType(item, 9);
+		SubUserFlag *u = (SubUserFlag *)findChildOfType(item, 9);
 		if (u) {
 			for (i = 0; i != 4; i++) {
 				u->userFlags[i] = f->readUint16BE();
@@ -1325,7 +1326,7 @@
 		f->writeUint16BE(te->subroutine_id);
 	}
 
-	if (getGameType() == GType_WW) {
+	if (getGameType() == GType_WW && getPlatform() == Common::kPlatformPC) {
 		// TODO Save room state data
 		for (uint s = 0; s <= _numRoomStates; s++) {
 			f->writeUint16BE(0);
@@ -1337,7 +1338,8 @@
 	for (num_item = _itemArrayInited - 1; num_item; num_item--) {
 		Item *item = _itemArrayPtr[item_index++];
 
-		if (getGameType() == GType_ELVIRA2) {
+		if ((getGameType() == GType_WW && getPlatform() == Common::kPlatformAmiga) ||
+			getGameType() == GType_ELVIRA2) {
 			writeItemID(f, item->parent);
 		} else {
 			f->writeUint16BE(item->parent);

Modified: scummvm/branches/branch-0-10-0/engines/agos/zones.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/zones.cpp	2007-08-03 07:47:34 UTC (rev 28429)
+++ scummvm/branches/branch-0-10-0/engines/agos/zones.cpp	2007-08-03 09:43:53 UTC (rev 28430)
@@ -44,6 +44,25 @@
 	_vgaFrozenBase = _vgaRealBase;
 }
 
+static const uint8 zoneTable[160] = {
+	0,  0,  2,  2,  2,  2,  0,  2,  2,  2,
+	3,  0,  0,  0,  0,  0,  0,  0,  1,  0,
+	3,  3,  3,  1,  3,  0,  0,  0,  1,  0,
+	2,  0,  3,  0,  3,  3,  0,  1,  1,  0,
+	1,  2,  2,  2,  0,  2,  2,  2,  0,  2,
+	1,  2,  2,  2,  0,  2,  2,  2,  2,  2,
+	2,  2,  2,  1,  2,  2,  2,  2,  2,  2,
+	2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
+	2,  2,  0,  2,  0,  3,  2,  2,  2,  3,
+	2,  3,  3,  3,  1,  3,  3,  1,  1,  0,
+	2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
+	2,  2,  2,  2,  2,  0,  0,  2,  2,  0,
+	0,  2,  0,  2,  2,  2,  0,  0,  0,  0,
+	0,  0,  0,  0,  0,  2,  2,  2,  2,  2,
+	2,  0,  2,  0,  0,  2,  2,  0,  2,  2,
+	2,  2,  2,  2,  2,  0,  0,  0,  0,  0,
+};
+
 void AGOSEngine::loadZone(uint zoneNum) {
 	VgaPointersEntry *vpe;
 
@@ -56,7 +75,13 @@
 	// Loading order is important
 	// due to resource managment
 
-	loadVGAVideoFile(zoneNum, 2);
+	if (getPlatform() == Common::kPlatformAmiga && getGameType() == GType_WW &&
+		zoneTable[zoneNum] == 3) {
+		uint8 num = (zoneNum >= 85) ? 94 : 18;
+		loadVGAVideoFile(num, 2);
+	} else {
+		loadVGAVideoFile(zoneNum, 2);
+	}
 	vpe->vgaFile2 = _block;
 	vpe->vgaFile2End = _blockEnd;
 


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