diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 9c8e5a78b9..d792175352 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -40,6 +40,11 @@ bool GSShift = false, GSAlt = false; string s_strIniPath="inis"; const char* s_iniFilename = "GSnull.ini"; +// Because I haven't bothered to get GSOpen2 working in Windows yet in GSNull. +#ifdef __LINUX__ +#define USE_GSOPEN2 +#endif + void (*GSirq)(); EXPORT_C_(u32) PS2EgetLibType() @@ -124,9 +129,7 @@ EXPORT_C_(void) GSshutdown() EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) { int err = 0; -#ifdef GS_LOG GS_LOG("GS open\n"); -#endif //assert( GSirq != NULL ); err = GSOpenWindow(pDsp, Title); @@ -135,6 +138,18 @@ EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) return err; } +#ifdef USE_GSOPEN2 +EXPORT_C_(s32) GSopen2( void *pDsp, u32 flags ) +{ + GS_LOG("GS open2\n"); + + GSOpenWindow2(pDsp, flags); + + SysPrintf("Opening GSnull (2)\n"); + return 0; +} +#endif + EXPORT_C_(void) GSclose() { SysPrintf("Closing GSnull\n"); diff --git a/plugins/GSnull/Linux/GSLinux.cpp b/plugins/GSnull/Linux/GSLinux.cpp index bc52a951cc..5abcf08ff0 100644 --- a/plugins/GSnull/Linux/GSLinux.cpp +++ b/plugins/GSnull/Linux/GSLinux.cpp @@ -17,20 +17,32 @@ #include "GSLinux.h" Display *display; -int screen; +int screen; +GtkScrolledWindow *win; int GSOpenWindow(void *pDsp, char *Title) { display = XOpenDisplay(0); screen = DefaultScreen(display); - if( pDsp != NULL ) + if (pDsp != NULL) *(Display**)pDsp = display; else return -1; return 0; } + +int GSOpenWindow2(void *pDsp, u32 flags) +{ + GtkWidget *widget; + if (pDsp != NULL) + win = *(GtkScrolledWindow**)pDsp; + else + return -1; + + return 0; +} void GSCloseWindow() { diff --git a/plugins/GSnull/Linux/GSLinux.h b/plugins/GSnull/Linux/GSLinux.h index 65c23a5027..0e4e781631 100644 --- a/plugins/GSnull/Linux/GSLinux.h +++ b/plugins/GSnull/Linux/GSLinux.h @@ -21,6 +21,7 @@ #include extern int GSOpenWindow(void *pDsp, char *Title); +extern int GSOpenWindow2(void *pDsp, u32 flags); extern void GSCloseWindow(); extern void GSProcessMessages(); extern void HandleKeyEvent(keyEvent *ev); diff --git a/plugins/onepad/Linux/linux.cpp b/plugins/onepad/Linux/linux.cpp index 84bbe14af5..a86a71ab90 100644 --- a/plugins/onepad/Linux/linux.cpp +++ b/plugins/onepad/Linux/linux.cpp @@ -20,6 +20,7 @@ */ #include "linux.h" +#include Display *GSdsp; @@ -38,9 +39,25 @@ extern string KeyName(int pad, int key); s32 _PADopen(void *pDsp) { - GSdsp = *(Display**)pDsp; - SetAutoRepeat(false); + GtkScrolledWindow *win; + + win = *(GtkScrolledWindow**) pDsp; + PAD_LOG("It is a '%s'", GTK_OBJECT_TYPE_NAME(&win)); + if (GTK_IS_WIDGET(win)) + { + // Since we have a GtkScrolledWindow, for now we'll grab whatever display + // comes along instead. Later, we can fiddle with this, but I'm not sure the + // best way to get a Display* out of a GtkScrolledWindow. A GtkWindow I might + // be able to manage... --arcum42 + GSdsp = GDK_DISPLAY(); + } + else + { + GSdsp = *(Display**)pDsp; + } + + SetAutoRepeat(false); return 0; } diff --git a/plugins/onepad/keyboard.cpp b/plugins/onepad/keyboard.cpp index eb60646ce0..48397e0934 100644 --- a/plugins/onepad/keyboard.cpp +++ b/plugins/onepad/keyboard.cpp @@ -50,21 +50,24 @@ char* KeysymToChar(int keysym) void PollForKeyboardInput(int pad) { #ifdef __LINUX__ - PollForX11KeyboardInput(pad); + PollForX11KeyboardInput(pad); #endif } void SetAutoRepeat(bool autorep) { #ifdef __LINUX__ - if (autorep) - XAutoRepeatOn(GSdsp); - else - XAutoRepeatOff(GSdsp); + if (toggleAutoRepeat) + { + if (autorep) + XAutoRepeatOn(GSdsp); + else + XAutoRepeatOff(GSdsp); + } #endif } - #ifdef __LINUX__ +#ifdef __LINUX__ void PollForX11KeyboardInput(int pad) { XEvent E; diff --git a/plugins/onepad/onepad.cpp b/plugins/onepad/onepad.cpp index dfe3a46d2b..d01ba93dee 100644 --- a/plugins/onepad/onepad.cpp +++ b/plugins/onepad/onepad.cpp @@ -44,6 +44,7 @@ u16 status[2]; int pressure; static keyEvent s_event; string s_strIniPath = "inis/OnePAD.ini"; +bool toggleAutoRepeat = true; const u32 version = PS2E_PAD_VERSION; const u32 revision = 0; @@ -118,10 +119,7 @@ u8 stdmodel[2][8] = { u8 *buf; int padID[2]; int padMode[2]; -int curPad; -int curByte; -int curCmd; -int cmdLen; +int curPad, curByte, curCmd, cmdLen; int ds2mode = 0; // DS Mode at start FILE *padLog = NULL; @@ -246,10 +244,10 @@ EXPORT_C_(s32) PADinit(u32 flags) status[1] = 0xffff; #ifdef __LINUX__ - char strcurdir[256]; + /*char strcurdir[256]; getcwd(strcurdir, 256); s_strIniPath = strcurdir; - s_strIniPath += "/inis/OnePAD.ini"; + s_strIniPath += "/inis/OnePAD.ini";*/ #endif LoadConfig(); diff --git a/plugins/onepad/onepad.h b/plugins/onepad/onepad.h index da9b60fd8e..bc00f5a180 100644 --- a/plugins/onepad/onepad.h +++ b/plugins/onepad/onepad.h @@ -66,6 +66,8 @@ enum PadOptions extern FILE *padLog; extern void initLogging(); +extern bool toggleAutoRepeat; + #define PAD_LOG __Log //#define PAD_LOG __LogToConsole