uOFW
Reverse engineered PSP kernel 6.60.
Data Structures | Typedefs | Enumerations | Functions
Controller Module

Data Structures

struct  SceCtrlData
 
struct  SceCtrlData2
 
struct  SceCtrlLatch
 
struct  SceCtrlInputDataTransferHandler
 

Typedefs

typedef void(* SceKernelButtonCallbackFunction) (u32 curButtons, u32 lastButtons, void *opt)
 

Enumerations

enum  SceCtrlPadButtons {
  SCE_CTRL_SELECT = 0x00000001 , SCE_CTRL_L3 = 0x00000002 , SCE_CTRL_R3 = 0x00000004 , SCE_CTRL_START = 0x00000008 ,
  SCE_CTRL_UP = 0x00000010 , SCE_CTRL_RIGHT = 0x00000020 , SCE_CTRL_DOWN = 0x00000040 , SCE_CTRL_LEFT = 0x00000080 ,
  SCE_CTRL_LTRIGGER = 0x00000100 , SCE_CTRL_RTRIGGER = 0x00000200 , SCE_CTRL_L1TRIGGER = 0x00000400 , SCE_CTRL_R1TRIGGER = 0x00000800 ,
  SCE_CTRL_TRIANGLE = 0x00001000 , SCE_CTRL_CIRCLE = 0x00002000 , SCE_CTRL_CROSS = 0x00004000 , SCE_CTRL_SQUARE = 0x00008000 ,
  SCE_CTRL_INTERCEPTED = 0x00010000 , SCE_CTRL_HOLD = 0x00020000 , SCE_CTRL_WLAN_UP = 0x00040000 , SCE_CTRL_REMOTE = 0x00080000 ,
  SCE_CTRL_VOLUP = 0x00100000 , SCE_CTRL_VOLDOWN = 0x00200000 , SCE_CTRL_SCREEN = 0x00400000 , SCE_CTRL_NOTE = 0x00800000 ,
  SCE_CTRL_DISC = 0x01000000 , SCE_CTRL_MS = 0x02000000 , SCE_CTRL_UNK_10000000 = 0x10000000 , SCE_CTRL_UNK_20000000 = 0x20000000
}
 
enum  SceCtrlPadInputMode { SCE_CTRL_INPUT_DIGITAL_ONLY = 0 , SCE_CTRL_INPUT_DIGITAL_ANALOG = 1 }
 
enum  SceCtrlPadPollMode { SCE_CTRL_POLL_INACTIVE = 0 , SCE_CTRL_POLL_ACTIVE = 1 }
 
enum  SceCtrlPort
 
enum  SceCtrlPadButtonMaskMode { SCE_CTRL_MASK_NO_MASK = 0 , SCE_CTRL_MASK_IGNORE_BUTTONS = 1 , SCE_CTRL_MASK_APPLY_BUTTONS = 2 }
 

Functions

s32 sceCtrlInit (void)
 
s32 sceCtrlEnd (void)
 
s32 sceCtrlSuspend (void)
 
s32 sceCtrlResume (void)
 
u32 sceCtrlSetPollingMode (u8 pollMode)
 
u32 sceCtrlGetSamplingMode (u8 *pMode)
 
s32 sceCtrlSetSamplingMode (u8 mode)
 
u32 sceCtrlGetSamplingCycle (u32 *pCycle)
 
s32 sceCtrlSetSamplingCycle (u32 cycle)
 
u32 sceCtrlGetIdleCancelKey (u32 *pResetButtonsMake, u32 *pResetButtonsPress, u32 *pResetButtonsMakeHoldMode, u32 *pResetButtonsPressHoldMode)
 
u32 sceCtrlSetIdleCancelKey (u32 resetButtonsMake, u32 resetButtonsPress, u32 resetButtonsMakeHoldMode, u32 resetButtonsPressHoldMode)
 Specifies the buttons which, when being pressed, reset the idle timer. More...
 
s32 sceCtrlGetIdleCancelThreshold (s32 *pUnHoldThreshold, s32 *pHoldThreshold)
 
s32 sceCtrlSetIdleCancelThreshold (s32 unHoldThreshold, s32 holdThreshold)
 
s16 sceCtrlGetSuspendingExtraSamples (void)
 
s32 sceCtrlSetSuspendingExtraSamples (s16 suspendSamples)
 
s32 sceCtrl_driver_E467BEC8 (u8 externalPort, SceCtrlInputDataTransferHandler *transferHandler, void *inputSource)
 
