Plugin APIs: Corrected a few things that got missed when I committed initially. Moved the ini path passing to a separate function. Restored a few functions I'd deleted, and depreciated them instead.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@780 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-03-14 02:39:40 +00:00
parent 04b49b108e
commit ceaee3748e
10 changed files with 180 additions and 104 deletions

View File

@ -69,13 +69,6 @@ PS2E_FW_VERSION = 0x0002,
PS2E_SIO_VERSION = 0x0001
} PluginLibVersion;
enum {
SIO_TYPE_PAD = 0x00000001,
SIO_TYPE_MTAP = 0x00000004,
SIO_TYPE_RM = 0x00000040,
SIO_TYPE_MC = 0x00000100
} SioTypes;
// freeze modes:
enum {
FREEZE_LOAD = 0,

View File

@ -17,8 +17,8 @@
*/
#ifndef __PLUGINCALLBACKS_H__
#define __PLUGINCALLBACKS_H__
#ifndef __pDisplayS_H__
#define __pDisplayS_H__
extern "C" {
typedef u32 (CALLBACK* _PS2EgetLibType)(void);
@ -29,7 +29,7 @@ typedef char*(CALLBACK* _PS2EgetLibName)(void);
// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _GSinit)(char *configpath);
typedef s32 (CALLBACK* _GSopen)(char *Title, bool multithread);
typedef s32 (CALLBACK* _GSopen)(void *pDisplay, char *Title, bool multithread);
typedef void (CALLBACK* _GSclose)();
typedef void (CALLBACK* _GSshutdown)();
typedef void (CALLBACK* _GSvsync)(int field);
@ -60,12 +60,13 @@ typedef void (CALLBACK* _GSmakeSnapshot)(const char *path);
typedef void (CALLBACK* _GSmakeSnapshot2)(const char *path, int*, int);
typedef s32 (CALLBACK* _GSfreeze)(u8 mode, freezeData *data);
typedef void (CALLBACK* _GSconfigure)();
typedef void (CALLBACK* _GSconfigpath)(char *configpath);
typedef s32 (CALLBACK* _GStest)();
typedef void (CALLBACK* _GSabout)();
// PAD
typedef s32 (CALLBACK* _PADinit)(char *configpath, u32 flags);
typedef s32 (CALLBACK* _PADopen)();
typedef s32 (CALLBACK* _PADopen)(void *pDisplay);
typedef void (CALLBACK* _PADclose)();
typedef void (CALLBACK* _PADshutdown)();
typedef keyEvent* (CALLBACK* _PADkeyEvent)();
@ -75,20 +76,25 @@ typedef u32 (CALLBACK* _PADquery)();
typedef void (CALLBACK* _PADupdate)(u8 pad);
typedef void (CALLBACK* _PADgsDriverInfo)(GSdriverInfo *info);
typedef s32 (CALLBACK* _PADfreeze)(u8 mode, freezeData *data);
typedef void (CALLBACK* _PADconfigure)();
typedef void (CALLBACK* _PADconfigpath)(char *configpath);
typedef s32 (CALLBACK* _PADtest)();
typedef void (CALLBACK* _PADabout)();
// SIO
typedef s32 (CALLBACK* _SIOinit)(char *configpath, u32 port, u32 slot, SIOchangeSlotCB f);
typedef s32 (CALLBACK* _SIOopen)();
typedef s32 (CALLBACK* _SIOinit)();
typedef s32 (CALLBACK* _SIOopen)(void *pDisplay);
typedef void (CALLBACK* _SIOclose)();
typedef void (CALLBACK* _SIOshutdown)();
typedef u8 (CALLBACK* _SIOstartPoll)(u8 value);
typedef u8 (CALLBACK* _SIOpoll)(u8 value);
typedef s32 (CALLBACK* _SIOstartPoll)(u8 deviceType, u32 port, u32 slot, u8 *returnValue);
typedef s32 (CALLBACK* _SIOpoll)(u8 value, u8 *returnValue);
typedef u32 (CALLBACK* _SIOquery)();
typedef void (CALLBACK* _SIOkeyEvent)(keyEvent* ev);
typedef s32 (CALLBACK* _SIOfreeze)(u8 mode, freezeData *data);
typedef void (CALLBACK* _SIOconfigure)();
typedef void (CALLBACK* _SIOconfigpath)(char *configpath);
typedef s32 (CALLBACK* _SIOtest)();
typedef void (CALLBACK* _SIOabout)();
@ -96,11 +102,19 @@ typedef void (CALLBACK* _SIOabout)();
// NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _SPU2init)(char *configpath);
typedef s32 (CALLBACK* _SPU2open)();
typedef s32 (CALLBACK* _SPU2open)(void *pDisplay);
typedef void (CALLBACK* _SPU2close)();
typedef void (CALLBACK* _SPU2shutdown)();
typedef void (CALLBACK* _SPU2write)(u32 mem, u16 value);
typedef u16 (CALLBACK* _SPU2read)(u32 mem);
typedef void (CALLBACK* _SPU2readDMA4Mem)(u16 *pMem, u32 size);
typedef void (CALLBACK* _SPU2writeDMA4Mem)(u16 *pMem, u32 size);
typedef void (CALLBACK* _SPU2interruptDMA4)();
typedef void (CALLBACK* _SPU2readDMA7Mem)(u16 *pMem, u32 size);
typedef void (CALLBACK* _SPU2writeDMA7Mem)(u16 *pMem, u32 size);
typedef void (CALLBACK* _SPU2interruptDMA7)();
typedef void (CALLBACK* _SPU2readDMAMem)(u16 *pMem, u32 size, u8 core);
typedef void (CALLBACK* _SPU2writeDMAMem)(u16 *pMem, u32 size, u8 core);
typedef void (CALLBACK* _SPU2interruptDMA)(u8 core);
@ -114,8 +128,10 @@ typedef void (CALLBACK* _SPU2setTimeStretcher)(short int enable);
typedef u32 (CALLBACK* _SPU2ReadMemAddr)(u8 core);
typedef void (CALLBACK* _SPU2WriteMemAddr)(u8 core,u32 value);
typedef void (CALLBACK* _SPU2async)(u32 cycles);
typedef s32 (CALLBACK* _SPU2freeze)(int mode, freezeData *data);
typedef s32 (CALLBACK* _SPU2freeze)(u8 mode, freezeData *data);
typedef void (CALLBACK* _SPU2keyEvent)(keyEvent* ev);
typedef void (CALLBACK* _SPU2configure)();
typedef void (CALLBACK* _SPU2configpath)(char *configpath);
typedef s32 (CALLBACK* _SPU2test)();
typedef void (CALLBACK* _SPU2about)();
@ -137,7 +153,10 @@ typedef s32 (CALLBACK* _CDVDgetTrayStatus)();
typedef s32 (CALLBACK* _CDVDctrlTrayOpen)();
typedef s32 (CALLBACK* _CDVDctrlTrayClose)();
typedef void (CALLBACK* _CDVDkeyEvent)(keyEvent* ev);
typedef s32 (CALLBACK* _CDVDfreeze)(u8 mode, freezeData *data);
typedef void (CALLBACK* _CDVDconfigure)();
typedef void (CALLBACK* _CDVDconfigpath)(char *configpath);
typedef s32 (CALLBACK* _CDVDtest)();
typedef void (CALLBACK* _CDVDabout)();
typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)());
@ -146,7 +165,7 @@ typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)());
// NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _DEV9init)(char *configpath);
typedef s32 (CALLBACK* _DEV9open)();
typedef s32 (CALLBACK* _DEV9open)(void *pDisplay);
typedef void (CALLBACK* _DEV9close)();
typedef void (CALLBACK* _DEV9shutdown)();
typedef u8 (CALLBACK* _DEV9read8)(u32 mem);
@ -160,8 +179,10 @@ typedef void (CALLBACK* _DEV9writeDMA8Mem)(u32 *pMem, int size);
typedef void (CALLBACK* _DEV9irqCallback)(DEV9callback callback);
typedef DEV9handler (CALLBACK* _DEV9irqHandler)(void);
typedef void (CALLBACK* _DEV9keyEvent)(keyEvent* ev);
typedef s32 (CALLBACK* _DEV9freeze)(int mode, freezeData *data);
typedef void (CALLBACK* _DEV9configure)();
typedef void (CALLBACK* _DEV9configpath)(char *configpath);
typedef s32 (CALLBACK* _DEV9test)();
typedef void (CALLBACK* _DEV9about)();
@ -169,7 +190,7 @@ typedef void (CALLBACK* _DEV9about)();
// NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _USBinit)(char *configpath);
typedef s32 (CALLBACK* _USBopen)();
typedef s32 (CALLBACK* _USBopen)(void *pDisplay);
typedef void (CALLBACK* _USBclose)();
typedef void (CALLBACK* _USBshutdown)();
typedef u8 (CALLBACK* _USBread8)(u32 mem);
@ -185,22 +206,26 @@ typedef void (CALLBACK* _USBirqCallback)(USBcallback callback);
typedef USBhandler (CALLBACK* _USBirqHandler)(void);
typedef void (CALLBACK* _USBsetRAM)(void *mem);
typedef void (CALLBACK* _USBkeyEvent)(keyEvent* ev);
typedef s32 (CALLBACK* _USBfreeze)(int mode, freezeData *data);
typedef void (CALLBACK* _USBconfigure)();
typedef void (CALLBACK* _USBconfigpath)(char *configpath);
typedef s32 (CALLBACK* _USBtest)();
typedef void (CALLBACK* _USBabout)();
//FW
typedef s32 (CALLBACK* _FWinit)(char *configpath);
typedef s32 (CALLBACK* _FWopen)();
typedef s32 (CALLBACK* _FWopen)(void *pDisplay);
typedef void (CALLBACK* _FWclose)();
typedef void (CALLBACK* _FWshutdown)();
typedef u32 (CALLBACK* _FWread32)(u32 mem);
typedef void (CALLBACK* _FWwrite32)(u32 mem, u32 value);
typedef void (CALLBACK* _FWirqCallback)(void (*callback)());
typedef void (CALLBACK* _FWkeyEvent)(keyEvent* ev);
typedef s32 (CALLBACK* _FWfreeze)(int mode, freezeData *data);
typedef void (CALLBACK* _FWconfigure)();
typedef void (CALLBACK* _FWconfigpath)(char *configpath);
typedef s32 (CALLBACK* _FWtest)();
typedef void (CALLBACK* _FWabout)();
@ -236,6 +261,7 @@ extern _GSsetWindowInfo GSsetWindowInfo;
#endif
extern _GSfreeze GSfreeze;
extern _GSconfigure GSconfigure;
extern _GSconfigpath GSconfigpath;
extern _GStest GStest;
extern _GSabout GSabout;
@ -250,8 +276,10 @@ extern _PADpoll PAD1poll;
extern _PADquery PAD1query;
extern _PADupdate PAD1update;
extern _PADfreeze PAD1freeze;
extern _PADgsDriverInfo PAD1gsDriverInfo;
extern _PADconfigure PAD1configure;
extern _PADconfigpath PAD1configpath;
extern _PADtest PAD1test;
extern _PADabout PAD1about;
@ -266,8 +294,10 @@ extern _PADpoll PAD2poll;
extern _PADquery PAD2query;
extern _PADupdate PAD2update;
extern _PADfreeze PAD2freeze;
extern _PADgsDriverInfo PAD2gsDriverInfo;
extern _PADconfigure PAD2configure;
extern _PADconfigpath PAD2configpath;
extern _PADtest PAD2test;
extern _PADabout PAD2about;
@ -279,8 +309,11 @@ extern _SIOshutdown SIOshutdown[2][9];
extern _SIOstartPoll SIOstartPoll[2][9];
extern _SIOpoll SIOpoll[2][9];
extern _SIOquery SIOquery[2][9];
extern _SIOkeyEvent SIOkeyEvent;
extern _SIOfreeze SIOfreeze[2][9];
extern _SIOconfigure SIOconfigure[2][9];
extern _SIOconfigpath SIOconfigpath[2][9];
extern _SIOtest SIOtest[2][9];
extern _SIOabout SIOabout[2][9];
@ -306,9 +339,11 @@ extern _SPU2irqCallback SPU2irqCallback;
extern _SPU2setClockPtr SPU2setClockPtr;
extern _SPU2setTimeStretcher SPU2setTimeStretcher;
extern _SPU2keyEvent SPU2keyEvent;
extern _SPU2async SPU2async;
extern _SPU2freeze SPU2freeze;
extern _SPU2configure SPU2configure;
extern _SPU2configpath SPU2configpath;
extern _SPU2test SPU2test;
extern _SPU2about SPU2about;
@ -328,7 +363,10 @@ extern _CDVDgetTrayStatus CDVDgetTrayStatus;
extern _CDVDctrlTrayOpen CDVDctrlTrayOpen;
extern _CDVDctrlTrayClose CDVDctrlTrayClose;
extern _CDVDkeyEvent CDVDkeyEvent;
extern _CDVDfreeze CDVDfreeze;
extern _CDVDconfigure CDVDconfigure;
extern _CDVDconfigpath CDVDconfigpath;
extern _CDVDtest CDVDtest;
extern _CDVDabout CDVDabout;
extern _CDVDnewDiskCB CDVDnewDiskCB;
@ -349,7 +387,9 @@ extern _DEV9writeDMA8Mem DEV9writeDMA8Mem;
extern _DEV9irqCallback DEV9irqCallback;
extern _DEV9irqHandler DEV9irqHandler;
extern _DEV9keyEvent DEV9keyEvent;
extern _DEV9configure DEV9configure;
extern _DEV9configpath DEV9configpath;
extern _DEV9freeze DEV9freeze;
extern _DEV9test DEV9test;
extern _DEV9about DEV9about;
@ -371,7 +411,9 @@ extern _USBirqCallback USBirqCallback;
extern _USBirqHandler USBirqHandler;
extern _USBsetRAM USBsetRAM;
extern _USBkeyEvent USBkeyEvent;
extern _USBconfigure USBconfigure;
extern _USBconfigpath USBconfigpath;
extern _USBfreeze USBfreeze;
extern _USBtest USBtest;
extern _USBabout USBabout;
@ -385,10 +427,12 @@ extern _FWread32 FWread32;
extern _FWwrite32 FWwrite32;
extern _FWirqCallback FWirqCallback;
extern _FWkeyEvent FWkeyEvent;
extern _FWconfigure FWconfigure;
extern _FWconfigpath FWconfigpath;
extern _FWfreeze FWfreeze;
extern _FWtest FWtest;
extern _FWabout FWabout;
}
#endif // __PLUGINCALLBACKS_H__
#endif // __pDisplayS_H__

