1 #ifndef _PSEMU_PLUGIN_DEFS_H
2 #define _PSEMU_PLUGIN_DEFS_H
9 #define _PPDK_HEADER_VERSION 3
11 #define PLUGIN_VERSION 1
13 // plugin type returned by PSEgetLibType (types can be merged if plugin is multi type!)
20 // DLL function return codes
21 #define PSE_ERR_SUCCESS 0 // every function in DLL if completed sucessfully should return this value
22 #define PSE_ERR_FATAL -1 // undefined error but fatal one, that kills all functionality
24 // XXX_Init return values
25 // Those return values apply to all libraries
26 // currently obsolete - preserved for compatibilty
28 #define PSE_INIT_ERR_SUCCESS 0 // initialization went OK
29 #define PSE_INIT_ERR_NOTCONFIGURED -2 // this driver is not configured
30 #define PSE_INIT_ERR_NOHARDWARE -3 // this driver can not operate properly on this hardware or hardware is not detected
34 // GPU_Test return values
36 // sucess, everything configured, and went OK.
37 #define PSE_GPU_ERR_SUCCESS 0
40 // this error might be returned as critical error but none of below
41 #define PSE_GPU_ERR -20
44 // this driver is not configured
45 #define PSE_GPU_ERR_NOTCONFIGURED PSE_GPU_ERR - 1
46 // this driver failed Init
47 #define PSE_GPU_ERR_INIT PSE_GPU_ERR - 2
50 // this warning might be returned as undefined warning but allowing driver to continue
51 #define PSE_GPU_WARN 20
53 // GPU_Query - will be implemented soon
60 unsigned char reserved[100];
64 // if driver can operate in both modes it must support GPU_changeMode();
65 #define PSE_GPU_FLAGS_FULLSCREEN 1 // this driver can operate in fullscreen mode
66 #define PSE_GPU_FLAGS_WINDOWED 2 // this driver can operate in windowed mode
69 #define PSE_GPU_STATUS_WINDOWWRONG 1 // this driver cannot operate in this windowed mode
71 // GPU_Query End - will be implemented in v2
76 // CDR_Test return values
78 // sucess, everything configured, and went OK.
79 #define PSE_CDR_ERR_SUCCESS 0
81 // general failure (error undefined)
82 #define PSE_CDR_ERR_FAILURE -1
85 #define PSE_CDR_ERR -40
86 // this driver is not configured
87 #define PSE_CDR_ERR_NOTCONFIGURED PSE_CDR_ERR - 0
88 // if this driver is unable to read data from medium
89 #define PSE_CDR_ERR_NOREAD PSE_CDR_ERR - 1
92 #define PSE_CDR_WARN 40
93 // if this driver emulates lame mode ie. can read only 2048 tracks and sector header is emulated
94 // this might happen to CDROMS that do not support RAW mode reading - surelly it will kill many games
95 #define PSE_CDR_WARN_LAMECD PSE_CDR_WARN + 0
102 // some info retricted (now!)
104 // sucess, everything configured, and went OK.
105 #define PSE_SPU_ERR_SUCCESS 0
108 // this error might be returned as critical error but none of below
109 #define PSE_SPU_ERR -60
111 // this driver is not configured
112 #define PSE_SPU_ERR_NOTCONFIGURED PSE_SPU_ERR - 1
113 // this driver failed Init
114 #define PSE_SPU_ERR_INIT PSE_SPU_ERR - 2
118 // this warning might be returned as undefined warning but allowing driver to continue
119 #define PSE_SPU_WARN 60
128 functions that must be exported from PAD Plugin
130 long PADinit(long flags); // called only once when PSEmu Starts
131 void PADshutdown(void); // called when PSEmu exits
132 long PADopen(PadInitS *); // called when PSEmu is running program
134 long PADconfigure(void);
136 long PADtest(void); // called from Configure Dialog and after PADopen();
139 unsigned char PADstartPoll(int);
140 unsigned char PADpoll(unsigned char);
144 // PADquery responses (notice - values ORed)
145 // PSEmu will use them also in PADinit to tell Plugin which Ports will use
146 // notice that PSEmu will call PADinit and PADopen only once when they are from
149 // might be used in port 1
150 #define PSE_PAD_USE_PORT1 1
151 // might be used in port 2
152 #define PSE_PAD_USE_PORT2 2
157 #define PSE_PAD_TYPE_MOUSE 1
158 // NEGCON - 16 button analog controller SLPH-00001
159 #define PSE_PAD_TYPE_NEGCON 2
160 // GUN CONTROLLER - gun controller SLPH-00014 from Konami
161 #define PSE_PAD_TYPE_GUN 3
162 // STANDARD PAD SCPH-1080, SCPH-1150
163 #define PSE_PAD_TYPE_STANDARD 4
164 // ANALOG JOYSTICK SCPH-1110
165 #define PSE_PAD_TYPE_ANALOGJOY 5
166 // GUNCON - gun controller SLPH-00034 from Namco
167 #define PSE_PAD_TYPE_GUNCON 6
168 // ANALOG CONTROLLER SCPH-1150
169 #define PSE_PAD_TYPE_ANALOGPAD 7
172 // sucess, everything configured, and went OK.
173 #define PSE_PAD_ERR_SUCCESS 0
174 // general plugin failure (undefined error)
175 #define PSE_PAD_ERR_FAILURE -1
179 // this error might be returned as critical error but none of below
180 #define PSE_PAD_ERR -80
181 // this driver is not configured
182 #define PSE_PAD_ERR_NOTCONFIGURED PSE_PAD_ERR - 1
183 // this driver failed Init
184 #define PSE_PAD_ERR_INIT PSE_PAD_ERR - 2
188 // this warning might be returned as undefined warning but allowing driver to continue
189 #define PSE_PAD_WARN 80
194 // controller type - fill it withe predefined values above
195 unsigned char controllerType;
197 //0 : no multitap between psx and pad
198 //1 : multitap between psx and pad on port 1
199 //2 : multitap between psx and pad on port 2
203 // status of buttons - every controller fills this field
204 unsigned short buttonStatus;
206 // for analog pad fill those next 4 bytes
207 // values are analog in range 0-255 where 127 is center position
208 unsigned char rightJoyX, rightJoyY, leftJoyX, leftJoyY;
210 // for mouse fill those next 2 bytes
211 // values are in range -128 - 127
212 unsigned char moveX, moveY;
214 unsigned char Vib[2];
215 unsigned char VibF[2];
217 //configuration mode Request 0x43
219 unsigned char reserved[87];
224 /* Added by linuzappz@pcsx.net */
226 /* Modes bits for NETsendData/NETrecvData */
227 #define PSE_NET_BLOCKING 0x00000000
228 #define PSE_NET_NONBLOCKING 0x00000001
230 /* note: unsupported fields should be zeroed.
234 char CdromID[9]; // ie. 'SCPH12345', no \0 trailing character
237 GPUshowScreenPic GPU_showScreenPic;
238 GPUdisplayText GPU_displayText;
239 PADsetSensitive PAD_setSensitive;
245 char BIOSpath[256]; // 'HLE' for internal bios
254 long NETopen(HWND hWnd)
255 opens the connection.
256 shall return 0 on success, else -1.
257 -1 is also returned if the user selects offline mode.
260 closes the connection.
261 shall return 0 on success, else -1.
264 this is called when the user paused the emulator.
267 this is called when the user resumed the emulator.
269 long NETqueryPlayer()
270 returns player number
272 long NETsendPadData(void *pData, int Size)
273 this should be called for the first pad only on each side.
275 long NETrecvPadData(void *pData, int Pad)
276 call this for Pad 1/2 to get the data sent by the above func.
280 long NETsendData(void *pData, int Size, int Mode)
281 sends Size bytes from pData to the other side.
283 long NETrecvData(void *pData, int Size, int Mode)
284 receives Size bytes from pData to the other side.
286 void NETsetInfo(netInfo *info);
287 sets the netInfo struct.
289 void NETkeypressed(int key) (linux only)
290 key is a XK_?? (X11) keycode.
296 #endif // _PSEMU_PLUGIN_DEFS_H