[Scummvm-git-logs] scummvm master -> b6dbb42daa7d818cf2f28286c36618558522c94a

sev- sev at scummvm.org
Tue Oct 19 10:05:45 UTC 2021


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3146b2ffae AD: Allow mixed md5 calculation method to exist for single file
841254e6f1 AD: Fix seeking for tail md5
9aba6496f9 AD: Fixed tail md5 comparisons
b6dbb42daa PEGASUS: Updated few md5s after MacResMan changes


Commit: 3146b2ffae8a646b549b7fc820404e2d55d762a4
    https://github.com/scummvm/scummvm/commit/3146b2ffae8a646b549b7fc820404e2d55d762a4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-19T13:05:22+03:00

Commit Message:
AD: Allow mixed md5 calculation method to exist for single file

Changed paths:
    engines/advancedDetector.cpp


diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index e68ef492da..d453f2f319 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -574,18 +574,19 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
 
 		for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) {
 			Common::String fname = Common::punycode_decodefilename(fileDesc->fileName);
+			Common::String key = flagsToMD5Prefix(g->flags) + ':' + fname;
 
-			if (filesProps.contains(fname))
+			if (filesProps.contains(key))
 				continue;
 
 			FileProperties tmp;
 			if (getFileProperties(allFiles, *g, fname, tmp)) {
-				debugC(3, kDebugGlobalDetection, "> '%s': '%s' %ld", fname.c_str(), tmp.md5.c_str(), tmp.size);
+				debugC(3, kDebugGlobalDetection, "> '%s': '%s' %ld", key.c_str(), tmp.md5.c_str(), tmp.size);
 			}
 
 			// Both positive and negative results are cached to avoid
 			// repeatedly checking for files.
-			filesProps[fname] = tmp;
+			filesProps[key] = tmp;
 		}
 	}
 
