DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CGamePad Class Reference

#include <gamepad.hpp>

Public Member Functions

void Init ()
 
void UpDate ()
 
int On (int mask)
 
int On2 (int mask)
 
int Down (int mask)
 
int Down2 (int mask)
 
int GetPadOn ()
 
int GetPadDown ()
 
int GetPadUp ()
 
int GetLX ()
 
int GetLY ()
 
int GetRX ()
 
int GetRY ()
 
int GetLX2 ()
 
int GetLY2 ()
 
int GetRX2 ()
 
int GetRY2 ()
 
int AllOn ()
 
float GetRXf ()
 
float GetRYf ()
 
float GetLXf ()
 
float GetLYf ()
 
float GetLXf2 ()
 
float GetLYf2 ()
 
void KeyLock (int mask)
 
void KeyLock2 (int mask)
 
void StopVibration ()
 
void VibrationEnable (int enable)
 
void Step ()
 
void AutoRepeatOff ()
 
void MenuModeOff ()
 
void MenuModeOn (int threshold)
 
void SetAutoRepeat (int mask, int initial_delay, int repeat_delay)
 
void CancelAutoRepeat (int mask)
 
void SetVibration (int motor, int intensity, int duration)
 

Private Attributes

PAD_DATA pad [2]
 
PAD_DATA previous_pad [2]
 
int unk_130 [5]
 
PAD_REPEAT repeat [2]
 
int axis_threshold [2]
 
int key_lock
 
int key_lock2
 
int vibration_enabled
 

Detailed Description

Manages both game controllers.

Definition at line 124 of file gamepad.hpp.

Member Function Documentation

◆ Init()

void CGamePad::Init ( )

Initializes the controller library and both controller ports.

Mangled name:
Init__8CGamePadFv
Address:
0x12A610
Size:
0x214

Definition at line 16 of file gamepad.cpp.

◆ UpDate()

void CGamePad::UpDate ( )

Reads both controllers and updates derived button states.

Mangled name:
UpDate__8CGamePadFv
Address:
0x12AD70
Size:
0x3CC

Definition at line 261 of file gamepad.cpp.

◆ On()

int CGamePad::On ( int  mask)

Tests whether the first controller presses any requested button.

Mangled name:
On__8CGamePadFi
Address:
0x12B810
Size:
0x2C

Definition at line 557 of file gamepad.cpp.

◆ On2()

int CGamePad::On2 ( int  mask)

Tests whether the second controller presses any requested button.

Mangled name:
On2__8CGamePadFi
Address:
0x12B840
Size:
0x2C

Definition at line 575 of file gamepad.cpp.

◆ Down()

int CGamePad::Down ( int  mask)

Tests whether the first controller newly presses any requested button.

Mangled name:
Down__8CGamePadFi
Address:
0x12B870
Size:
0x38

Definition at line 583 of file gamepad.cpp.

◆ Down2()

int CGamePad::Down2 ( int  mask)

Tests whether the second controller newly presses any requested button.

Mangled name:
Down2__8CGamePadFi
Address:
0x12B8B0
Size:
0x38

Definition at line 601 of file gamepad.cpp.

◆ GetPadOn()

int CGamePad::GetPadOn ( )

Gets the buttons pressed on the first controller.

Mangled name:
GetPadOn__8CGamePadFv
Address:
0x12B600
Size:
0x28

Definition at line 509 of file gamepad.cpp.

◆ GetPadDown()

int CGamePad::GetPadDown ( )

Gets the buttons newly pressed on the first controller.

Mangled name:
GetPadDown__8CGamePadFv
Address:
0x12B630
Size:
0x30

Definition at line 517 of file gamepad.cpp.

◆ GetPadUp()

int CGamePad::GetPadUp ( )

Gets the buttons newly released on the first controller.

Mangled name:
GetPadUp__8CGamePadFv
Address:
0x12B660
Size:
0x30

Definition at line 525 of file gamepad.cpp.

◆ GetLX()

int CGamePad::GetLX ( )

Gets the calibrated first-controller left stick horizontal position.

Mangled name:
GetLX__8CGamePadFv
Address:
0x12B310
Size:
0x24

