Fix crash if selected settings window does not open
[lsnes.git] / src / platform / macosx / sdl-sysjoy-interface.h
blobaca5322f6b54da9f9834276613bea69b617eaeef
1 #ifndef _sdl__sysjoy__interface__included__
2 #define _sdl__sysjoy__interface__included__
4 #include <stdint.h>
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 struct joystick_hwdata;
12 typedef struct _SDL_Joystick
14 int index;
15 const char* name;
16 int naxes;
17 int nhats;
18 int nballs;
19 int nbuttons;
20 struct joystick_hwdata* hwdata;
21 int16_t axes[256];
22 uint8_t hats[256];
23 uint8_t buttons[256];
24 } SDL_Joystick;
26 #define SDL_HAT_UP 1
27 #define SDL_HAT_RIGHTUP 2
28 #define SDL_HAT_RIGHT 3
29 #define SDL_HAT_RIGHTDOWN 4
30 #define SDL_HAT_DOWN 5
31 #define SDL_HAT_LEFTDOWN 6
32 #define SDL_HAT_LEFT 7
33 #define SDL_HAT_LEFTUP 8
34 #define SDL_HAT_CENTERED 0
36 typedef uint8_t Uint8;
38 //Driver -> Wrapper.
39 extern uint8_t SDL_numjoysticks;
40 int SDL_PrivateJoystickAxis(SDL_Joystick* j, uint8_t axis, int16_t value);
41 int SDL_PrivateJoystickBall(SDL_Joystick* j, uint8_t ball, int16_t dx, int16_t dy);
42 int SDL_PrivateJoystickHat(SDL_Joystick* j, uint8_t hat, uint8_t val);
43 int SDL_PrivateJoystickButton(SDL_Joystick* j, uint8_t button, uint8_t state);
44 void SDL_SetError(const char* err);
45 //Wrapper -> Driver.
46 int SDL_SYS_JoystickInit(void);
47 const char *SDL_SYS_JoystickName(int index);
48 int SDL_SYS_JoystickOpen(SDL_Joystick *joystick);
49 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick);
50 void SDL_SYS_JoystickClose(SDL_Joystick *joystick);
51 void SDL_SYS_JoystickQuit(void);
53 #ifdef __cplusplus
55 #endif
56 #endif