State of one controller port as the last poll read it.
More...
#include <joypad.h>
State of one controller port as the last poll read it.
The name is inferred. The poll has a table of kJoypadNumPorts at 0x0047fe00.
◆ JoypadState()
| JoypadState::JoypadState |
( |
| ) |
|
Clear the buttons, the sticks, and the pressures, and give the port no pad.
mThreshold is not set.
- Ghidra address:
- NTSC-U/C: 0x0028a5e8
- Ghidra address:
- PAL: 0x00293de0
◆ AddStickButtons()
| void JoypadState::AddStickButtons |
( |
int * | pButtons, |
|
|
bool | bMenu ) |
Set the bits of the stick directions pushed past mThreshold.
Bits kPadLeftStickUp to kPadRightStickLeft follow the two sticks. With bMenu set, the left stick also sets the bits of the directional buttons.
- Parameters
-
| pButtons | The button word to add the bits to. |
| bMenu | Whether the menus receive this controller's input. |
- Ghidra address:
- NTSC-U/C: 0x0028ab30
- Ghidra address:
- PAL: 0x00294328
◆ GetSticks()
- Returns
- The analogue sticks.
◆ GetPressures()
| const float * JoypadState::GetPressures |
( |
| ) |
const |
|
inline |
- Returns
- Each button's pressure, from 0 to 1.
◆ SetStick()
| void JoypadState::SetStick |
( |
int | nStick, |
|
|
float | fX, |
|
|
float | fY ) |
|
inline |
Set the position of a stick.
- Parameters
-
| nStick | The stick. |
| fX | The horizontal position, -1 to 1. |
| fY | The vertical position, -1 to 1. |
◆ SetPressure()
| void JoypadState::SetPressure |
( |
int | nButton, |
|
|
float | fPressure ) |
|
inline |
Set the pressure of a button.
- Parameters
-
| nButton | The button. |
| fPressure | The pressure, 0 to 1. |
◆ GetButtons()
| int JoypadState::GetButtons |
( |
| ) |
const |
|
inline |
◆ SetButtons()
| void JoypadState::SetButtons |
( |
int | nButtons | ) |
|
|
inline |
◆ GetPad()
| int JoypadState::GetPad |
( |
| ) |
const |
|
inline |
- Returns
- The player this port serves, or kJoypadNoPad.
◆ SetPad()
| void JoypadState::SetPad |
( |
int | nPad | ) |
|
|
inline |
- Parameters
-
| nPad | The player this port serves, or kJoypadNoPad. |
◆ GetConnected()
| int JoypadState::GetConnected |
( |
| ) |
const |
|
inline |
- Returns
- Non-zero while the controller is connected.
◆ SetConnected()
| void JoypadState::SetConnected |
( |
int | nConnected | ) |
|
|
inline |
- Parameters
-
| nConnected | Non-zero while the controller is connected. |
◆ SetThreshold()
| void JoypadState::SetThreshold |
( |
float | fThreshold | ) |
|
|
inline |
- Parameters
-
| fThreshold | How far a stick moves before its bit is set. |
The documentation for this class was generated from the following file: