Difference between revisions of "Advanced Detector"

Jump to navigation Jump to search
128 bytes added ,  15:03, 25 October 2018
m
Text replacement - "</source>" to "</syntaxhighlight>"
(Fix syntax highlighting)
m (Text replacement - "</source>" to "</syntaxhighlight>")
Tags: Mobile edit Mobile web edit
(2 intermediate revisions by the same user not shown)
Line 29: Line 29:


When you look into your .scummvmrc or scummvm.ini (depending on the platform), you will find that generally it has following structure
When you look into your .scummvmrc or scummvm.ini (depending on the platform), you will find that generally it has following structure
<source lang="INI">
<syntaxhighlight lang="INI">
[scummvm]
[scummvm]
globalkey1=foo
globalkey1=foo
Line 41: Line 41:
language=en
language=en
platform=pc
platform=pc
</source>
</syntaxhighlight>


What you see here is several sections designated by identifiers in square brackets and set of key/value pairs belonging to each such section.
What you see here is several sections designated by identifiers in square brackets and set of key/value pairs belonging to each such section.
Line 73: Line 73:
Targets generated by Advanced Detector have the following structure:
Targets generated by Advanced Detector have the following structure:


<code>
   GAMEID-DEMO-CD-PLATFORM-LANG
   GAMEID-DEMO-CD-PLATFORM-LANG
</code>


The target generation is affected by AD flags. The flags which have influence are: ADGF_CD, ADGF_DEMO, ADGF_DROPLANGUAGE.  
The target generation is affected by AD flags. The flags which have influence are: ADGF_CD, ADGF_DEMO, ADGF_DROPLANGUAGE.


== PlainGameDescriptor table ==
== PlainGameDescriptor table ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
struct PlainGameDescriptor {
struct PlainGameDescriptor {
const char *gameid;
const char *gameid;
const char *description;
const char *description;
};
};
</source>
</syntaxhighlight>


This table contains all gameids which are known by the engine. Also each gameid contains a full human-readable description, which is used to provide the '''description''' field in the ScummVM configuration file.
This table contains all gameids which are known by the engine. Also each gameid contains a full human-readable description, which is used to provide the '''description''' field in the ScummVM configuration file.
Line 94: Line 92:
Typical PlainGameDescriptor table:
Typical PlainGameDescriptor table:


<source lang="cpp">
<syntaxhighlight lang="cpp">
static const PlainGameDescriptor cineGames[] = {
static const PlainGameDescriptor cineGames[] = {
{"cine", "Cinematique evo.1 engine game"},
{"cine", "Cinematique evo.1 engine game"},
Line 101: Line 99:
{0, 0}
{0, 0}
};
};
</source>
</syntaxhighlight>


Please note that it is NULL-terminated, and also contains the generic gameid ''cine'' which is used by fallback detection.
Please note that it is NULL-terminated, and also contains the generic gameid ''cine'' which is used by fallback detection.
Line 109: Line 107:
ADGameDescription table has the following structure:
ADGameDescription table has the following structure:


<source lang="cpp">
<syntaxhighlight lang="cpp">
struct ADGameDescription {
struct ADGameDescription {
const char *gameid;
const char *gameid;
Line 119: Line 117:
const char *guioptions;
const char *guioptions;
};
};
</source>
</syntaxhighlight>


'''gameid''' -- This is the gameid. Mainly it is used for taking the game description from the ''PlainGameDescriptor'' table.
'''gameid''' -- This is the gameid. Mainly it is used for taking the game description from the ''PlainGameDescriptor'' table.
Line 138: Line 136:
Typical ADGameDescription table will look as follows:
Typical ADGameDescription table will look as follows:


<source lang="cpp">
<syntaxhighlight lang="cpp">
static const ADGameDescription gameDescriptions[] = {
static const ADGameDescription gameDescriptions[] = {
{
{
Line 151: Line 149:
{ AD_TABLE_END_MARKER, 0, 0 }
{ AD_TABLE_END_MARKER, 0, 0 }
};
};
</source>
</syntaxhighlight>


== ADGameFileDescription structure ==
== ADGameFileDescription structure ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
struct ADGameFileDescription {
struct ADGameFileDescription {
const char *fileName; ///< Name of described file.
const char *fileName; ///< Name of described file.
Line 162: Line 160:
int32 fileSize;  ///< Size of the described file. Set to -1 to ignore.
int32 fileSize;  ///< Size of the described file. Set to -1 to ignore.
};
};
</source>
</syntaxhighlight>


'''fileName''' -- name of the file. It is case insensitive, but historically we use lowercase names.
'''fileName''' -- name of the file. It is case insensitive, but historically we use lowercase names.
Line 204: Line 202:
== Upgrading obsolete gameids ==
== Upgrading obsolete gameids ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
         {"simon1acorn", "simon1", Common::kPlatformAcorn},
         {"simon1acorn", "simon1", Common::kPlatformAcorn},
Line 213: Line 211:
         {0, 0, Common::kPlatformUnknown}
         {0, 0, Common::kPlatformUnknown}
};
};
</source>
</syntaxhighlight>


= AdvancedMetaEngine =
= AdvancedMetaEngine =
Line 221: Line 219:
== Engine constructor ==
== Engine constructor ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids);
AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids);
</source>
</syntaxhighlight>


'''descs''' must point to a list of ''ADGameDescription'' structures, or their supersets.
'''descs''' must point to a list of ''ADGameDescription'' structures, or their supersets.
TrustedUser
2,147

edits

Navigation menu