s32 sceCtrlPeekLatch (SceCtrlLatch *pLatch)
 Gets the latch data. More...
 
s32 sceCtrlReadLatch (SceCtrlLatch *pLatch)
 Gets the latch data. More...
 
s32 sceCtrlPeekBufferPositive (SceCtrlData *pData, u8 nBufs)
 Retrieves controller state data by polling (positive logic). More...
 
s32 sceCtrlPeekBufferNegative (SceCtrlData *pData, u8 nBufs)
 Retrieves controller state data by polling (negative logic). More...
 
s32 sceCtrlReadBufferPositive (SceCtrlData *pData, u8 nBufs)
 Retrieves controller state data by blocking (positive logic). More...
 
s32 sceCtrlReadBufferNegative (SceCtrlData *pData, u8 nBufs)
 Retrieves controller state data by blocking (negative logic). More...
 
s32 sceCtrlPeekBufferPositive2 (u32 port, SceCtrlData2 *pData, u8 nBufs)
 Retrieves controller state data by polling (positive logic) with support for wireless controllers. More...
 
s32 sceCtrlPeekBufferNegative2 (u32 port, SceCtrlData2 *pData, u8 nBufs)
 Retrieves controller state data by polling (negative logic) with support for wireless controllers. More...
 
s32 sceCtrlReadBufferPositive2 (u32 port, SceCtrlData2 *pData, u8 nBufs)
 Retrieves controller state data by blocking (positive logic) with support for wireless controllers. More...
 
s32 sceCtrlReadBufferNegative2 (u32 port, SceCtrlData2 *pData, u8 nBufs)
 Retrieves controller state data by blocking (negative logic) with support for wireless controllers. More...
 
s32 sceCtrlClearRapidFire (u8 slot)
 
s32 sceCtrlSetRapidFire (u8 slot, u32 uiMask, u32 uiTrigger, u32 uiTarget, u8 uiDelay, u8 uiMake, u8 uiBreak)
 
s32 sceCtrlSetAnalogEmulation (u8 slot, u8 aX, u8 aY, u32 uiMake)
 
s32 sceCtrlSetButtonEmulation (u8 slot, u32 userButtons, u32 kernelButtons, u32 uiMake)
 
u32 sceCtrlGetButtonIntercept (u32 buttons)
 
u32 sceCtrlSetButtonIntercept (u32 buttons, u32 buttonMaskMode)
 
s32 sceCtrlSetSpecialButtonCallback (u32 slot, u32 buttonMask, SceKernelButtonCallbackFunction callback, void *opt)
 
u32 sceCtrl_driver_6C86AF22 (s32 arg1)
 
u32 sceCtrl_driver_5886194C (s8 arg1)
 
u32 sceCtrlUpdateCableTypeReq (void)
 

Detailed Description

Copyright (C) 2011 - 2015 The uOFW team See the file COPYING for copying permission.

Controller (joystick) management.

Typedef Documentation

◆ SceKernelButtonCallbackFunction

typedef void(* SceKernelButtonCallbackFunction) (u32 curButtons, u32 lastButtons, void *opt)

The callback function used by sceCtrlSetSpecialButtonCallback().

Enumeration Type Documentation

◆ SceCtrlPadButtons

Enumeration for the digital controller buttons in positive logic.

Note
SCE_CTRL_INTERCEPTED, SCE_CTRL_WLAN_UP, SCE_CTRL_REMOTE, SCE_CTRL_VOLUP, SCE_CTRL_VOLDOWN, SCE_CTRL_SCREEN, SCE_CTRL_NOTE, SCE_CTRL_DISC, SCE_CTRL_MS can only be read in kernel mode.
Enumerator
SCE_CTRL_SELECT 

Select button.

SCE_CTRL_L3 

DS3 L3 button.

SCE_CTRL_R3 

DS3 R3 button.

SCE_CTRL_START 

Start button.

SCE_CTRL_UP 

Up D-Pad button.

SCE_CTRL_RIGHT 

Right D-Pad button.

SCE_CTRL_DOWN 

Down D-Pad button.

SCE_CTRL_LEFT 

Left D-Pad button.

SCE_CTRL_LTRIGGER 

Left trigger. This accounts for the DS3 L2 trigger as well.

SCE_CTRL_RTRIGGER 

Right trigger. This accounts for the DS3 R2 trigger as well.

