Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
m_Do_controller_pad.h
Go to the documentation of this file.
1#ifndef M_DO_M_DO_CONTROLLER_PAD_H
2#define M_DO_M_DO_CONTROLLER_PAD_H
3
6
7// Controller Ports 1 - 4
8enum { PAD_1, PAD_2, PAD_3, PAD_4 };
9
10class mDoCPd_c {
11public:
12 static void create();
13 static void read();
16 static void recalibrate();
17
19 static JUTGamePad* getGamePad(u32 pad) { return m_gamePad[pad]; }
20 static u32 getTrig(u32 pad) { return getCpadInfo(pad).mPressedButtonFlags; }
21 static u32 getTrigLockL(u32 pad) { return getCpadInfo(pad).mTrigLockL; }
22 static u32 getTrigLockR(u32 pad) { return getCpadInfo(pad).mTrigLockR; }
23 static u32 getTrigUp(u32 pad) { return getTrig(pad) & CButton::DPAD_UP; }
24 static u32 getTrigDown(u32 pad) { return getTrig(pad) & CButton::DPAD_DOWN; }
25 static u32 getTrigLeft(u32 pad) { return getTrig(pad) & CButton::DPAD_LEFT; }
26 static u32 getTrigRight(u32 pad) { return getTrig(pad) & CButton::DPAD_RIGHT; }
27 static u32 getTrigL(u32 pad) { return getTrig(pad) & CButton::L; }
28 static u32 getTrigR(u32 pad) { return getTrig(pad) & CButton::R; }
29 static u32 getTrigA(u32 pad) { return getTrig(pad) & CButton::A; }
30 static u32 getTrigB(u32 pad) { return getTrig(pad) & CButton::B; }
31 static u32 getTrigZ(u32 pad) { return getTrig(pad) & CButton::Z; }
32 static u32 getTrigY(u32 pad) { return getTrig(pad) & CButton::Y; }
33 static u32 getTrigX(u32 pad) { return getTrig(pad) & CButton::X; }
34 static u32 getTrigStart(u32 pad) { return getTrig(pad) & CButton::START; }
35 static u32 getHold(u32 pad) { return getCpadInfo(pad).mButtonFlags; }
36 static u32 getHoldLockL(u32 pad) { return getCpadInfo(pad).mHoldLockL; }
37 static u32 getHoldLockR(u32 pad) { return getCpadInfo(pad).mHoldLockR; }
38 static u32 getHoldUp(u32 pad) { return getHold(pad) & CButton::DPAD_UP; }
39 static u32 getHoldDown(u32 pad) { return getHold(pad) & CButton::DPAD_DOWN; }
40 static u32 getHoldLeft(u32 pad) { return getHold(pad) & CButton::DPAD_LEFT; }
41 static u32 getHoldRight(u32 pad) { return getHold(pad) & CButton::DPAD_RIGHT; }
42 static u32 getHoldL(u32 pad) { return getHold(pad) & CButton::L; }
43 static u32 getHoldR(u32 pad) { return getHold(pad) & CButton::R; }
44 static u32 getHoldA(u32 pad) { return getHold(pad) & CButton::A; }
45 static u32 getHoldB(u32 pad) { return getHold(pad) & CButton::B; }
46 static u32 getHoldZ(u32 pad) { return getHold(pad) & CButton::Z; }
47 static u32 getHoldY(u32 pad) { return getHold(pad) & CButton::Y; }
48 static u32 getHoldX(u32 pad) { return getHold(pad) & CButton::X; }
49 static f32 getStickX(u32 pad) { return getCpadInfo(pad).mMainStickPosX; }
50 static f32 getStickY(u32 pad) { return getCpadInfo(pad).mMainStickPosY; }
51 static f32 getStickX3D(u32 pad) { return getCpadInfo(pad).mMainStickPosX; }
52 static f32 getStickValue(u32 pad) { return getCpadInfo(pad).mMainStickValue; }
53 static s16 getStickAngle(u32 pad) { return getCpadInfo(pad).mMainStickAngle; }
54 static s16 getStickAngle3D(u32 pad) { return getCpadInfo(pad).mMainStickAngle; }
55 static f32 getSubStickX3D(u32 pad) { return getCpadInfo(pad).mCStickPosX; }
56 static f32 getSubStickX(u32 pad) { return getCpadInfo(pad).mCStickPosX; }
57 static f32 getSubStickY(u32 pad) { return getCpadInfo(pad).mCStickPosY; }
58 static f32 getSubStickValue(u32 pad) { return getCpadInfo(pad).mCStickValue; }
59 static s16 getSubStickAngle(u32 pad) { return getCpadInfo(pad).mCStickAngle; }
60 static f32 getAnalogR(u32 pad) { return getCpadInfo(pad).mTriggerRight; }
61 static f32 getAnalogL(u32 pad) { return getCpadInfo(pad).mTriggerLeft; }
62 static BOOL isConnect(u32 pad) { return JUTGamePad::getPortStatus(pad) == 0; }
63 static void startMotorWave(u32 pad, void* param_2, JUTGamePad::CRumble::ERumble param_3, u32 param_4) {
64 m_gamePad[pad]->startMotorWave(param_2, param_3, param_4);
65 }
66 static void stopMotor(u32 pad) { m_gamePad[pad]->stopMotor(); }
67 static void stopMotorWave(u32 pad) { m_gamePad[pad]->stopMotorWave(); }
68 static void stopMotorHard(u32 pad) { return m_gamePad[pad]->stopMotorHard(); }
69 static void stopMotorWaveHard(u32 pad) { return m_gamePad[pad]->stopMotorWaveHard(); }
70
73};
74
76 param_1 = analog * (1.0f / 15.0f);
77 if (param_1 > 1.0f) {
78 param_1 = 1.0f;
79 }
80}
81
83 param_1 = analog * 0.0071428571827709675f;
84 if (param_1 > 1.0f) {
85 param_1 = 1.0f;
86 }
87}
88
89#endif /* M_DO_M_DO_CONTROLLER_PAD_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition m_Do_controller_pad.h:10
static u32 getTrigR(u32 pad)
Definition m_Do_controller_pad.h:28
static u32 getHoldX(u32 pad)
Definition m_Do_controller_pad.h:48
static s16 getSubStickAngle(u32 pad)
Definition m_Do_controller_pad.h:59
static f32 getStickX(u32 pad)
Definition m_Do_controller_pad.h:49
static u32 getTrigA(u32 pad)
Definition m_Do_controller_pad.h:29
static u32 getTrigRight(u32 pad)
Definition m_Do_controller_pad.h:26
static u32 getTrigLockL(u32 pad)
Definition m_Do_controller_pad.h:21
static u32 getHoldLockR(u32 pad)
Definition m_Do_controller_pad.h:37
static u32 getHoldB(u32 pad)
Definition m_Do_controller_pad.h:45
static u32 getTrigStart(u32 pad)
Definition m_Do_controller_pad.h:34
static f32 getSubStickValue(u32 pad)
Definition m_Do_controller_pad.h:58
static JUTGamePad * getGamePad(u32 pad)
Definition m_Do_controller_pad.h:19
static s16 getStickAngle(u32 pad)
Definition m_Do_controller_pad.h:53
static f32 getAnalogR(u32 pad)
Definition m_Do_controller_pad.h:60
static interface_of_controller_pad m_cpadInfo[4]
Definition m_Do_controller_pad.h:72
static u32 getTrig(u32 pad)
Definition m_Do_controller_pad.h:20
static void read()
Definition m_Do_controller_pad.cpp:50
static u32 getTrigL(u32 pad)
Definition m_Do_controller_pad.h:27
static f32 getSubStickX3D(u32 pad)
Definition m_Do_controller_pad.h:55
static f32 getSubStickY(u32 pad)
Definition m_Do_controller_pad.h:57
static f32 getSubStickX(u32 pad)
Definition m_Do_controller_pad.h:56
static f32 getAnalogL(u32 pad)
Definition m_Do_controller_pad.h:61
static u32 getTrigLeft(u32 pad)
Definition m_Do_controller_pad.h:25
static u32 getHoldZ(u32 pad)
Definition m_Do_controller_pad.h:46
static u32 getHoldR(u32 pad)
Definition m_Do_controller_pad.h:43
static s16 getStickAngle3D(u32 pad)
Definition m_Do_controller_pad.h:54
static u32 getTrigY(u32 pad)
Definition m_Do_controller_pad.h:32
static u32 getHoldL(u32 pad)
Definition m_Do_controller_pad.h:42
static void recalibrate()
Definition m_Do_controller_pad.cpp:126
static void LRlockCheck(interface_of_controller_pad *)
Definition m_Do_controller_pad.cpp:101
static u32 getTrigUp(u32 pad)
Definition m_Do_controller_pad.h:23
static void stopMotorHard(u32 pad)
Definition m_Do_controller_pad.h:68
static u32 getHoldLockL(u32 pad)
Definition m_Do_controller_pad.h:36
static u32 getTrigX(u32 pad)
Definition m_Do_controller_pad.h:33
static f32 getStickX3D(u32 pad)
Definition m_Do_controller_pad.h:51
static interface_of_controller_pad & getCpadInfo(u32 pad)
Definition m_Do_controller_pad.h:18
static u32 getHoldDown(u32 pad)
Definition m_Do_controller_pad.h:39
static u32 getHoldRight(u32 pad)
Definition m_Do_controller_pad.h:41
static JUTGamePad * m_gamePad[4]
Definition m_Do_controller_pad.h:71
static void convert(interface_of_controller_pad *, JUTGamePad *)
Definition m_Do_controller_pad.cpp:79
static void stopMotorWaveHard(u32 pad)
Definition m_Do_controller_pad.h:69
static f32 getStickY(u32 pad)
Definition m_Do_controller_pad.h:50
static u32 getHoldLeft(u32 pad)
Definition m_Do_controller_pad.h:40
static u32 getHoldA(u32 pad)
Definition m_Do_controller_pad.h:44
static u32 getHoldUp(u32 pad)
Definition m_Do_controller_pad.h:38
static u32 getHold(u32 pad)
Definition m_Do_controller_pad.h:35
static u32 getTrigZ(u32 pad)
Definition m_Do_controller_pad.h:31
static u32 getTrigB(u32 pad)
Definition m_Do_controller_pad.h:30
static f32 getStickValue(u32 pad)
Definition m_Do_controller_pad.h:52
static void stopMotor(u32 pad)
Definition m_Do_controller_pad.h:66
static void startMotorWave(u32 pad, void *param_2, JUTGamePad::CRumble::ERumble param_3, u32 param_4)
Definition m_Do_controller_pad.h:63
static void create()
Definition m_Do_controller_pad.cpp:19
static void stopMotorWave(u32 pad)
Definition m_Do_controller_pad.h:67
static u32 getTrigDown(u32 pad)
Definition m_Do_controller_pad.h:24
static u32 getHoldY(u32 pad)
Definition m_Do_controller_pad.h:47
static BOOL isConnect(u32 pad)
Definition m_Do_controller_pad.h:62
static u32 getTrigLockR(u32 pad)
Definition m_Do_controller_pad.h:22
void mDoCPd_ANALOG_CONV(u8 analog, f32 &param_1)
Definition m_Do_controller_pad.h:75
@ PAD_1
Definition m_Do_controller_pad.h:8
@ PAD_2
Definition m_Do_controller_pad.h:8
@ PAD_3
Definition m_Do_controller_pad.h:8
@ PAD_4
Definition m_Do_controller_pad.h:8
void mDoCPd_TRIGGER_CONV(u8 analog, f32 &param_1)
Definition m_Do_controller_pad.h:82
@ R
Definition JUTGamePad.h:17
@ X
Definition JUTGamePad.h:21
@ L
Definition JUTGamePad.h:18
@ B
Definition JUTGamePad.h:20
@ DPAD_DOWN
Definition JUTGamePad.h:14
@ START
Definition JUTGamePad.h:23
@ A
Definition JUTGamePad.h:19
@ DPAD_RIGHT
Definition JUTGamePad.h:13
@ Y
Definition JUTGamePad.h:22
@ DPAD_LEFT
Definition JUTGamePad.h:12
@ Z
Definition JUTGamePad.h:16
@ DPAD_UP
Definition JUTGamePad.h:15
ERumble
Definition JUTGamePad.h:209
Definition JUTGamePad.h:45
void stopMotor()
Definition JUTGamePad.h:138
void stopMotorWaveHard()
Definition JUTGamePad.h:200
void startMotorWave(void *param_2, CRumble::ERumble rumble, u32 param_4)
Definition JUTGamePad.h:238
static s8 getPortStatus(u32 port)
Definition JUTGamePad.h:141
void stopMotorHard()
Definition JUTGamePad.h:139
void stopMotorWave()
Definition JUTGamePad.h:137
Definition c_API_controller_pad.h:6
f32 mTriggerLeft
Definition c_API_controller_pad.h:21
u8 mTrigLockR
Definition c_API_controller_pad.h:29
f32 mMainStickPosX
Definition c_API_controller_pad.h:7
s16 mMainStickAngle
Definition c_API_controller_pad.h:10
u8 mTrigLockL
Definition c_API_controller_pad.h:27
f32 mCStickValue
Definition c_API_controller_pad.h:15
u32 mPressedButtonFlags
Definition c_API_controller_pad.h:24
u8 mHoldLockL
Definition c_API_controller_pad.h:26
f32 mMainStickPosY
Definition c_API_controller_pad.h:8
u32 mButtonFlags
Definition c_API_controller_pad.h:23
f32 mCStickPosY
Definition c_API_controller_pad.h:14
f32 mTriggerRight
Definition c_API_controller_pad.h:22
u8 mHoldLockR
Definition c_API_controller_pad.h:28
f32 mCStickPosX
Definition c_API_controller_pad.h:13
f32 mMainStickValue
Definition c_API_controller_pad.h:9
s16 mCStickAngle
Definition c_API_controller_pad.h:16
int BOOL
Definition types.h:27
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned char u8
Definition types.h:8