PS2GL
OpenGL*-like API for the PS2
Loading...
Searching...
No Matches
CPad Class Reference

Data Structures

struct  tButtonsPressed
 
struct  tPadStatus
 
struct  tStickData
 

Public Member Functions

 CPad (unsigned int port)
 
bool Open (void)
 
void Read (void)
 
bool IsDown (unsigned int button)
 
bool IsUp (unsigned int button)
 
bool WasPushed (unsigned int button)
 
bool WasReleased (unsigned int button)
 
float RightStickX (void)
 
float RightStickY (void)
 
float LeftStickX (void)
 
float LeftStickY (void)
 

Private Member Functions

bool IsDown (tPadStatus status, unsigned int button)
 
bool IsUp (tPadStatus status, unsigned int button)
 
bool UpdateStick (tStickData *stickCur, tStickData *stickLast)
 
uint128_t DmaBuffer[scePadDmaBufferMax] __attribute__ ((aligned(64)))
 
tPadStatus CurStatus __attribute__ ((aligned(16)))
 
tPadStatus LastStatus __attribute__ ((aligned(16)))
 

Private Attributes

unsigned int uiPort
 
bool bPadModeSet
 

Detailed Description

Definition at line 46 of file pads.h.


Data Structure Documentation

◆ CPad::tButtonsPressed

struct CPad::tButtonsPressed

Definition at line 65 of file pads.h.

Data Fields
uint16_t select: 1
uint16_t i: 1
uint16_t j: 1
uint16_t start: 1
uint16_t leftUp: 1
uint16_t leftRight: 1
uint16_t leftDown: 1
uint16_t leftLeft: 1
uint16_t l2: 1
uint16_t r2: 1
uint16_t l1: 1
uint16_t r1: 1
uint16_t rightUp: 1
uint16_t rightRight: 1
uint16_t rightDown: 1
uint16_t rightLeft: 1

◆ CPad::tPadStatus

struct CPad::tPadStatus

Definition at line 94 of file pads.h.

+ Collaboration diagram for CPad::tPadStatus:
Data Fields
uint8_t success
uint8_t statLen
uint16_t buttons
uint8_t r3h
uint8_t r3v
uint8_t l3h
uint8_t l3v
uint8_t kanAtsu[12]
uint8_t whoKnows[12]
tStickData rightStick
tStickData leftStick

◆ CPad::tStickData

struct CPad::tStickData

Definition at line 87 of file pads.h.

Data Fields
uint8_t xVal
uint8_t yVal
uint8_t xCenter
uint8_t yCenter
float xPos
float yPos
bool isCentered

Constructor & Destructor Documentation

◆ CPad()

CPad::CPad ( unsigned int port)

Definition at line 85 of file pads.cpp.

Member Function Documentation

◆ Open()

bool CPad::Open ( void )

Definition at line 97 of file pads.cpp.

◆ Read()

void CPad::Read ( void )

Definition at line 103 of file pads.cpp.

◆ IsDown() [1/2]

bool CPad::IsDown ( unsigned int button)

Definition at line 203 of file pads.cpp.

◆ IsUp() [1/2]

bool CPad::IsUp ( unsigned int button)

Definition at line 208 of file pads.cpp.

◆ WasPushed()

bool CPad::WasPushed ( unsigned int button)

Definition at line 213 of file pads.cpp.

◆ WasReleased()

bool CPad::WasReleased ( unsigned int button)

Definition at line 218 of file pads.cpp.

◆ RightStickX()

float CPad::RightStickX ( void )
inline

Definition at line 58 of file pads.h.

◆ RightStickY()

float CPad::RightStickY ( void )
inline

Definition at line 59 of file pads.h.

◆ LeftStickX()

float CPad::LeftStickX ( void )
inline

Definition at line 61 of file pads.h.

◆ LeftStickY()

float CPad::LeftStickY ( void )
inline

Definition at line 62 of file pads.h.

◆ IsDown() [2/2]

bool CPad::IsDown ( tPadStatus status,
unsigned int button )
private

Definition at line 193 of file pads.cpp.

◆ IsUp() [2/2]

bool CPad::IsUp ( tPadStatus status,
unsigned int button )
private

Definition at line 198 of file pads.cpp.

◆ UpdateStick()

bool CPad::UpdateStick ( tStickData * stickCur,
tStickData * stickLast )
private

Definition at line 145 of file pads.cpp.

Field Documentation

◆ uiPort

unsigned int CPad::uiPort
private

Definition at line 114 of file pads.h.

◆ bPadModeSet

bool CPad::bPadModeSet
private

Definition at line 115 of file pads.h.


The documentation for this class was generated from the following files: