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