@@ -615,25 +616,26 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
 		// Try to match all files for this game
 		for (fileDesc = game.desc->filesDescriptions; fileDesc->fileName; fileDesc++) {
 			Common::String tstr = Common::punycode_decodefilename(fileDesc->fileName);
+			Common::String key = flagsToMD5Prefix(g->flags) + ':' + tstr;
 
-			if (!filesProps.contains(tstr) || filesProps[tstr].size == -1) {
+			if (!filesProps.contains(key) || filesProps[key].size == -1) {
 				allFilesPresent = false;
 				break;
 			}
 
-			game.matchedFiles[tstr] = filesProps[tstr];
+			game.matchedFiles[tstr] = filesProps[key];
 
 			if (game.hasUnknownFiles)
 				continue;
 
 			if (fileDesc->md5 != nullptr && fileDesc->md5 != filesProps[tstr].md5) {
-				debugC(3, kDebugGlobalDetection, "MD5 Mismatch. Skipping (%s) (%s)", fileDesc->md5, filesProps[tstr].md5.c_str());
+				debugC(3, kDebugGlobalDetection, "MD5 Mismatch. Skipping (%s) (%s)", fileDesc->md5, filesProps[key].md5.c_str());
 				game.hasUnknownFiles = true;
 				continue;
 			}
 
 			if (fileDesc->fileSize != -1 && fileDesc->fileSize != filesProps[tstr].size) {
-				debugC(3, kDebugGlobalDetection, "Size Mismatch. Skipping (%ld) (%ld)", fileDesc->fileSize, filesProps[tstr].size);
+				debugC(3, kDebugGlobalDetection, "Size Mismatch. Skipping (%ld) (%ld)", fileDesc->fileSize, filesProps[key].size);
 				game.hasUnknownFiles = true;
 				continue;
 			}


Commit: 841254e6f1c3845984ebdfcf865b268f6857f22e
    https://github.com/scummvm/scummvm/commit/841254e6f1c3845984ebdfcf865b268f6857f22e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-19T13:05:22+03:00

Commit Message:
AD: Fix seeking for tail md5

Changed paths:
    common/macresman.cpp
    engines/advancedDetector.cpp


diff --git a/common/macresman.cpp b/common/macresman.cpp
index 87ae6cd818..4f952fd6a2 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -114,7 +114,7 @@ String MacResManager::computeResForkMD5AsString(uint32 length, bool tail) const
 
 	SeekableSubReadStream resForkStream(_stream, dataOffset, dataOffset + dataLength);
 	if (tail && dataLength > length)
-		resForkStream.seek(length, SEEK_END);
+		resForkStream.seek(-length, SEEK_END);
 
 	return computeStreamMD5AsString(resForkStream, MIN<uint32>(length, _resForkSize));
 }
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index d453f2f319..91cbe121e3 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -549,7 +549,7 @@ static bool getFilePropertiesIntern(uint md5Bytes, const AdvancedMetaEngine::Fil
 
 	if (game.flags & ADGF_TAILMD5) {
 		if (testFile.size() > md5Bytes)
-			testFile.seek(md5Bytes, SEEK_END);
+			testFile.seek(-md5Bytes, SEEK_END);
 	}
 
 	fileProps.size = testFile.size();


Commit: 9aba6496f9c70a606f1dd6ca5dd34b12edcc15a7
    https://github.com/scummvm/scummvm/commit/9aba6496f9c70a606f1dd6ca5dd34b12edcc15a7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-19T13:05:22+03:00

Commit Message:
AD: Fixed tail md5 comparisons

Changed paths:
    engines/advancedDetector.cpp


diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 91cbe121e3..7b53d40a33 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -574,7 +574,7 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
 
 		for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) {
 			Common::String fname = Common::punycode_decodefilename(fileDesc->fileName);
-			Common::String key = flagsToMD5Prefix(g->flags) + ':' + fname;
+			Common::String key = Common::String::format("%c:%s", flagsToMD5Prefix(g->flags), fname.c_str());
 
 			if (filesProps.contains(key))
 				continue;
@@ -616,7 +616,7 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
 		// Try to match all files for this game
 		for (fileDesc = game.desc->filesDescriptions; fileDesc->fileName; fileDesc++) {
 			Common::String tstr = Common::punycode_decodefilename(fileDesc->fileName);
-			Common::String key = flagsToMD5Prefix(g->flags) + ':' + tstr;
+			Common::String key = Common::String::format("%c:%s", flagsToMD5Prefix(g->flags), tstr.c_str());
 
 			if (!filesProps.contains(key) || filesProps[key].size == -1) {
 				allFilesPresent = false;
@@ -628,13 +628,13 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
 			if (game.hasUnknownFiles)
 				continue;
 
-			if (fileDesc->md5 != nullptr && fileDesc->md5 != filesProps[tstr].md5) {
+			if (fileDesc->md5 != nullptr && fileDesc->md5 != filesProps[key].md5) {
 				debugC(3, kDebugGlobalDetection, "MD5 Mismatch. Skipping (%s) (%s)", fileDesc->md5, filesProps[key].md5.c_str());
 				game.hasUnknownFiles = true;
 				continue;
 			}
 
-			if (fileDesc->fileSize != -1 && fileDesc->fileSize != filesProps[tstr].size) {
+			if (fileDesc->fileSize != -1 && fileDesc->fileSize != filesProps[key].size) {
 				debugC(3, kDebugGlobalDetection, "Size Mismatch. Skipping (%ld) (%ld)", fileDesc->fileSize, filesProps[key].size);
 				game.hasUnknownFiles = true;
 				continue;


Commit: b6dbb42daa7d818cf2f28286c36618558522c94a
    https://github.com/scummvm/scummvm/commit/b6dbb42daa7d818cf2f28286c36618558522c94a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-19T13:05:22+03:00

Commit Message:
PEGASUS: Updated few md5s after MacResMan changes

Changed paths:
    engines/pegasus/detection.cpp


diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index 8141914dba..46f6f03ef9 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -92,7 +92,7 @@ static const PegasusGameDescription gameDescriptions[] = {
 		{
 			"pegasus",
 			"v1.0 Demo",
-			AD_ENTRY1s("JMP PP Resources", "d13a602d2498010d720a6534f097f88b", 365585), // FIXMEMD5
+			AD_ENTRY1s("JMP PP Resources", "d13a602d2498010d720a6534f097f88b", 365329),
 			Common::EN_ANY,
 			Common::kPlatformMacintosh,
 			ADGF_MACRESFORK | ADGF_DEMO,
@@ -107,7 +107,7 @@ static const PegasusGameDescription gameDescriptions[] = {
 		{
 			"pegasus",
 			"Demo",
-			AD_ENTRY1s("JMP PP Resources", "d13a602d2498010d720a6534f097f88b", 360129), // FIXMEMD5
+			AD_ENTRY1s("JMP PP Resources", "d13a602d2498010d720a6534f097f88b", 359873),
 			Common::EN_ANY,
 			Common::kPlatformMacintosh,
 			ADGF_MACRESFORK | ADGF_DEMO,




More information about the Scummvm-git-logs mailing list