PSXSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Data Fields
psx_pad_state Struct Reference

This structure contains the state of the pad (game controller) after polling it with PSX_PollPad() More...

#include <psxpad.h>

Data Structures

union  extra
 Extra data for non-normal controllers. More...
 

Data Fields

unsigned char status
 Status.
 
unsigned char id
 Id.
 
unsigned char type
 Type of pad.
 
unsigned short buttons
 Button bitmask.
 
union psx_pad_state::extra extra
 

Detailed Description

This structure contains the state of the pad (game controller) after polling it with PSX_PollPad()

Field Documentation

unsigned short psx_pad_state::buttons

Button bitmask.

To be checked by AND'ing with the defines in psxpad.h for buttons. If a bit is set for a button, it is pressed. Checking the pad type to use this bitmask is not necessary at all, and if button emulations are set up, this may not represent the buttons actually pressed. Also reliable when type is PADTYPE_UNKNOWN

unsigned char psx_pad_state::id

Id.

Bits 7-4 indicate the type. Bits 3-0 indicate the number of words in the raw packet returned by the controller.

unsigned char psx_pad_state::status

Status.

0 on success, 255 on failure.

unsigned char psx_pad_state::type

Type of pad.

To be evaluated with the types in the psx_pad_types enum


The documentation for this struct was generated from the following file: