Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
361 giacomo 1
Joystick port driver for Shark
2
 
3
Structures:
4
 
5
JOY_STATE = Describe the position and buttons state of a joystick
6
	int x;
7
	int y;
8
	char b1;
9
	char b2;
10
 
11
JOY_BUTTONS = Describe the four buttons state of a joystick
12
	char b1;
13
	char b2;
14
	char b3;
15
	char b4;
16
 
17
JOY_BOUND = Describe the position boundaries of a joystick
18
	int x_min;
19
	int y_min;
20
	int x_max;
21
	int y_max;
22
 
23
Functions:
24
 
25
int  get_joystick_bound_A(JOY_BOUND *jb);
26
int  get_joystick_bound_B(JOY_BOUND *jb);
27
	Read, in a loop, x and y position of a joystick until a joystick button is pressed. Usefull to acquire min and max value for x and y axis.
28
 
29
int  get_joystick_A(JOY_STATE *js);
30
int  get_joystick_B(JOY_STATE *js);
31
	Get (x,y) position and buttons status of a joystick.
32
 
33
int  get_joystick_AB(JOY_STATE *jsa, JOY_STATE *jsb);
34
	Get (x,y) position and buttons status of both joysticks.
35
 
36
void get_joystick_buttons(JOY_BUTTONS *jb);
37
	Get buttons status.