2 //________________________________________________________________________________________
3 // File description: Common plugin spec, version #1.0 maintained by F|RES
5 #ifndef _PLUGINS_H_INCLUDED__
6 #define _PLUGINS_H_INCLUDED__
10 // TODO: See if we can get rid of the windows.h include.
14 #include "CommonTypes.h"
16 // Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed
20 // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
27 VIDEO_DESTROY
, // The video debugging window was destroyed
28 AUDIO_DESTROY
, // The audio debugging window was destroyed
29 WIIMOTE_DISCONNECT
, // Disconnect Wiimote
30 INPUT_FRAME_COUNTER
// Wind back the frame counter for rerecording
33 // System specific declarations and definitions
37 #define EXPORT __declspec(dllexport)
40 #define EXPORT __attribute__ ((visibility("default")))
48 // simulate something that looks like win32
49 // long term, kill these
51 #define HINSTANCE void*
54 #if defined(__cplusplus)
65 PLUGIN_TYPE_VIDEO
= 1,
74 #define STATE_MODE_READ 1
75 #define STATE_MODE_WRITE 2
76 #define STATE_MODE_MEASURE 3
78 // used for notification on emulation state
79 enum PLUGIN_EMUSTATE
{
80 PLUGIN_EMUSTATE_PLAY
= 1,
81 PLUGIN_EMUSTATE_PAUSE
,
89 u16 Version
; // Set to 0x0100
90 PLUGIN_TYPE Type
; // Set to PLUGIN_TYPE_DVD
91 char Name
[100]; // Name of the DLL
95 // apparently a windows-ism.
99 // TODO: Remove, or at least remove the void pointers and replace with data.
100 // This design is just wrong and ugly - the plugins shouldn't have this much access.
105 char game_ini
[MAX_PATH
];
109 // GLOBAL I N T E R F A C E
110 // ____________________________________________________________________________
111 // Function: GetDllInfo
112 // Purpose: This function allows the emulator to gather information
113 // about the DLL by filling in the PluginInfo structure.
114 // input: A pointer to a PLUGIN_INFO structure that needs to be
115 // filled by the function. (see def above)
118 EXPORT
void CALL
GetDllInfo(PLUGIN_INFO
* _pPluginInfo
);
120 // ___________________________________________________________________________
121 // Function: DllConfig
122 // Purpose: This function is optional function that is provided
123 // to allow the user to configure the DLL
124 // input: A handle to the window that calls this function
127 EXPORT
void CALL
DllConfig(HWND _hParent
);
129 // ___________________________________________________________________________
130 // Function: DllDebugger
131 // Purpose: Open the debugger
132 // input: a handle to the window that calls this function
135 EXPORT
void CALL
DllDebugger(HWND _hParent
, bool Show
);
137 // ___________________________________________________________________________
138 // Function: DllSetGlobals
139 // Purpose: Set the pointer for globals variables
140 // input: a pointer to the global struct
143 EXPORT
void CALL
SetDllGlobals(PLUGIN_GLOBALS
* _pPluginGlobals
);
145 // ___________________________________________________________________________
146 // Function: Initialize
147 // Purpose: Initialize the plugin
151 EXPORT
void CALL
Initialize(void *init
);
153 // ___________________________________________________________________________
154 // Function: Shutdown
155 // Purpose: This function is called when the emulator is shutting down
156 // a game allowing the dll to de-initialise.
160 EXPORT
void CALL
Shutdown(void);
162 // ___________________________________________________________________________
164 // Purpose: Saves/load state
168 EXPORT
void CALL
DoState(unsigned char **ptr
, int mode
);
170 // ___________________________________________________________________________
171 // Function: EmuStateChange
172 // Purpose: Notifies the plugin of a change in emulation state
176 EXPORT
void CALL
EmuStateChange(PLUGIN_EMUSTATE newState
);
179 #if defined(__cplusplus)
183 #endif // _PLUGINS_H_INCLUDED__