From 7fc90b21f5172684e1b01307fdc0d3985bfee64d Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Mon, 3 Jan 2011 21:43:14 +0000 Subject: Gun sight interface. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@61728 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- gui/Plugin.c | 2 ++ libpcsxcore/plugins.c | 9 +++++++++ libpcsxcore/plugins.h | 6 +++++- macosx/Plugin.c | 2 ++ win32/gui/plugin.c | 2 ++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gui/Plugin.c b/gui/Plugin.c index 99afab83..67ef1472 100644 --- a/gui/Plugin.c +++ b/gui/Plugin.c @@ -330,9 +330,11 @@ int _OpenPlugins() { ret = PAD1_open(&gpuDisp); if (ret < 0) { SysMessage(_("Error opening Controller 1 plugin!")); return -1; } PAD1_registerVibration(GPU_visualVibration); + PAD1_registerCursor(GPU_cursor); ret = PAD2_open(&gpuDisp); if (ret < 0) { SysMessage(_("Error opening Controller 2 plugin!")); return -1; } PAD2_registerVibration(GPU_visualVibration); + PAD2_registerCursor(GPU_cursor); if (Config.UseNet && !NetOpened) { netInfo info; diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index 0e0696a8..dca6e7b6 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -53,6 +53,7 @@ GPUvBlank GPU_vBlank; GPUregisterCallback GPU_registerCallback; GPUidle GPU_idle; GPUvisualVibration GPU_visualVibration; +GPUcursor GPU_cursor; CDRinit CDR_init; CDRshutdown CDR_shutdown; @@ -108,6 +109,7 @@ PADstartPoll PAD1_startPoll; PADpoll PAD1_poll; PADsetSensitive PAD1_setSensitive; PADregisterVibration PAD1_registerVibration; +PADregisterCursor PAD1_registerCursor; PADconfigure PAD2_configure; PADabout PAD2_about; @@ -123,6 +125,7 @@ PADstartPoll PAD2_startPoll; PADpoll PAD2_poll; PADsetSensitive PAD2_setSensitive; PADregisterVibration PAD2_registerVibration; +PADregisterCursor PAD2_registerCursor; NETinit NET_init; NETshutdown NET_shutdown; @@ -219,6 +222,7 @@ void CALLBACK GPU__vBlank(int val) {} void CALLBACK GPU__registerCallback(void (CALLBACK *callback)(int)) {} void CALLBACK GPU__idle(void) {} void CALLBACK GPU__visualVibration(unsigned long iSmall, unsigned long iBig) {} +void CALLBACK GPU__cursor(int player, int x, int y) {} #define LoadGpuSym1(dest, name) \ LoadSym(GPU_##dest, GPU##dest, name, TRUE); @@ -262,6 +266,7 @@ static int LoadGPUplugin(const char *GPUdll) { LoadGpuSym0(registerCallback, "GPUregisterCallback"); LoadGpuSym0(idle, "GPUidle"); LoadGpuSym0(visualVibration, "GPUvisualVibration"); + LoadGpuSym0(cursor, "GPUcursor"); LoadGpuSym0(configure, "GPUconfigure"); LoadGpuSym0(test, "GPUtest"); LoadGpuSym0(about, "GPUabout"); @@ -479,6 +484,7 @@ 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)) {} +void CALLBACK PAD1__registerCursor(void (CALLBACK *callback)(int, int, int)) {} #define LoadPad1Sym1(dest, name) \ LoadSym(PAD1_##dest, PAD##dest, name, TRUE); @@ -513,6 +519,7 @@ static int LoadPAD1plugin(const char *PAD1dll) { LoadPad1Sym0(poll, "PADpoll"); LoadPad1SymN(setSensitive, "PADsetSensitive"); LoadPad1Sym0(registerVibration, "PADregisterVibration"); + LoadPad1Sym0(registerCursor, "PADregisterCursor"); return 0; } @@ -535,6 +542,7 @@ 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)) {} +void CALLBACK PAD2__registerCursor(void (CALLBACK *callback)(int, int, int)) {} #define LoadPad2Sym1(dest, name) \ LoadSym(PAD2_##dest, PAD##dest, name, TRUE); @@ -569,6 +577,7 @@ static int LoadPAD2plugin(const char *PAD2dll) { LoadPad2Sym0(poll, "PADpoll"); LoadPad2SymN(setSensitive, "PADsetSensitive"); LoadPad2Sym0(registerVibration, "PADregisterVibration"); + LoadPad2Sym0(registerCursor, "PADregisterCursor"); return 0; } diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index 430f84e1..4ddcae82 100644 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -97,6 +97,7 @@ 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); +typedef void (CALLBACK* GPUcursor)(int, int, int); // GPU function pointers extern GPUupdateLace GPU_updateLace; @@ -125,6 +126,7 @@ extern GPUvBlank GPU_vBlank; extern GPUregisterCallback GPU_registerCallback; extern GPUidle GPU_idle; extern GPUvisualVibration GPU_visualVibration; +extern GPUcursor GPU_cursor; // CD-ROM Functions typedef long (CALLBACK* CDRinit)(void); @@ -249,6 +251,7 @@ 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)); +typedef void (CALLBACK* PADregisterCursor)(void (CALLBACK *callback)(int, int, int)); // PAD function pointers extern PADconfigure PAD1_configure; @@ -265,7 +268,7 @@ extern PADstartPoll PAD1_startPoll; extern PADpoll PAD1_poll; extern PADsetSensitive PAD1_setSensitive; extern PADregisterVibration PAD1_registerVibration; - +extern PADregisterCursor PAD1_registerCursor; extern PADconfigure PAD2_configure; extern PADabout PAD2_about; extern PADinit PAD2_init; @@ -280,6 +283,7 @@ extern PADstartPoll PAD2_startPoll; extern PADpoll PAD2_poll; extern PADsetSensitive PAD2_setSensitive; extern PADregisterVibration PAD2_registerVibration; +extern PADregisterCursor PAD2_registerCursor; // NET Functions typedef long (CALLBACK* NETinit)(void); diff --git a/macosx/Plugin.c b/macosx/Plugin.c index c5c450d2..4710b057 100644 --- a/macosx/Plugin.c +++ b/macosx/Plugin.c @@ -93,9 +93,11 @@ int _OpenPlugins() { ret = PAD1_open(&gpuDisp); if (ret < 0) { SysMessage(_("Error Opening PAD1 Plugin")); return -1; } PAD1_registerVibration(GPU_visualVibration); + PAD1_registerCursor(GPU_cursor); ret = PAD2_open(&gpuDisp); if (ret < 0) { SysMessage(_("Error Opening PAD2 Plugin")); return -1; } PAD2_registerVibration(GPU_visualVibration); + PAD2_registerCursor(GPU_cursor); return 0; } diff --git a/win32/gui/plugin.c b/win32/gui/plugin.c index ccde0c89..f9bfe96f 100644 --- a/win32/gui/plugin.c +++ b/win32/gui/plugin.c @@ -288,9 +288,11 @@ int _OpenPlugins(HWND hWnd) { ret = PAD1_open(hWnd); if (ret < 0) { SysMessage (_("Error Opening PAD1 Plugin (%d)"), ret); return -1; } PAD1_registerVibration(GPU_visualVibration); + PAD1_registerCursor(GPU_cursor); ret = PAD2_open(hWnd); if (ret < 0) { SysMessage (_("Error Opening PAD2 Plugin (%d)"), ret); return -1; } PAD2_registerVibration(GPU_visualVibration); + PAD2_registerCursor(GPU_cursor); SetCurrentDirectory(PcsxDir); ShowCursor(FALSE); -- cgit v1.2.3