[Scummvm-cvs-logs] scummvm master -> 00e0d68a9f4b85ac66f757dd8603036b82a566e6

bluegr bluegr at gmail.com
Mon Dec 28 11:10:23 CET 2015


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

Summary:
00e0d68a9f MT32: Also use the ROM name to return the most appropriate ROM info


Commit: 00e0d68a9f4b85ac66f757dd8603036b82a566e6
    https://github.com/scummvm/scummvm/commit/00e0d68a9f4b85ac66f757dd8603036b82a566e6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-28T12:09:25+02:00

Commit Message:
MT32: Also use the ROM name to return the most appropriate ROM info

Since we are not using munt's SHA-1 hashing code, this returns the most
appropriate feature set for CM-32L ROMs

Changed paths:
    audio/softsynth/mt32/ROMInfo.cpp



diff --git a/audio/softsynth/mt32/ROMInfo.cpp b/audio/softsynth/mt32/ROMInfo.cpp
index 7c01270..f6817c1 100644
--- a/audio/softsynth/mt32/ROMInfo.cpp
+++ b/audio/softsynth/mt32/ROMInfo.cpp
@@ -54,12 +54,21 @@ static const ROMInfo *getKnownROMInfoFromList(unsigned int index) {
 
 const ROMInfo* ROMInfo::getROMInfo(Common::File *file) {
 	size_t fileSize = file->size();
+	Common::String fileName = file->getName();
+	fileName.toUppercase();
+	bool isCM32LROM = fileName.hasPrefix("CM32L_");
 	// We haven't added the SHA1 checksum code in ScummVM, as the file size
-	// suffices for our needs for now.
+	// and ROM name suffices for our needs for now.
 	//const char *fileDigest = file->getSHA1();
 	for (int i = 0; getKnownROMInfoFromList(i) != NULL; i++) {
 		const ROMInfo *romInfo = getKnownROMInfoFromList(i);
 		if (fileSize == romInfo->fileSize /*&& !strcmp(fileDigest, romInfo->sha1Digest)*/) {
+			if (fileSize == 65536) {
+				// If we are looking for a CM-32L ROM, make sure we return the first matching
+				// CM-32L ROM from the list, instead of the first matching MT-32 ROM
+				if (isCM32LROM && romInfo->controlROMFeatures->isDefaultReverbMT32Compatible())
+					continue;
+			}
 			return romInfo;
 		}
 	}






More information about the Scummvm-git-logs mailing list