SCE_CTRL_L1TRIGGER 

DS3 L1 trigger.

SCE_CTRL_R1TRIGGER 

DS3 R1 trigger.

SCE_CTRL_TRIANGLE 

Triangle button.

SCE_CTRL_CIRCLE 

Circle button.

SCE_CTRL_CROSS 

Cross button.

SCE_CTRL_SQUARE 

Square button.

SCE_CTRL_INTERCEPTED 

If this bit is set, then controller input is being intercepted by the system software or another application. For example, this is the case when the PSP's HOME menu is being shown.

SCE_CTRL_HOLD 

Hold button.

SCE_CTRL_WLAN_UP 

W-LAN switch up.

SCE_CTRL_REMOTE 

Remote hold position.

SCE_CTRL_VOLUP 

Volume up button.

SCE_CTRL_VOLDOWN 

Volume down button.

SCE_CTRL_SCREEN 

Screen button.

SCE_CTRL_NOTE 

Music Note button.

SCE_CTRL_DISC 

Disc present.

SCE_CTRL_MS 

Memory stick present.

◆ SceCtrlPadInputMode

Controller input modes.

Enumerator
SCE_CTRL_INPUT_DIGITAL_ONLY 

Digital input only. No recognizing of analog input.

SCE_CTRL_INPUT_DIGITAL_ANALOG 

Recognizing of both digital and analog input.

◆ SceCtrlPadPollMode

Controller input poll modes.

Enumerator
SCE_CTRL_POLL_INACTIVE 

No controller input is recognized.

SCE_CTRL_POLL_ACTIVE 

Controller input is recognized.

◆ SceCtrlPort

Specifies the type of input data to be obtained.

◆ SceCtrlPadButtonMaskMode

Button mask settings.

Enumerator
SCE_CTRL_MASK_NO_MASK 

No mask for the specified buttons. Button input is normally recognized.

SCE_CTRL_MASK_IGNORE_BUTTONS 

The specified buttons are ignored, that means even if these buttons are pressed by the user they won't be shown as pressed internally. You can only block user buttons for applications running in User Mode.

SCE_CTRL_MASK_APPLY_BUTTONS 

The specified buttons show up as being pressed, even if the user does not press them. You can only turn ON user buttons for applications running in User Mode.

Function Documentation

◆ sceCtrlInit()

s32 sceCtrlInit ( void  )

Initializes the controller device. Bind the controller driver to the controller device.

Returns
0 on success.

◆ sceCtrlEnd()

s32 sceCtrlEnd ( void  )

Terminates the controller device. Unbind the controller driver from the controller device.

Returns
0.

◆ sceCtrlSuspend()

s32 sceCtrlSuspend ( void  )

Suspends the controller driver and put the controller device into a low-power state.

Returns
0.

◆ sceCtrlResume()

s32 sceCtrlResume ( void  )

Resumes the controller driver after and bring the controller device back from a low-power state.

Returns
0.

◆ sceCtrlSetPollingMode()

u32 sceCtrlSetPollingMode ( u8  pollMode)

Enables/disables controller device input.

Parameters
pollModeOne of SceCtrlPadPollMode. If set to 0, no button/analog input is recognized. Set to 1 to enable button/analog input.
Returns
0.

◆ sceCtrlGetSamplingMode()

u32 sceCtrlGetSamplingMode ( u8 *  pMode)

Gets the current controller device input mode.

Parameters
pModePointer to an u8 variable which is to receive the current controller mode. One of SceCtrlPadInputMode.
Returns
0.

◆ sceCtrlSetSamplingMode()

s32 sceCtrlSetSamplingMode ( u8  mode)

Sets the controller device input mode.

Parameters
modeThe new controller input mode. One of SceCtrlPadInputMode.
Returns
The previous input mode on success.

◆ sceCtrlGetSamplingCycle()

u32 sceCtrlGetSamplingCycle ( u32 *  pCycle)

Gets the current update interval of the internal controller data buffers.

Parameters
pCyclePointer to an u32 variable which is to receive the current update interval (in microseconds).
Returns
0.

◆ sceCtrlSetSamplingCycle()

s32 sceCtrlSetSamplingCycle ( u32  cycle)

Sets the update frequency of the internal controller buffer. Default update interval is the VBlank interrupt (approximately 60 times per second).

