PSPSDK 2024-11-24
|
Data Structures | |
struct | SceCtrlData |
Controller data. More... | |
struct | SceCtrlLatch |
Controller latch data. More... | |
Typedefs | |
typedef struct SceCtrlData | SceCtrlData |
Controller data. | |
typedef struct SceCtrlLatch | SceCtrlLatch |
Controller latch data. | |
Enumerations | |
enum | PspCtrlButtons { PSP_CTRL_SELECT = 0x000001 , PSP_CTRL_START = 0x000008 , PSP_CTRL_UP = 0x000010 , PSP_CTRL_RIGHT = 0x000020 , PSP_CTRL_DOWN = 0x000040 , PSP_CTRL_LEFT = 0x000080 , PSP_CTRL_LTRIGGER = 0x000100 , PSP_CTRL_RTRIGGER = 0x000200 , PSP_CTRL_TRIANGLE = 0x001000 , PSP_CTRL_CIRCLE = 0x002000 , PSP_CTRL_CROSS = 0x004000 , PSP_CTRL_SQUARE = 0x008000 , PSP_CTRL_HOME = 0x010000 , PSP_CTRL_HOLD = 0x020000 , PSP_CTRL_NOTE = 0x800000 , PSP_CTRL_SCREEN = 0x400000 , PSP_CTRL_VOLUP = 0x100000 , PSP_CTRL_VOLDOWN = 0x200000 , PSP_CTRL_WLAN_UP = 0x040000 , PSP_CTRL_REMOTE = 0x080000 , PSP_CTRL_DISC = 0x1000000 , PSP_CTRL_MS = 0x2000000 } |
Enumeration representing digital controller button flags. More... | |
enum | PspCtrlMode { PSP_CTRL_MODE_DIGITAL = 0 , PSP_CTRL_MODE_ANALOG = 1 } |
Controller mode. More... | |
Functions | |
int | sceCtrlSetSamplingCycle (int cycle) |
Set the controller cycle setting. | |
int | sceCtrlGetSamplingCycle (int *pcycle) |
Get the controller current cycle setting. | |
int | sceCtrlSetSamplingMode (int mode) |
Set the controller mode. | |
int | sceCtrlGetSamplingMode (int *pmode) |
Get the current controller mode. | |
int | sceCtrlPeekBufferPositive (SceCtrlData *pad_data, int count) |
Read latest controller data from the controller service. | |
int | sceCtrlPeekBufferNegative (SceCtrlData *pad_data, int count) |
int | sceCtrlReadBufferPositive (SceCtrlData *pad_data, int count) |
Read new controller data from the controller service. | |
int | sceCtrlReadBufferNegative (SceCtrlData *pad_data, int count) |
int | sceCtrlPeekLatch (SceCtrlLatch *latch_data) |
Read latest latch data from the controller service. | |
int | sceCtrlReadLatch (SceCtrlLatch *latch_data) |
Read new latch data from the controller service. | |
int | sceCtrlSetIdleCancelThreshold (int idlereset, int idleback) |
Set analog threshold relating to the idle timer. | |
int | sceCtrlGetIdleCancelThreshold (int *idlerest, int *idleback) |
Get the idle threshold values. | |
Controller data.
Contains current button and axis state.
Controller latch data.
Contains information about button state changes between two controller service sampling cycles. With each sampling cycle, the controller service compares the new pressed & releasedbutton states with the previously collected pressed button states. This comparison will result in the following possible states for each button:
It is possible for a button to (briefly) be in two states at the same time. Valid combinations are as follows:
In other words, if a button is in the Make state, then it is also in the Press state. However, this is not the case for the inverse. A button in the Press state does not need to be in the Make state.
Mask the values with one or more PspCtrlButtons flags to access specific buttons.
These comparison results are stored internally as latch data and can be retrieved using the APIs sceCtrlPeekLatch() and sceCtrlReadLatch().
Enumeration representing digital controller button flags.
Each flag corresponds to a different button and can be used to extract button states from SceCtrlData and SceCtrlLatch structures. Flags can be combined using bitwise OR operation to check for mutliple key states at once.
Controller mode.
Specifies if analog data should be included in SceCtrlData.
Enumerator | |
---|---|
PSP_CTRL_MODE_DIGITAL | |
PSP_CTRL_MODE_ANALOG |
Get the idle threshold values.
idlerest | - Movement needed by the analog to reset the idle timer. |
idleback | - Movement needed by the analog to bring the PSP back from an idle state. |
Get the controller current cycle setting.
pcycle | - Return value. |
Get the current controller mode.
pmode | - Return value. |
int sceCtrlPeekBufferNegative | ( | SceCtrlData * | pad_data, |
int | count | ||
) |
int sceCtrlPeekBufferPositive | ( | SceCtrlData * | pad_data, |
int | count | ||
) |
Read latest controller data from the controller service.
Controller data contains current button and axis state.
pad_data | - A pointer to SceCtrlData structure that receives controller data. |
count | - Number of SceCtrlData structures to read. |
int sceCtrlPeekLatch | ( | SceCtrlLatch * | latch_data | ) |
Read latest latch data from the controller service.
Latch data contains information about button state changes between two controller service sampling cycles.
latch_data | A pointer to SceCtrlLatch structure that receives latch data. |
int sceCtrlReadBufferNegative | ( | SceCtrlData * | pad_data, |
int | count | ||
) |
int sceCtrlReadBufferPositive | ( | SceCtrlData * | pad_data, |
int | count | ||
) |
Read new controller data from the controller service.
Controller data contains current button and axis state.
Example:
pad_data | - A pointer to SceCtrlData structure that receives controller data. |
count | - Number of SceCtrlData structures to read. |
Referenced by pspDebugKbInit().
int sceCtrlReadLatch | ( | SceCtrlLatch * | latch_data | ) |
Read new latch data from the controller service.
Latch data contains information about button state changes between two controller service sampling cycles.
Example:
latch_data | A pointer to SceCtrlLatch structure that receives latch data. |
Set analog threshold relating to the idle timer.
idlereset | - Movement needed by the analog to reset the idle timer. |
idleback | - Movement needed by the analog to bring the PSP back from an idle state. |
Set to -1 for analog to not cancel idle timer. Set to 0 for idle timer to be cancelled even if the analog is not moved. Set between 1 - 128 to specify the movement on either axis needed by the analog to fire the event.
Set the controller cycle setting.
cycle | - Cycle. Normally set to 0. |
Referenced by pspDebugKbInit().
Set the controller mode.
mode | - One of PspCtrlMode. If this is PSP_CTRL_MODE_DIGITAL, no data about the analog stick will be present in the SceCtrlData struct read by SceCtrlReadBuffer. |
Referenced by pspDebugKbInit().