Index: detection.cpp
===================================================================
--- detection.cpp	(revision 48270)
+++ detection.cpp	(working copy)
@@ -38,6 +38,7 @@
 #include "scumm/he/intern_he.h"
 #include "scumm/scumm_v0.h"
 #include "scumm/scumm_v8.h"
+#include "scumm/file.h"
 
 #include "engines/metaengine.h"
 
@@ -209,6 +210,42 @@
 	return false;
 }
 
+static ScummDiskImage *openDiskImage(const Common::FSNode &node, const GameFilenamePattern *gfp) {
+	Common::String disk1 = node.getName();
+
+	// setup necessary game settings for disk image reader
+	GameSettings gs;
+	memset(&gs, 0, sizeof(GameSettings));
+	gs.gameid = gfp->gameid;
+	gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK); 
+	gs.platform = gfp->platform;
+
+	// determine second disk file name
+	Common::String disk2(disk1);
+	for (Common::String::iterator it = disk2.begin(); it != disk2.end(); ++it) {
+		// replace "xyz1.(d64|dsk)" by "xyz2.(d64|dsk)"
+		if (*it == '1') {
+			*it = '2';
+			break;
+		}
+	}
+
+	// open image
+	SearchMan.addDirectory("tmpDiskImgDir", node.getParent());
+	ScummDiskImage *diskImg = new ScummDiskImage(disk1.c_str(), disk2.c_str(), gs);
+	if (diskImg->open(disk1.c_str()) && diskImg->openSubFile("00.LFL")) {
+		return diskImg;
+	}
+	delete diskImg;
+	return 0;
+}
+
+static void closeDiskImage(ScummDiskImage *img) {
+	if (img)
+		img->close();
+	SearchMan.remove("tmpDiskImgDir");
+}
+
 // The following function tries to detect the language for COMI and DIG
 static Common::Language detectLanguage(const Common::FSList &fslist, byte id) {
 	// First try to detect Chinese translation
@@ -389,9 +426,18 @@
 		//
 		DetectorDesc &d = fileMD5Map[file];
 		if (d.md5.empty()) {
-			Common::File tmp;
-			if (tmp.open(d.node) && Common::md5_file_string(tmp, md5str, kMD5FileSizeLimit)) {
+			Common::File *tmp = 0;
+			bool isDiskImg = (file.hasSuffix(".d64") || file.hasSuffix(".dsk"));
+			
+			if (isDiskImg) {
+				tmp = openDiskImage(d.node, gfp);
+			} else {
+				tmp = new Common::File;
+				tmp->open(d.node);
+			}
 
+			if (tmp && tmp->isOpen() && Common::md5_file_string(*tmp, md5str, kMD5FileSizeLimit)) {
+
 				d.md5 = md5str;
 				d.md5Entry = findInMD5Table(md5str);
 
@@ -409,6 +455,10 @@
 					results.push_back(dr);
 				}
 			}
+
+			if (isDiskImg)
+				closeDiskImage((ScummDiskImage*)tmp);
+			delete tmp;
 		}
 
 		// If an exact match for this file has already been found, don't bother
Index: detection_tables.h
===================================================================
--- detection_tables.h	(revision 48270)
+++ detection_tables.h	(working copy)
@@ -426,7 +426,7 @@
 	{ "maniac", "Maniac Mansion (Sp).prg", kGenUnchanged, Common::ES_ESP, Common::kPlatformNES, "NES" },
 
 	{ "zak", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 },
-	{ "zak", "zak1.d64", kGenUnchanged, UNK_LANG, Common::kPlatformC64, 0 },         // ... and zak2.d64
+	{ "zak", "zak1.d64", kGenUnchanged, UNK_LANG, Common::kPlatformC64, "V1" },         // ... and zak2.d64
 
 	{ "indy3", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 },
 
Index: scumm-md5.h
===================================================================
--- scumm-md5.h	(revision 48270)
+++ scumm-md5.h	(working copy)
@@ -181,6 +181,7 @@
 	{ "41958e24d03181ff9a381a66d048a581", "ft", "", "", -1, Common::PT_BRA, Common::kPlatformUnknown },
 	{ "425205754fa749f4f0b0dd9d09fa45fd", "football", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "430bc518017b6fac046f58bab6baad5d", "monkey2", "", "", -1, Common::JA_JPN, Common::kPlatformFMTowns },
+	{ "439a7f4adf510489981ac52308e7d7a2", "maniac", "C64", "", -1, Common::DE_DEU, Common::kPlatformC64 },
 	{ "45082a5c9f42ba14dacfe1fdeeba819d", "freddicove", "HE 100", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "45152f7cf2ba8f43cf8a8ea2e740ae09", "monkey", "VGA", "VGA", 8357, Common::ES_ESP, Common::kPlatformPC },
 	{ "4521138d15d1fd7649c31fb981746231", "pajama2", "HE 98.5", "Demo", -1, Common::DE_DEU, Common::kPlatformUnknown },
@@ -190,7 +191,6 @@
 	{ "47e75b1bdcb44c78cb94883d1731ccf8", "fbear", "HE 61", "Demo", 6203, Common::EN_ANY, Common::kPlatformPC },
 	{ "48b9f04b348bc5013327753f0d12a144", "loom", "EGA", "EGA", -1, Common::ES_ESP, Common::kPlatformAmiga },
 	{ "49210e124e4c2b30f1290a9ef6306301", "monkey", "EGA", "EGA", 8357, Common::EN_ANY, Common::kPlatformPC },
-	{ "4973bbc3899e3826dbf316e1d7271ec7", "zak", "V1", "", 196608, Common::DE_DEU, Common::kPlatformC64 },
 	{ "499c958affc394f2a3868f1eb568c3ee", "freddi4", "HE 99", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows },
 	{ "49a1739981a89066b1121fac04b710f4", "spyfox2", "HE CUP", "Preview", 5756234, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "4aa93cb30e485b728504ba3a693f12bf", "pajama", "HE 100", "", -1, Common::RU_RUS, Common::kPlatformWindows },
@@ -227,7 +227,7 @@
 	{ "54a68a5f5e3c86da42b7ca5f51e79b1d", "maniac", "NES", "", 262144, Common::IT_ITA, Common::kPlatformNES },
 	{ "54a936ad06161ff7bfefcb96200f7bff", "monkey", "VGA", "VGA Demo", -1, Common::EN_ANY, Common::kPlatformAmiga },
 	{ "55518cd73cf9c6d23ea29c51ee06bdfe", "ft", "", "", -1, Common::IT_ITA, Common::kPlatformUnknown },
-	{ "55d3987641bf229c83bc729210173383", "zak", "V1", "", 174848, Common::EN_ANY, Common::kPlatformC64 },
+	//{ "55d3987641bf229c83bc729210173383", "zak", "V1", "", 174848, Common::EN_ANY, Common::kPlatformC64 },
 	{ "55e4cc866ff9046824e1c638ba2b8c7f", "ft", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown },
 	{ "55f4e9402bec2bded383843123f37c5c", "pajama2", "HE 98.5", "", -1, Common::DE_DEU, Common::kPlatformWindows },
 	{ "566165a7338fa11029e7c14d94fa70d0", "freddi", "HE 73", "Demo", 9800, Common::EN_ANY, Common::kPlatformWindows },
@@ -329,7 +329,7 @@
 	{ "78c07ca088526d8d4446a4c2cb501203", "freddi3", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformUnknown },
 	{ "7974365d3dc0f43a2748c975f91ff042", "monkey2", "", "", -1, Common::ES_ESP, Common::kPlatformPC },
 	{ "79b05f628586837e7166e82b2279bb50", "loom", "PC-Engine", "", -1, Common::JA_JPN, Common::kPlatformPCEngine },
-	{ "7b60620558b8d6b7d7313b8ac7bb5a98", "zak", "V1", "", 174848, Common::IT_ITA, Common::kPlatformC64 },
+	//{ "7b60620558b8d6b7d7313b8ac7bb5a98", "zak", "V1", "", 174848, Common::IT_ITA, Common::kPlatformC64 },
 	{ "7bad72e332a59f9fcc1d437f4edad32a", "puttcircus", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown },
 	{ "7c2e76087027eeee9c8f8985f93a1cc5", "freddi4", "", "Demo", 13584, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "7c8100e360e8ef05f88069d4cfa0afd1", "puttrace", "HE 99", "Demo", 13108, Common::EN_GRB, Common::kPlatformWindows },
@@ -393,6 +393,7 @@
 	{ "94db6519da85b8d08c976d8e9a858ea7", "baseball", "HE CUP", "Preview", 10044774, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "95818b178d473c989ac753574e8892aa", "readtime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "95b3806e043be08668c54c3ffe98650f", "BluesABCTime", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
+	{ "95be99181bd0f10fef4872c2d4a771cb", "zak", "V1", "", -1, Common::DE_DEU, Common::kPlatformC64 },
 	{ "96a3069a3c63caa7329588ce1fef41ee", "spyozon", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown },
 	{ "9708cf716ed8bcc9ff3fcfc69413b746", "puttputt", "HE 61", "", -1, Common::EN_ANY, Common::kPlatformPC },
 	{ "9781422e4288dbc090720e4563168ba7", "puttzoo", "", "", -1, Common::FR_FRA, Common::kPlatformWindows },
@@ -487,7 +488,6 @@
 	{ "c3b22fa4654bb580b20325ebf4174841", "puttzoo", "", "", -1, Common::NL_NLD, Common::kPlatformWindows },
 	{ "c3df37df9d3b481b45f75283a9907c47", "loom", "EGA", "EGA", -1, Common::IT_ITA, Common::kPlatformPC },
 	{ "c4787c3e8b5e2dfda90850ee800af00f", "zak", "V2", "V2", -1, Common::FR_FRA, Common::kPlatformPC },
-	{ "c4a7f7398ac9ae588940f9912ea5fd8f", "maniac", "C64", "", -1, Common::DE_DEU, Common::kPlatformC64 },
 	{ "c4ffae9fac495475d6bc3343ccc8faf9", "Soccer2004", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "c5cc7cba02a2fbd539c4439e775b0536", "puttzoo", "HE 99", "Updated", 43470, Common::DE_DEU, Common::kPlatformWindows },
 	{ "c5d10e190d4b4d59114b824f2fdbd00e", "loom", "FM-TOWNS", "", -1, Common::EN_ANY, Common::kPlatformFMTowns },
@@ -544,7 +544,7 @@
 	{ "d74122362a77ec24525fdd50297dfd82", "freddi4", "", "", -1, Common::FR_FRA, Common::kPlatformMacintosh },
 	{ "d7ab7cd6105546016e6a0d46fb36b964", "pajama", "HE 100", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "d7b247c26bf1f01f8f7daf142be84de3", "balloon", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows },
-	{ "d831f7c048574dd9d5d85db2a1468099", "maniac", "C64", "", -1, Common::EN_ANY, Common::kPlatformC64 },
+	//{ "d831f7c048574dd9d5d85db2a1468099", "maniac", "C64", "", -1, Common::EN_ANY, Common::kPlatformC64 },
 	{ "d8323015ecb8b10bf53474f6e6b0ae33", "dig", "", "", 16304, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "d8d07efcb88f396bee0b402b10c3b1c9", "maniac", "NES", "", 262144, Common::EN_GRB, Common::kPlatformNES },
 	{ "d917f311a448e3cc7239c31bddb00dd2", "samnmax", "", "CD", 9080, Common::EN_ANY, Common::kPlatformUnknown },
