1 #ifndef _PSEMU_PLUGIN_DEFS_H
2 #define _PSEMU_PLUGIN_DEFS_H
11 #define _PPDK_HEADER_VERSION 3
13 #define PLUGIN_VERSION 1
15 // plugin type returned by PSEgetLibType (types can be merged if plugin is multi type!)
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
26 // XXX_Init return values
27 // Those return values apply to all libraries
28 // currently obsolete - preserved for compatibilty
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
36 // GPU_Test return values
38 // sucess, everything configured, and went OK.
39 #define PSE_GPU_ERR_SUCCESS 0
42 // this error might be returned as critical error but none of below
43 #define PSE_GPU_ERR -20
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
52 // this warning might be returned as undefined warning but allowing driver to continue
53 #define PSE_GPU_WARN 20
55 // GPU_Query - will be implemented soon
62 unsigned char reserved[100];
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
71 #define PSE_GPU_STATUS_WINDOWWRONG 1 // this driver cannot operate in this windowed mode
73 // GPU_Query End - will be implemented in v2
78 // CDR_Test return values
80 // sucess, everything configured, and went OK.
81 #define PSE_CDR_ERR_SUCCESS 0
83 // general failure (error undefined)
84 #define PSE_CDR_ERR_FAILURE -1
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
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
104 // some info retricted (now!)
106 // sucess, everything configured, and went OK.
107 #define PSE_SPU_ERR_SUCCESS 0
110 // this error might be returned as critical error but none of below
111 #define PSE_SPU_ERR -60
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
120 // this warning might be returned as undefined warning but allowing driver to continue
121 #define PSE_SPU_WARN 60
130 functions that must be exported from PAD Plugin
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
136 long PADconfigure(void);
138 long PADtest(void); // called from Configure Dialog and after PADopen();
141 unsigned char PADstartPoll(int);
142 unsigned char PADpoll(unsigned char);
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
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
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
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
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
190 // this warning might be returned as undefined warning but allowing driver to continue
191 #define PSE_PAD_WARN 80
196 // controler type - fill it withe predefined values above
197 unsigned char controllerType;
199 // status of buttons - every controller fills this field
200 unsigned short buttonStatus;
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;
206 // for mouse fill those next 2 bytes
207 // values are in range -128 - 127
208 unsigned char moveX, moveY;
212 volatile uint8_t VibF[2];
214 unsigned char reserved[87];
219 /* Added by linuzappz@pcsx.net */
221 /* Modes bits for NETsendData/NETrecvData */
222 #define PSE_NET_BLOCKING 0x00000000
223 #define PSE_NET_NONBLOCKING 0x00000001
225 /* note: unsupported fields should be zeroed.
229 char CdromID[9]; // ie. 'SCPH12345', no \0 trailing character
232 GPUshowScreenPic GPU_showScreenPic;
233 GPUdisplayText GPU_displayText;
234 PADsetSensitive PAD_setSensitive;
240 char BIOSpath[256]; // 'HLE' for internal bios
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.
255 closes the connection.
256 shall return 0 on success, else -1.
259 this is called when the user paused the emulator.
262 this is called when the user resumed the emulator.
264 long NETqueryPlayer()
265 returns player number
267 long NETsendPadData(void *pData, int Size)
268 this should be called for the first pad only on each side.
270 long NETrecvPadData(void *pData, int Pad)
271 call this for Pad 1/2 to get the data sent by the above func.
275 long NETsendData(void *pData, int Size, int Mode)
276 sends Size bytes from pData to the other side.
278 long NETrecvData(void *pData, int Size, int Mode)
279 receives Size bytes from pData to the other side.
281 void NETsetInfo(netInfo *info);
282 sets the netInfo struct.
284 void NETkeypressed(int key) (linux only)
285 key is a XK_?? (X11) keycode.
291 #endif // _PSEMU_PLUGIN_DEFS_H