22 #ifndef ENGINES_ADVANCED_DETECTOR_H 23 #define ENGINES_ADVANCED_DETECTOR_H 25 #include "engines/metaengine.h" 26 #include "engines/engine.h" 28 #include "common/hash-str.h" 30 #include "common/gui_options.h" 61 #define AD_LISTEND {NULL, 0, NULL, 0} 67 #define AD_ENTRY1(f, x) {{ f, 0, x, -1}, AD_LISTEND} 73 #define AD_ENTRY1s(f, x, s) {{ f, 0, x, s}, AD_LISTEND} 79 #define AD_ENTRY2s(f1, x1, s1, f2, x2, s2) {{f1, 0, x1, s1}, {f2, 0, x2, s2}, AD_LISTEND} 85 #define AD_ENTRY3s(f1, x1, s1, f2, x2, s2, f3, x3, s3) {{f1, 0, x1, s1}, {f2, 0, x2, s2}, {f3, 0, x3, s3}, AD_LISTEND} 86 #define AD_ENTRY4s(f1, x1, s1, f2, x2, s2, f3, x3, s3, f4, x4, s4) {{f1, 0, x1, s1}, {f2, 0, x2, s2}, {f3, 0, x3, s3}, {f4, 0, x4, s4}, AD_LISTEND} 87 #define AD_ENTRY5s(f1, x1, s1, f2, x2, s2, f3, x3, s3, f4, x4, s4, f5, x5, s5) {{f1, 0, x1, s1}, {f2, 0, x2, s2}, {f3, 0, x3, s3}, {f4, 0, x4, s4}, {f5, 0, x5, s5}, AD_LISTEND} 88 #define AD_ENTRY6s(f1, x1, s1, f2, x2, s2, f3, x3, s3, f4, x4, s4, f5, x5, s5, f6, x6, s6) {{f1, 0, x1, s1}, {f2, 0, x2, s2}, {f3, 0, x3, s3}, {f4, 0, x4, s4}, {f5, 0, x5, s5}, {f6, 0, x6, s6}, AD_LISTEND} 205 #define AD_TABLE_END_MARKER \ 206 { NULL, NULL, { { NULL, 0, NULL, 0 } }, Common::UNK_LANG, Common::kPlatformUnknown, ADGF_NO_FLAGS, GUIO0() } 219 const char *filenames[10];
277 #define AD_EXTRA_GUI_OPTIONS_TERMINATOR { 0, { 0, 0, 0, 0, 0, 0 } } 401 for (
const byte *descPtr = _gameDescriptors; ((
const ADGameDescription *)descPtr)->gameId !=
nullptr; descPtr += _descItemSize)
406 void dumpDetectionEntries()
const override final;
424 void preprocessDescriptions();
426 void detectClashes()
const;
431 bool _hashMapsInited;
479 bool cleanupPirated(ADDetectedGames &matched)
const;
481 friend class FileMapArchive;
512 const char *getName()
const override = 0;
579 md5HashMap.setVal(fname, md5);
583 return md5HashMap.getVal(fname);
587 sizeHashMap.setVal(fname, size);
591 return sizeHashMap.getVal(fname);
595 return (md5HashMap.contains(fname) && sizeHashMap.contains(fname));
604 if (archiveHashMap.contains(filename)) {
605 delete archiveHashMap[filename];
608 archiveHashMap.setVal(filename, archivePtr);
612 return archiveHashMap.getValOrDefault(node.
getPath(),
nullptr);
619 void clearArchives() {
620 for (
auto &entry : archiveHashMap) {
623 archiveHashMap.clear(
true);
627 md5HashMap.clear(
true);
628 sizeHashMap.clear(
true);
638 FileHashMap md5HashMap;
639 SizeHashMap sizeHashMap;
640 ArchiveHashMap archiveHashMap;
644 #define ADCacheMan AdvancedDetectorCacheManager::instance()
Always add English as a language option.
Definition: advancedDetector.h:106
Flag to designate not yet officially supported games that are not fit for public testing.
Definition: advancedDetector.h:99
Definition: advancedDetector.h:257
const char * md5
MD5 of (the beginning of) the described file. Optional. Set to NULL to ignore.
Definition: advancedDetector.h:53
Common::Array< ADDetectedGame > ADDetectedGames
Definition: advancedDetector.h:199
const char * extra
Definition: advancedDetector.h:137
Definition: advancedDetector.h:120
const ADGameDescription * desc
Definition: advancedDetector.h:189
const char * fileName
Name of the described file.
Definition: advancedDetector.h:51
const ADGameDescription * desc
Definition: advancedDetector.h:213
const char * gameId
Definition: advancedDetector.h:126
Do not add platform to gameid.
Definition: advancedDetector.h:110
ADDetectedGame(const ADGameDescription *d)
Definition: advancedDetector.h:195
MD5Properties
Definition: game.h:106
No flags.
Definition: advancedDetector.h:96
uint16 fileType
Optional. Not used during detection, only by engines.
Definition: advancedDetector.h:52
Definition: advancedDetector.h:247
bool hasUnknownFiles
Definition: advancedDetector.h:187
uint32 flags
Definition: advancedDetector.h:163
Add "-dvd" to gameid.
Definition: advancedDetector.h:112
Calculate the MD5 for this entry from the resource fork.
Definition: advancedDetector.h:107
ADGameFlags
Definition: advancedDetector.h:95
ADFlags
Definition: advancedDetector.h:223
Definition: archive.h:141
int64 fileSize
Size of the described file. Set to -1 to ignore.
Definition: advancedDetector.h:54
Flag to designate not yet officially supported games that are fit for public testing.
Definition: advancedDetector.h:100
Common::Language language
Definition: advancedDetector.h:150
Do not add language to gameid.
Definition: advancedDetector.h:109
Add "-cd" to gameid.
Definition: advancedDetector.h:111
Automatically generate gameid from ADGameDescription::extra.
Definition: advancedDetector.h:98
Use ADGameDescription::extra as the main game title, not gameid.
Definition: advancedDetector.h:108
Definition: advancedDetector.h:264
Definition: algorithm.h:29
Definition: advancedDetector.h:102
Definition: advancedDetector.h:576
const char * guiOptions
Definition: advancedDetector.h:172
Flag to designate well-known pirated versions with cracks.
Definition: advancedDetector.h:101
Definition: advancedDetector.h:186
Calculate the MD5 for this entry from the end of the file.
Definition: advancedDetector.h:97
Definition: advancedDetector.h:208
Definition: advancedDetector.h:104
FilePropertiesMap matchedFiles
Definition: advancedDetector.h:188
Add "-demo" to gameid.
Definition: advancedDetector.h:113
Common::Platform platform
Definition: advancedDetector.h:155
Definition: advancedDetector.h:234
Add "-remastered' to gameid.
Definition: advancedDetector.h:114
Definition: singleton.h:42
Language
Definition: language.h:45
Definition: advancedDetector.h:50