Definition at line 441 of file gamepad.cpp.

◆ GetLY()

int CGamePad::GetLY ( )

Gets the calibrated first-controller left stick vertical position.

Mangled name:
GetLY__8CGamePadFv
Address:
0x12B340
Size:
0x24

Definition at line 445 of file gamepad.cpp.

◆ GetRX()

int CGamePad::GetRX ( )

Gets the calibrated first-controller right stick horizontal position.

Mangled name:
GetRX__8CGamePadFv
Address:
0x12B2B0
Size:
0x24

Definition at line 433 of file gamepad.cpp.

◆ GetRY()

int CGamePad::GetRY ( )

Gets the calibrated first-controller right stick vertical position.

Mangled name:
GetRY__8CGamePadFv
Address:
0x12B2E0
Size:
0x24

Definition at line 437 of file gamepad.cpp.

◆ GetLX2()

int CGamePad::GetLX2 ( )

Gets the calibrated second-controller left stick horizontal position.

Mangled name:
GetLX2__8CGamePadFv
Address:
0x12B3D0
Size:
0x24

Definition at line 457 of file gamepad.cpp.

◆ GetLY2()

int CGamePad::GetLY2 ( )

Gets the calibrated second-controller left stick vertical position.

Mangled name:
GetLY2__8CGamePadFv
Address:
0x12B400
Size:
0x24

Definition at line 461 of file gamepad.cpp.

◆ GetRX2()

int CGamePad::GetRX2 ( )

Gets the calibrated second-controller right stick horizontal position.

Mangled name:
GetRX2__8CGamePadFv
Address:
0x12B370
Size:
0x24

Definition at line 449 of file gamepad.cpp.

◆ GetRY2()

int CGamePad::GetRY2 ( )

Gets the calibrated second-controller right stick vertical position.

Mangled name:
GetRY2__8CGamePadFv
Address:
0x12B3A0
Size:
0x24

Definition at line 453 of file gamepad.cpp.

◆ AllOn()

int CGamePad::AllOn ( )

Combines the button and stick states of both controllers.

Mangled name:
AllOn__8CGamePadFv
Address:
0x12B430
Size:
0xB4

Definition at line 465 of file gamepad.cpp.

◆ GetRXf()

float CGamePad::GetRXf ( )

Gets the normalized first-controller right stick horizontal position.

Mangled name:
GetRXf__8CGamePadFv
Address:
0x12B690
Size:
0x3C

Definition at line 533 of file gamepad.cpp.

◆ GetRYf()

float CGamePad::GetRYf ( )

Gets the normalized first-controller right stick vertical position.

Mangled name:
GetRYf__8CGamePadFv
Address:
0x12B6D0
Size:
0x3C

Definition at line 537 of file gamepad.cpp.

◆ GetLXf()

float CGamePad::GetLXf ( )

Gets the normalized first-controller left stick horizontal position.

Mangled name:
GetLXf__8CGamePadFv
Address:
0x12B710
Size:
0x3C

Definition at line 541 of file gamepad.cpp.

◆ GetLYf()

float CGamePad::GetLYf ( )

Gets the normalized first-controller left stick vertical position.

Mangled name:
GetLYf__8CGamePadFv
Address:
0x12B750
Size:
0x3C

Definition at line 545 of file gamepad.cpp.

◆ GetLXf2()

float CGamePad::GetLXf2 ( )

Gets the normalized second-controller left stick horizontal position.

Mangled name:
GetLXf2__8CGamePadFv
Address:
0x12B790
Size:
0x3C

Definition at line 549 of file gamepad.cpp.

◆ GetLYf2()

float CGamePad::GetLYf2 ( )

Gets the normalized second-controller left stick vertical position.

Mangled name:
GetLYf2__8CGamePadFv
Address:
0x12B7D0
Size:
0x3C

Definition at line 553 of file gamepad.cpp.

◆ KeyLock()

void CGamePad::KeyLock ( int  mask)

Sets the first controller input lock mask.

Mangled name:
KeyLock__8CGamePadFi
Address:
0x12B5E0
Size:
0xC

Definition at line 501 of file gamepad.cpp.

