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.
15 #include "CommonTypes.h"
17 // Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed
21 // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
27 WIIMOTE_DISCONNECT
, // Disconnect Wiimote
28 INPUT_FRAME_COUNTER
// Wind back the frame counter for rerecording
31 // System specific declarations and definitions
35 #define EXPORT __declspec(dllexport)
38 #define EXPORT __attribute__ ((visibility("default")))
47 #if defined(__cplusplus)
58 PLUGIN_TYPE_VIDEO
= 1,
60 PLUGIN_TYPE_PAD_REMOVED
,
64 PLUGIN_TYPE_WIIMOTE_REMOVED
,
67 #define STATE_MODE_READ 1
68 #define STATE_MODE_WRITE 2
69 #define STATE_MODE_MEASURE 3
71 // used for notification on emulation state
72 enum PLUGIN_EMUSTATE
{
73 PLUGIN_EMUSTATE_PLAY
= 1,
74 PLUGIN_EMUSTATE_PAUSE
,
82 u16 Version
; // Set to 0x0100
83 PLUGIN_TYPE Type
; // Set to PLUGIN_TYPE_DVD
84 char Name
[100]; // Name of the DLL
87 // TODO: Remove, or at least remove the void pointers and replace with data.
88 // This design is just wrong and ugly - the plugins shouldn't have this much access.
91 void *was_eventHandler_but_lets_not_break_abi
;
93 char game_ini
[MAX_PATH
];
97 // GLOBAL I N T E R F A C E
98 // ____________________________________________________________________________
99 // Function: GetDllInfo
100 // Purpose: This function allows the emulator to gather information
101 // about the DLL by filling in the PluginInfo structure.
102 // input: A pointer to a PLUGIN_INFO structure that needs to be
103 // filled by the function. (see def above)
106 EXPORT
void CALL
GetDllInfo(PLUGIN_INFO
* _pPluginInfo
);
108 // ___________________________________________________________________________
109 // Function: DllConfig
110 // Purpose: This function is optional function that is provided
111 // to allow the user to configure the DLL
112 // input: A handle to the window that calls this function
115 EXPORT
void CALL
DllConfig(void *_hParent
);
117 // ___________________________________________________________________________
118 // Function: DllDebugger
119 // Purpose: Open the debugger
120 // input: a handle to the window that calls this function
123 EXPORT
void* CALL
DllDebugger(void *_hParent
, bool Show
);
125 // ___________________________________________________________________________
126 // Function: DllSetGlobals
127 // Purpose: Set the pointer for globals variables
128 // input: a pointer to the global struct
131 EXPORT
void CALL
SetDllGlobals(PLUGIN_GLOBALS
* _pPluginGlobals
);
133 // ___________________________________________________________________________
134 // Function: Initialize
135 // Purpose: Initialize the plugin
139 EXPORT
void CALL
Initialize(void *init
);
141 // ___________________________________________________________________________
142 // Function: Shutdown
143 // Purpose: This function is called when the emulator is shutting down
144 // a game allowing the dll to de-initialise.
148 EXPORT
void CALL
Shutdown(void);
150 // ___________________________________________________________________________
152 // Purpose: Saves/load state
156 EXPORT
void CALL
DoState(unsigned char **ptr
, int mode
);
158 // ___________________________________________________________________________
159 // Function: EmuStateChange
160 // Purpose: Notifies the plugin of a change in emulation state
164 EXPORT
void CALL
EmuStateChange(PLUGIN_EMUSTATE newState
);
167 #if defined(__cplusplus)
171 #endif // _PLUGINS_H_INCLUDED__