Plugin APIs: Restored pDsp, renamed to pDisplay for clarity (Though arcum42's right and about needing documentation). Renamed PADinit for psx emulator compatibility. Played around a bit with SIO api, thinking for simplicity best to just use one plugin of each type (SIO PAD/MTAP, remote, and memcard. Could even be separate types, but no real need for it). Added PADFreeze() and its friend SIOFreeze().

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@779 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
mattmenke 2009-03-14 02:12:17 +00:00
parent 17298b7e6b
commit 04b49b108e
8 changed files with 47 additions and 38 deletions

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __CDVDAPI_H__ #ifndef __CDVDAPI_H__
#define __CDVDAPI_H__ #define __CDVDAPI_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
/* CDVD plugin API */ /* CDVD plugin API */
@ -36,7 +36,7 @@
// Basic functions. // Basic functions.
EXPORT_C_(s32) CDVDinit(char *configpath); EXPORT_C_(s32) CDVDinit(char *configpath);
EXPORT_C_(s32) CDVDopen(const char* pTitleFilename); EXPORT_C_(s32) CDVDopen(void *pDisplay, const char* pTitleFilename);
EXPORT_C_(void) CDVDclose(); EXPORT_C_(void) CDVDclose();
EXPORT_C_(void) CDVDshutdown(); EXPORT_C_(void) CDVDshutdown();
EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode); EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode);
@ -92,7 +92,7 @@ CDVD_MODE_2328 2, // skip sync+head+sub (24) bytes
CDVD_MODE_2048 3, // skip sync+head+sub (24) bytes CDVD_MODE_2048 3, // skip sync+head+sub (24) bytes
CDVD_MODE_2368 4 // full 2352 bytes + 16 subq CDVD_MODE_2368 4 // full 2352 bytes + 16 subq
} TrackModes } TrackModes
// CDVDgetDiskType returns: // CDVDgetDiskType returns:
enum { enum {
CDVD_TYPE_ILLEGAL = 0xff, // Illegal Disc CDVD_TYPE_ILLEGAL = 0xff, // Illegal Disc
@ -110,7 +110,7 @@ CDVD_TYPE_DETCTCD = 0x02, // Detecting Cd
CDVD_TYPE_DETCT = 0x01, // Detecting CDVD_TYPE_DETCT = 0x01, // Detecting
CDVD_TYPE_NODISC = 0x00 // No Disc CDVD_TYPE_NODISC = 0x00 // No Disc
} DiskType; } DiskType;
// CDVDgetTrayStatus returns: // CDVDgetTrayStatus returns:
enum { enum {
CDVD_TRAY_CLOSE = 0x00, CDVD_TRAY_CLOSE = 0x00,

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __DEV9API_H__ #ifndef __DEV9API_H__
#define __DEV9API_H__ #define __DEV9API_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
typedef void (*DEV9callback)(int cycles); typedef void (*DEV9callback)(int cycles);
@ -38,7 +38,7 @@ typedef int (*DEV9handler)(void);
// NOTE: The read/write functions CANNOT use XMM/MMX regs // NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones // If you want to use them, need to save and restore current ones
EXPORT_C_(s32) DEV9init(char *configpath); EXPORT_C_(s32) DEV9init(char *configpath);
EXPORT_C_(s32) DEV9open(); EXPORT_C_(s32) DEV9open(void *pDisplay);
EXPORT_C_(void) DEV9close(); EXPORT_C_(void) DEV9close();
EXPORT_C_(void) DEV9shutdown(); EXPORT_C_(void) DEV9shutdown();
EXPORT_C_(u8) DEV9read8(u32 addr); EXPORT_C_(u8) DEV9read8(u32 addr);

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __FWAPI_H__ #ifndef __FWAPI_H__
#define __FWAPI_H__ #define __FWAPI_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
/* FW plugin API */ /* FW plugin API */
@ -38,7 +38,7 @@
// NOTE: The read/write functions CANNOT use XMM/MMX regs // NOTE: The read/write functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones // If you want to use them, need to save and restore current ones
EXPORT_C_(s32) CALLBACK FWinit(char *configpath); EXPORT_C_(s32) CALLBACK FWinit(char *configpath);
EXPORT_C_(s32) CALLBACK FWopen(); EXPORT_C_(s32) CALLBACK FWopen(void *pDisplay);
EXPORT_C_(void) CALLBACK FWclose(); EXPORT_C_(void) CALLBACK FWclose();
EXPORT_C_(void) CALLBACK FWshutdown(); EXPORT_C_(void) CALLBACK FWshutdown();
EXPORT_C_(u32) CALLBACK FWread32(u32 addr); EXPORT_C_(u32) CALLBACK FWread32(u32 addr);

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __GSAPI_H__ #ifndef __GSAPI_H__
#define __GSAPI_H__ #define __GSAPI_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
typedef struct _GSdriverInfo { typedef struct _GSdriverInfo {
@ -38,7 +38,7 @@ typedef struct _GSdriverInfo {
// Basic functions. // Basic functions.
EXPORT_C_(s32) GSinit(char *configpath); EXPORT_C_(s32) GSinit(char *configpath);
EXPORT_C_(s32) GSopen(char *Title, bool multithread); EXPORT_C_(s32) GSopen(void *pDisplay, char *Title, bool multithread);
EXPORT_C_(void) GSclose(); EXPORT_C_(void) GSclose();
EXPORT_C_(void) GSshutdown(); EXPORT_C_(void) GSshutdown();
EXPORT_C_(void) GSvsync(int field); EXPORT_C_(void) GSvsync(int field);

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __PADAPI_H__ #ifndef __PADAPI_H__
#define __PADAPI_H__ #define __PADAPI_H__
@ -28,15 +28,15 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
/* PAD plugin API */ /* PAD plugin API */
/* So obsolete that everyone uses it. */ /* So obsolete that everyone uses it. */
// Basic functions. // Basic functions.
EXPORT_C_(s32) CALLBACK PADinit(char *configpath, u32 flags); EXPORT_C_(s32) CALLBACK PADinitEx(char *configpath);
EXPORT_C_(s32) CALLBACK PADopen(); EXPORT_C_(s32) CALLBACK PADopen(void *pDsp);
EXPORT_C_(void) CALLBACK PADclose(); EXPORT_C_(void) CALLBACK PADclose();
EXPORT_C_(void) CALLBACK PADshutdown(); EXPORT_C_(void) CALLBACK PADshutdown();
// PADkeyEvent is called every vsync (return NULL if no event) // PADkeyEvent is called every vsync (return NULL if no event)
@ -58,6 +58,7 @@ EXPORT_C_(u8) CALLBACK PADquery();
EXPORT_C_(void) CALLBACK PADupdate(u8 pad); EXPORT_C_(void) CALLBACK PADupdate(u8 pad);
// Extended functions // Extended functions
EXPORT_C_(s32) CALLBACK PADfreeze(int mode, freezeData *data);
EXPORT_C_(void) CALLBACK PADgsDriverInfo(GSdriverInfo *info); EXPORT_C_(void) CALLBACK PADgsDriverInfo(GSdriverInfo *info);
EXPORT_C_(void) CALLBACK PADconfigure(); EXPORT_C_(void) CALLBACK PADconfigure();
EXPORT_C_(void) CALLBACK PADabout(); EXPORT_C_(void) CALLBACK PADabout();

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __SIOAPI_H__ #ifndef __SIOAPI_H__
#define __SIOAPI_H__ #define __SIOAPI_H__
@ -28,19 +28,27 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
/* SIO plugin API */ /* SIO plugin API */
// basic funcs // basic funcs
s32 CALLBACK SIOinit(char *configpath, u32 port, u32 slot, SIOchangeSlotCB f); // Single plugin can only be PAD, MTAP, RM, or MC. Only load one plugin of each type,
s32 CALLBACK SIOopen(); // 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 SIOclose();
void CALLBACK SIOshutdown(); void CALLBACK SIOshutdown();
u8 CALLBACK SIOstartPoll(u8 value); // Returns 0 if device doesn't exist. Simplifies things. Also means you don't
u8 CALLBACK SIOpoll(u8 value); // have to distinguish between MTAP and PAD SIO plugins.
s32 CALLBACK 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();
// returns: SIO_TYPE_{PAD,MTAP,RM,MC} // returns: SIO_TYPE_{PAD,MTAP,RM,MC}
u32 CALLBACK SIOquery(); u32 CALLBACK SIOquery();

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __SPU2API_H__ #ifndef __SPU2API_H__
#define __SPU2API_H__ #define __SPU2API_H__
@ -28,11 +28,11 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
EXPORT_C_(s32) SPU2init(char *configpath); EXPORT_C_(s32) SPU2init(char *configpath);
EXPORT_C_(s32) SPU2open(); EXPORT_C_(s32) SPU2open(void *pDisplay);
EXPORT_C_(void) SPU2close(); EXPORT_C_(void) SPU2close();
EXPORT_C_(void) SPU2shutdown(); EXPORT_C_(void) SPU2shutdown();
EXPORT_C_(void) SPU2write(u32 mem, u16 value); EXPORT_C_(void) SPU2write(u32 mem, u16 value);

View File

@ -15,8 +15,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __USBAPI_H__ #ifndef __USBAPI_H__
#define __USBAPI_H__ #define __USBAPI_H__
@ -28,7 +28,7 @@
* shadowpcsx2@yahoo.gr, * shadowpcsx2@yahoo.gr,
* and florinsasu@hotmail.com * and florinsasu@hotmail.com
*/ */
#include "Pcsx2Api.h" #include "Pcsx2Api.h"
typedef void (*USBcallback)(int cycles); typedef void (*USBcallback)(int cycles);
@ -36,7 +36,7 @@ typedef int (*USBhandler)(void);
// Basic functions. // Basic functions.
EXPORT_C_(s32) CALLBACK USBinit(char *configpath); EXPORT_C_(s32) CALLBACK USBinit(char *configpath);
EXPORT_C_(s32) CALLBACK USBopen(); EXPORT_C_(s32) CALLBACK USBopen(void *pDisplay);
EXPORT_C_(void) CALLBACK USBclose(); EXPORT_C_(void) CALLBACK USBclose();
EXPORT_C_(void) CALLBACK USBshutdown(); EXPORT_C_(void) CALLBACK USBshutdown();
EXPORT_C_(u8) CALLBACK USBread8(u32 addr); EXPORT_C_(u8) CALLBACK USBread8(u32 addr);