uOFW
Reverse engineered PSP kernel 6.60.
|
Data Structures | |
struct | SceCtrlData |
struct | SceCtrlData2 |
struct | SceCtrlLatch |
struct | SceCtrlInputDataTransferHandler |
Typedefs | |
typedef void(* | SceKernelButtonCallbackFunction) (u32 curButtons, u32 lastButtons, void *opt) |
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) |
Copyright (C) 2011 - 2015 The uOFW team See the file COPYING for copying permission.
Controller (joystick) management.
typedef void(* SceKernelButtonCallbackFunction) (u32 curButtons, u32 lastButtons, void *opt) |
The callback function used by sceCtrlSetSpecialButtonCallback().
enum SceCtrlPadButtons |
Enumeration for the digital controller buttons in positive logic.
enum SceCtrlPadInputMode |
enum SceCtrlPadPollMode |
enum SceCtrlPort |
Specifies the type of input data to be obtained.
Button mask settings.
s32 sceCtrlInit | ( | void | ) |
Initializes the controller device. Bind the controller driver to the controller device.
s32 sceCtrlEnd | ( | void | ) |
Terminates the controller device. Unbind the controller driver from the controller device.
s32 sceCtrlSuspend | ( | void | ) |
Suspends the controller driver and put the controller device into a low-power state.
s32 sceCtrlResume | ( | void | ) |
Resumes the controller driver after and bring the controller device back from a low-power state.
u32 sceCtrlSetPollingMode | ( | u8 | pollMode | ) |
Enables/disables controller device input.
pollMode | One of SceCtrlPadPollMode. If set to 0, no button/analog input is recognized. Set to 1 to enable button/analog input. |
u32 sceCtrlGetSamplingMode | ( | u8 * | pMode | ) |
Gets the current controller device input mode.
pMode | Pointer to an u8 variable which is to receive the current controller mode. One of SceCtrlPadInputMode. |
s32 sceCtrlSetSamplingMode | ( | u8 | mode | ) |
Sets the controller device input mode.
mode | The new controller input mode. One of SceCtrlPadInputMode. |
u32 sceCtrlGetSamplingCycle | ( | u32 * | pCycle | ) |
Gets the current update interval of the internal controller data buffers.
pCycle | Pointer to an u32 variable which is to receive the current update interval (in microseconds). |
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).
cycle | The 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. |
u32 sceCtrlGetIdleCancelKey | ( | u32 * | pResetButtonsMake, |
u32 * | pResetButtonsPress, | ||
u32 * | pResetButtonsMakeHoldMode, | ||
u32 * | pResetButtonsPressHoldMode | ||
) |
Obtains the different cancel-idle-timer buttons.
pResetButtonsMake | Pointer 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. |
pResetButtonsPress | Pointer 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. |
pResetButtonsMakeHoldMode | Pointer 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. |
pResetButtonsPressHoldMode | Pointer 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. |
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.
resetButtonsMake | Buttons 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. |
resetButtonsPress | Buttons 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. |
resetButtonsMakeHoldMode | Buttons 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. |
resetButtonsPressHoldMode | Buttons 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. |
s32 sceCtrlGetIdleCancelThreshold | ( | s32 * | pUnHoldThreshold, |
s32 * | pHoldThreshold | ||
) |
Gets the idle timer cancel movement threshold values for the analog stick.
pUnHoldThreshold | Pointer to a s32 variable which is to receive the treshold value when HOLD mode is inactive. |
pHoldThreshold | Pointer to a s32 variable which is to receive the treshold value when HOLD mode is active. |
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.
unHoldThreshold | Movement 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. |
holdThreshold | Movement 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. |
s16 sceCtrlGetSuspendingExtraSamples | ( | void | ) |
Gets the number of VBlanks which will be waited for when the PSP device is being suspended.
s32 sceCtrlSetSuspendingExtraSamples | ( | s16 | suspendSamples | ) |
Sets a number of VBlanks which will be waited for when the PSP device is being suspended.
suspendSamples | The number of VBlanks. Between 0 - 300. |
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.
externalPort | Pass a valid element of SceCtrlPort (either 1 or 2). |
transferHandler | Pointer to a SceCtrlInputDataTransferHandler containing a function to copy the inputSource into the PSP's controller buffers. |
inputSource | Pointer 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. |
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.
pLatch | Pointer to a SceCtrlLatch variable which is to receive the accumulated button latch data. |
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.
pLatch | Pointer to a SceCtrlLatch variable which is to receive the current button latch data. |
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.
pData | Pointer to one or more SceCtrlData variables to receive controller state data. The obtained button data is represented in positive logic. |
nBufs | The 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. |
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.
pData | Pointer to one or more SceCtrlData variables to receive controller state data. The obtained button data is represented in negative logic. |
nBufs | The 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. |
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.
pData | Pointer to one or more SceCtrlData variables to receive controller state data. The obtained data is represented in positive logic. |
nBufs | The 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. |
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.
pData | Pointer to one or more SceCtrlData variables to receive controller state data. The obtained data is represented in negative logic. |
nBufs | The 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. |
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.
port | Pass a valid element of SceCtrlPort (either 1 or 2). |
pData | Pointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in positive logic. |
nBufs | The 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. |
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.
port | Pass a valid element of SceCtrlPort (either 1 or 2). |
pData | Pointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in negative logic. |
nBufs | The 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. |
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.
port | Pass a valid element of SceCtrlPort (either 1 or 2). |
pData | Pointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in positive logic. |
nBufs | The 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. |
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.
port | Pass a valid element of SceCtrlPort (either 1 or 2). |
pData | Pointer to one or more SceCtrlData2 variables to receive controller state data. The obtained button data is represented in negative logic. |
nBufs | The 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. |
s32 sceCtrlClearRapidFire | ( | u8 | slot | ) |
Disables a rapid-fire button event.
slot | The slot of the event to clear. Between 0 - 15. |
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.
slot | The slot used to set the custom values. Between 0 - 15. Up to 16 slots can be used. |
uiMask | Comparison 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. |
uiTrigger | The buttons which will start the rapid fire event for the specified uiTarget buttons when being pressed. |
uiTarget | The buttons for which the rapid-fire event will be applied to. User mode buttons only. uiMake and uiBreak define the rapid-fire cycle. |
uiDelay | Dead 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. |
uiMake | The 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. |
uiBreak | The 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. |
s32 sceCtrlSetAnalogEmulation | ( | u8 | slot, |
u8 | aX, | ||
u8 | aY, | ||
u32 | uiMake | ||
) |
Emulates values for the analog pad's X- and Y-axis.
slot | The slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are combined. |
aX | New emulated value for the X-axis. Between 0 - 0xFF. |
aY | New emulate value for the Y-axis. Between 0 - 0xFF. |
uiMake | Specifies the duration of the emulation. Meassured in sampling counts. |
s32 sceCtrlSetButtonEmulation | ( | u8 | slot, |
u32 | userButtons, | ||
u32 | kernelButtons, | ||
u32 | uiMake | ||
) |
Emulates buttons for the digital pad.
slot | The slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are combined. |
userButtons | Emulated user buttons of SceCtrlPadButtons. You cannot emulate kernel buttons and the emulated buttons will only be applied for applications running in user mode. |
kernelButtons | Emulated buttons of SceCtrlPadButtons (you can emulate both user and kernel buttons). The emulated buttons will only be applied for applications running in kernel mode. |
uiMake | Specifies the duration of the emulation. Meassured in sampling counts. |
u32 sceCtrlGetButtonIntercept | ( | u32 | buttons | ) |
Gets the button mask settings applied to PSP buttons.
buttons | The buttons to check for. One or more buttons of SceCtrlPadButtons. |
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.
buttons | The button value for which the button mask mode will be applied for. One or more buttons of SceCtrlPadButtons. |
buttonMaskMode | Specifies the type of the button mask. One of SceCtrlPadButtonMaskMode. |
s32 sceCtrlSetSpecialButtonCallback | ( | u32 | slot, |
u32 | buttonMask, | ||
SceKernelButtonCallbackFunction | callback, | ||
void * | opt | ||
) |
Registers a button callback.
slot | The slot used to register the callback. Between 0 - 3. |
buttonMask | Bitwise OR'ed button values which will be checked for being pressed. One or more buttons of SceCtrlPadButtons. |
callback | Pointer to the callback function handling the button callbacks. |
opt | Optional user argument. Passed to the callback function as its third argument. |
u32 sceCtrl_driver_6C86AF22 | ( | s32 | arg1 | ) |
Unknown.
arg1 | Unknown argument. |
u32 sceCtrl_driver_5886194C | ( | s8 | arg1 | ) |
Unknown.
arg1 | Unknown argument. |
u32 sceCtrlUpdateCableTypeReq | ( | void | ) |
Unknown.