X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fcli%2Fsdl-joystick.c;h=1a3fecfcf006f8f9dc842a138995ce65d4f16de8;hb=63bd5be0436de94860a00c34048fa4c6c131ece3;hp=167c777e71b3f6525e8cad2496aab44e9872a4d6;hpb=5232c20c0fa2c80964fe1d3f597c239bcf93d6fc;p=fceu.git diff --git a/drivers/cli/sdl-joystick.c b/drivers/cli/sdl-joystick.c index 167c777..1a3fecf 100644 --- a/drivers/cli/sdl-joystick.c +++ b/drivers/cli/sdl-joystick.c @@ -27,8 +27,8 @@ #include #include "sdl.h" -#ifndef GP2X static SDL_Joystick *jo[4] = {NULL, NULL, NULL, NULL}; + static void ConfigJoystick (int z); #define JOY_A 0x01 @@ -39,12 +39,10 @@ static void ConfigJoystick (int z); #define JOY_DOWN 0x20 #define JOY_LEFT 0x40 #define JOY_RIGHT 0x80 -#endif /* Gets the current joystick position information. */ uint32 GetJSOr (void) { -#ifndef GP2X int n; /* joystick index */ int b; /* button index */ int *joym; /* pointer to a joystick's button map */ @@ -78,15 +76,11 @@ uint32 GetJSOr (void) } return ret; -#else - return 0; -#endif } /* Cleanup opened joysticks. */ void KillJoysticks (void) { -#ifndef GP2X int n; /* joystick index */ for (n = 0; n < 4; n++) @@ -96,13 +90,11 @@ void KillJoysticks (void) } SDL_QuitSubSystem(SDL_INIT_JOYSTICK); return; -#endif } /* Initialize joysticks. */ int InitJoysticks (void) { -#ifndef GP2X int n; /* joystick index */ if(!(joy[0]|joy[1]|joy[2]|joy[3])) return(0); @@ -131,7 +123,6 @@ int InitJoysticks (void) } return (1); -#endif } #define WNOINPUT(); for(;;){uint8 t; if(read(fileno(stdin),&t,1)==-1) \ @@ -140,7 +131,6 @@ int InitJoysticks (void) /* Configure a joystick button. */ static void BConfig (int n, int b) { -#ifndef GP2X SDL_Event event; /* SDL event structure */ WNOINPUT(); while (1) @@ -165,13 +155,11 @@ static void BConfig (int n, int b) WNOINPUT(); return; -#endif } /* Joystick button and axis configuration. */ void ConfigJoystick (int n) { -#ifndef GP2X int sa; /* buffer value */ char buf[128]; /* input buffer */ @@ -209,5 +197,4 @@ void ConfigJoystick (int n) BConfig(n, 0); fcntl(fileno(stdin), F_SETFL, sa); -#endif }