1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus-core - m64p_frontend.h *
3 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4 * Copyright (C) 2009 Richard Goedeken *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22 /* This header file defines typedefs for function pointers to Core functions
23 * designed for use by the front-end user interface.
26 #if !defined(M64P_FRONTEND_H)
27 #define M64P_FRONTEND_H
29 #include "m64p_types.h"
36 /* pointer types to the callback functions in the front-end application */
37 typedef void (*ptr_DebugCallback)(void *Context, int level, const char *message);
38 typedef void (*ptr_StateCallback)(void *Context, m64p_core_param param_type, int new_value);
39 #if defined(M64P_CORE_PROTOTYPES)
40 EXPORT void CALL DebugCallback(void *Context, int level, const char *message);
41 EXPORT void CALL StateCallback(void *Context, m64p_core_param param_type, int new_value);
46 * This function initializes libmupen64plus for use by allocating memory,
47 * creating data structures, and loading the configuration file.
49 typedef m64p_error (*ptr_CoreStartup)(int, const char *, const char *, void *, ptr_DebugCallback, void *, ptr_StateCallback);
50 #if defined(M64P_CORE_PROTOTYPES)
51 EXPORT m64p_error CALL CoreStartup(int, const char *, const char *, void *, ptr_DebugCallback, void *, ptr_StateCallback);
56 * This function saves the configuration file, then destroys data structures
57 * and releases memory allocated by the core library.
59 typedef m64p_error (*ptr_CoreShutdown)(void);
60 #if defined(M64P_CORE_PROTOTYPES)
61 EXPORT m64p_error CALL CoreShutdown(void);
66 * This function attaches the given plugin to the emulator core. There can only
67 * be one plugin of each type attached to the core at any given time.
69 typedef m64p_error (*ptr_CoreAttachPlugin)(m64p_plugin_type, m64p_dynlib_handle);
70 #if defined(M64P_CORE_PROTOTYPES)
71 EXPORT m64p_error CALL CoreAttachPlugin(m64p_plugin_type, m64p_dynlib_handle);
76 * This function detaches the given plugin from the emulator core, and re-attaches
77 * the 'dummy' plugin functions.
79 typedef m64p_error (*ptr_CoreDetachPlugin)(m64p_plugin_type);
80 #if defined(M64P_CORE_PROTOTYPES)
81 EXPORT m64p_error CALL CoreDetachPlugin(m64p_plugin_type);
86 * This function sends a command to the emulator core.
88 typedef m64p_error (*ptr_CoreDoCommand)(m64p_command, int, void *);
89 #if defined(M64P_CORE_PROTOTYPES)
90 EXPORT m64p_error CALL CoreDoCommand(m64p_command, int, void *);
93 /* CoreOverrideVidExt()
95 * This function overrides the core's internal SDL-based OpenGL functions. This
96 * override functionality allows a front-end to define its own video extension
97 * functions to be used instead of the SDL functions. If any of the function
98 * pointers in the structure are NULL, the override function will be disabled
99 * and the core's internal SDL functions will be used.
101 typedef m64p_error (*ptr_CoreOverrideVidExt)(m64p_video_extension_functions *);
102 #if defined(M64P_CORE_PROTOTYPES)
103 EXPORT m64p_error CALL CoreOverrideVidExt(m64p_video_extension_functions *);
108 * This function will add a Cheat Function to a list of currently active cheats
109 * which are applied to the open ROM.
111 typedef m64p_error (*ptr_CoreAddCheat)(const char *, m64p_cheat_code *, int);
112 #if defined(M64P_CORE_PROTOTYPES)
113 EXPORT m64p_error CALL CoreAddCheat(const char *, m64p_cheat_code *, int);
116 /* CoreCheatEnabled()
118 * This function will enable or disable a Cheat Function which is in the list of
119 * currently active cheats.
121 typedef m64p_error (*ptr_CoreCheatEnabled)(const char *, int);
122 #if defined(M64P_CORE_PROTOTYPES)
123 EXPORT m64p_error CALL CoreCheatEnabled(const char *, int);
126 /* CoreGetRomSettings()
128 * This function will retrieve the ROM settings from the mupen64plus INI file for
129 * the ROM image corresponding to the given CRC values.
131 typedef m64p_error (*ptr_CoreGetRomSettings)(m64p_rom_settings *, int, int, int);
132 #if defined(M64P_CORE_PROTOTYPES)
133 EXPORT m64p_error CALL CoreGetRomSettings(m64p_rom_settings *, int, int, int);
140 #endif /* #define M64P_FRONTEND_H */