2012-01-01 00:41:00 +00:00
|
|
|
/* Copyright (C) 2011, 2012 The uOFW team
|
2011-12-19 21:53:17 +00:00
|
|
|
See the file COPYING for copying permission.
|
|
|
|
*/
|
|
|
|
|
2011-12-15 19:17:25 +00:00
|
|
|
/**
|
2011-11-24 18:18:36 +00:00
|
|
|
* ctrl.h
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @author _Felix_
|
2012-02-04 21:40:00 +00:00
|
|
|
* @version 6.60
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* Controller libraries of the SCE PSP system.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
|
|
|
|
2012-08-23 13:37:32 +00:00
|
|
|
#include "common_header.h"
|
2012-05-06 20:14:38 +00:00
|
|
|
|
2012-02-02 15:19:54 +00:00
|
|
|
/** @defgroup Controller Controller libraries
|
2011-11-24 18:31:12 +00:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2011-11-24 18:18:36 +00:00
|
|
|
#ifndef CTRL_H
|
|
|
|
#define CTRL_H
|
|
|
|
|
2012-02-02 15:19:54 +00:00
|
|
|
/** The callback function used by ::sceCtrlSetSpecialButtonCallback. */
|
2012-08-09 10:54:36 +00:00
|
|
|
typedef void (*SceCtrlCb)(u32 currBtns, u32 lastBtns, void *opt);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Type definition for improved style. */
|
2012-05-16 18:56:45 +00:00
|
|
|
typedef u8 SceCtrlPadPollMode;
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Type definition for improved style. */
|
2012-05-16 18:56:45 +00:00
|
|
|
typedef u8 SceCtrlPadButtonMaskMode;
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/** General information about an internal PSP controller buffer. Including current pressed button(s) and current position
|
2011-12-01 19:44:30 +00:00
|
|
|
* of the analog controller.
|
|
|
|
*/
|
2012-05-16 18:56:45 +00:00
|
|
|
typedef struct {
|
2011-12-01 19:44:30 +00:00
|
|
|
/** The time, how long the D-Pad & the Analog-Pad have been active. Time unit is in microseconds.
|
2012-04-26 22:16:42 +00:00
|
|
|
* Can be used to get the time period of a button pressing event.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2011-12-01 20:14:30 +00:00
|
|
|
u32 activeTime; //0
|
2012-05-16 18:56:45 +00:00
|
|
|
/** The currently pressed D-Pad button(s). Bitwise OR'ed values of ::sceCtrlPadButtons. */
|
2011-12-01 20:14:30 +00:00
|
|
|
u32 buttons; //4
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Analog Stick X-axis offset (0 - 255). Left = 0, Right = 255. */
|
2011-12-01 20:14:30 +00:00
|
|
|
u8 aX; //8
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Analog Stick Y-axis offset (0 - 255). Up = 0, Down = 255. */
|
2011-12-01 20:14:30 +00:00
|
|
|
u8 aY; //9
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Reserved. Values are normally set to 0. */
|
2011-12-01 20:14:30 +00:00
|
|
|
u8 rsrv[6]; //10
|
2011-12-15 19:17:25 +00:00
|
|
|
} SceCtrlData; //Size of SceCtrlData: 16
|
2011-12-01 19:44:30 +00:00
|
|
|
|
2012-02-04 21:56:29 +00:00
|
|
|
/** Extended SceCtrlData structure. */
|
2012-05-16 18:56:45 +00:00
|
|
|
typedef struct {
|
2011-12-01 19:44:30 +00:00
|
|
|
/** The time, how long the D-Pad & the Analog-Pad have been active. Time unit is in microseconds.
|
2011-12-15 19:17:25 +00:00
|
|
|
* Can be used to get the time period if a button pressing.
|
|
|
|
*/
|
|
|
|
u32 activeTime; //0
|
2012-05-16 18:56:45 +00:00
|
|
|
/** The currently pressed D-Pad button(s). Bitwise OR'ed values of ::sceCtrlPadButtons. */
|
2011-12-15 19:17:25 +00:00
|
|
|
u32 buttons; //4
|
|
|
|
/** Analog Stick X-axis offset (0 - 255). Left = 0, Right = 255. */
|
|
|
|
u8 aX; //8
|
|
|
|
/** Analog Stick Y-axis offset (0 - 255). Up = 0, Down = 255. */
|
|
|
|
u8 aY; //9
|
|
|
|
/** Reserved. Values are normally set to 0. */
|
|
|
|
u8 rsrv[6]; //10
|
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk1; //16
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk2; //20
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk3; //24
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk4; //28
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk5; //32
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk6; //36
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk7; //40
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Unknown. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk8; //44
|
2012-02-02 15:19:54 +00:00
|
|
|
} SceCtrlDataExt; //Size of SceCtrlDataExt: 48
|
2011-12-01 19:44:30 +00:00
|
|
|
|
2012-02-04 21:56:29 +00:00
|
|
|
/** Status attributes of a button. Each structure member represents an active button
|
2012-05-16 18:56:45 +00:00
|
|
|
* through its button value (one of ::sceCtrlPadButtons).
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-05-16 18:56:45 +00:00
|
|
|
typedef struct {
|
2011-11-24 18:18:36 +00:00
|
|
|
/** Button is newly pressed (was not already been pressed). */
|
|
|
|
u32 btnMake; //0
|
|
|
|
/** Stop of button press. */
|
|
|
|
u32 btnBreak; //4
|
|
|
|
/** Button is pressed. */
|
|
|
|
u32 btnPress; //8
|
|
|
|
/** Button is not pressed. */
|
|
|
|
u32 btnRelease; //12
|
2011-12-15 19:17:25 +00:00
|
|
|
} SceCtrlLatch; //Size of SceCtrlLatch: 16
|
|
|
|
|
2012-05-03 18:29:34 +00:00
|
|
|
/** Custom function name. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrl_5A36B1C2(s32 arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlPeekBufferPositiveExt")));
|
2012-05-03 18:29:34 +00:00
|
|
|
/** Custom function name. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrl_239A6BA7(s32 arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlPeekBufferNegativeExt")));
|
2012-05-03 18:29:34 +00:00
|
|
|
/** Custom function name. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrl_1098030B(s32 arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlReadBufferPositiveExt")));
|
2012-05-03 18:29:34 +00:00
|
|
|
/** Custom function name. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrl_7C3675AB(s32 arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlReadBufferNegativeExt")));
|
2012-05-03 18:29:34 +00:00
|
|
|
/** Custom function name. */
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrl_driver_E467BEC8(u8 mode, s32 arg2, s32 arg3)__attribute__((alias("sceCtrlExtendInternalCtrlBuffers")));
|
2012-05-03 18:29:34 +00:00
|
|
|
|
2011-11-24 18:18:36 +00:00
|
|
|
/**
|
|
|
|
* Enumeration for the digital controller buttons.
|
|
|
|
*
|
2011-12-01 19:44:30 +00:00
|
|
|
* @note PSP_CTRL_HOME, PSP_CTRL_WLAN_UP, PSP_CTRL_REMOTE, PSP_CTRL_VOLUP, PSP_CTRL_VOLDOWN, PSP_CTRL_SCREEN, PSP_CTRL_NOTE, PSP_CTRL_DISC,
|
2011-11-24 18:18:36 +00:00
|
|
|
* PSP_CTRL_MS can only be read in kernel mode.
|
|
|
|
*/
|
2012-05-16 18:56:45 +00:00
|
|
|
enum sceCtrlPadButtons {
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Select button. Negative value = 0xFFFFFFFE. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_SELECT = 0x1,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Start button. Negative value = 0xFFFFFFF7. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_START = 0x8,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Up D-Pad button. Negative value = 0xFFFFFFEF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_UP = 0x10,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Right D-Pad button. Negative value = 0xFFFFFFDF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_RIGHT = 0x20,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Down D-Pad button. Negative value = 0xFFFFFFBF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_DOWN = 0x40,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Left D-Pad button. Negative value = 0xFFFFFF7F. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_LEFT = 0x80,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Left trigger. Negative value = 0xFFFFFEFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_LTRIGGER = 0x100,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Right trigger. Negative value = 0xFFFFFDFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_RTRIGGER = 0x200,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Triangle button. Negative value = 0xFFFFEFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_TRIANGLE = 0x1000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Circle button. Negative value = 0xFFFFDFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_CIRCLE = 0x2000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Cross button. Negative value = 0xFFFFBFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_CROSS = 0x4000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Square button. Negative value = 0xFFFF7FFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_SQUARE = 0x8000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Home button. In user mode this bit is set if the exit dialog is visible. Negative value = 0xFFFEFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_HOME = 0x10000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Hold button. Negative value = 0xFFFDFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_HOLD = 0x20000,
|
2012-02-04 21:40:00 +00:00
|
|
|
/** W-LAN switch up. Negative value = 0xFFFBFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_WLAN_UP = 0x40000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Remote hold position. Negative value = 0xFFF7FFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_REMOTE = 0x80000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Volume up button. Negative value = 0xFFEFFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_VOLUP = 0x100000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Volume down button. Negative value = 0xFFBFFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_VOLDOWN = 0x200000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Screen button. Negative value = 0xFFBFFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_SCREEN = 0x400000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Music Note button. Negative value = 0xFF7FFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_NOTE = 0x800000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Disc present. Negative value = 0xFEFFFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_DISC = 0x1000000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Memory stick present. Negative value = 0xFDFFFFFF. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_MS = 0x2000000,
|
2012-02-02 15:47:30 +00:00
|
|
|
};
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/** Controller input modes. */
|
2012-08-09 10:54:36 +00:00
|
|
|
enum SceCtrlPadInputMode {
|
2012-02-04 21:40:00 +00:00
|
|
|
/** Digital input only. No recognizing of analog input. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_INPUT_DIGITAL_ONLY = 0,
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Recognizing of both digital and analog input. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_INPUT_DIGITAL_ANALOG = 1,
|
2011-11-24 18:18:36 +00:00
|
|
|
};
|
|
|
|
|
2012-02-02 15:19:54 +00:00
|
|
|
/** Controller input poll modes. */
|
2012-05-16 18:56:45 +00:00
|
|
|
enum sceCtrlPadPollMode {
|
2011-11-24 18:18:36 +00:00
|
|
|
/** No controller input is recognized. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_POLL_KILLED = 0,
|
2011-11-24 18:18:36 +00:00
|
|
|
/** Controller input is recognized. */
|
2012-05-16 18:56:45 +00:00
|
|
|
SCE_CTRL_POLL_RUNNING = 1,
|
2011-11-24 18:18:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Button mask settings. */
|
2012-05-16 18:56:45 +00:00
|
|
|
enum sceCtrlPadButtonMaskMode {
|
|
|
|
/** Remove any masks involving the specified buttons. */
|
|
|
|
SCE_CTRL_MASK_NO_MASK = 0,
|
|
|
|
/** Block the specified buttons (their button status (pressed/un-pressed) won't be recognized).
|
|
|
|
* You can only block user buttons for applications running in User Mode. */
|
|
|
|
SCE_CTRL_MASK_IGNORE_BUTTONS = 1,
|
|
|
|
/** Set the specified buttons (they will be simulated as being pressed).
|
|
|
|
* You can only set user buttons for applications running in User Mode. */
|
|
|
|
SCE_CTRL_MASK_SET_BUTTONS = 2,
|
2011-11-24 18:18:36 +00:00
|
|
|
};
|
|
|
|
|
2011-12-15 19:17:25 +00:00
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Initialize the controller device. Bind the controller driver to the controller device.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @return 0 on success, otherwise < 0.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlInit(void);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Terminate the controller device. Unbind the controller driver from the controller device.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlEnd(void);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Suspend the controller driver and put the controller device into a low-power state.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSuspend(void);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Resume the controller driver after and bring the controller device
|
|
|
|
* back from a low-power state.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlResume(void);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
2011-11-24 18:18:36 +00:00
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Enable/disable controller device input.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param pollMode One of ::sceCtrlPadPollMode. If set to 0, no button/analog input is recognized.
|
2012-02-02 15:19:54 +00:00
|
|
|
* Set to 1 to enable button/analog input.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @return 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetPollingMode(SceCtrlPadPollMode pollMode);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Get the current controller device input mode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-08-09 10:54:36 +00:00
|
|
|
* @param mode Receiving the current controller mode. One of ::SceCtrlPadInputMode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
u32 sceCtrlGetSamplingMode(u8 *mode);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Set the controller device input mode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-08-09 10:54:36 +00:00
|
|
|
* @param mode The new controller input mode. One of ::SceCtrlPadInputMode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The previous input mode on success, otherwise less than 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetSamplingMode(u8 mode);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-16 18:56:45 +00:00
|
|
|
* Get the current cycle specifying the update frequency of the internal controller data buffers.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param cycle Receiving the current cycle.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlGetSamplingCycle(u32 *cycle);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-03 18:29:34 +00:00
|
|
|
* Set the update frequency of the internal controller buffer. Default update frequency is the VBlank-Interrupt (60 times/sec).
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2011-11-24 21:44:37 +00:00
|
|
|
* @param cycle The new time period between two samplings of controller attributes in microseconds.
|
2012-05-03 18:29:34 +00:00
|
|
|
* Setting to 0 enables the VBlank-Interrupt-Update process. If you want to set an own
|
2012-05-16 18:56:45 +00:00
|
|
|
* time period for updating the internal controller buffer(s), cycle has to be greater 5554
|
|
|
|
* and less than 20001.
|
2012-05-03 18:29:34 +00:00
|
|
|
* This will disable the VBlank-Interrupt-Update process.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The previous cycle on success, otherwise less than 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetSamplingCycle(u32 cycle);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the idle threshold values.
|
|
|
|
*
|
2011-11-24 21:44:37 +00:00
|
|
|
* @param idlerest Movement needed by the analog to reset the idle timer.
|
|
|
|
* @param idleback Movement needed by the analog to bring the PSP back from an idle state.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlGetIdleCancelThreshold(s32 *idleReset, s32 *idleBack);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set analog threshold relating to the idle timer.
|
|
|
|
*
|
2011-11-24 21:44:37 +00:00
|
|
|
* @param idlereset Movement needed by the analog to reset the idle timer.
|
|
|
|
* @param idleback Movement needed by the analog to bring the PSP back from an idle state.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
|
|
|
* Set to -1 for analog to not cancel idle timer.
|
2012-02-04 21:40:00 +00:00
|
|
|
* Set to 0 for idle timer to be canceled even if the analog is not moved.
|
2011-11-24 18:18:36 +00:00
|
|
|
* Set between 1 - 128 to specify the movement on either axis needed by the analog to fire the event.
|
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetIdleCancelThreshold(s32 idlereset, s32 idleback);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Get the number of VBlanks for which will be waited when terminating the controller library.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @return The number of VBlanks.
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s16 sceCtrlGetSuspendingExtraSamples(void);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set a number of VBlanks for which will be waited when terminating the controller library.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param suspendSamples The number of VBlanks. Between 0 - 300.
|
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2012-02-02 15:19:54 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetSuspendingExtraSamples(s16 suspendSamples);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
2012-05-03 21:37:22 +00:00
|
|
|
typedef struct _ctrlUnkStruct {
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 unk1;
|
|
|
|
s32 (*func)(int);
|
2012-05-03 21:37:22 +00:00
|
|
|
} ctrlUnkStruct;
|
|
|
|
|
2012-02-02 15:19:54 +00:00
|
|
|
/**
|
2012-02-04 21:56:29 +00:00
|
|
|
* Extend the 64 internal controller buffers to represent SceCtrlDataExt structures.
|
2012-04-26 22:16:42 +00:00
|
|
|
* By default, an internal controller buffer is equivalent to a SceCtrlData structure. This function has to be called before using
|
2012-02-02 15:19:54 +00:00
|
|
|
* the extended read/peekBuffer functions.
|
|
|
|
*
|
|
|
|
* @param mode Seems to be an index. Pass either 1 or 2.
|
2012-05-03 18:29:34 +00:00
|
|
|
* @param arg2 Pointer to a ctrlUnkStruct structure?
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param arg3 Unknown.
|
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlExtendInternalCtrlBuffers(u8 mode, ctrlUnkStruct *arg2, s32 arg3);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2011-12-01 19:58:27 +00:00
|
|
|
* Read the current internal latch buffer. The following button states are delivered:
|
2011-12-15 19:17:25 +00:00
|
|
|
* Button is pressed, button is not pressed, button has been newly pressed
|
|
|
|
* and button has been newly released.
|
2012-04-26 22:16:42 +00:00
|
|
|
* Once a button has been i.e. pressed, its value is stored into the specific internal latch buffer member (uiMake in this case)
|
2011-11-24 18:18:36 +00:00
|
|
|
* until you manually reset the specific latch buffer field.
|
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param latch Pointer to a SceCtrlLatch structure retrieving the current internal latch buffer.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of reads of the internal latch buffer, without being reseted, on success, otherwise less than 0.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @par Example:
|
|
|
|
* @code
|
|
|
|
* SceCtrlLatch latch_data;
|
|
|
|
*
|
|
|
|
* sceCtrlPeekLatch(&latch_data);
|
|
|
|
* while(1) {
|
|
|
|
* //Cross button pressed
|
|
|
|
* if (latch_data.btnPress & PSP_CTRL_CROSS) {
|
|
|
|
* //do something
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* @endcode
|
|
|
|
*
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlPeekLatch(SceCtrlLatch *latch);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2011-12-01 19:58:27 +00:00
|
|
|
* Read the current internal latch buffer and reset the buffer afterwards. The following button states are delivered:
|
2011-11-24 18:18:36 +00:00
|
|
|
* Button is pressed, button is not pressed, button has been newly pressed
|
|
|
|
* and button has been newly released.
|
2011-11-24 21:44:37 +00:00
|
|
|
* After the internal latch buffer has been read, it will be cleaned (all members will be reset to zero).
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param latch Pointer to a SceCtrlLatch structure retrieving the current internal latch buffer.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of reads of the internal latch buffer without being reseted (typically 1) on success, otherwise less than 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlReadLatch(SceCtrlLatch *latch);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
2011-12-01 19:44:30 +00:00
|
|
|
/**
|
2012-02-04 21:56:29 +00:00
|
|
|
* Read the current internal controller buffer. Does not wait for the next VBlank.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param pad Pointer to a SceCtrlData structure retrieving the current internal controller buffer.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param count The number of internal buffers to read. There are 64 internal controller buffers which can be read.
|
2012-02-02 15:19:54 +00:00
|
|
|
* Has to be set to a value in the range of 1 - 64.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers, otherwise less than 0.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @par Example:
|
|
|
|
* @code
|
|
|
|
* SceCtrlData pad;
|
|
|
|
|
|
|
|
* sceCtrlSetSamplingCycle(0);
|
|
|
|
* sceCtrlSetSamplingMode(1);
|
|
|
|
*
|
|
|
|
* while(1) {
|
|
|
|
* sceCtrlPeekBufferPositive(&pad, 1);
|
|
|
|
* //Cross button pressed
|
|
|
|
* if (pad.Buttons & PSP_CTRL_CROSS) {
|
|
|
|
* //do something
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* @endcode
|
2011-12-01 19:44:30 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlPeekBufferPositive(SceCtrlData *pad, u8 reqBufReads);
|
2011-12-01 19:44:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read the current internal SceCtrlData buffer. Does not wait for the next VBlank.
|
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param pad Pointer to a SceCtrlData structure retrieving the current internal controller buffer. Negative button values have to be used.
|
2012-05-16 18:56:45 +00:00
|
|
|
* Check ::sceCtrlPadButtons for the negative active values of the buttons. If no button is active, the internal
|
2011-12-01 19:44:30 +00:00
|
|
|
* button value is 0xFFFFFFFF.
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param reqBufReads The number of internal 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.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers, otherwise less than 0.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @par Example:
|
|
|
|
* @code
|
|
|
|
* SceCtrlData pad;
|
|
|
|
|
|
|
|
* sceCtrlSetSamplingCycle(0);
|
|
|
|
* sceCtrlSetSamplingMode(1);
|
|
|
|
*
|
|
|
|
* while(1) {
|
|
|
|
* sceCtrlPeekBufferNegative(&pad, 1);
|
|
|
|
* //Cross button pressed
|
|
|
|
* if (pad.Buttons & ~PSP_CTRL_CROSS) {
|
|
|
|
* //do something
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* @endcode
|
2011-12-01 19:44:30 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlPeekBufferNegative(SceCtrlData *pad, u8 reqBufReads);
|
2011-12-01 19:44:30 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Read the current internal SceCtrlData buffer. By default, the internal controller buffer will be read after every VSYNC period (60 times/sec).
|
2012-02-02 16:46:18 +00:00
|
|
|
* You can set your own update timer by calling ::sceCtrlSetSamplingCycle.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param pad Pointer to a SceCtrlData structure retrieving the current internal button buffer.
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param reqBufReads The number of internal 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.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers on success, otherwise less than 0.
|
2011-12-01 19:44:30 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlReadBufferPositive(SceCtrlData *pad, u8 reqBufReads);
|
2011-12-01 19:44:30 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Read the current internal SceCtrlData buffer. By default, the internal controller buffer will be read after every VSYNC period (60 times/sec).
|
2012-02-02 16:46:18 +00:00
|
|
|
* You can set your own update time by calling ::sceCtrlSetSamplingCycle.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param pad Pointer to a SceCtrlData structure retrieving the current internal controller buffer. Negative button values have to be used.
|
2012-05-16 18:56:45 +00:00
|
|
|
* Check ::sceCtrlPadButtons for the negative active values of the buttons. If no button is active, the internal
|
2011-12-01 19:44:30 +00:00
|
|
|
* button value is 0xFFFFFFFF.
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param reqBufReads The number of internal 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.
|
2011-12-01 19:44:30 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers on success, otherwise less than 0.
|
2011-12-01 19:44:30 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlReadBufferNegative(SceCtrlData *pad, u8 reqBufReads);
|
2011-12-01 19:44:30 +00:00
|
|
|
|
2011-12-15 19:17:25 +00:00
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Extended ::sceCtrlPeekBufferPositive. See description for more info.
|
|
|
|
* You need to call ::sceCtrlExtendInternalCtrlBuffers before use.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @param arg1 Pass 1 or 2.
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param padExt Pointer to a SceCtrlData structure retrieving the current internal controller buffer.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers on success, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlPeekBufferPositiveExt(s32 arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Extended ::sceCtrlPeekBufferNegative. See description for more info.
|
|
|
|
* You need to call ::sceCtrlExtendInternalCtrlBuffers before use.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param arg1 Unknown. Pass 1 or 2.
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param padExt Pointer to a SceCtrlData structure retrieving the current internal controller buffer.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlPeekBufferNegativeExt(s32 arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Extended ::sceCtrlReadBufferPositive. See description for more info.
|
|
|
|
* You need to call ::sceCtrlExtendInternalCtrlBuffers before use.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @param arg1 Pass 1 or 2.
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param padExt Pointer to a SceCtrlData structure retrieving the current internal controller buffer.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlReadBufferPositiveExt(s32 arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Extended ::sceCtrlReadBufferNegative. See description for more info.
|
2012-02-04 21:40:00 +00:00
|
|
|
* You need to call ::sceCtrlExtendInternalCtrlBuffers before use.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
|
|
|
* @param arg1 Pass 1 or 2.
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param padExt Pointer to a SceCtrlData structure retrieving the current internal controller buffer.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return The amount of read internal controller buffers, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlReadBufferNegativeExt(s32 arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Clear a rapid-fire-button slot.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param slot The slot to clear. Between 0 - 15.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlClearRapidFire(u8 slot);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-04 21:40:00 +00:00
|
|
|
* Set a pressed/un-pressed period for a button.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @param slot The slot used to set the custom values. Between 0 - 15. Multiple slots can be used.
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param pressedBtnRange The pressed-button-range to check for. One or more buttons of ::sceCtrlPadButtons.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBtnsEventTrigger The button(s) which will fire the pressed/un-pressed period for a button/buttons when being pressed.
|
2012-02-02 15:19:54 +00:00
|
|
|
* Has to be included in pressedBtnRange.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBtn The requested button(s) on which the pressed/un-pressed period (the rapid fire event) will be applied to.
|
2012-02-02 15:19:54 +00:00
|
|
|
* User mode buttons ONLY.
|
|
|
|
* @param reqBtnEventOnTime For how many (consecutive) internal controller buffer updates the requested button(s) will be set to ON (pressed).
|
|
|
|
* This "ON-time" will only be applied in the beginning of every new fired event
|
2012-03-04 16:42:54 +00:00
|
|
|
* (not being fired immediately before). Set to 0 - 63.
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param reqBtnOnTime For how many (consecutive) internal controller buffer updates the requested button(s) will be set to ON (pressed).
|
|
|
|
* This "ON-time" is set after reqBtnEventOnTime was applied and the reqButton was turned off.
|
|
|
|
* It will be applied for as long as the same rapid fire event is called without a break
|
2012-03-04 16:42:54 +00:00
|
|
|
* (i.e. the pressing of a different PSP button). Set to 0 - 63. If set to 0, the reqButton will be turned ON
|
2012-02-02 15:19:54 +00:00
|
|
|
* for 1 internal controller buffer update.
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param reqBtnOffTime For how many (consecutive) internal controller buffer updates the requested button(s) will be set to OFF (un-pressed).
|
2012-02-02 15:19:54 +00:00
|
|
|
* This "OFF-time" is set after reqBtnEventOnTime was applied.
|
|
|
|
* It will be applied for as long as the same rapid fire event is called without a break
|
2012-03-04 16:42:54 +00:00
|
|
|
* (i.e. the pressing of a different PSP button). Set to 0 - 63. If set to 0, the reqButton will be turned OFF
|
2012-02-02 15:19:54 +00:00
|
|
|
* for 64 (consecutive) internal controller buffer updates.
|
|
|
|
*
|
|
|
|
* @Note Please choose values for reqBtnEventOnTime, reqBtnOnTime and reqBtnOffTime which are, when being bitwise OR'ed together, < 64.
|
|
|
|
* Otherwise, you will get an error.
|
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @par Example:
|
|
|
|
* @code
|
2012-02-02 16:46:18 +00:00
|
|
|
* //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 ctrl buffer updates in both cases (as long as D-Pad-Up is pressed).
|
2012-02-02 15:19:54 +00:00
|
|
|
* sceCtrlSetRapidFire(0, 0xFF, PSP_CTRL_UP, PSP_CTRL_RTRIGGER, 63, 63, 63);
|
|
|
|
*
|
2012-02-02 16:46:18 +00:00
|
|
|
* //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 ctrl buffer updates in both cases (as long as D-Pad-Up is pressed).
|
2012-02-02 15:19:54 +00:00
|
|
|
* sceCtrlSetRapidFire(0, 0xFF, PSP_CTRL_UP, PSP_CTRL_RTRIGGER, 0, 40, 40);
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetRapidFire(u8 slot, u32 pressedBtnRange, u32 reqBtnsEventTrigger, u32 reqBtn, u8 reqBtnEventOnTime, u8 reqBtnOnTime, u8 reqBtnOffTime);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Emulate values for the analog pad's X- and Y-axis.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param slot The slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are bitwise OR'ed together.
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param aXEmu New emulated value for the X-axis. Between 0 - 255.
|
|
|
|
* @param aYEmu New emulate value for the Y-axis. Between 0 - 255.
|
|
|
|
* @param bufUpdates Specifies for how many updates of the internal controller buffers the custom values will be applied for.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetAnalogEmulation(u8 slot, u8 aXEmu, u8 aYEmu, u32 bufUpdates);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Emulate buttons for the digital pad.
|
2011-12-15 19:17:25 +00:00
|
|
|
*
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param slot The slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are bitwise OR'ed together.
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param uModeBtnEmu Emulated user buttons of ::sceCtrlPadButtons. You cannot emulate kernel buttons and
|
2012-02-02 15:19:54 +00:00
|
|
|
* the emulated buttons will only be applied for applications running in user mode.
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param kModeBtnEmu Emulated buttons of ::sceCtrlPadButtons (you can emulate both user and kernel buttons).
|
2012-02-02 15:19:54 +00:00
|
|
|
* The emulated buttons will only be applied for applications running in kernel mode.
|
|
|
|
* @param bufUpdates Specifies for how many updates of the internal controller buffers the custom values will be applied for.
|
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetButtonEmulation(u8 slot, u32 uModeBtnEmu, u32 kModeBtnEmu, u32 bufUpdates);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-04 21:56:29 +00:00
|
|
|
* Get the button mask mode of one or more bitwise OR'ed PSP buttons.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @note In the PSPSDK, this function is defined as sceCtrlGetButtonMask.
|
|
|
|
*
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param buttons The button(s) to check for (one or more buttons of ::sceCtrlPadButtons)
|
|
|
|
* an existing button mask mode applying to it/them.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
2012-05-16 18:56:45 +00:00
|
|
|
* @return The button mask mode for the given button(s). One of ::sceCtrlPadButtonMaskMode.
|
|
|
|
* SCE_CTRL_MASK_DELETE_BUTTON_MASK_SETTING (0), if btnMask (or parts of it) is/are included in the currently set button mask.
|
|
|
|
* SCE_CTRL_MASK_IGNORE_BUTTON_MASK (1), if btnMask is not included in the current button mask.
|
|
|
|
* SCE_CTRL_MASK_SET_BUTTON_MASK (2), if btnMask (or parts of it) are set to ON by the current set button mask.
|
2012-02-02 15:19:54 +00:00
|
|
|
*/
|
2012-05-16 18:56:45 +00:00
|
|
|
SceCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 buttons);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @note In the PSPSDK, this function is defined as sceCtrlSetButtonMask.
|
|
|
|
*
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param buttons The button value for which the button mask mode will be applied for.
|
|
|
|
* One or more buttons of ::sceCtrlPadButtons.
|
|
|
|
* @param btnMaskMode Specifies the mask mode of the button mask. One of ::sceCtrlPadButtonMaskMode.
|
|
|
|
*
|
|
|
|
* btnMaskMode = SCE_CTRL_MASK_IGNORE_BUTTONS:
|
|
|
|
* Delete the specified buttons from the supported buttons
|
|
|
|
* and remove them from the 'set to ON' buttons.
|
|
|
|
* btnMaskMode = SCE_CTRL_MASK_SET_BUTTONS:
|
|
|
|
* Add the specified buttons to both the supported buttons
|
|
|
|
* and to the 'set to ON' buttons.
|
|
|
|
* btnMaskMode = SCE_CTRL_MASK_NO_MASK:
|
|
|
|
* Add the specified buttons to the supported buttons
|
|
|
|
* and remove them from the 'set to ON' buttons.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @return The button mask mode regarding the new btnMask compared with the previously set btnMask.
|
2012-05-16 18:56:45 +00:00
|
|
|
* SCE_CTRL_MASK_DELETE_BUTTON_MASK_SETTING (0) for the new btnMask (or parts of it) already being supported by the previously set btnMask,
|
|
|
|
* SCE_CTRL_MASK_IGNORE_BUTTON_MASK (1) for the new btnMask already being ignored by the previously btnMask or
|
|
|
|
* SCE_CTRL_MASK_SET_BUTTON_MASK (2) for the new btnMask (or parts of being) being already being set to ON
|
2012-02-02 15:19:54 +00:00
|
|
|
* by the previously set btnMask.
|
|
|
|
*
|
|
|
|
* @par Example:
|
|
|
|
* @code
|
|
|
|
* //Block user mode buttons for User mode applications
|
|
|
|
* sceCtrlSetButtonIntercept(0xFFFF, 1);
|
|
|
|
* //Do something
|
|
|
|
*
|
|
|
|
* //Remove block from user mode buttons for User mode applications
|
|
|
|
* sceCtrlSetButtonIntercept(0xFFFF, 0);
|
|
|
|
* @endcode
|
|
|
|
*/
|
2012-05-16 18:56:45 +00:00
|
|
|
SceCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 buttons, SceCtrlPadButtonMaskMode btnMaskMode);
|
2012-02-02 15:19:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Register a button callback.
|
|
|
|
*
|
|
|
|
* @note In the PSPSDK, this function is defined as sceCtrlRegisterButtonCallback.
|
|
|
|
*
|
|
|
|
* @param slot The slot used to register the callback (0-3).
|
2012-05-16 18:56:45 +00:00
|
|
|
* @param btnMask Bitwise OR'ed button values which will be checked for being pressed. One or more buttons of ::sceCtrlPadButtons.
|
2012-08-09 10:54:36 +00:00
|
|
|
* @param cbFunc Pointer to the callback function (s32 currBtns, s32 lastBtns, void *opt), which handles button input effects.
|
2012-02-02 15:19:54 +00:00
|
|
|
* @param opt Optional user argument. Passed to the callback function as its third argument.
|
|
|
|
*
|
2012-05-03 18:29:34 +00:00
|
|
|
* @return 0 on success, otherwise less than 0.
|
2012-02-02 15:19:54 +00:00
|
|
|
*/
|
2012-08-09 10:54:36 +00:00
|
|
|
s32 sceCtrlSetSpecialButtonCallback(u32 slot, u32 btnMask, SceCtrlCb cbFunc, void *opt);
|
2011-12-15 19:17:25 +00:00
|
|
|
|
2011-11-24 18:34:38 +00:00
|
|
|
#endif /* CTRL_H */
|
|
|
|
|
2011-12-19 21:53:17 +00:00
|
|
|
/** @} */
|