|
uOFW
Reverse engineered PSP kernel 6.60.
|
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 |
Button mask settings.
| s32 sceCtrlInit | ( | void | ) |
Initialize the controller device. Bind the controller driver to the controller device.
| s32 sceCtrlEnd | ( | void | ) |
Terminate the controller device. Unbind the controller driver from the controller device.
| s32 sceCtrlSuspend | ( | void | ) |
Suspend the controller driver and put the controller device into a low-power state.
| s32 sceCtrlResume | ( | void | ) |
Resume the controller driver after and bring the controller device back from a low-power state.
| u32 sceCtrlSetPollingMode | ( | u8 | pollMode | ) |
Enable/disable 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 * | mode | ) |
Get the current controller device input mode.
| mode | Receiving the current controller mode. One of SceCtrlPadInputMode. |
| s32 sceCtrlSetSamplingMode | ( | u8 | mode | ) |
Set the controller device input mode.
| mode | The new controller input mode. One of SceCtrlPadInputMode. |
| u32 sceCtrlGetSamplingCycle | ( | u32 * | cycle | ) |
Get the current update interval of the internal controller data buffers.
| cycle | Receiving the current update interval (in microseconds). |
| s32 sceCtrlSetSamplingCycle | ( | u32 | cycle | ) |
Set 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 * | oneTimeResetButtons, |
| u32 * | allTimeResetButtons, | ||
| u32 * | oneTimeHoldResetButtons, | ||
| u32 * | allTimeHoldResetButtons | ||
| ) |
Obtain the different cancel-idle-timer buttons.
| oneTimeResetButtons | Pointer retrieving the buttons reseting the timer when being pressed a new time (not being pressed immediately before). |
| allTimeResetButtons | Pointer retrieving the buttons reseting the timer when being pressed. |
| oneTimeHoldResetButtons | Pointer retrieving the buttons reseting the timer when being pressed a new time (not being pressed immediately before). These buttons are checked for when HOLD mode is active. |
| allTimeHoldResetButtons | Pointer retrieving the buttons reseting the timer when being pressed a new time. These buttons are checked for when HOLD mode is active. |
| u32 sceCtrlSetIdleCancelKey | ( | u32 | oneTimeResetButtons, |
| u32 | allTimeResetButtons, | ||
| u32 | oneTimeHoldResetButtons, | ||
| u32 | allTimeHoldResetButtons | ||
| ) |
Specify the buttons which, when being pressed, reset the idle timer. It is satisfying to press only one button of the specified buttons to reset it.
| oneTimeResetButtons | The buttons needed to be pressed to reset the timer. One or more of SceCtrlPadButtons. If you keep pressing 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. |
| allTimeResetButtons | The buttons needed to be pressed to reset the timer. One or more of SceCtrlPadButtons. As long as you press one of these buttons, the timer is reset. In case HOLD mode is active, pressing these buttons will not reset the timer. |
| oneTimeHoldResetButtons | The buttons needed to be pressed to reset the timer when 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. |
| allTimeHoldResetButtons | The buttons needed to be pressed to reset the timer when HOLD mode is active. One or more of SceCtrlPadButtons. As long as you press one of these buttons, the timer is reset. |
// Pressing the select will reset the idle timer. No other button will reset it. sceCtrlSetIdleCancelKey(0, SCE_CTRL_SELECT, 0, 0);
| s32 sceCtrlGetIdleCancelThreshold | ( | s32 * | iUnHoldThreshold, |
| s32 * | iHoldThreshold | ||
| ) |
Get the idle timer cancel threshold values for the analog stick.
| iUnHoldThreshold | Movement needed by the analog stick to reset the idle timer. Used when HOLD mode is inactive. -1 is obtained when the analog stick cannot cancel the idle timer, otherwise the movement needed by the analog stick (between 0 - 128) to cancel the idle timer. |
| iHoldThreshold | Movement needed by the analog stick to reset the idle timer. Used when HOLD mode is active. -1 is obtained when the analog stick cannot cancel the idle timer, otherwise the movement needed by the analog stick (between 0 - 128) to cancel the idle timer. |
| s32 sceCtrlSetIdleCancelThreshold | ( | s32 | iUnHoldThreshold, |
| s32 | iHoldThreshold | ||
| ) |
Set analog stick 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.
| iUnHoldThreshold | 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). Set to -1 for analog stick to not cancel the idle timer (although it is moved). |
| iHoldThreshold | 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). Set to -1 for analog stick to not cancel the idle timer (although it is moved). |
| s16 sceCtrlGetSuspendingExtraSamples | ( | void | ) |
Get the number of VBlanks which will be waited for when the PSP device is being suspended.
| s32 sceCtrlSetSuspendingExtraSamples | ( | s16 | suspendSamples | ) |
Set 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 sceCtrlExtendInternalCtrlBuffers | ( | u8 | inputMode, |
| SceCtrlInputDataTransferHandler * | transferHandler, | ||
| void * | inputSource | ||
| ) |
Set up internal controller buffers to receive external input data. Each input mode has its own set of buffers. These buffers are of type SceCtrlDataExt. Note: This function has to be called initially in order to obtain external input data via the corresponding Peek/Read functions.
| inputMode | Pass a valid element of SceCtrlExternalInputMode (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 * | latch | ) |
Obtain button latch data stored in the internal latch controller buffers. The following button states can be obtained: Button is pressed, button is not pressed, button has been newly pressed and button has been newly released. Once a button has been, for example, pressed, its value is stored into the specific latch member (buttonMake in this case) until you manually reset the specific latch buffer field.
| latch | Pointer to a SceCtrlLatch structure retrieving the current button latch data. |
SceCtrlLatch latch; sceCtrlPeekLatch(&latch); while (1) { // Cross button pressed if (latch.buttonPress & SCE_CTRL_CROSS) { // do something } }
| s32 sceCtrlReadLatch | ( | SceCtrlLatch * | latch | ) |
Obtain button latch data stored in the internal latch controller buffers. The following button states can be obtained: Button is pressed, button is not pressed, button has been newly pressed and button has been newly released. After the internal latch data has been read, it will be reset to zero again.
| latch | Pointer to a SceCtrlLatch structure retrieving the current button latch data. |
| s32 sceCtrlPeekBufferPositive | ( | SceCtrlData * | data, |
| u8 | nBufs | ||
| ) |
Obtain 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.
| data | Pointer to controller data structure in which button information is stored. 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. |
SceCtrlData data; sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(SCE_CTRL_INPUT_DIGITAL_ANALOG); while (1) { sceCtrlPeekBufferPositive(&data, 1); // Cross button pressed if (data.buttons & SCE_CTRL_CROSS) { // do something } }
| s32 sceCtrlPeekBufferNegative | ( | SceCtrlData * | data, |
| u8 | nBufs | ||
| ) |
Obtain 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.
| data | Pointer to controller data structure in which button information is stored. 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. |
SceCtrlData data; sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(SCE_CTRL_INPUT_DIGITAL_ANALOG); while (1) { sceCtrlPeekBufferNegative(&data, 1); // Cross button pressed if (data.buttons & ~SCE_CTRL_CROSS) { // do something } }
| s32 sceCtrlReadBufferPositive | ( | SceCtrlData * | data, |
| u8 | nBufs | ||
| ) |
Obtain 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.
| data | Pointer to controller data structure in which button information is stored. 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 sceCtrlReadBufferNegative | ( | SceCtrlData * | data, |
| u8 | nBufs | ||
| ) |
Obtain 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.
| data | Pointer to controller data structure in which button information is stored. 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 sceCtrlPeekBufferPositiveExtra | ( | u32 | inputMode, |
| SceCtrlDataExt * | data, | ||
| u8 | nBufs | ||
| ) |
Extended sceCtrlPeekBufferPositive(). See description for more info. You need to call ::SceCtrlExtendInternalCtrlBuffers() before use.
| inputMode | Pass a valid element of SceCtrlExternalInputMode (either 1 or 2). |
| data | Pointer to controller data structure in which button information is stored. 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 sceCtrlPeekBufferNegativeExtra | ( | u32 | inputMode, |
| SceCtrlDataExt * | data, | ||
| u8 | nBufs | ||
| ) |
Extended sceCtrlPeekBufferNegative(). See description for more info. You need to call sceCtrlExtendInternalCtrlBuffers() before use.
| inputMode | Pass a valid element of SceCtrlExternalInputMode (either 1 or 2). |
| data | Pointer to controller data structure in which button information is stored. 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 sceCtrlReadBufferPositiveExtra | ( | u32 | inputMode, |
| SceCtrlDataExt * | data, | ||
| u8 | nBufs | ||
| ) |
Extended sceCtrlReadBufferPositive(). See description for more info. You need to call sceCtrlExtendInternalCtrlBuffers() before use.
| inputMode | Pass a valid element of SceCtrlExternalInputMode (either 1 or 2). |
| data | Pointer to controller data structure in which button information is stored. 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 sceCtrlReadBufferNegativeExtra | ( | u32 | inputMode, |
| SceCtrlDataExt * | data, | ||
| u8 | nBufs | ||
| ) |
Extended sceCtrlReadBufferNegative(). See description for more info. You need to call sceCtrlExtendInternalCtrlBuffers() before use.
| inputMode | Pass a valid element of SceCtrlExternalInputMode (either 1 or 2). |
| data | Pointer to controller data structure in which button information is stored. 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 | ) |
Disable 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 | ||
| ) |
Specify 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. |
// 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). sceCtrlSetRapidFire(0, SCE_CTRL_UP, SCE_CTRL_UP, SCE_CTRL_RTRIGGER, 63, 63, 63); // 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). sceCtrlSetRapidFire(0, SCE_CTRL_UP, SCE_CTRL_UP, SCE_CTRL_RTRIGGER, 0, 40, 40);
| s32 sceCtrlSetAnalogEmulation | ( | u8 | slot, |
| u8 | aX, | ||
| u8 | aY, | ||
| u32 | uiMake | ||
| ) |
Emulate 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 | ||
| ) |
Emulate 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 | ) |
Get 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 | ||
| ) |
Set 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. |
// Block user mode buttons for User mode applications sceCtrlSetButtonIntercept(0xFFFF, SCE_CTRL_MASK_IGNORE_BUTTONS); // Do something // Remove block from user mode buttons for User mode applications sceCtrlSetButtonIntercept(0xFFFF, SCE_CTRL_MASK_NO_MASK);
| s32 sceCtrlSetSpecialButtonCallback | ( | u32 | slot, |
| u32 | buttonMask, | ||
| SceKernelButtonCallbackFunction | callback, | ||
| void * | opt | ||
| ) |
Register 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 purpose.
| arg1 | Unknown argument. |
| u32 sceCtrl_driver_5886194C | ( | s8 | arg1 | ) |
Unknown purpose.
| arg1 | Unknown argument. |
| u32 sceCtrlUpdateCableTypeReq | ( | void | ) |
Unknown purpose.
1.7.6.1