1 //
2 // Jaguar joystick handler
3 //
4 
5 #ifndef __JOYSTICK_H__
6 #define __JOYSTICK_H__
7 
8 #include <stdint.h>
9 
10 #include <boolean.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 enum
17 {
18    BUTTON_FIRST = 0,
19    BUTTON_U = 0,
20    BUTTON_D = 1,
21    BUTTON_L = 2,
22    BUTTON_R = 3,
23 
24    BUTTON_s = 4,
25    BUTTON_7 = 5,
26    BUTTON_4 = 6,
27    BUTTON_1 = 7,
28    BUTTON_0 = 8,
29    BUTTON_8 = 9,
30    BUTTON_5 = 10,
31    BUTTON_2 = 11,
32    BUTTON_d = 12,
33    BUTTON_9 = 13,
34    BUTTON_6 = 14,
35    BUTTON_3 = 15,
36 
37    BUTTON_A = 16,
38    BUTTON_B = 17,
39    BUTTON_C = 18,
40    BUTTON_OPTION = 19,
41    BUTTON_PAUSE = 20,
42    BUTTON_LAST = 20
43 };
44 
45 void JoystickInit(void);
46 void JoystickReset(void);
47 void JoystickDone(void);
48 //void JoystickWriteByte(uint32_t, uint8_t);
49 void JoystickWriteWord(uint32_t, uint16_t);
50 //uint8_t JoystickReadByte(uint32_t);
51 uint16_t JoystickReadWord(uint32_t);
52 void JoystickExec(void);
53 
54 extern uint8_t joypad0Buttons[];
55 extern uint8_t joypad1Buttons[];
56 extern bool audioEnabled;
57 extern bool joysticksEnabled;
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif	// __JOYSTICK_H__
64 
65