Parameters
cycleThe new interval between two samplings of controller attributes in microseconds. Setting to 0 enables the VBlank-Interrupt-Update process. If you want to set an own interval for updating the internal controller buffers, cycle has to in the range of 5555 - 20000 (the range from about 180 Hz to 50 Hz). This will disable the VBlank-Interrupt-Update process.
Returns
The previous cycle on success.

◆ sceCtrlGetIdleCancelKey()

u32 sceCtrlGetIdleCancelKey ( u32 *  pResetButtonsMake,
u32 *  pResetButtonsPress,
u32 *  pResetButtonsMakeHoldMode,
u32 *  pResetButtonsPressHoldMode 
)

Obtains the different cancel-idle-timer buttons.

Parameters
pResetButtonsMakePointer to an u32 variable which is to receive the buttons resetting the idle timer when being pressed a new time (not already being pressed). Not used when the system is in HOLD mode.
pResetButtonsPressPointer to an u32 variable which is to receive the buttons resetting the idle timer when being pressed. Not used when the system is in HOLD mode.
pResetButtonsMakeHoldModePointer to an u32 variable which is to receive the buttons resetting the idle timer when being pressed a new time (not already being pressed). Used when the system is in HOLD mode.
pResetButtonsPressHoldModePointer to an u32 variable which is to receive the buttons resetting the idle timer when being pressed a new time. Used when the system is in HOLD mode.
Returns
0 on success.

◆ sceCtrlSetIdleCancelKey()

u32 sceCtrlSetIdleCancelKey ( u32  resetButtonsMake,
u32  resetButtonsPress,
u32  resetButtonsMakeHoldMode,
u32  resetButtonsPressHoldMode 
)

Specifies the buttons which, when being pressed, reset the idle timer.

This function lets you specify buttons which reset the idle timer. If multiple buttons are specified the timer can be resetted by simply pressing one of the specified buttons. A button combination is also possible.

Parameters
resetButtonsMakeButtons which will reset the timer if pressed. One or more of SceCtrlPadButtons. If you keep pressing one or more of these buttons after resetting the timer, they will not reset the timer anymore. You will have to release the buttons first, before they can reset it again. In case HOLD mode is active, pressing these buttons will not reset the timer.
resetButtonsPressButtons which will reset the timer if pressed. One or more of SceCtrlPadButtons. As long as you press one of these buttons, the timer is resetted. In case HOLD mode is active, pressing these buttons will not reset the timer.
resetButtonsMakeHoldModeButtons which will reset the timer if pressed while HOLD mode is active. One or more of SceCtrlPadButtons. If you keep pressing these buttons after resetting the timer, they will not reset it anymore. You will have to release the buttons first, before they can reset the timer again.
resetButtonsPressHoldModeButtons which will reset the timer if pressed while HOLD mode is active. One or more of SceCtrlPadButtons. As long as you press one of these buttons, the timer is resetted.
Returns
0 on success.
Example:
// Pressing the START button will reset the idle timer. Button needs to be released and pressed again to reset the
// idle timer another time. HOLD mode has to be inactive.
// Pressing the SELECT button will reset the idle timer. The button can be kept pressed (held down) to keep resetting
// the idle timer. HOLD mode has to be inactive.
u32 sceCtrlSetIdleCancelKey(u32 resetButtonsMake, u32 resetButtonsPress, u32 resetButtonsMakeHoldMode, u32 resetButtonsPressHoldMode)
Specifies the buttons which, when being pressed, reset the idle timer.
@ SCE_CTRL_START
Definition: ctrl.h:171
@ SCE_CTRL_SELECT
Definition: ctrl.h:165

◆ sceCtrlGetIdleCancelThreshold()

s32 sceCtrlGetIdleCancelThreshold ( s32 *  pUnHoldThreshold,
s32 *  pHoldThreshold 
)

Gets the idle timer cancel movement threshold values for the analog stick.

Parameters
pUnHoldThresholdPointer to a s32 variable which is to receive the treshold value when HOLD mode is inactive.
pHoldThresholdPointer to a s32 variable which is to receive the treshold value when HOLD mode is active.
Returns
0 on success.

◆ sceCtrlSetIdleCancelThreshold()

s32 sceCtrlSetIdleCancelThreshold ( s32  unHoldThreshold,
s32  holdThreshold 
)

Sets analog stick movement threshold values for cancelling the idle timer. In case SCE_CTRL_INPUT_DIGITAL_ONLY is set as the input mode for the controller, analog stick movements will not result in cancelling the idle timer.

