Windows: Link debug build against debug wiiuse. Can't keep linking to the release...
[dolphin.git] / Source / PluginSpecs / PluginSpecs.h
blobae0e67f1ec5b1e0d0d887e9df9fb3f3d73c89f02
2 //________________________________________________________________________________________
3 // File description: Common plugin spec, version #1.0 maintained by F|RES
5 #ifndef _PLUGINS_H_INCLUDED__
6 #define _PLUGINS_H_INCLUDED__
8 // Includes
9 // ------------
10 // TODO: See if we can get rid of the windows.h include.
11 #ifdef _WIN32
12 #include <windows.h>
13 #endif
14 #include "Common.h"
15 #include "CommonTypes.h"
17 // Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed
18 // -----------------
19 enum PLUGIN_COMM
21 // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
22 WM_USER_PAUSE = 10,
23 WM_USER_STOP,
24 WM_USER_CREATE,
25 WM_USER_SETCURSOR,
26 WM_USER_KEYDOWN,
27 WIIMOTE_DISCONNECT, // Disconnect Wiimote
28 INPUT_FRAME_COUNTER // Wind back the frame counter for rerecording
31 // System specific declarations and definitions
32 // ------------
34 #ifdef _WIN32
35 #define EXPORT __declspec(dllexport)
36 #define CALL __cdecl
37 #else
38 #define EXPORT __attribute__ ((visibility("default")))
39 #define __cdecl
40 #define CALL
41 #ifndef TRUE
42 #define TRUE 1
43 #define FALSE 0
44 #endif
45 #endif
47 #if defined(__cplusplus)
48 extern "C" {
49 #endif
53 // Global values
54 // ------------
56 // Plugin types
57 enum PLUGIN_TYPE {
58 PLUGIN_TYPE_VIDEO = 1,
59 PLUGIN_TYPE_DVD,
60 PLUGIN_TYPE_PAD_REMOVED,
61 PLUGIN_TYPE_AUDIO,
62 PLUGIN_TYPE_COMPILER,
63 PLUGIN_TYPE_DSP,
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,
75 PLUGIN_EMUSTATE_STOP,
78 // Export structs
79 // ------------
80 typedef struct
82 u16 Version; // Set to 0x0100
83 PLUGIN_TYPE Type; // Set to PLUGIN_TYPE_DVD
84 char Name[100]; // Name of the DLL
85 } PLUGIN_INFO;
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.
89 typedef struct
91 void *was_eventHandler_but_lets_not_break_abi;
92 void *logManager;
93 char game_ini[MAX_PATH];
94 char unique_id[16];
95 } PLUGIN_GLOBALS;
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)
104 // output: none
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
113 // output: none
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
121 // output: none
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
129 // output: none
131 EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals);
133 // ___________________________________________________________________________
134 // Function: Initialize
135 // Purpose: Initialize the plugin
136 // input: Init
137 // output: none
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.
145 // input: none
146 // output: none
148 EXPORT void CALL Shutdown(void);
150 // ___________________________________________________________________________
151 // Function: DoState
152 // Purpose: Saves/load state
153 // input/output: ptr
154 // input: mode
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
161 // input: newState
162 // output: none
164 EXPORT void CALL EmuStateChange(PLUGIN_EMUSTATE newState);
167 #if defined(__cplusplus)
169 #endif
171 #endif // _PLUGINS_H_INCLUDED__