Commit | Line | Data |
---|---|---|
ef79bbde P |
1 | #ifndef _PSEMU_PLUGIN_DEFS_H |
2 | #define _PSEMU_PLUGIN_DEFS_H | |
3 | ||
4 | #ifdef __cplusplus | |
5 | extern "C" { | |
6 | #endif | |
7 | ||
78de2879 | 8 | // this can't be __stdcall like it was in PSEmu API as too many functions are mixed up |
9 | #undef CALLBACK | |
10 | #define CALLBACK | |
11 | ||
ef79bbde P |
12 | // header version |
13 | #define _PPDK_HEADER_VERSION 3 | |
14 | ||
15 | #define PLUGIN_VERSION 1 | |
16 | ||
17 | // plugin type returned by PSEgetLibType (types can be merged if plugin is multi type!) | |
18 | #define PSE_LT_CDR 1 | |
19 | #define PSE_LT_GPU 2 | |
20 | #define PSE_LT_SPU 4 | |
21 | #define PSE_LT_PAD 8 | |
22 | #define PSE_LT_NET 16 | |
23 | ||
24 | // DLL function return codes | |
25 | #define PSE_ERR_SUCCESS 0 // every function in DLL if completed sucessfully should return this value | |
26 | #define PSE_ERR_FATAL -1 // undefined error but fatal one, that kills all functionality | |
27 | ||
28 | // XXX_Init return values | |
29 | // Those return values apply to all libraries | |
30 | // currently obsolete - preserved for compatibilty | |
31 | ||
32 | #define PSE_INIT_ERR_SUCCESS 0 // initialization went OK | |
33 | #define PSE_INIT_ERR_NOTCONFIGURED -2 // this driver is not configured | |
34 | #define PSE_INIT_ERR_NOHARDWARE -3 // this driver can not operate properly on this hardware or hardware is not detected | |
35 | ||
36 | /* GPU PlugIn */ | |
37 | ||
38 | // GPU_Test return values | |
39 | ||
40 | // sucess, everything configured, and went OK. | |
41 | #define PSE_GPU_ERR_SUCCESS 0 | |
42 | ||
43 | // ERRORS | |
44 | // this error might be returned as critical error but none of below | |
45 | #define PSE_GPU_ERR -20 | |
46 | ||
47 | ||
48 | // this driver is not configured | |
49 | #define PSE_GPU_ERR_NOTCONFIGURED PSE_GPU_ERR - 1 | |
50 | // this driver failed Init | |
51 | #define PSE_GPU_ERR_INIT PSE_GPU_ERR - 2 | |
52 | ||
53 | // WARNINGS | |
54 | // this warning might be returned as undefined warning but allowing driver to continue | |
55 | #define PSE_GPU_WARN 20 | |
56 | ||
57 | // GPU_Query - will be implemented soon | |
58 | ||
59 | typedef struct | |
60 | { | |
4c08b9e7 | 61 | unsigned int flags; |
62 | unsigned int status; | |
ef79bbde P |
63 | void* window; |
64 | unsigned char reserved[100]; | |
65 | } gpuQueryS; | |
66 | ||
67 | // gpuQueryS.flags | |
68 | // if driver can operate in both modes it must support GPU_changeMode(); | |
69 | #define PSE_GPU_FLAGS_FULLSCREEN 1 // this driver can operate in fullscreen mode | |
70 | #define PSE_GPU_FLAGS_WINDOWED 2 // this driver can operate in windowed mode | |
71 | ||
72 | // gpuQueryS.status | |
73 | #define PSE_GPU_STATUS_WINDOWWRONG 1 // this driver cannot operate in this windowed mode | |
74 | ||
75 | // GPU_Query End - will be implemented in v2 | |
76 | ||
77 | ||
78 | /* CDR PlugIn */ | |
79 | ||
80 | // CDR_Test return values | |
81 | ||
82 | // sucess, everything configured, and went OK. | |
83 | #define PSE_CDR_ERR_SUCCESS 0 | |
84 | ||
85 | // general failure (error undefined) | |
86 | #define PSE_CDR_ERR_FAILURE -1 | |
87 | ||
88 | // ERRORS | |
89 | #define PSE_CDR_ERR -40 | |
90 | // this driver is not configured | |
91 | #define PSE_CDR_ERR_NOTCONFIGURED PSE_CDR_ERR - 0 | |
92 | // if this driver is unable to read data from medium | |
93 | #define PSE_CDR_ERR_NOREAD PSE_CDR_ERR - 1 | |
94 | ||
95 | // WARNINGS | |
96 | #define PSE_CDR_WARN 40 | |
97 | // if this driver emulates lame mode ie. can read only 2048 tracks and sector header is emulated | |
98 | // this might happen to CDROMS that do not support RAW mode reading - surelly it will kill many games | |
99 | #define PSE_CDR_WARN_LAMECD PSE_CDR_WARN + 0 | |
100 | ||
101 | ||
102 | ||
103 | ||
104 | /* SPU PlugIn */ | |
105 | ||
106 | // some info retricted (now!) | |
107 | ||
108 | // sucess, everything configured, and went OK. | |
109 | #define PSE_SPU_ERR_SUCCESS 0 | |
110 | ||
111 | // ERRORS | |
112 | // this error might be returned as critical error but none of below | |
113 | #define PSE_SPU_ERR -60 | |
114 | ||
115 | // this driver is not configured | |
116 | #define PSE_SPU_ERR_NOTCONFIGURED PSE_SPU_ERR - 1 | |
117 | // this driver failed Init | |
118 | #define PSE_SPU_ERR_INIT PSE_SPU_ERR - 2 | |
119 | ||
120 | ||
121 | // WARNINGS | |
122 | // this warning might be returned as undefined warning but allowing driver to continue | |
123 | #define PSE_SPU_WARN 60 | |
124 | ||
125 | ||
126 | ||
127 | ||
128 | /* PAD PlugIn */ | |
129 | ||
130 | /* | |
131 | ||
132 | functions that must be exported from PAD Plugin | |
133 | ||
134 | long PADinit(long flags); // called only once when PSEmu Starts | |
135 | void PADshutdown(void); // called when PSEmu exits | |
136 | long PADopen(PadInitS *); // called when PSEmu is running program | |
137 | long PADclose(void); | |
138 | long PADconfigure(void); | |
139 | void PADabout(void); | |
140 | long PADtest(void); // called from Configure Dialog and after PADopen(); | |
141 | long PADquery(void); | |
142 | ||
143 | unsigned char PADstartPoll(int); | |
1e774d8e | 144 | unsigned char PADpoll(unsigned char, int *); |
ef79bbde P |
145 | |
146 | */ | |
147 | ||
148 | // PADquery responses (notice - values ORed) | |
149 | // PSEmu will use them also in PADinit to tell Plugin which Ports will use | |
150 | // notice that PSEmu will call PADinit and PADopen only once when they are from | |
151 | // same plugin | |
152 | ||
153 | // might be used in port 1 | |
154 | #define PSE_PAD_USE_PORT1 1 | |
155 | // might be used in port 2 | |
156 | #define PSE_PAD_USE_PORT2 2 | |
157 | ||
158 | ||
159 | ||
3c0fb554 AP |
160 | // No controller |
161 | #define PSE_PAD_TYPE_NONE 0 | |
ef79bbde P |
162 | // MOUSE SCPH-1030 |
163 | #define PSE_PAD_TYPE_MOUSE 1 | |
164 | // NEGCON - 16 button analog controller SLPH-00001 | |
165 | #define PSE_PAD_TYPE_NEGCON 2 | |
166 | // GUN CONTROLLER - gun controller SLPH-00014 from Konami | |
167 | #define PSE_PAD_TYPE_GUN 3 | |
168 | // STANDARD PAD SCPH-1080, SCPH-1150 | |
169 | #define PSE_PAD_TYPE_STANDARD 4 | |
170 | // ANALOG JOYSTICK SCPH-1110 | |
171 | #define PSE_PAD_TYPE_ANALOGJOY 5 | |
172 | // GUNCON - gun controller SLPH-00034 from Namco | |
173 | #define PSE_PAD_TYPE_GUNCON 6 | |
174 | // ANALOG CONTROLLER SCPH-1150 | |
175 | #define PSE_PAD_TYPE_ANALOGPAD 7 | |
176 | ||
177 | ||
178 | // sucess, everything configured, and went OK. | |
179 | #define PSE_PAD_ERR_SUCCESS 0 | |
180 | // general plugin failure (undefined error) | |
181 | #define PSE_PAD_ERR_FAILURE -1 | |
182 | ||
183 | ||
184 | // ERRORS | |
185 | // this error might be returned as critical error but none of below | |
186 | #define PSE_PAD_ERR -80 | |
187 | // this driver is not configured | |
188 | #define PSE_PAD_ERR_NOTCONFIGURED PSE_PAD_ERR - 1 | |
189 | // this driver failed Init | |
190 | #define PSE_PAD_ERR_INIT PSE_PAD_ERR - 2 | |
191 | ||
192 | ||
193 | // WARNINGS | |
194 | // this warning might be returned as undefined warning but allowing driver to continue | |
195 | #define PSE_PAD_WARN 80 | |
196 | ||
197 | ||
198 | typedef struct | |
199 | { | |
3b1a5e21 | 200 | // controller type - fill it withe predefined values above |
ef79bbde P |
201 | unsigned char controllerType; |
202 | ||
bdeee1a1 | 203 | unsigned char padding; |
204 | unsigned short saveSize; | |
205 | ||
29f3675b | 206 | int portMultitap; |
e288923d | 207 | int requestPadIndex; |
29f3675b | 208 | |
ef79bbde P |
209 | // status of buttons - every controller fills this field |
210 | unsigned short buttonStatus; | |
211 | ||
212 | // for analog pad fill those next 4 bytes | |
213 | // values are analog in range 0-255 where 127 is center position | |
214 | unsigned char rightJoyX, rightJoyY, leftJoyX, leftJoyY; | |
215 | ||
216 | // for mouse fill those next 2 bytes | |
217 | // values are in range -128 - 127 | |
218 | unsigned char moveX, moveY; | |
219 | ||
bdeee1a1 | 220 | // Lightgun values |
221 | int absoluteX, absoluteY; | |
222 | ||
d71c7095 | 223 | unsigned char Vib[2]; |
224 | unsigned char VibF[2]; | |
52c9fcc8 | 225 | |
bdeee1a1 | 226 | struct { |
227 | unsigned char configMode; | |
228 | unsigned char padMode; // 0 : digital 1: analog | |
229 | unsigned char cmd4dConfig[6]; | |
230 | unsigned int lastUseFrame; | |
26e9c4f1 | 231 | unsigned int unused; |
e457dc22 | 232 | unsigned char configModeUsed; |
233 | unsigned char padding[3]; | |
bdeee1a1 | 234 | } ds; |
a11d0b9d | 235 | unsigned char multitapLongModeEnabled; |
bdeee1a1 | 236 | unsigned char padding2; |
237 | unsigned char txData[34]; | |
ef79bbde | 238 | |
e457dc22 | 239 | unsigned char reserved[22]; |
ef79bbde P |
240 | } PadDataS; |
241 | ||
242 | /* NET PlugIn v2 */ | |
243 | /* Added by linuzappz@pcsx.net */ | |
244 | ||
245 | /* Modes bits for NETsendData/NETrecvData */ | |
246 | #define PSE_NET_BLOCKING 0x00000000 | |
247 | #define PSE_NET_NONBLOCKING 0x00000001 | |
248 | ||
249 | /* note: unsupported fields should be zeroed. | |
250 | ||
251 | typedef struct { | |
252 | char EmuName[32]; | |
253 | char CdromID[9]; // ie. 'SCPH12345', no \0 trailing character | |
254 | char CdromLabel[11]; | |
255 | void *psxMem; | |
256 | GPUshowScreenPic GPU_showScreenPic; | |
257 | GPUdisplayText GPU_displayText; | |
258 | PADsetSensitive PAD_setSensitive; | |
259 | char GPUpath[256]; | |
260 | char SPUpath[256]; | |
261 | char CDRpath[256]; | |
262 | char MCD1path[256]; | |
263 | char MCD2path[256]; | |
264 | char BIOSpath[256]; // 'HLE' for internal bios | |
265 | char Unused[1024]; | |
266 | } netInfo; | |
267 | ||
268 | */ | |
269 | ||
270 | /* | |
271 | basic funcs: | |
272 | ||
273 | long NETopen(HWND hWnd) | |
274 | opens the connection. | |
275 | shall return 0 on success, else -1. | |
276 | -1 is also returned if the user selects offline mode. | |
277 | ||
278 | long NETclose() | |
279 | closes the connection. | |
280 | shall return 0 on success, else -1. | |
281 | ||
282 | void NETpause() | |
283 | this is called when the user paused the emulator. | |
284 | ||
285 | void NETresume() | |
286 | this is called when the user resumed the emulator. | |
287 | ||
288 | long NETqueryPlayer() | |
289 | returns player number | |
290 | ||
291 | long NETsendPadData(void *pData, int Size) | |
292 | this should be called for the first pad only on each side. | |
293 | ||
294 | long NETrecvPadData(void *pData, int Pad) | |
295 | call this for Pad 1/2 to get the data sent by the above func. | |
296 | ||
297 | extended funcs: | |
298 | ||
299 | long NETsendData(void *pData, int Size, int Mode) | |
300 | sends Size bytes from pData to the other side. | |
301 | ||
302 | long NETrecvData(void *pData, int Size, int Mode) | |
303 | receives Size bytes from pData to the other side. | |
304 | ||
305 | void NETsetInfo(netInfo *info); | |
306 | sets the netInfo struct. | |
307 | ||
308 | void NETkeypressed(int key) (linux only) | |
309 | key is a XK_?? (X11) keycode. | |
310 | */ | |
311 | ||
312 | #ifdef __cplusplus | |
313 | } | |
314 | #endif | |
315 | #endif // _PSEMU_PLUGIN_DEFS_H |