451ab91e |
1 | [[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]] |
2 | |
3 | = Mupen64Plus v2.0 Basic Core API = |
4 | |
5 | Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function. |
6 | |
7 | {| border="1" |
8 | |Prototype |
9 | |'''<tt>m64p_error PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities)</tt>''' |
10 | |- |
11 | |Input Parameters |
12 | |'''<tt>PluginType</tt>''' Pointer to an enumerated type to store the plugin type. The value <tt>M64PLUGIN_CORE</tt> will always be stored.<br /> |
13 | '''<tt>PluginVersion</tt>''' Pointer to an integer to store the version number of the Mupen64Plus core. Version number 2.1.3 would be stored as 0x00020103.<br /> |
14 | '''<tt>APIVersion</tt>''' Pointer to an integer to store the version number of the Core--Front-end API used by the Mupen64plus core library.<br /> |
15 | '''<tt>PluginNamePtr</tt>''' Pointer to a const character pointer to receive the name of the core library. The const char * which is returned must point to a persistent string (ie, not stored on the stack).<br /> |
16 | '''<tt>Capabilities</tt>''' Pointer to an integer to store a logically-or'd set of flags which specify the capabilities of the core which were built into the library during compilation. These are defined in the <tt>m64p_core_caps</tt> enumerated type, defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. |
17 | |- |
18 | |Usage |
19 | |This function retrieves version information from the core library. This function is the same for the core library and the plugins, so that a front-end may examine all shared libraries in a directory and determine their types. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information. |
20 | |} |
21 | <br /> |
22 | {| border="1" |
23 | |Prototype |
24 | |'''<tt>m64p_error CoreGetAPIVersions(int *ConfigVersion, int *DebugVersion, int *VidextVersion, int *ExtraVersion)</tt>''' |
25 | |- |
26 | |Input Parameters |
27 | |'''<tt>ConfigVersion</tt>''' Pointer to an integer to store the version number of the Config API exported by the Mupen64plus core library.<br /> |
28 | '''<tt>DebugVersion</tt>''' Pointer to an integer to store the version number of the Debug API exported by the Mupen64plus core library.<br /> |
29 | '''<tt>VidextVersion</tt>''' Pointer to an integer to store the version number of the Video Extension API exported by the Mupen64plus core library.<br /> |
30 | '''<tt>ExtraVersion</tt>''' Pointer to an integer to store an API version number for future use. Currently set to 0.<br /> |
31 | |- |
32 | |Usage |
33 | |This function retrieves API version information from the core library. This function may be used by either the front-end application or any plugin modules. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information. |
34 | |} |
35 | <br /> |
36 | {| border="1" |
37 | |Prototype |
38 | |'''<tt>const char * CoreErrorMessage(m64p_error ReturnCode)</tt>''' |
39 | |- |
40 | |Input Parameters |
41 | |'''<tt>ReturnCode</tt>''' Enumerated type containing an error code. |
42 | |- |
43 | |Usage |
44 | |This function returns a pointer to a NULL-terminated string giving a human-readable description of the error. |
45 | |} |
46 | <br /> |
47 | |