Parameters
unHoldThresholdMovement needed by the analog stick to reset the idle timer. Used when HOLD mode is inactive. Set between 1 - 128 to specify the movement on either axis. Set to 0 for idle timer to be canceled even if the analog stick is not moved (that is, the idle timer itself stops running). Specify SCE_CTRL_IDLE_CANCEL_TRESHOLD_NO_CANCELLATION for analog stick movement to not cancel the idle timer.
holdThresholdMovement needed by the analog stick to reset the idle timer. Used when HOLD mode is active. Set between 1 - 128 to specify the movement on either axis. Set to 0 for idle timer to be canceled even if the analog stick is not moved (that is, the idle timer itself stops running). Specify SCE_CTRL_IDLE_CANCEL_TRESHOLD_NO_CANCELLATION for analog stick movement to not cancel the idle timer.
Returns
0 on success.

◆ sceCtrlGetSuspendingExtraSamples()

s16 sceCtrlGetSuspendingExtraSamples ( void  )

Gets the number of VBlanks which will be waited for when the PSP device is being suspended.

Returns
The number of VBlanks to wait for.

◆ sceCtrlSetSuspendingExtraSamples()

s32 sceCtrlSetSuspendingExtraSamples ( s16  suspendSamples)

Sets a number of VBlanks which will be waited for when the PSP device is being suspended.

Parameters
suspendSamplesThe number of VBlanks. Between 0 - 300.
Returns
0 on success.

◆ sceCtrl_driver_E467BEC8()

s32 sceCtrl_driver_E467BEC8 ( u8  externalPort,
SceCtrlInputDataTransferHandler transferHandler,
void *  inputSource 
)

Sets up internal controller buffers to receive external input data. Each input mode has its own set of buffers. These buffers are of type SceCtrlData2. Note: This function has to be called initially in order to obtain external input data via the corresponding Peek/Read functions.

Parameters
externalPortPass a valid element of SceCtrlPort (either 1 or 2).
transferHandlerPointer to a SceCtrlInputDataTransferHandler containing a function to copy the inputSource into the PSP's controller buffers.
inputSourcePointer to buffer containing the Controller input data to copy to the PSP's controller buffers. It is passed as the source argument to the given transfer function.
Returns
0 on success.

◆ sceCtrlPeekLatch()

s32 sceCtrlPeekLatch ( SceCtrlLatch pLatch)

Gets the latch data.

This function reads the latch data collected by the controller service. At each sampling interval, the controller service compares the new pressed/released button states with the previously sampled pressed button states and stores that comparison as latch data.

Compared to sceCtrlReadLatch(), calling this API will not result in clearing the internal latch data. As such, the data returned is the accumulated latch data since the last time sceCtrlReadLatch() was called. Consequently, the returned data should not be relied on whether a button is currently in a pressed or released state.

Parameters
pLatchPointer to a SceCtrlLatch variable which is to receive the accumulated button latch data.
Returns
On success, the number of times the controller service performed sampling since the last time sceCtrlReadLatch() was called.
< 0 on error.
See also
SceCtrlLatch
sceCtrlReadLatch()

◆ sceCtrlReadLatch()

s32 sceCtrlReadLatch ( SceCtrlLatch pLatch)

Gets the latch data.

This function reads the most recent latch data collected by the controller service. At each sampling interval, the controller service compares the new pressed/released button states with the previously sampled pressed button states and stores that comparison as latch data.

Compared to sceCtrlPeekLatch(), calling this API will result in clearing the internal latch data. As such, calling code might have to explicitly wait for the controller service to update its collected latch data.

