summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-01-02 21:17:12 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-01-02 21:17:12 +0000
commitf0e0e3d0fdcb81b82fb2d554f2350f9ea135b0e9 (patch)
treedd6d10dd82117dab0de37c2cefdaff39791b64d8 /libpcsxcore
parentff50ab7210911eb6c49914b68102e18803b7d944 (diff)
downloadpcsxr-f0e0e3d0fdcb81b82fb2d554f2350f9ea135b0e9.tar.gz
Visual vibration interface.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@61703 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/plugins.c33
-rw-r--r--libpcsxcore/plugins.h31
2 files changed, 39 insertions, 25 deletions
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c
index 1bfeb132..0e0696a8 100644
--- a/libpcsxcore/plugins.c
+++ b/libpcsxcore/plugins.c
@@ -29,7 +29,7 @@ static s64 cdOpenCaseTime = 0;
GPUupdateLace GPU_updateLace;
GPUinit GPU_init;
-GPUshutdown GPU_shutdown;
+GPUshutdown GPU_shutdown;
GPUconfigure GPU_configure;
GPUtest GPU_test;
GPUabout GPU_about;
@@ -38,7 +38,7 @@ GPUclose GPU_close;
GPUreadStatus GPU_readStatus;
GPUreadData GPU_readData;
GPUreadDataMem GPU_readDataMem;
-GPUwriteStatus GPU_writeStatus;
+GPUwriteStatus GPU_writeStatus;
GPUwriteData GPU_writeData;
GPUwriteDataMem GPU_writeDataMem;
GPUdmaChain GPU_dmaChain;
@@ -52,11 +52,12 @@ GPUclearDynarec GPU_clearDynarec;
GPUvBlank GPU_vBlank;
GPUregisterCallback GPU_registerCallback;
GPUidle GPU_idle;
+GPUvisualVibration GPU_visualVibration;
CDRinit CDR_init;
CDRshutdown CDR_shutdown;
CDRopen CDR_open;
-CDRclose CDR_close;
+CDRclose CDR_close;
CDRtest CDR_test;
CDRgetTN CDR_getTN;
CDRgetTD CDR_getTD;
@@ -106,6 +107,7 @@ PADkeypressed PAD1_keypressed;
PADstartPoll PAD1_startPoll;
PADpoll PAD1_poll;
PADsetSensitive PAD1_setSensitive;
+PADregisterVibration PAD1_registerVibration;
PADconfigure PAD2_configure;
PADabout PAD2_about;
@@ -120,11 +122,12 @@ PADkeypressed PAD2_keypressed;
PADstartPoll PAD2_startPoll;
PADpoll PAD2_poll;
PADsetSensitive PAD2_setSensitive;
+PADregisterVibration PAD2_registerVibration;
NETinit NET_init;
NETshutdown NET_shutdown;
NETopen NET_open;
-NETclose NET_close;
+NETclose NET_close;
NETtest NET_test;
NETconfigure NET_configure;
NETabout NET_about;
@@ -143,7 +146,7 @@ NETkeypressed NET_keypressed;
SIO1init SIO1_init;
SIO1shutdown SIO1_shutdown;
SIO1open SIO1_open;
-SIO1close SIO1_close;
+SIO1close SIO1_close;
SIO1test SIO1_test;
SIO1configure SIO1_configure;
SIO1about SIO1_about;
@@ -198,7 +201,7 @@ void CALLBACK GPUbusy( int ticks )
{
//printf( "GPUbusy( %i )\n", ticks );
//fflush( 0 );
-
+
psxRegs.interrupt |= (1 << PSXINT_GPUBUSY);
psxRegs.intCycle[PSXINT_GPUBUSY].cycle = ticks;
psxRegs.intCycle[PSXINT_GPUBUSY].sCycle = psxRegs.cycle;
@@ -213,8 +216,9 @@ long CALLBACK GPU__getScreenPic(unsigned char *pMem) { return -1; }
long CALLBACK GPU__showScreenPic(unsigned char *pMem) { return -1; }
void CALLBACK GPU__clearDynarec(void (CALLBACK *callback)(void)) {}
void CALLBACK GPU__vBlank(int val) {}
-void CALLBACK GPU__registerCallback(void (CALLBACK *callback)(int)) {};
+void CALLBACK GPU__registerCallback(void (CALLBACK *callback)(int)) {}
void CALLBACK GPU__idle(void) {}
+void CALLBACK GPU__visualVibration(unsigned long iSmall, unsigned long iBig) {}
#define LoadGpuSym1(dest, name) \
LoadSym(GPU_##dest, GPU##dest, name, TRUE);
@@ -230,9 +234,9 @@ static int LoadGPUplugin(const char *GPUdll) {
void *drv;
hGPUDriver = SysLoadLibrary(GPUdll);
- if (hGPUDriver == NULL) {
+ if (hGPUDriver == NULL) {
GPU_configure = NULL;
- SysMessage (_("Could not load GPU plugin %s!"), GPUdll); return -1;
+ SysMessage (_("Could not load GPU plugin %s!"), GPUdll); return -1;
}
drv = hGPUDriver;
LoadGpuSym1(init, "GPUinit");
@@ -257,6 +261,7 @@ static int LoadGPUplugin(const char *GPUdll) {
LoadGpuSym0(vBlank, "GPUvBlank");
LoadGpuSym0(registerCallback, "GPUregisterCallback");
LoadGpuSym0(idle, "GPUidle");
+ LoadGpuSym0(visualVibration, "GPUvisualVibration");
LoadGpuSym0(configure, "GPUconfigure");
LoadGpuSym0(test, "GPUtest");
LoadGpuSym0(about, "GPUabout");
@@ -364,7 +369,7 @@ static int LoadSPUplugin(const char *SPUdll) {
LoadSpuSym0(about, "SPUabout");
LoadSpuSym0(test, "SPUtest");
LoadSpuSym1(writeRegister, "SPUwriteRegister");
- LoadSpuSym1(readRegister, "SPUreadRegister");
+ LoadSpuSym1(readRegister, "SPUreadRegister");
LoadSpuSym1(writeDMA, "SPUwriteDMA");
LoadSpuSym1(readDMA, "SPUreadDMA");
LoadSpuSym1(writeDMAMem, "SPUwriteDMAMem");
@@ -473,6 +478,7 @@ void CALLBACK PAD1__about(void) {}
long CALLBACK PAD1__test(void) { return 0; }
long CALLBACK PAD1__query(void) { return 3; }
long CALLBACK PAD1__keypressed() { return 0; }
+void CALLBACK PAD1__registerVibration(void (CALLBACK *callback)(unsigned long, unsigned long)) {}
#define LoadPad1Sym1(dest, name) \
LoadSym(PAD1_##dest, PAD##dest, name, TRUE);
@@ -506,6 +512,7 @@ static int LoadPAD1plugin(const char *PAD1dll) {
LoadPad1Sym0(startPoll, "PADstartPoll");
LoadPad1Sym0(poll, "PADpoll");
LoadPad1SymN(setSensitive, "PADsetSensitive");
+ LoadPad1Sym0(registerVibration, "PADregisterVibration");
return 0;
}
@@ -514,7 +521,7 @@ unsigned char CALLBACK PAD2__startPoll(int pad) {
PadDataS padd;
PAD2_readPort2(&padd);
-
+
return _PADstartPoll(&padd);
}
@@ -527,6 +534,7 @@ void CALLBACK PAD2__about(void) {}
long CALLBACK PAD2__test(void) { return 0; }
long CALLBACK PAD2__query(void) { return PSE_PAD_USE_PORT1 | PSE_PAD_USE_PORT2; }
long CALLBACK PAD2__keypressed() { return 0; }
+void CALLBACK PAD2__registerVibration(void (CALLBACK *callback)(unsigned long, unsigned long)) {}
#define LoadPad2Sym1(dest, name) \
LoadSym(PAD2_##dest, PAD##dest, name, TRUE);
@@ -560,6 +568,7 @@ static int LoadPAD2plugin(const char *PAD2dll) {
LoadPad2Sym0(startPoll, "PADstartPoll");
LoadPad2Sym0(poll, "PADpoll");
LoadPad2SymN(setSensitive, "PADsetSensitive");
+ LoadPad2Sym0(registerVibration, "PADregisterVibration");
return 0;
}
@@ -789,7 +798,7 @@ void ReleasePlugins() {
if (hPAD1Driver != NULL) PAD1_shutdown();
if (hPAD2Driver != NULL) PAD2_shutdown();
- if (Config.UseNet && hNETDriver != NULL) NET_shutdown();
+ if (Config.UseNet && hNETDriver != NULL) NET_shutdown();
if (hCDRDriver != NULL) SysCloseLibrary(hCDRDriver); hCDRDriver = NULL;
if (hGPUDriver != NULL) SysCloseLibrary(hGPUDriver); hGPUDriver = NULL;
diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h
index 37957a13..430f84e1 100644
--- a/libpcsxcore/plugins.h
+++ b/libpcsxcore/plugins.h
@@ -96,11 +96,12 @@ typedef void (CALLBACK* GPUclearDynarec)(void (CALLBACK *callback)(void));
typedef void (CALLBACK* GPUvBlank)(int);
typedef void (CALLBACK* GPUregisterCallback)(void (CALLBACK *callback)(int));
typedef void (CALLBACK* GPUidle)(void);
+typedef void (CALLBACK* GPUvisualVibration)(unsigned long, unsigned long);
// GPU function pointers
extern GPUupdateLace GPU_updateLace;
extern GPUinit GPU_init;
-extern GPUshutdown GPU_shutdown;
+extern GPUshutdown GPU_shutdown;
extern GPUconfigure GPU_configure;
extern GPUtest GPU_test;
extern GPUabout GPU_about;
@@ -109,7 +110,7 @@ extern GPUclose GPU_close;
extern GPUreadStatus GPU_readStatus;
extern GPUreadData GPU_readData;
extern GPUreadDataMem GPU_readDataMem;
-extern GPUwriteStatus GPU_writeStatus;
+extern GPUwriteStatus GPU_writeStatus;
extern GPUwriteData GPU_writeData;
extern GPUwriteDataMem GPU_writeDataMem;
extern GPUdmaChain GPU_dmaChain;
@@ -123,6 +124,7 @@ extern GPUclearDynarec GPU_clearDynarec;
extern GPUvBlank GPU_vBlank;
extern GPUregisterCallback GPU_registerCallback;
extern GPUidle GPU_idle;
+extern GPUvisualVibration GPU_visualVibration;
// CD-ROM Functions
typedef long (CALLBACK* CDRinit)(void);
@@ -165,7 +167,7 @@ typedef long (CALLBACK* CDRgetTE)(unsigned char, unsigned char *, unsigned char
extern CDRinit CDR_init;
extern CDRshutdown CDR_shutdown;
extern CDRopen CDR_open;
-extern CDRclose CDR_close;
+extern CDRclose CDR_close;
extern CDRtest CDR_test;
extern CDRgetTN CDR_getTN;
extern CDRgetTD CDR_getTD;
@@ -183,10 +185,10 @@ extern CDRreadCDDA CDR_readCDDA;
extern CDRgetTE CDR_getTE;
// SPU Functions
-typedef long (CALLBACK* SPUinit)(void);
-typedef long (CALLBACK* SPUshutdown)(void);
-typedef long (CALLBACK* SPUclose)(void);
-typedef void (CALLBACK* SPUplaySample)(unsigned char);
+typedef long (CALLBACK* SPUinit)(void);
+typedef long (CALLBACK* SPUshutdown)(void);
+typedef long (CALLBACK* SPUclose)(void);
+typedef void (CALLBACK* SPUplaySample)(unsigned char);
typedef void (CALLBACK* SPUwriteRegister)(unsigned long, unsigned short);
typedef unsigned short (CALLBACK* SPUreadRegister)(unsigned long);
typedef void (CALLBACK* SPUwriteDMA)(unsigned short);
@@ -236,8 +238,8 @@ extern SPUplayCDDAchannel SPU_playCDDAchannel;
typedef long (CALLBACK* PADconfigure)(void);
typedef void (CALLBACK* PADabout)(void);
typedef long (CALLBACK* PADinit)(long);
-typedef long (CALLBACK* PADshutdown)(void);
-typedef long (CALLBACK* PADtest)(void);
+typedef long (CALLBACK* PADshutdown)(void);
+typedef long (CALLBACK* PADtest)(void);
typedef long (CALLBACK* PADclose)(void);
typedef long (CALLBACK* PADquery)(void);
typedef long (CALLBACK* PADreadPort1)(PadDataS*);
@@ -246,6 +248,7 @@ typedef long (CALLBACK* PADkeypressed)(void);
typedef unsigned char (CALLBACK* PADstartPoll)(int);
typedef unsigned char (CALLBACK* PADpoll)(unsigned char);
typedef void (CALLBACK* PADsetSensitive)(int);
+typedef void (CALLBACK* PADregisterVibration)(void (CALLBACK *callback)(unsigned long, unsigned long));
// PAD function pointers
extern PADconfigure PAD1_configure;
@@ -261,6 +264,7 @@ extern PADkeypressed PAD1_keypressed;
extern PADstartPoll PAD1_startPoll;
extern PADpoll PAD1_poll;
extern PADsetSensitive PAD1_setSensitive;
+extern PADregisterVibration PAD1_registerVibration;
extern PADconfigure PAD2_configure;
extern PADabout PAD2_about;
@@ -275,6 +279,7 @@ extern PADkeypressed PAD2_keypressed;
extern PADstartPoll PAD2_startPoll;
extern PADpoll PAD2_poll;
extern PADsetSensitive PAD2_setSensitive;
+extern PADregisterVibration PAD2_registerVibration;
// NET Functions
typedef long (CALLBACK* NETinit)(void);
@@ -311,11 +316,11 @@ typedef struct {
typedef long (CALLBACK* NETsetInfo)(netInfo *);
typedef long (CALLBACK* NETkeypressed)(int);
-// NET function pointers
+// NET function pointers
extern NETinit NET_init;
extern NETshutdown NET_shutdown;
extern NETopen NET_open;
-extern NETclose NET_close;
+extern NETclose NET_close;
extern NETtest NET_test;
extern NETconfigure NET_configure;
extern NETabout NET_about;
@@ -365,11 +370,11 @@ typedef unsigned short (CALLBACK* SIO1readBaud16)(void);
typedef unsigned long (CALLBACK* SIO1readBaud32)(void);
typedef void (CALLBACK* SIO1registerCallback)(void (CALLBACK *callback)(void));
-// SIO1 function pointers
+// SIO1 function pointers
extern SIO1init SIO1_init;
extern SIO1shutdown SIO1_shutdown;
extern SIO1open SIO1_open;
-extern SIO1close SIO1_close;
+extern SIO1close SIO1_close;
extern SIO1test SIO1_test;
extern SIO1configure SIO1_configure;
extern SIO1about SIO1_about;