One controller's pad-library state: the DMA area libpad fills and the decoder's working state.
More...
|
| void | SetActuators (int nSmallMotor, unsigned char nBigMotor) |
| | Drive the two vibration motors.
|
| void | Init (int nPort, int nSlot, int nDeadZone) |
| | Reset the record and open the pad at nPort and nSlot.
|
| int | Read (int *pButtons, unsigned char *pAxis0, unsigned char *pAxis1, unsigned char *pAxis2, unsigned char *pAxis3, unsigned char *pPressures, short *pPressureDeltas) |
| | Advance the pad's setup state machine and decode the latest report.
|
One controller's pad-library state: the DMA area libpad fills and the decoder's working state.
The class is not polymorphic and emits no RTTI. The title comes from the prefix of its messages. The joypad layer has a table of eight at 0x00480240, one per port and multitap slot. The record is 0x180 bytes. The first 0x100 bytes are the area scePadPortOpen() receives, and the record therefore starts on a 64-byte boundary.
| void BreugPad::Init |
( |
int | nPort, |
|
|
int | nSlot, |
|
|
int | nDeadZone ) |
Reset the record and open the pad at nPort and nSlot.
Clears the actuator levels and the pressure baseline, aligns actuator 0 to byte 0 and actuator 1 to byte 1 with the rest unused, starts libpad through scePadInit(0) the first time any record opens, and opens the port with mDmaArea. Also sets the scale of ApplyDeadzone() from nDeadZone, which every record shares.
- Parameters
-
| nPort | The port, from 0. |
| nSlot | The multitap slot, from 0. |
| nDeadZone | Stored in mDeadZone. |
- Ghidra address:
- NTSC-U/C: 0x0028d4e8
- Ghidra address:
- PAL: 0x00296ec8
| int BreugPad::Read |
( |
int * | pButtons, |
|
|
unsigned char * | pAxis0, |
|
|
unsigned char * | pAxis1, |
|
|
unsigned char * | pAxis2, |
|
|
unsigned char * | pAxis3, |
|
|
unsigned char * | pPressures, |
|
|
short * | pPressureDeltas ) |
Advance the pad's setup state machine and decode the latest report.
mPhase indexes a 78-entry jump table at 0x0041c5e0 that walks the pad through analog mode, actuator alignment, and pressure-sensitive mode, and mReadyLevel records how far it has got. Each non-null output receives one value of the decoded report, the analog values centred on zero and passed through ApplyDeadzone(). A pad that is not stable reports only mButtons and zero axes.
- Parameters
-
| pButtons | Receives the button word at mButtons, or null. |
| pAxis0 | Receives the left stick's horizontal axis, or null. |
| pAxis1 | Receives the left stick's vertical axis, or null. |
| pAxis2 | Receives the right stick's horizontal axis, or null. |
| pAxis3 | Receives the right stick's vertical axis, or null. |
| pPressures | Receives the twelve pressure bytes, or null. |
| pPressureDeltas | Receives each pressure less its baseline, or null. |
- Returns
- mReadyLevel, or 0 when the read fails.
- Ghidra address:
- NTSC-U/C: 0x0028d6f8
- Ghidra address:
- PAL: 0x002970d8