[Scummvm-cvs-logs] SF.net SVN: scummvm:[33703] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Fri Aug 8 20:28:15 CEST 2008


Revision: 33703
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33703&view=rev
Author:   buddha_
Date:     2008-08-08 18:28:13 +0000 (Fri, 08 Aug 2008)

Log Message:
-----------
Added detection entry for the Sony published CD version of Future Wars.
Also added decrypting of the crypted AUTO00.PRC for this particular version.
Now this version should work but no CD audio support for it yet though.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/cine.h
    scummvm/trunk/engines/cine/detection.cpp
    scummvm/trunk/engines/cine/part.cpp
    scummvm/trunk/engines/cine/part.h
    scummvm/trunk/engines/cine/prc.cpp

Modified: scummvm/trunk/engines/cine/cine.h
===================================================================
--- scummvm/trunk/engines/cine/cine.h	2008-08-08 15:06:28 UTC (rev 33702)
+++ scummvm/trunk/engines/cine/cine.h	2008-08-08 18:28:13 UTC (rev 33703)
@@ -59,7 +59,8 @@
 enum CineGameFeatures {
 	GF_CD =   1 << 0,
 	GF_DEMO = 1 << 1,
-	GF_ALT_FONT = 1 << 2
+	GF_ALT_FONT = 1 << 2,
+	GF_CRYPTED_BOOT_PRC = 1 << 3
 };
 
 struct CINEGameDescription;

Modified: scummvm/trunk/engines/cine/detection.cpp
===================================================================
--- scummvm/trunk/engines/cine/detection.cpp	2008-08-08 15:06:28 UTC (rev 33702)
+++ scummvm/trunk/engines/cine/detection.cpp	2008-08-08 18:28:13 UTC (rev 33703)
@@ -76,7 +76,26 @@
 		0,
 	},
 
+	// This is a CD version of Future Wars published by Sony.
+	// This version has a crypted AUTO00.PRC.
 	{
+		{
+			"fw",
+			"Sony CD version",
+			{
+				{ "AUTO00.PRC", 0, "4fe1e7930b38e3c63f0f2474d471bf8f", -1},
+				{ "PART01", 0, "61d003202d301c29dd399acfb1354310", -1},
+				{ NULL, 0, NULL, 0}
+			},
+			Common::EN_USA,
+			Common::kPlatformPC,
+			Common::ADGF_CD
+		},
+		GType_FW,
+		GF_CD | GF_CRYPTED_BOOT_PRC,
+	},
+
+	{
 		// This is the version included in the UK "Classic Collection"
 		{
 			"fw",

Modified: scummvm/trunk/engines/cine/part.cpp
===================================================================
--- scummvm/trunk/engines/cine/part.cpp	2008-08-08 15:06:28 UTC (rev 33702)
+++ scummvm/trunk/engines/cine/part.cpp	2008-08-08 18:28:13 UTC (rev 33703)
@@ -259,7 +259,12 @@
 	return data;
 }
 
-byte *readFile(const char *filename) {
+/*! \brief Rotate value to the left by n bits */
+byte rol(byte value, int n) {
+	return (byte) ((value << n) | (value >> (8 - n)));
+}
+
+byte *readFile(const char *filename, bool crypted) {
 	Common::File in;
 
 	in.open(filename);
@@ -272,6 +277,16 @@
 	byte *dataPtr = (byte *)malloc(size);
 	in.read(dataPtr, size);
 
+	// The Sony published CD version of Future Wars has its
+	// AUTO00.PRC file's bytes rotated to the right by one.
+	// So we decode the so called crypting by rotating all
+	// the bytes to the left by one.
+	if (crypted) {
+		for (uint index = 0; index < size; index++) {
+			dataPtr[index] = rol(dataPtr[index], 1);
+		}
+	}
+
 	return dataPtr;
 }
 

Modified: scummvm/trunk/engines/cine/part.h
===================================================================
--- scummvm/trunk/engines/cine/part.h	2008-08-08 15:06:28 UTC (rev 33702)
+++ scummvm/trunk/engines/cine/part.h	2008-08-08 18:28:13 UTC (rev 33703)
@@ -48,7 +48,7 @@
 
 byte *readBundleFile(int16 foundFileIdx);
 byte *readBundleSoundFile(const char *entryName, uint32 *size = 0);
-byte *readFile(const char *filename);
+byte *readFile(const char *filename, bool crypted = false);
 
 void checkDataDisk(int16 param);
 

Modified: scummvm/trunk/engines/cine/prc.cpp
===================================================================
--- scummvm/trunk/engines/cine/prc.cpp	2008-08-08 15:06:28 UTC (rev 33702)
+++ scummvm/trunk/engines/cine/prc.cpp	2008-08-08 18:28:13 UTC (rev 33703)
@@ -61,7 +61,7 @@
 	checkDataDisk(-1);
 	if ((g_cine->getGameType() == Cine::GType_FW) &&
 		(!scumm_stricmp(pPrcName, BOOT_PRC_NAME) || !scumm_stricmp(pPrcName, "demo.prc"))) {
-		scriptPtr = dataPtr = readFile(pPrcName);
+		scriptPtr = dataPtr = readFile(pPrcName, (g_cine->getFeatures() & GF_CRYPTED_BOOT_PRC) != 0);
 	} else {
 		scriptPtr = dataPtr = readBundleFile(findFileInBundle(pPrcName));
 	}


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