Parameters
pLatchPointer to a SceCtrlLatch variable which is to receive the current button latch data.
Returns
On success, the number of times the controller service performed sampling since the last time sceCtrlReadLatch() was called.
< 0 on error.
Example:
SceCtrlLatch latchData;
while (1) {
// Obtain latch data
sceCtrlReadLatch(&latchData);
if (latchData.buttonMake & SCE_CTRL_CROSS)
{
// The Cross button has just been pressed (transition from 'released' state to 'pressed' state)
}
if (latchData.buttonPress & SCE_CTRL_SQUARE)
{
// The Square button is currently in the 'pressed' state
}
if (latchData.buttonBreak & SCE_CTRL_TRIANGLE)
{
// The Triangle button has just been released (transition from 'pressed' state to 'released' state)
}
if (latchData.buttonRelease & SCE_CTRL_CIRCLE)
{
// The Circle button is currently in the 'released' state
}
// As we clear the internal latch data with the ReadLatch() call, we can explicitly wait for the VBLANK interval
// to give the controller service the time it needs to collect new latch data again. This guarantees the next call
// to sceCtrlReadLatch() will return collected data again.
//
// Note: The sceCtrlReadBuffer*() APIs are implicitly waiting for a VBLANK interval if necessary.
sceDisplayWaitVBlank();
}
s32 sceCtrlReadLatch(SceCtrlLatch *pLatch)
Gets the latch data.
@ SCE_CTRL_CROSS
Definition: ctrl.h:193
@ SCE_CTRL_TRIANGLE
Definition: ctrl.h:189
@ SCE_CTRL_CIRCLE
Definition: ctrl.h:191
@ SCE_CTRL_SQUARE
Definition: ctrl.h:195
Definition: ctrl.h:133
u32 buttonRelease
Definition: ctrl.h:141
u32 buttonMake
Definition: ctrl.h:135
u32 buttonPress
Definition: ctrl.h:139
u32 buttonBreak
Definition: ctrl.h:137
See also
SceCtrlLatch
sceCtrlPeekLatch()

◆ sceCtrlPeekBufferPositive()

s32 sceCtrlPeekBufferPositive ( SceCtrlData pData,
u8  nBufs 
)

Retrieves controller state data by polling (positive logic).

This function obtains button data stored in the internal controller buffers. Does not wait for the next update interval to be performed.
The obtained data will be the latest transfered button data into the internal controller buffers.

Parameters
pDataPointer to one or more SceCtrlData variables to receive controller state data. The obtained button data is represented in positive logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.
Example:
while (1) {
// Cross button pressed
if (data.buttons & SCE_CTRL_CROSS) {
// do something
}
}
s32 sceCtrlPeekBufferPositive(SceCtrlData *pData, u8 nBufs)
Retrieves controller state data by polling (positive logic).
s32 sceCtrlSetSamplingCycle(u32 cycle)
s32 sceCtrlSetSamplingMode(u8 mode)
@ SCE_CTRL_INPUT_DIGITAL_ANALOG
Definition: ctrl.h:229
Definition: ctrl.h:22
u32 buttons
Definition: ctrl.h:29

◆ sceCtrlPeekBufferNegative()

s32 sceCtrlPeekBufferNegative ( SceCtrlData pData,
u8  nBufs 
)

Retrieves controller state data by polling (negative logic).

This fucntion obtains button data stored in the internal controller buffers. Does not wait for the next update interval to be performed. The obtained data will be the latest transfered button data into the internal controller buffers.

Parameters
pDataPointer to one or more SceCtrlData variables to receive controller state data. The obtained button data is represented in negative logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.
Example:
while (1) {
// Cross button pressed
if (data.buttons & ~SCE_CTRL_CROSS) {
// do something
}
}
s32 sceCtrlPeekBufferNegative(SceCtrlData *pData, u8 nBufs)
Retrieves controller state data by polling (negative logic).

◆ sceCtrlReadBufferPositive()

s32 sceCtrlReadBufferPositive ( SceCtrlData pData,
u8  nBufs 
)

Retrieves controller state data by blocking (positive logic).

This function obtains button data stored in the internal controller buffers. Waits for the next update interval before obtaining the data. The read data is the newest transfered data into the internal controller buffers.

Parameters
pDataPointer to one or more SceCtrlData variables to receive controller state data. The obtained data is represented in positive logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.

◆ sceCtrlReadBufferNegative()

s32 sceCtrlReadBufferNegative ( SceCtrlData pData,
u8  nBufs 
)

Retrieves controller state data by blocking (negative logic).

This function obtains button data stored in the internal controller buffers. Waits for the next update interval before obtaining the data. The read data is the newest transfered data into the internal controller buffers.

Parameters
pDataPointer to one or more SceCtrlData variables to receive controller state data. The obtained data is represented in negative logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.

◆ sceCtrlPeekBufferPositive2()

s32 sceCtrlPeekBufferPositive2 ( u32  port,
SceCtrlData2 pData,
u8  nBufs 
)

Retrieves controller state data by polling (positive logic) with support for wireless controllers.

This function Obtains button data stored in the internal controller buffers. Waits for the next update interval before obtaining the data. The read data is the newest transfered data into the internal controller buffers and can contain input state provided by external input devices such as a wireless controller.

