[Scummvm-git-logs] scummvm master -> d1950e88c51cc52ec0f5fb3fc8cdd3c6dc309993
bluegr
noreply at scummvm.org
Sun Apr 27 20:59:00 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
049feecac1 SCUMM: More work on the detection entry dumping functionality
d1950e88c5 GLK: More work on the detection entry dumping functionality
Commit: 049feecac1f1f8e46c834143c8d8899fe1877640
https://github.com/scummvm/scummvm/commit/049feecac1f1f8e46c834143c8d8899fe1877640
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-27T23:53:18+03:00
Commit Message:
SCUMM: More work on the detection entry dumping functionality
We now match all the files used for detection with their corresponding
MD5 entries. The code is still left disabled to check for possible edge
cases
Changed paths:
engines/scumm/detection.cpp
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 4ad6f5907a7..c9cb04b8edc 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -19,6 +19,8 @@
*
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
#include "base/plugins.h"
#include "engines/metaengine.h"
@@ -97,6 +99,8 @@ public:
}
void dumpDetectionEntries() const override final;
+
+ GameFilenamePattern matchGameFilenamePattern(const MD5Table *entry) const;
};
PlainGameList ScummMetaEngineDetection::getSupportedGames() const {
@@ -120,26 +124,58 @@ static Common::String escapeString(const char *string) {
return res;
}
-void ScummMetaEngineDetection::dumpDetectionEntries() const {
+GameFilenamePattern ScummMetaEngineDetection::matchGameFilenamePattern(const MD5Table *entry) const {
+ GameFilenamePattern bestMatch = GameFilenamePattern();
+
+ for (const GameFilenamePattern *gfp = gameFilenamesTable; gfp->gameid; ++gfp) {
+ if (!scumm_stricmp(gfp->gameid, entry->gameid)) {
+ if (gfp->platform == UNK || entry->platform == UNK || gfp->platform == entry->platform) {
+ bestMatch = *gfp;
+
+ if (gfp->language == UNK_LANG || entry->language == UNK_LANG || gfp->language == entry->language) {
+ if (!gfp->variant || !entry->variant || !scumm_stricmp(gfp->variant, entry->variant))
+ return *gfp;
+ }
+ }
+ }
+ }
+
+ return bestMatch;
+}
+
+ void ScummMetaEngineDetection::dumpDetectionEntries() const {
#if 0
for (const MD5Table *entry = md5table; entry->gameid != 0; ++entry) {
PlainGameDescriptor pd = findGame(entry->gameid);
const char *title = pd.description;
- debug("game (");
- debug("\tname \"%s\"", escapeString(pd.gameId).c_str());
- debug("\ttitle \"%s\"", escapeString(title).c_str());
- debug("\textra \"%s\"", escapeString(entry->extra).c_str());
- debug("\tlanguage \"%s\"", escapeString(getLanguageLocale(entry->language)).c_str());
- debug("\tplatform \"%s\"", escapeString(getPlatformCode(entry->platform)).c_str());
- debug("\tsourcefile \"%s\"", escapeString(getName()).c_str());
- debug("\tengine \"%s\"", escapeString(getEngineName()).c_str());
-
- Common::String md5 = entry->md5;
-
- debug("\trom (name \"%s\" size %lld md5-%d %s)", escapeString(entry->gameid).c_str(), static_cast<long long int>(entry->filesize), getMD5Bytes(), md5.c_str());
-
- debug(")\n");
+ printf("game (\n");
+ printf("\tname \"%s\"\n", escapeString(entry->gameid).c_str());
+ printf("\ttitle \"%s\"\n", escapeString(title).c_str());
+ printf("\textra \"%s\"\n", escapeString(entry->extra).c_str());
+ printf("\tlanguage \"%s\"\n", escapeString(getLanguageLocale(entry->language)).c_str());
+ printf("\tplatform \"%s\"\n", escapeString(getPlatformCode(entry->platform)).c_str());
+ printf("\tsourcefile \"%s\"\n", escapeString(getName()).c_str());
+ printf("\tengine \"%s\"\n", escapeString(getEngineName()).c_str());
+
+ // Match the appropriate file name for the current game variant.
+ GameFilenamePattern gameEntry = matchGameFilenamePattern(entry);
+ Common::String fileName;
+
+ if (gameEntry.gameid) {
+ fileName = generateFilenameForDetection(gameEntry.pattern, gameEntry.genMethod, gameEntry.platform);
+ } else {
+ warning("dumpDetectionEntries(): no game entry found for '%s'", entry->gameid);
+ fileName = entry->gameid;
+ }
+
+ printf("\trom ( name \"%s\" size %lld md5-%d %s )\n",
+ escapeString(fileName.c_str()).c_str(),
+ static_cast<long long int>(entry->filesize),
+ getMD5Bytes(),
+ entry->md5);
+
+ printf(")\n\n"); // Closing for 'game ('
}
#endif
}
Commit: d1950e88c51cc52ec0f5fb3fc8cdd3c6dc309993
https://github.com/scummvm/scummvm/commit/d1950e88c51cc52ec0f5fb3fc8cdd3c6dc309993
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-27T23:53:19+03:00
Commit Message:
GLK: More work on the detection entry dumping functionality
List terminators have been added to the game entries returned from GLK
subengines that use different game entry formats, namely, Comprehend,
Level9 and ZCode. The code is still disabled to check for possible edge
cases
Changed paths:
engines/glk/comprehend/detection.cpp
engines/glk/detection.cpp
engines/glk/level9/detection.cpp
engines/glk/zcode/detection.cpp
diff --git a/engines/glk/comprehend/detection.cpp b/engines/glk/comprehend/detection.cpp
index 868b8c1d5c9..00bd815d991 100644
--- a/engines/glk/comprehend/detection.cpp
+++ b/engines/glk/comprehend/detection.cpp
@@ -47,6 +47,14 @@ const GlkDetectionEntry* ComprehendMetaEngine::getDetectionEntries() {
};
entries.push_back(detection);
}
+
+ entries.push_back({nullptr,
+ nullptr,
+ nullptr,
+ 0,
+ Common::UNK_LANG,
+ Common::kPlatformUnknown});
+
return entries.data();
}
diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index cb2b8682026..ad34db41bd7 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -19,6 +19,8 @@
*
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
#include "base/plugins.h"
#include "common/md5.h"
#include "common/memstream.h"
@@ -372,14 +374,14 @@ void GlkMetaEngineDetection::dumpDetectionEntries() const {
const char *title = pd.description;
const char *extra = engineName == EngineName::COMPREHEND ? "" : entry->_extra;
- debug("game (");
- debug("\tname \"%s\"", escapeString(entry->_gameId).c_str());
- debug("\ttitle \"%s\"", escapeString(title).c_str());
- debug("\textra \"%s\"", escapeString(extra).c_str());
- debug("\tlanguage \"%s\"", escapeString(getLanguageLocale(entry->_language)).c_str());
- debug("\tplatform \"%s\"", escapeString(getPlatformCode(entry->_platform)).c_str());
- debug("\tsourcefile \"%s\"", escapeString(getName()).c_str());
- debug("\tengine \"%s\"", escapeString(getEngineName()).c_str());
+ printf("game (\n");
+ printf("\tname \"%s\"\n", escapeString(entry->_gameId).c_str());
+ printf("\ttitle \"%s\"\n", escapeString(title).c_str());
+ printf("\textra \"%s\"\n", escapeString(extra).c_str());
+ printf("\tlanguage \"%s\"\n", escapeString(getLanguageLocale(entry->_language)).c_str());
+ printf("\tplatform \"%s\"\n", escapeString(getPlatformCode(entry->_platform)).c_str());
+ printf("\tsourcefile \"%s\"\n", escapeString(getName()).c_str());
+ printf("\tengine \"%s\"\n", escapeString(getEngineName()).c_str());
Common::String checksum = entry->_md5;
@@ -389,12 +391,12 @@ void GlkMetaEngineDetection::dumpDetectionEntries() const {
// Level9 engine does not use md5 checksums, so checksums are not printed.
if (engineName == EngineName::LEVEL9) {
- debug("\trom (name \"%s\" size %lld)", escapeString(fname).c_str(), static_cast<long long int>(entry->_filesize));
+ printf("\trom ( name \"%s\" size %lld )", escapeString(fname).c_str(), static_cast<long long int>(entry->_filesize));
} else {
- debug("\trom (name \"%s\" size %lld md5-%d %s)", escapeString(fname).c_str(), static_cast<long long int>(entry->_filesize), getMD5Bytes(), checksum.c_str());
+ printf("\trom ( name \"%s\" size %lld md5-%d %s )", escapeString(fname).c_str(), static_cast<long long int>(entry->_filesize), getMD5Bytes(), checksum.c_str());
}
- debug(")\n");
+ printf(")\n");
}
}
#endif
diff --git a/engines/glk/level9/detection.cpp b/engines/glk/level9/detection.cpp
index 2527023ac42..552f087ccf0 100644
--- a/engines/glk/level9/detection.cpp
+++ b/engines/glk/level9/detection.cpp
@@ -722,6 +722,14 @@ const GlkDetectionEntry* Level9MetaEngine::getDetectionEntries() {
};
entries.push_back(detection);
}
+
+ entries.push_back({nullptr,
+ nullptr,
+ nullptr,
+ 0,
+ Common::UNK_LANG,
+ Common::kPlatformUnknown});
+
return entries.data();
}
diff --git a/engines/glk/zcode/detection.cpp b/engines/glk/zcode/detection.cpp
index 6f3f5ca8fd9..64e41262183 100644
--- a/engines/glk/zcode/detection.cpp
+++ b/engines/glk/zcode/detection.cpp
@@ -51,6 +51,14 @@ const GlkDetectionEntry* ZCodeMetaEngine::getDetectionEntries() {
};
entries.push_back(detection);
}
+
+ entries.push_back({nullptr,
+ nullptr,
+ nullptr,
+ 0,
+ Common::UNK_LANG,
+ Common::kPlatformUnknown});
+
return entries.data();
}
More information about the Scummvm-git-logs
mailing list