1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2001 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
19 /* values for the joystick */
20 #define JOYSTICK_OFF 0
21 #define JOYSTICK_AVAILABLE 1
24 #include <machine/joystick.h>
25 #define DEV_JOYSTICK_0 "/dev/joy0"
26 #define DEV_JOYSTICK_1 "/dev/joy1"
27 #define DEV_JOYSTICK_2 "/dev/joy2"
28 #define DEV_JOYSTICK_3 "/dev/joy3"
30 #define DEV_JOYSTICK_0 "/dev/js0"
31 #define DEV_JOYSTICK_1 "/dev/js1"
32 #define DEV_JOYSTICK_2 "/dev/js2"
33 #define DEV_JOYSTICK_3 "/dev/js3"
36 /* get these values from the program 'js' from the joystick package, */
37 /* set JOYSTICK_PERCENT to a threshold appropriate for your joystick */
40 #define JOYSTICK_XLEFT -32767
41 #define JOYSTICK_XMIDDLE 0
42 #define JOYSTICK_XRIGHT 32767
43 #define JOYSTICK_YUPPER -32767
44 #define JOYSTICK_YMIDDLE 0
45 #define JOYSTICK_YLOWER 32767
47 #define JOYSTICK_XLEFT 30
48 #define JOYSTICK_XMIDDLE 530
49 #define JOYSTICK_XRIGHT 1250
50 #define JOYSTICK_YUPPER 40
51 #define JOYSTICK_YMIDDLE 680
52 #define JOYSTICK_YLOWER 1440
55 #define JOYSTICK_PERCENT 25
57 #define JOY_LEFT MV_LEFT
58 #define JOY_RIGHT MV_RIGHT
60 #define JOY_DOWN MV_DOWN
61 #define JOY_BUTTON_1 (1<<4)
62 #define JOY_BUTTON_2 (1<<5)
63 #define JOY_BUTTON (JOY_BUTTON_1 | JOY_BUTTON_2)
65 #define JOY_BUTTON_NOT_PRESSED 0
66 #define JOY_BUTTON_PRESSED 1
67 #define JOY_BUTTON_NEW_PRESSED 2
68 #define JOY_BUTTON_NEW_RELEASED 3
71 #define JOYSTICK_STATUS JOYSTICK_OFF
73 #define JOYSTICK_STATUS JOYSTICK_AVAILABLE
77 #if defined(TARGET_SDL)
78 SDL_Joystick *Get_SDL_Joystick(int);
79 boolean Open_SDL_Joystick(int);
80 void Close_SDL_Joystick(int);
81 boolean Check_SDL_JoystickOpened(int);
82 void HandleJoystickEvent(Event *);
83 int Get_SDL_Joystick_Axis(int, int);
86 void CheckJoystickData(void);
88 int JoystickButton(int);
89 int AnyJoystick(void);
90 int AnyJoystickButton(void);
92 #endif /* JOYSTICK_H */