Remarks
You need to call sceCtrl_driver_E467BEC8() before initial use of this API or its related ones.
Parameters
portPass a valid element of SceCtrlPort (either 1 or 2).
pDataPointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in positive logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.

◆ sceCtrlPeekBufferNegative2()

s32 sceCtrlPeekBufferNegative2 ( u32  port,
SceCtrlData2 pData,
u8  nBufs 
)

Retrieves controller state data by polling (negative logic) with support for wireless controllers.

This function obtains button data stored in the internal controller buffers. Waits for the next update interval before obtaining the data. The read data is the newest transfered data into the internal controller buffers and can contain input state provided by external input devices such as a wireless controller.

Remarks
You need to call sceCtrl_driver_E467BEC8() before initial use of this API or its related ones.
Parameters
portPass a valid element of SceCtrlPort (either 1 or 2).
pDataPointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in negative logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.

◆ sceCtrlReadBufferPositive2()

s32 sceCtrlReadBufferPositive2 ( u32  port,
SceCtrlData2 pData,
u8  nBufs 
)

Retrieves controller state data by blocking (positive logic) with support for wireless controllers.

This function obtains button data stored in the internal controller buffers. Waits for the next update interval before obtaining the data. The read data is the newest transfered data into the internal controller buffers and can contain input state provided by external input devices such as a wireless controller.

Remarks
You need to call sceCtrl_driver_E467BEC8() before initial use of this API or its related ones.
Parameters
portPass a valid element of SceCtrlPort (either 1 or 2).
pDataPointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in positive logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.

◆ sceCtrlReadBufferNegative2()

s32 sceCtrlReadBufferNegative2 ( u32  port,
SceCtrlData2 pData,
u8  nBufs 
)

Retrieves controller state data by blocking (negative logic) with support for wireless controllers.

This function obtains button data stored in the internal controller buffers. Waits for the next update interval before obtaining the data. The read data is the newest transfered data into the internal controller buffers and can contain input state provided by external input devices such as a wireless controller.

Remarks
You need to call sceCtrl_driver_E467BEC8() before initial use of this API or its related ones.
Parameters
portPass a valid element of SceCtrlPort (either 1 or 2).
pDataPointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in negative logic.
nBufsThe number of internal controller buffers to read. There are 64 internal controller buffers which can be read. Has to be set to a value in the range of 1 - 64.
Returns
The number of read internal controller buffers on success.

◆ sceCtrlClearRapidFire()

s32 sceCtrlClearRapidFire ( u8  slot)

Disables a rapid-fire button event.

Parameters
slotThe slot of the event to clear. Between 0 - 15.
Returns
0 on success.

◆ sceCtrlSetRapidFire()

s32 sceCtrlSetRapidFire ( u8  slot,
u32  uiMask,
u32  uiTrigger,
u32  uiTarget,
u8  uiDelay,
u8  uiMake,
u8  uiBreak 
)

Specifies a rapid-fire event for one or more buttons.

Parameters
slotThe slot used to set the custom values. Between 0 - 15. Up to 16 slots can be used.
uiMaskComparison mask of the button operation for rapid-fire trigger. In order for the uiTrigger buttons to trigger the event, they need to be included in these buttons. One or more buttons of SceCtrlPadButtons.
uiTriggerThe buttons which will start the rapid fire event for the specified uiTarget buttons when being pressed.
uiTargetThe buttons for which the rapid-fire event will be applied to. User mode buttons only. uiMake and uiBreak define the rapid-fire cycle.
uiDelayDead time of rapid-fire trigger (sampling count). Specifies the rapid-fire start timing. It will only be applied for the first ON period of a (not cancelled) rapid-fire event.
Set to 0 - 63.
uiMakeThe press time for the uiTarget buttons. This "ON-time" is set after uiDelay was applied and the uiTrigger buttons were turned OFF. It will be applied for as long as the same rapid fire event is called without a break (i.e. pressing of a different PSP button). Set to 0 - 63. If set to 0, the uiTarget button(s) will be turned ON for one sampling count.
uiBreakThe release time for uiTarget buttons. This "OFF-time" is set after uiDelay was applied. It will be applied as long as the same rapid fire event is called without a break (i.e. the pressing of a different PSP button). Set to 0 - 63. If set to 0, the uiTarget button will be turned OFF for 64 consecutive sampling counts.
Returns
0 on success.
Example:
// A rapid fire event for the R-button while the D-Pad-Up button is being pressed.
// R-button will be turned ON and OFF for 64 internal controller buffer updates in both cases
// (as long as D-Pad-Up is pressed).
// A rapid fire event for the R-button while the D-Pad-Up button is being pressed.
// R-button will be turned OFF and ON for 40 internal controller buffer updates in both cases
// (as long as D-Pad-Up is pressed).
s32 sceCtrlSetRapidFire(u8 slot, u32 uiMask, u32 uiTrigger, u32 uiTarget, u8 uiDelay, u8 uiMake, u8 uiBreak)
@ SCE_CTRL_UP
Definition: ctrl.h:173
@ SCE_CTRL_RTRIGGER
Definition: ctrl.h:183

