Open main menu

Difference between revisions of "Advanced Detector"

1,685 bytes added ,  23:15, 28 February 2012
More content
(How AD works section)
(More content)
Line 59: Line 59:


In case there are no matches against ''ADGameDescription'' list, there are two additional fallback detection modes. One is file-based detection, which matches just the file names, and second one is a hook which gets called and could contain code of any complexity. Most prominent example of advanced fallback detection is SCI engine.
In case there are no matches against ''ADGameDescription'' list, there are two additional fallback detection modes. One is file-based detection, which matches just the file names, and second one is a hook which gets called and could contain code of any complexity. Most prominent example of advanced fallback detection is SCI engine.
== PlainGameDescriptor table ==
<syntax type="C++">
struct PlainGameDescriptor {
const char *gameid;
const char *description;
};
</syntax>
This table contains all gameids which are known by the engine. Also each gameid contains full human-readable description, which goes to '''description''' field in ScummVM configuration file.
Only '''gameid''' which are present in this table could be used in ''ADGameDescription'' table.
Typical PlainGameDescriptor table:
<syntax type="C++">
static const PlainGameDescriptor cineGames[] = {
{"cine", "Cinematique evo.1 engine game"},
{"fw", "Future Wars"},
{"os", "Operation Stealth"},
{0, 0}
};
</syntax>
Please note that it is NULL-terminated, and also contains generic gameid ''cine'' which is used by fallback detection.


== ADGameDescription table ==
== ADGameDescription table ==


AGGameDescription table has the following structure:
ADGameDescription table has the following structure:


<syntax type="C++">
<syntax type="C++">
Line 71: Line 97:
Common::Language language;
Common::Language language;
Common::Platform platform;
Common::Platform platform;
/**
* A bitmask of extra flags. The top 16 bits are reserved for generic flags
* defined in the ADGameFlags. This leaves 16 bits to be used by client
* code.
*/
uint32 flags;
uint32 flags;
const char *guioptions;
const char *guioptions;
};
};
</syntax>
</syntax>
'''gameid'''
'''extra'''
'''filesDescriptions'''
'''language'''
'''platform'''
'''flags'''
'''guioptions'''




Typical ADGameDescription table will look as follows:
Typical ADGameDescription table will look as follows:


<syntax type="C++">
static const CINEGameDescription gameDescriptions[] = {
static const CINEGameDescription gameDescriptions[] = {
{
{
Line 102: Line 136:
{ AD_TABLE_END_MARKER, 0, 0 }
{ AD_TABLE_END_MARKER, 0, 0 }
};
};
</syntax>
== ADGameFileDescription structure ==
<syntax type="C++">
struct ADGameFileDescription {
const char *fileName; ///< Name of described file.
uint16 fileType; ///< Optional. Not used during detection, only by engines.
const char *md5; ///< MD5 of (the beginning of) the described file. Optional. Set to NULL to ignore.
int32 fileSize;  ///< Size of the described file. Set to -1 to ignore.
};
</syntax>
'''fileName'''
'''fileType'''
'''md5'''
'''fileSize'''
== Upgrading obsolete gameids ==
<syntax type="C++">
static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
        {"simon1acorn", "simon1", Common::kPlatformAcorn},
        {"simon1amiga", "simon1", Common::kPlatformAmiga},
        {"simon2talkie", "simon2", Common::kPlatformPC},
        {"simon2mac", "simon2", Common::kPlatformMacintosh},
        {"simon2win", "simon2", Common::kPlatformWindows},
        {0, 0, Common::kPlatformUnknown}
};
</syntax>