1 #ifndef _PSEMU_PLUGIN_DEFS_H
2 #define _PSEMU_PLUGIN_DEFS_H
8 // this can't be __stdcall like it was in PSEmu API as too many functions are mixed up
13 #define _PPDK_HEADER_VERSION 3
15 #define PLUGIN_VERSION 1
17 // plugin type returned by PSEgetLibType (types can be merged if plugin is multi type!)
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
28 // XXX_Init return values
29 // Those return values apply to all libraries
30 // currently obsolete - preserved for compatibilty
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
38 // GPU_Test return values
40 // sucess, everything configured, and went OK.
41 #define PSE_GPU_ERR_SUCCESS 0
44 // this error might be returned as critical error but none of below
45 #define PSE_GPU_ERR -20
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
54 // this warning might be returned as undefined warning but allowing driver to continue
55 #define PSE_GPU_WARN 20
57 // GPU_Query - will be implemented soon
64 unsigned char reserved[100];
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
73 #define PSE_GPU_STATUS_WINDOWWRONG 1 // this driver cannot operate in this windowed mode
75 // GPU_Query End - will be implemented in v2
80 // CDR_Test return values
82 // sucess, everything configured, and went OK.
83 #define PSE_CDR_ERR_SUCCESS 0
85 // general failure (error undefined)
86 #define PSE_CDR_ERR_FAILURE -1
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
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
106 // some info retricted (now!)
108 // sucess, everything configured, and went OK.
109 #define PSE_SPU_ERR_SUCCESS 0
112 // this error might be returned as critical error but none of below
113 #define PSE_SPU_ERR -60
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
122 // this warning might be returned as undefined warning but allowing driver to continue
123 #define PSE_SPU_WARN 60
132 functions that must be exported from PAD Plugin
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
138 long PADconfigure(void);
140 long PADtest(void); // called from Configure Dialog and after PADopen();
143 unsigned char PADstartPoll(int);
144 unsigned char PADpoll(unsigned char);
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
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
161 #define PSE_PAD_TYPE_MOUSE 1
162 // NEGCON - 16 button analog controller SLPH-00001
163 #define PSE_PAD_TYPE_NEGCON 2
164 // GUN CONTROLLER - gun controller SLPH-00014 from Konami
165 #define PSE_PAD_TYPE_GUN 3
166 // STANDARD PAD SCPH-1080, SCPH-1150
167 #define PSE_PAD_TYPE_STANDARD 4
168 // ANALOG JOYSTICK SCPH-1110
169 #define PSE_PAD_TYPE_ANALOGJOY 5
170 // GUNCON - gun controller SLPH-00034 from Namco
171 #define PSE_PAD_TYPE_GUNCON 6
172 // ANALOG CONTROLLER SCPH-1150
173 #define PSE_PAD_TYPE_ANALOGPAD 7
176 // sucess, everything configured, and went OK.
177 #define PSE_PAD_ERR_SUCCESS 0
178 // general plugin failure (undefined error)
179 #define PSE_PAD_ERR_FAILURE -1
183 // this error might be returned as critical error but none of below
184 #define PSE_PAD_ERR -80
185 // this driver is not configured
186 #define PSE_PAD_ERR_NOTCONFIGURED PSE_PAD_ERR - 1
187 // this driver failed Init
188 #define PSE_PAD_ERR_INIT PSE_PAD_ERR - 2
192 // this warning might be returned as undefined warning but allowing driver to continue
193 #define PSE_PAD_WARN 80
198 // controler type - fill it withe predefined values above
199 unsigned char controllerType;
201 // status of buttons - every controller fills this field
202 unsigned short buttonStatus;
204 // for analog pad fill those next 4 bytes
205 // values are analog in range 0-255 where 127 is center position
206 unsigned char rightJoyX, rightJoyY, leftJoyX, leftJoyY;
208 // for mouse fill those next 2 bytes
209 // values are in range -128 - 127
210 unsigned char moveX, moveY;
212 unsigned char Vib[2];
213 unsigned char VibF[2];
215 unsigned char reserved[87];
220 /* Added by linuzappz@pcsx.net */
222 /* Modes bits for NETsendData/NETrecvData */
223 #define PSE_NET_BLOCKING 0x00000000
224 #define PSE_NET_NONBLOCKING 0x00000001
226 /* note: unsupported fields should be zeroed.
230 char CdromID[9]; // ie. 'SCPH12345', no \0 trailing character
233 GPUshowScreenPic GPU_showScreenPic;
234 GPUdisplayText GPU_displayText;
235 PADsetSensitive PAD_setSensitive;
241 char BIOSpath[256]; // 'HLE' for internal bios
250 long NETopen(HWND hWnd)
251 opens the connection.
252 shall return 0 on success, else -1.
253 -1 is also returned if the user selects offline mode.
256 closes the connection.
257 shall return 0 on success, else -1.
260 this is called when the user paused the emulator.
263 this is called when the user resumed the emulator.
265 long NETqueryPlayer()
266 returns player number
268 long NETsendPadData(void *pData, int Size)
269 this should be called for the first pad only on each side.
271 long NETrecvPadData(void *pData, int Pad)
272 call this for Pad 1/2 to get the data sent by the above func.
276 long NETsendData(void *pData, int Size, int Mode)
277 sends Size bytes from pData to the other side.
279 long NETrecvData(void *pData, int Size, int Mode)
280 receives Size bytes from pData to the other side.
282 void NETsetInfo(netInfo *info);
283 sets the netInfo struct.
285 void NETkeypressed(int key) (linux only)
286 key is a XK_?? (X11) keycode.
292 #endif // _PSEMU_PLUGIN_DEFS_H