View File

@ -35,7 +35,7 @@
// Basic functions.
EXPORT_C_(s32) CDVDinit(char *configpath);
EXPORT_C_(s32) CDVDinit();
EXPORT_C_(s32) CDVDopen(void *pDisplay, const char* pTitleFilename);
EXPORT_C_(void) CDVDclose();
EXPORT_C_(void) CDVDshutdown();
@ -55,7 +55,10 @@ EXPORT_C_(s32) CDVDctrlTrayClose(); //close disc tray
// Extended functions
EXPORT_C_(void) CDVDkeyEvent(keyEvent *ev);
EXPORT_C_(void) CDVDconfigure();
EXPORT_C_(s32) CDVDfreeze(u8 mode, freezeData *data);
EXPORT_C_(void) CDVDconfigpath(char *configpath);
EXPORT_C_(void) CDVDabout();
EXPORT_C_(s32) CDVDtest();
EXPORT_C_(void) CDVDnewDiskCB(void (*callback)());

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DEV9API_H__
#define __DEV9API_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
typedef void (*DEV9callback)(int cycles);
@ -37,7 +37,9 @@ typedef int (*DEV9handler)(void);
// Basic functions.
// NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones
EXPORT_C_(s32) DEV9init(char *configpath);
EXPORT_C_(s32) DEV9init();
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) DEV9open(void *pDisplay);
EXPORT_C_(void) DEV9close();
EXPORT_C_(void) DEV9shutdown();
@ -57,8 +59,10 @@ EXPORT_C_(DEV9handler) DEV9irqHandler(void);
// Extended functions
EXPORT_C_(s32) DEV9freeze(int mode, freezeData *data);
EXPORT_C_(void) DEV9keyEvent(keyEvent *ev);
EXPORT_C_(s32) DEV9freeze(u8 mode, freezeData *data);
EXPORT_C_(void) DEV9configure();
EXPORT_C_(void) DEV9configpath(char *configpath);
EXPORT_C_(void) DEV9about();
EXPORT_C_(s32) DEV9test();

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __FWAPI_H__
#define __FWAPI_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
/* FW plugin API */
@ -37,20 +37,23 @@
// NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones
EXPORT_C_(s32) CALLBACK FWinit(char *configpath);
EXPORT_C_(s32) CALLBACK FWopen(void *pDisplay);
EXPORT_C_(void) CALLBACK FWclose();
EXPORT_C_(void) CALLBACK FWshutdown();
EXPORT_C_(u32) CALLBACK FWread32(u32 addr);
EXPORT_C_(void) CALLBACK FWwrite32(u32 addr, u32 value);
EXPORT_C_(void) CALLBACK FWirqCallback(void (*callback)());
EXPORT_C_(s32) FWinit();
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) FWopen(void *pDisplay);
EXPORT_C_(void) FWclose();
EXPORT_C_(void) FWshutdown();
EXPORT_C_(u32) FWread32(u32 addr);
EXPORT_C_(void) FWwrite32(u32 addr, u32 value);
EXPORT_C_(void) FWirqCallback(void (*callback)());
// Extended functions
EXPORT_C_(s32) CALLBACK FWfreeze(int mode, freezeData *data);
EXPORT_C_(void) CALLBACK FWconfigure();
EXPORT_C_(void) CALLBACK FWabout();
EXPORT_C_(s32) CALLBACK FWtest();
EXPORT_C_(void) FWkeyEvent(keyEvent *ev);
EXPORT_C_(s32) FWfreeze(u8 mode, freezeData *data);
EXPORT_C_(void) FWconfigure();
EXPORT_C_(void) SPU2configpath(char *configpath);
EXPORT_C_(void) FWabout();
EXPORT_C_(s32) FWtest();
#endif
#endif // __USBAPI_H__

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __GSAPI_H__
#define __GSAPI_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
typedef struct _GSdriverInfo {
@ -37,7 +37,8 @@ typedef struct _GSdriverInfo {
} GSdriverInfo;
// Basic functions.
EXPORT_C_(s32) GSinit(char *configpath);
EXPORT_C_(s32) GSinit();
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) GSopen(void *pDisplay, char *Title, bool multithread);
EXPORT_C_(void) GSclose();
EXPORT_C_(void) GSshutdown();
@ -78,6 +79,7 @@ EXPORT_C_(s32) CALLBACK GSsetWindowInfo(winInfo *info);
#endif
EXPORT_C_(s32) GSfreeze(u8 mode, freezeData *data);
EXPORT_C_(void) GSconfigure();
EXPORT_C_(void) SGSconfigpath(char *configpath);
EXPORT_C_(void) GSabout();
EXPORT_C_(s32) GStest();

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __PADAPI_H__
#define __PADAPI_H__
@ -28,25 +28,26 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
/* PAD plugin API */
/* So obsolete that everyone uses it. */
// Basic functions.
EXPORT_C_(s32) CALLBACK PADinitEx(char *configpath);
EXPORT_C_(s32) CALLBACK PADopen(void *pDsp);
EXPORT_C_(void) CALLBACK PADclose();
EXPORT_C_(void) CALLBACK PADshutdown();
EXPORT_C_(s32) PADinit(u32 flags);
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) PADopen(void *pDisplay);
EXPORT_C_(void) PADclose();
EXPORT_C_(void) PADshutdown();
// PADkeyEvent is called every vsync (return NULL if no event)
EXPORT_C_(keyEvent*) CALLBACK PADkeyEvent();
EXPORT_C_(u8) CALLBACK PADstartPoll(u8 pad);
EXPORT_C_(u8) CALLBACK PADpoll(u8 value);
EXPORT_C_(keyEvent*) PADkeyEvent();
EXPORT_C_(u8) PADstartPoll(u8 pad);
EXPORT_C_(u8) PADpoll(u8 value);
// returns: 1 if supported pad1
// 2 if supported pad2
// 3 if both are supported
EXPORT_C_(u8) CALLBACK PADquery();
EXPORT_C_(u8) PADquery();
// call to give a hint to the PAD plugin to query for the keyboard state. A
// good plugin will query the OS for keyboard state ONLY in this function.
@ -55,13 +56,14 @@ EXPORT_C_(u8) CALLBACK PADquery();
// the window (and input). Note that PADupdate can be called from a different
// thread than the other functions, so mutex or other multithreading primitives
// have to be added to maintain data integrity.
EXPORT_C_(void) CALLBACK PADupdate(u8 pad);
EXPORT_C_(void) PADupdate(u8 pad);
// Extended functions
EXPORT_C_(s32) CALLBACK PADfreeze(int mode, freezeData *data);
EXPORT_C_(void) CALLBACK PADgsDriverInfo(GSdriverInfo *info);
EXPORT_C_(void) CALLBACK PADconfigure();
EXPORT_C_(void) CALLBACK PADabout();
EXPORT_C_(s32) CALLBACK PADtest();
EXPORT_C_(void) PADgsDriverInfo(GSdriverInfo *info);
EXPORT_C_(s32) PADfreeze(u8 mode, freezeData *data);
EXPORT_C_(void) PADconfigure();
EXPORT_C_(void) PADconfigpath(char *configpath);
EXPORT_C_(void) PADabout();
EXPORT_C_(s32) PADtest();
#endif // __PADAPI_H__

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __SIOAPI_H__
#define __SIOAPI_H__
@ -28,36 +28,45 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
/* SIO plugin API */
// basic funcs
// Basic functions.
EXPORT_C_(s32) SIOinit();
// Single plugin can only be PAD, MTAP, RM, or MC. Only load one plugin of each type,
// but not both a PAD and MTAP. Simplifies plugin selection and interface, as well
// as API.
s32 CALLBACK SIOinit(char *configpath);
s32 CALLBACK SIOopen(void *pDisplay);
void CALLBACK SIOclose();
void CALLBACK SIOshutdown();
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) SIOopen(void *pDisplay);
EXPORT_C_(void) SIOclose();
EXPORT_C_(void) SIOshutdown();
// Returns 0 if device doesn't exist. Simplifies things. Also means you don't
// have to distinguish between MTAP and PAD SIO plugins.
s32 CALLBACK SIOstartPoll(u8 deviceType, u32 port, u32 slot, u8 *returnValue);
EXPORT_C_(s32) SIOstartPoll(u8 deviceType, u32 port, u32 slot, u8 *returnValue);
// Returns 0 on the last output byte.
s32 CALLBACK SIOpoll(u8 value, u8 *returnValue);
EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent();
EXPORT_C_(s32) SIOpoll(u8 value, u8 *returnValue);
// returns: SIO_TYPE_{PAD,MTAP,RM,MC}
u32 CALLBACK SIOquery();
EXPORT_C_(u32) SIOquery();
// extended funcs
void CALLBACK SIOconfigure();
void CALLBACK SIOabout();
s32 CALLBACK SIOtest();
EXPORT_C_(void) SIOconfigure();
EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent();
EXPORT_C_(s32) SIOfreeze(u8 mode, freezeData *data);
EXPORT_C_(void) SIOconfigpath(char *configpath);
EXPORT_C_(void) SIOabout();
EXPORT_C_(s32) SIOtest();
enum {
SIO_TYPE_PAD = 0x00000001,
SIO_TYPE_MTAP = 0x00000004,
SIO_TYPE_RM = 0x00000040,
SIO_TYPE_MC = 0x00000100
} SioTypes;
#endif

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __SPU2API_H__
#define __SPU2API_H__
@ -28,15 +28,26 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
EXPORT_C_(s32) SPU2init(char *configpath);
EXPORT_C_(s32) SPU2init();
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) SPU2open(void *pDisplay);
EXPORT_C_(void) SPU2close();
EXPORT_C_(void) SPU2shutdown();
EXPORT_C_(void) SPU2write(u32 mem, u16 value);
EXPORT_C_(u16) SPU2read(u32 mem);
// The following calls are depreciated.
EXPORT_C_(void) SPU2readDMA4Mem(u16 *pMem, u32 size);
EXPORT_C_(void) SPU2readDMA7Mem(u16 *pMem, u32 size);
EXPORT_C_(void) SPU2writeDMA4Mem(u16 *pMem, u32 size);
EXPORT_C_(void) SPU2writeDMA7Mem(u16 *pMem, u32 size);
EXPORT_C_(void) SPU2interruptDMA4();
EXPORT_C_(void) SPU2interruptDMA7();
// These calls replace the calls above.
EXPORT_C_(void) SPU2readDMAMem(u16 *pMem, u32 size, u8 core);
EXPORT_C_(void) SPU2writeDMAMem(u16 *pMem, u32 size, u8 core);
EXPORT_C_(void) SPU2interruptDMA(u8 core);
@ -50,15 +61,17 @@ EXPORT_C_(void) SPU2WriteMemAddr(u8 core,u32 value);
EXPORT_C_(void) SPU2irqCallback(void (*SPU2callback)(),void (*DMA4callback)(),void (*DMA7callback)());
// extended funcs
// if start is true, starts recording spu2 data, else stops
// returns true if successful
EXPORT_C_(bool) SPU2setupRecording(bool start);
EXPORT_C_(void) SPU2keyEvent(keyEvent *ev);
EXPORT_C_(void) SPU2setClockPtr(u32* ptr);
EXPORT_C_(void) SPU2async(u32 cycles);
EXPORT_C_(s32) SPU2freeze(u8 mode, freezeData *data);
EXPORT_C_(void) SPU2configure();
EXPORT_C_(void) SPU2configpath(char *configpath);
EXPORT_C_(void) SPU2about();
EXPORT_C_(s32) SPU2test();

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __USBAPI_H__
#define __USBAPI_H__
@ -28,36 +28,39 @@
* shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com
*/
#include "Pcsx2Api.h"
typedef void (*USBcallback)(int cycles);
typedef int (*USBhandler)(void);
// Basic functions.
EXPORT_C_(s32) CALLBACK USBinit(char *configpath);
EXPORT_C_(s32) CALLBACK USBopen(void *pDisplay);
EXPORT_C_(void) CALLBACK USBclose();
EXPORT_C_(void) CALLBACK USBshutdown();
EXPORT_C_(u8) CALLBACK USBread8(u32 addr);
EXPORT_C_(u16) CALLBACK USBread16(u32 addr);
EXPORT_C_(u32) CALLBACK USBread32(u32 addr);
EXPORT_C_(void) CALLBACK USBwrite8(u32 addr, u8 value);
EXPORT_C_(void) CALLBACK USBwrite16(u32 addr, u16 value);
EXPORT_C_(void) CALLBACK USBwrite32(u32 addr, u32 value);
EXPORT_C_(void) CALLBACK USBasync(u32 cycles);
EXPORT_C_(s32) USBinit();
// pDisplay normally is passed a handle to the GS plugins window.
EXPORT_C_(s32) USBopen(void *pDisplay);
EXPORT_C_(void) USBclose();
EXPORT_C_(void) USBshutdown();
EXPORT_C_(u8) USBread8(u32 addr);
EXPORT_C_(u16) USBread16(u32 addr);
EXPORT_C_(u32) USBread32(u32 addr);
EXPORT_C_(void) USBwrite8(u32 addr, u8 value);
EXPORT_C_(void) USBwrite16(u32 addr, u16 value);
EXPORT_C_(void) USBwrite32(u32 addr, u32 value);
EXPORT_C_(void) USBasync(u32 cycles);
// cycles = IOP cycles before calling callback,
// if callback returns 1 the irq is triggered, else not
EXPORT_C_(void) CALLBACK USBirqCallback(USBcallback callback);
EXPORT_C_(USBhandler) CALLBACK USBirqHandler(void);
EXPORT_C_(void) CALLBACK USBsetRAM(void *mem);
EXPORT_C_(void) USBirqCallback(USBcallback callback);
EXPORT_C_(USBhandler) USBirqHandler(void);
EXPORT_C_(void) USBsetRAM(void *mem);
// Extended functions
EXPORT_C_(s32) CALLBACK USBfreeze(int mode, freezeData *data);
EXPORT_C_(void) CALLBACK USBconfigure();
EXPORT_C_(void) CALLBACK USBabout();
EXPORT_C_(s32) CALLBACK USBtest();
EXPORT_C_(void) USBkeyEvent(keyEvent *ev);
EXPORT_C_(s32) USBfreeze(u8 mode, freezeData *data);
EXPORT_C_(void) USBconfigure();
EXPORT_C_(void) USBconfigpath(char *configpath);
EXPORT_C_(void) USBabout();
EXPORT_C_(s32) USBtest();
#endif // __USBAPI_H__