|
resonance 1.0.1
|
Handle to one of the eight pad slots, two ports of four multitap slots each. More...
#include <joypadps2.h>
Public Member Functions | |
| JoypadPS2 (int nIndex) | |
| Claim slot nIndex. | |
| ~JoypadPS2 () | |
| Release the slot. | |
| int | Poll (unsigned int *pButtons, unsigned char *pAxis0, unsigned char *pAxis1, unsigned char *pAxis2, unsigned char *pAxis3) |
| Decode the slot's latest report through BreugPadRead(), without the pressure outputs. | |
| void | Reset () |
| Restart the slot's setup state machine. | |
| void | Open (int nPort, int nSlot, int nDeadZone) |
| Open the slot's pad through BreugPadInit(). | |
| void | DeInitPadData () |
| Close the slot's pad through scePadPortClose(). | |
| void | SetVibration (int nSmallMotor, int nBigMotor) |
| Drive the slot's motors through BreugPadSetMotors(). | |
| int | IsConnected () |
| Report whether a pad is present. | |
Public Attributes | |
| int | mId |
| Position of the handle among the InputPoller's JoypadPS2 objects, from 0. | |
Static Public Attributes | |
| static constexpr int | kSlotCount = 8 |
| Pad slots, two ports of four multitap slots each. | |
Handle to one of the eight pad slots, two ports of four multitap slots each.
The class is not polymorphic, emits no RTTI, and has no embedded file path. The eight-byte object, the allocation InputPoller::Setup() makes, stores the slot index and the position mId. Constructing a handle marks its slot in sSlotsInUse and destroying it clears the mark. Every other member forwards to the PadRecord of the slot in sRecords.
|
explicit |
Claim slot nIndex.
| nIndex | The slot, from 0. |
| JoypadPS2::~JoypadPS2 | ( | ) |
Release the slot.
| int JoypadPS2::Poll | ( | unsigned int * | pButtons, |
| unsigned char * | pAxis0, | ||
| unsigned char * | pAxis1, | ||
| unsigned char * | pAxis2, | ||
| unsigned char * | pAxis3 ) |
Decode the slot's latest report through BreugPadRead(), without the pressure outputs.
InputPoller::ReadControllers() is the caller.
| pButtons | Receives the button word, or null. |
| pAxis0 | Receives the first analog byte, or null. |
| pAxis1 | Receives the second analog byte, or null. |
| pAxis2 | Receives the third analog byte, or null. |
| pAxis3 | Receives the fourth analog byte, or null. |
| void JoypadPS2::Reset | ( | ) |
Restart the slot's setup state machine.
Clears PadRecord::mPhase and PadRecord::mReadyLevel. InputPoller::ResetJoypads() is the caller, expanded inline in InputPoller::FindJoypadConnections(). The title is inferred.
| void JoypadPS2::Open | ( | int | nPort, |
| int | nSlot, | ||
| int | nDeadZone ) |
Open the slot's pad through BreugPadInit().
InputPoller::Setup() is the caller. The title is inferred.
| nPort | The port, from 0. |
| nSlot | The multitap slot, from 0. |
| nDeadZone | The analog dead zone, passed through. |
| void JoypadPS2::DeInitPadData | ( | ) |
Close the slot's pad through scePadPortClose().
InputPoller::Shutdown() is the caller.
| void JoypadPS2::SetVibration | ( | int | nSmallMotor, |
| int | nBigMotor ) |
Drive the slot's motors through BreugPadSetMotors().
InputPoller::SetVibration() is the caller. The title is inferred.
| nSmallMotor | Positive to run the small motor. |
| nBigMotor | The big motor's level. |
| int JoypadPS2::IsConnected | ( | ) |
Report whether a pad is present.
InputPoller::NumberConnectedJoypads() is the caller. The title is inferred.
|
staticconstexpr |
Pad slots, two ports of four multitap slots each.
| int JoypadPS2::mId |
Position of the handle among the InputPoller's JoypadPS2 objects, from 0.
The constructor does not write it. InputPoller::Setup() assigns it after construction, and InputPoller::ReadControllers() indexes the player table with it. Both accesses are direct. +0x04