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)
 
tU128 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
tU16 select: 1
tU16 i: 1
tU16 j: 1
tU16 start: 1
tU16 leftUp: 1
tU16 leftRight: 1
tU16 leftDown: 1
tU16 leftLeft: 1
tU16 l2: 1
tU16 r2: 1
tU16 l1: 1
tU16 r1: 1
tU16 rightUp: 1
tU16 rightRight: 1
tU16 rightDown: 1
tU16 rightLeft: 1

◆ CPad::tPadStatus

struct CPad::tPadStatus

Definition at line 94 of file pads.h.

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

◆ CPad::tStickData

struct CPad::tStickData

Definition at line 87 of file pads.h.

Data Fields
tU8 xVal
tU8 yVal
tU8 xCenter
tU8 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: