#include <errno.h>
#include "sdl.h"
-#ifndef GP2X
static SDL_Joystick *jo[4] = {NULL, NULL, NULL, NULL};
+
static void ConfigJoystick (int z);
#define JOY_A 0x01
#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 */
}
return ret;
-#else
- return 0;
-#endif
}
/* Cleanup opened joysticks. */
void KillJoysticks (void)
{
-#ifndef GP2X
int n; /* joystick index */
for (n = 0; n < 4; n++)
}
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);
}
return (1);
-#endif
}
#define WNOINPUT(); for(;;){uint8 t; if(read(fileno(stdin),&t,1)==-1) \
/* Configure a joystick button. */
static void BConfig (int n, int b)
{
-#ifndef GP2X
SDL_Event event; /* SDL event structure */
WNOINPUT();
while (1)
WNOINPUT();
return;
-#endif
}
/* Joystick button and axis configuration. */
void ConfigJoystick (int n)
{
-#ifndef GP2X
int sa; /* buffer value */
char buf[128]; /* input buffer */
BConfig(n, 0);
fcntl(fileno(stdin), F_SETFL, sa);
-#endif
}