Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

Joystick port driver for Shark

Structures:

JOY_STATE = Describe the position and buttons state of a joystick
        int x;
        int y;
        char b1;
        char b2;

JOY_BUTTONS = Describe the four buttons state of a joystick
        char b1;
        char b2;
        char b3;
        char b4;

JOY_BOUND = Describe the position boundaries of a joystick
        int x_min;
        int y_min;
        int x_max;
        int y_max;

Functions:

int  get_joystick_bound_A(JOY_BOUND *jb);
int  get_joystick_bound_B(JOY_BOUND *jb);
        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.

int  get_joystick_A(JOY_STATE *js);
int  get_joystick_B(JOY_STATE *js);
        Get (x,y) position and buttons status of a joystick.

int  get_joystick_AB(JOY_STATE *jsa, JOY_STATE *jsb);
        Get (x,y) position and buttons status of both joysticks.

void get_joystick_buttons(JOY_BUTTONS *jb);
        Get buttons status.