joy.h File Reference

Joystick related functions. More...

Go to the source code of this file.

Defines

#define JOY_1   0x0
 The player 1 joystick.
#define JOY_2   0x1
 The player 2 joystick.
#define JOY_3   0x2
 The player 3 joystick (with the ea4way).
#define JOY_4   0x3
 The player 4 joystick (with the ea4way).
#define JOY_EXT   0x2
 The ext joystick.
#define JOY_UP   0x1
 The Up arrow.
#define JOY_DOWN   0x2
 The Down arrow.
#define JOY_LEFT   0x004
 The Left arrow.
#define JOY_RIGHT   0x008
 The Right arrow.
#define JOY_B   0x010
 The B button.
#define JOY_C   0x020
 The C button.
#define JOY_A   0x040
 The A button.
#define JOY_START   0x080
 The START button.
#define JOY_X   0x400
 The X button.
#define JOY_Y   0x200
 The Y button.
#define JOY_Z   0x100
 The Z button.
#define JOY_MODE   0x800
 The MODE button.
#define JOY_IS_PRESSED(x, y)   ((x & y) != 0)
 Check if the button is pressed.
#define JOY_NONE   0x0
 Means that no joypad is connected.
#define JOY_3BTS   0x1
 Standard 3 buttons joypad.
#define JOY_6BTS   0x2
 Standard B buttons joypad.

Functions

void joy_init (void)
 initialize the joysticks
u8 joy_gettype (u8 joy_num)
 Return the type of the joypad (3 buttons or 6 buttons).
u16 joy_read (u8 joy_num, u8 type)
 Read the input for the joystick.
void joy_ea4way_set (u8 joy_num)
 Set the joystick number to read for the ea4way.
u8 joy_isea4way (void)
 Test is an ea4way is connected.

Detailed Description

Joystick related functions.


Function Documentation

void joy_ea4way_set ( u8  joy_num  ) 

Set the joystick number to read for the ea4way.

Parameters:
joy_num The joystick number to read
u8 joy_gettype ( u8  joy_num  ) 

Return the type of the joypad (3 buttons or 6 buttons).

Parameters:
joy_num The joystick number to read
void joy_init ( void   ) 

initialize the joysticks

To call before anything else

u8 joy_isea4way ( void   ) 

Test is an ea4way is connected.

Return 1 if true, else 0

u16 joy_read ( u8  joy_num,
u8  type 
)

Read the input for the joystick.

Parameters:
joy_num The joystick number to read
type The type of joystick to read
 All Files Functions Variables Typedefs Defines

Generated on Sat Jan 16 19:02:43 2010 for libsmd by  doxygen 1.6.1