◆ sceCtrlSetAnalogEmulation()

s32 sceCtrlSetAnalogEmulation ( u8  slot,
u8  aX,
u8  aY,
u32  uiMake 
)

Emulates values for the analog pad's X- and Y-axis.

Parameters
slotThe slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are combined.
aXNew emulated value for the X-axis. Between 0 - 0xFF.
aYNew emulate value for the Y-axis. Between 0 - 0xFF.
uiMakeSpecifies the duration of the emulation. Meassured in sampling counts.
Returns
0 on success.

◆ sceCtrlSetButtonEmulation()

s32 sceCtrlSetButtonEmulation ( u8  slot,
u32  userButtons,
u32  kernelButtons,
u32  uiMake 
)

Emulates buttons for the digital pad.

Parameters
slotThe slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are combined.
userButtonsEmulated user buttons of SceCtrlPadButtons. You cannot emulate kernel buttons and the emulated buttons will only be applied for applications running in user mode.
kernelButtonsEmulated buttons of SceCtrlPadButtons (you can emulate both user and kernel buttons). The emulated buttons will only be applied for applications running in kernel mode.
uiMakeSpecifies the duration of the emulation. Meassured in sampling counts.
Returns
0 on success.

◆ sceCtrlGetButtonIntercept()

u32 sceCtrlGetButtonIntercept ( u32  buttons)

Gets the button mask settings applied to PSP buttons.

Parameters
buttonsThe buttons to check for. One or more buttons of SceCtrlPadButtons.
Returns
The button mask mode for the given buttons. One of SceCtrlPadButtonMaskMode.

◆ sceCtrlSetButtonIntercept()

u32 sceCtrlSetButtonIntercept ( u32  buttons,
u32  buttonMaskMode 
)

Sets a button mask mode for one or more buttons. You can only mask user mode buttons in user applications. Masking of kernel mode buttons is ignored as well as buttons used in kernel mode applications.

Parameters
buttonsThe button value for which the button mask mode will be applied for. One or more buttons of SceCtrlPadButtons.
buttonMaskModeSpecifies the type of the button mask. One of SceCtrlPadButtonMaskMode.
Returns
The previous button mask type for the given buttons. One of SceCtrlPadButtonMaskMode.
Example:
// Block user mode buttons for User mode applications
// Do something
// Remove block from user mode buttons for User mode applications
u32 sceCtrlSetButtonIntercept(u32 buttons, u32 buttonMaskMode)
@ SCE_CTRL_MASK_NO_MASK
Definition: ctrl.h:253
@ SCE_CTRL_MASK_IGNORE_BUTTONS
Definition: ctrl.h:259

◆ sceCtrlSetSpecialButtonCallback()

s32 sceCtrlSetSpecialButtonCallback ( u32  slot,
u32  buttonMask,
SceKernelButtonCallbackFunction  callback,
void *  opt 
)

Registers a button callback.

Parameters
slotThe slot used to register the callback. Between 0 - 3.
buttonMaskBitwise OR'ed button values which will be checked for being pressed. One or more buttons of SceCtrlPadButtons.
callbackPointer to the callback function handling the button callbacks.
optOptional user argument. Passed to the callback function as its third argument.
Returns
0 on success.

◆ sceCtrl_driver_6C86AF22()

u32 sceCtrl_driver_6C86AF22 ( s32  arg1)

Unknown.

Parameters
arg1Unknown argument.
Returns
0.

◆ sceCtrl_driver_5886194C()

u32 sceCtrl_driver_5886194C ( s8  arg1)

Unknown.

Parameters
arg1Unknown argument.
Returns
0.

◆ sceCtrlUpdateCableTypeReq()

u32 sceCtrlUpdateCableTypeReq ( void  )

Unknown.

Returns
0.