ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
Go to the source code of this file.
Functions | |
pad_t * | pad_open (unsigned int port, unsigned int slot, unsigned int mode, unsigned int lock) |
void | pad_close (pad_t *pad) |
int | pad_get_state (pad_t *pad) |
void | pad_wait (pad_t *pad) |
int | pad_get_num_modes (pad_t *pad) |
int | pad_has_type (pad_t *pad, int type) |
int | pad_get_type (pad_t *pad) |
void | pad_set_mode (pad_t *pad, int mode, int lock) |
void | pad_set_sensitivity (pad_t *pad, int enable) |
void | pad_init_actuators (pad_t *pad) |
void | pad_set_actuators (pad_t *pad, int small, unsigned char large) |
void pad_close | ( | pad_t * | pad | ) |
Close the pad
Definition at line 82 of file input.c.
References pad_t::actuator, pad_t::buffer, pad_t::buttons, NULL, padPortClose(), pad_t::port, and pad_t::slot.
int pad_get_num_modes | ( | pad_t * | pad | ) |
Get number of modes supported by pad
Definition at line 145 of file input.c.
References pad_t::num_modes, PAD_MODETABLE, padInfoMode(), pad_t::port, and pad_t::slot.
Referenced by pad_has_type().
int pad_get_state | ( | pad_t * | pad | ) |
Get the pad's state
Definition at line 103 of file input.c.
References padGetState(), pad_t::port, pad_t::slot, and pad_t::state.
Referenced by pad_wait().
int pad_get_type | ( | pad_t * | pad | ) |
Get the pad's type
Definition at line 206 of file input.c.
References PAD_MODECURID, padInfoMode(), pad_t::port, pad_t::slot, and pad_t::type.
int pad_has_type | ( | pad_t * | pad, |
int | type | ||
) |
Check if a type is supported by pad
Definition at line 178 of file input.c.
References pad_t::num_modes, pad_get_num_modes(), PAD_MODETABLE, PAD_TYPE_DIGITAL, padInfoMode(), pad_t::port, and pad_t::slot.
Referenced by pad_set_mode().
void pad_init_actuators | ( | pad_t * | pad | ) |
Init actuators
Definition at line 288 of file input.c.
References pad_t::actuator, actuator_t::large, NULL, PAD_MODECUREXID, pad_wait(), padInfoAct(), padInfoMode(), padSetActAlign(), pad_t::port, pad_t::slot, actuator_t::small, and actuator_t::status.
pad_t* pad_open | ( | unsigned int | port, |
unsigned int | slot, | ||
unsigned int | mode, | ||
unsigned int | lock | ||
) |
Open and initialize a pad
Definition at line 10 of file input.c.
References pad_t::actuator, pad_t::buffer, pad_t::buttons, pad_t::exec_cmd, pad_t::last_state, pad_t::lock, lock, pad_t::mode, mode, mtapGetConnection(), NULL, pad_t::num_modes, pad_set_mode(), PAD_TYPE_DIGITAL, pad_wait(), padPortOpen(), pad_t::port, port, pad_t::sensitivity, pad_t::slot, slot, pad_t::state, and pad_t::type.
void pad_set_actuators | ( | pad_t * | pad, |
int | small, | ||
unsigned char | large | ||
) |
Set actuators
Definition at line 326 of file input.c.
References pad_t::actuator, actuator_t::large, padSetActDirect(), pad_t::port, pad_t::slot, actuator_t::small, and actuator_t::status.
void pad_set_mode | ( | pad_t * | pad, |
int | mode, | ||
int | lock | ||
) |
Set the pad's mode and mode lock
Definition at line 215 of file input.c.
References pad_t::lock, lock, pad_t::mode, mode, pad_has_type(), PAD_MMODE_DIGITAL, PAD_MMODE_DUALSHOCK, PAD_MMODE_LOCK, PAD_MMODE_UNLOCK, PAD_TYPE_DIGITAL, PAD_TYPE_DUALSHOCK, pad_wait(), padSetMainMode(), pad_t::port, and pad_t::slot.
Referenced by pad_open().
void pad_set_sensitivity | ( | pad_t * | pad, |
int | enable | ||
) |
Set the pad's pressure sensitivity
Definition at line 261 of file input.c.
References pad_wait(), padEnterPressMode(), padExitPressMode(), padInfoPressMode(), pad_t::port, pad_t::sensitivity, and pad_t::slot.
void pad_wait | ( | pad_t * | pad | ) |
Wait until the pad is ready to accept commands
Definition at line 122 of file input.c.
References pad_t::last_state, pad_get_state(), PAD_STATE_DISCONN, PAD_STATE_ERROR, PAD_STATE_FINDCTP1, PAD_STATE_STABLE, pad_wait(), and pad_t::state.
Referenced by pad_init_actuators(), pad_open(), pad_set_mode(), pad_set_sensitivity(), and pad_wait().