#include <libpad.h>
Go to the source code of this file.
|
| class | PadRecord |
| | One controller's pad-library state: the DMA area libpad fills and the decoder's working state. More...
|
|
| void | BreugPadInit (PadRecord *pPad, int nPort, int nSlot, int nDeadZone) |
| | Reset a record and open the pad at nPort and nSlot.
|
| int | BreugPadRead (PadRecord *pPad, unsigned int *pButtons, unsigned char *pAxis0, unsigned char *pAxis1, unsigned char *pAxis2, unsigned char *pAxis3, unsigned char *pPressures, short *pPressureDeltas) |
| | Advance a pad's setup state machine and decode the latest report.
|
| void | BreugPadSetMotors (PadRecord *pPad, int nSmallMotor, int nBigMotor) |
| | Drive a pad's two vibration motors.
|
◆ BreugPadInit()
| void BreugPadInit |
( |
PadRecord * | pPad, |
|
|
int | nPort, |
|
|
int | nSlot, |
|
|
int | nDeadZone ) |
Reset a 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.
- Parameters
-
| pPad | The record. |
| nPort | The port, from 0. |
| nSlot | The multitap slot, from 0. |
| nDeadZone | Stored in mDeadZone. |
- Ghidra address:
- NTSC-U/C: 0x005bcf58
- Ghidra address:
- PAL: 0x00585f40
◆ BreugPadRead()
| int BreugPadRead |
( |
PadRecord * | pPad, |
|
|
unsigned int * | pButtons, |
|
|
unsigned char * | pAxis0, |
|
|
unsigned char * | pAxis1, |
|
|
unsigned char * | pAxis2, |
|
|
unsigned char * | pAxis3, |
|
|
unsigned char * | pPressures, |
|
|
short * | pPressureDeltas ) |
Advance a pad's setup state machine and decode the latest report.
mPhase indexes a 78-entry jump table at 0x00834430 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 zeroed inside the mDeadZone dead zone. A pad that is not stable reports only mButtons and zero axes.
- Parameters
-
| pPad | The record. |
| pButtons | Receives the button word at mButtons, 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. |
| pPressures | Receives the pressure bytes, or null. |
| pPressureDeltas | Receives each pressure less its baseline, or null. |
- Returns
- mReadyLevel, from 0 (no report) to 3 (pressure-sensitive), or 0 when the pad is not stable or the read fails.
- Ghidra address:
- NTSC-U/C: 0x005bc998
- Ghidra address:
- PAL: 0x00585960
◆ BreugPadSetMotors()
| void BreugPadSetMotors |
( |
PadRecord * | pPad, |
|
|
int | nSmallMotor, |
|
|
int | nBigMotor ) |
Drive a pad's two vibration motors.
Does nothing until mReadyLevel arrives at 2. Otherwise the small motor runs whenever nSmallMotor is positive, and the big motor takes nBigMotor as its level.
- Parameters
-
| pPad | The record. |
| nSmallMotor | Positive to run the small motor. |
| nBigMotor | The big motor's level. |
- Ghidra address:
- NTSC-U/C: 0x005bd0b0
- Ghidra address:
- PAL: 0x00586098