◆ KeyLock2()

void CGamePad::KeyLock2 ( int  mask)

Sets the second controller input lock mask.

Mangled name:
KeyLock2__8CGamePadFi
Address:
0x12B5F0
Size:
0xC

Definition at line 505 of file gamepad.cpp.

◆ StopVibration()

void CGamePad::StopVibration ( )

Stops both vibration actuators immediately.

Mangled name:
StopVibration__8CGamePadFv
Address:
0x12B9C0
Size:
0x5C

Definition at line 643 of file gamepad.cpp.

◆ VibrationEnable()

void CGamePad::VibrationEnable ( int  enable)

Enables or disables controller vibration.

Mangled name:
VibrationEnable__8CGamePadFi
Address:
0x12B9B0
Size:
0xC

Definition at line 639 of file gamepad.cpp.

◆ Step()

void CGamePad::Step ( )

Updates vibration timers and sends actuator values.

Mangled name:
Step__8CGamePadFv
Address:
0x12B140
Size:
0xEC

Definition at line 392 of file gamepad.cpp.

◆ AutoRepeatOff()

void CGamePad::AutoRepeatOff ( )

Disables automatic repeat for every button.

Mangled name:
AutoRepeatOff__8CGamePadFv
Address:
0x12B8F0
Size:
0x24

Definition at line 609 of file gamepad.cpp.

◆ MenuModeOff()

void CGamePad::MenuModeOff ( )

Disables analog-stick menu direction conversion.

Mangled name:
MenuModeOff__8CGamePadFv
Address:
0x12B930
Size:
0xC

Definition at line 617 of file gamepad.cpp.

◆ MenuModeOn()

void CGamePad::MenuModeOn ( int  threshold)

Enables analog-stick menu direction conversion at a threshold.

Mangled name:
MenuModeOn__8CGamePadFi
Address:
0x12B920
Size:
0xC

Definition at line 613 of file gamepad.cpp.

◆ SetAutoRepeat()

void CGamePad::SetAutoRepeat ( int  mask,
int  initial_delay,
int  repeat_delay 
)

Configures automatic repeat for selected buttons.

Mangled name:
SetAutoRepeat__8CGamePadFiii
Address:
0x12B560
Size:
0x78

Definition at line 485 of file gamepad.cpp.

◆ CancelAutoRepeat()

void CGamePad::CancelAutoRepeat ( int  mask)

Cancels automatic repeat for selected buttons.

Mangled name:
CancelAutoRepeat__8CGamePadFi
Address:
0x12B4F0
Size:
0x6C

Definition at line 469 of file gamepad.cpp.

◆ SetVibration()

void CGamePad::SetVibration ( int  motor,
int  intensity,
int  duration 
)

Starts one vibration actuator for a limited time.

Mangled name:
SetVibration__8CGamePadFiii
Address:
0x12B940
Size:
0x64

Definition at line 621 of file gamepad.cpp.

Member Data Documentation

◆ pad

PAD_DATA CGamePad::pad[2]
private

Specifies the current controller data.

Definition at line 125 of file gamepad.hpp.

◆ previous_pad

PAD_DATA CGamePad::previous_pad[2]
private

Specifies the previous controller data.

Definition at line 126 of file gamepad.hpp.

◆ unk_130

int CGamePad::unk_130[5]
private

Definition at line 127 of file gamepad.hpp.

◆ repeat

PAD_REPEAT CGamePad::repeat[2]
private

Specifies automatic repeat state for both controllers.

Definition at line 128 of file gamepad.hpp.

◆ axis_threshold

int CGamePad::axis_threshold[2]
private

Specifies analog-stick menu thresholds.

Definition at line 129 of file gamepad.hpp.

◆ key_lock

int CGamePad::key_lock
private

Specifies the first controller input lock.

Definition at line 130 of file gamepad.hpp.

◆ key_lock2

int CGamePad::key_lock2
private

Specifies the second controller input lock.

Definition at line 131 of file gamepad.hpp.

◆ vibration_enabled

int CGamePad::vibration_enabled
private

Specifies whether vibration can run.

Definition at line 132 of file gamepad.hpp.