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-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-04-29 13:52:13 +00:00
|
|
|
#include "../common/common.h"
|
2012-04-30 20:34:31 +00:00
|
|
|
#include <pspmodulemgr.h>
|
2011-11-24 18:18:36 +00:00
|
|
|
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Custom function name. */
|
2012-02-02 20:16:28 +00:00
|
|
|
int sceCtrl_5A36B1C2(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlPeekBufferPositiveExt")));
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Custom function name. */
|
2012-02-02 20:16:28 +00:00
|
|
|
int sceCtrl_239A6BA7(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlPeekBufferNegativeExt")));
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Custom function name. */
|
2012-02-02 20:16:28 +00:00
|
|
|
int sceCtrl_1098030B(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlReadBufferPositiveExt")));
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Custom function name. */
|
2012-02-02 20:16:28 +00:00
|
|
|
int sceCtrl_7C3675AB(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlReadBufferNegativeExt")));
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Custom function name. */
|
2012-02-04 21:40:00 +00:00
|
|
|
int sceCtrl_driver_E467BEC8(u8 mode, int arg2, int arg3)__attribute__((alias("sceCtrlExtendInternalCtrlBuffers")));
|
2012-02-02 15:19:54 +00:00
|
|
|
|
|
|
|
/** The callback function used by ::sceCtrlSetSpecialButtonCallback. */
|
2012-02-04 21:40:00 +00:00
|
|
|
typedef void (*SceCtrlCb)(int currBtns, int 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-02-04 21:40:00 +00:00
|
|
|
typedef u8 PspCtrlPadInputMode;
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Type definition for improved style. */
|
2012-02-04 21:40:00 +00:00
|
|
|
typedef u8 PspCtrlPadPollMode;
|
2012-02-02 16:31:13 +00:00
|
|
|
/** Type definition for improved style. */
|
2012-02-04 21:40:00 +00:00
|
|
|
typedef u8 PspCtrlPadButtonMaskMode;
|
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.
|
|
|
|
*/
|
|
|
|
typedef struct _SceCtrlData {
|
|
|
|
/** 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-02-02 15:47:30 +00:00
|
|
|
/** The currently pressed D-Pad button(s). Bitwise OR'ed values of ::PspCtrlPadButtons. */
|
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. */
|
2011-12-01 19:44:30 +00:00
|
|
|
typedef struct _SceCtrlDataExt {
|
|
|
|
/** 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-02-02 15:47:30 +00:00
|
|
|
/** The currently pressed D-Pad button(s). Bitwise OR'ed values of ::PspCtrlPadButtons. */
|
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. */
|
|
|
|
int unk1; //16
|
|
|
|
/** Unknown. */
|
|
|
|
int unk2; //20
|
|
|
|
/** Unknown. */
|
|
|
|
int unk3; //24
|
|
|
|
/** Unknown. */
|
|
|
|
int unk4; //28
|
|
|
|
/** Unknown. */
|
|
|
|
int unk5; //32
|
|
|
|
/** Unknown. */
|
|
|
|
int unk6; //36
|
|
|
|
/** Unknown. */
|
|
|
|
int unk7; //40
|
|
|
|
/** Unknown. */
|
|
|
|
int 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
|
|
|
|
* through its button value (one of ::pspCtrlPadButtons).
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
|
|
|
typedef struct _SceCtrlLatch {
|
|
|
|
/** 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
|
|
|
|
|
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-02-04 21:40:00 +00:00
|
|
|
enum pspCtrlPadButtons {
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Select button. Negative value = 0xFFFFFFFE. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_SELECT = 0x1,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Start button. Negative value = 0xFFFFFFF7. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_START = 0x8,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Up D-Pad button. Negative value = 0xFFFFFFEF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_UP = 0x10,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Right D-Pad button. Negative value = 0xFFFFFFDF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_RIGHT = 0x20,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Down D-Pad button. Negative value = 0xFFFFFFBF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_DOWN = 0x40,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Left D-Pad button. Negative value = 0xFFFFFF7F. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_LEFT = 0x80,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Left trigger. Negative value = 0xFFFFFEFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_LTRIGGER = 0x100,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Right trigger. Negative value = 0xFFFFFDFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_RTRIGGER = 0x200,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Triangle button. Negative value = 0xFFFFEFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_TRIANGLE = 0x1000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Circle button. Negative value = 0xFFFFDFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_CIRCLE = 0x2000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Cross button. Negative value = 0xFFFFBFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_CROSS = 0x4000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Square button. Negative value = 0xFFFF7FFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_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. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_HOME = 0x10000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Hold button. Negative value = 0xFFFDFFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_HOLD = 0x20000,
|
2012-02-04 21:40:00 +00:00
|
|
|
/** W-LAN switch up. Negative value = 0xFFFBFFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_WLAN_UP = 0x40000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Remote hold position. Negative value = 0xFFF7FFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_REMOTE = 0x80000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Volume up button. Negative value = 0xFFEFFFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_VOLUP = 0x100000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Volume down button. Negative value = 0xFFBFFFFF. */
|
|
|
|
PSP_CTRL_VOLDOWN = 0x200000,
|
|
|
|
/** Screen button. Negative value = 0xFFBFFFFF. */
|
|
|
|
PSP_CTRL_SCREEN = 0x400000,
|
|
|
|
/** Music Note button. Negative value = 0xFF7FFFFF. */
|
|
|
|
PSP_CTRL_NOTE = 0x800000,
|
|
|
|
/** Disc present. Negative value = 0xFEFFFFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_DISC = 0x1000000,
|
2011-12-01 19:44:30 +00:00
|
|
|
/** Memory stick present. Negative value = 0xFDFFFFFF. */
|
2011-11-24 18:18:36 +00:00
|
|
|
PSP_CTRL_MS = 0x2000000,
|
2012-02-02 15:47:30 +00:00
|
|
|
};
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/** Controller input modes. */
|
2012-02-04 21:40:00 +00:00
|
|
|
enum pspCtrlPadInputMode {
|
|
|
|
/** Digital input only. No recognizing of analog input. */
|
2012-02-02 15:19:54 +00:00
|
|
|
PSP_CTRL_INPUT_DIGITAL_ONLY = 0,
|
2011-12-15 19:17:25 +00:00
|
|
|
/** Recognizing of both digital and analog input. */
|
2012-02-02 15:19:54 +00:00
|
|
|
PSP_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-02-04 21:40:00 +00:00
|
|
|
enum pspCtrlPadPollMode {
|
2011-11-24 18:18:36 +00:00
|
|
|
/** No controller input is recognized. */
|
|
|
|
PSP_CTRL_POLL_NO_POLLING = 0,
|
|
|
|
/** Controller input is recognized. */
|
|
|
|
PSP_CTRL_POLL_POLLING = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Button mask settings. */
|
2012-02-04 21:40:00 +00:00
|
|
|
enum pspCtrlPadButtonMaskMode {
|
2012-02-02 15:19:54 +00:00
|
|
|
/** Remove any custom mask settings involving the specified button bit mask. */
|
|
|
|
PSP_CTRL_MASK_DELETE_BUTTON_MASK_SETTING = 0,
|
2012-02-04 21:40:00 +00:00
|
|
|
/** Block the buttons defined by the button bit mask (their button status (pressed/un-pressed) won't be recognized).
|
2012-02-02 15:19:54 +00:00
|
|
|
* You can only block user buttons for applications running in user mode. */
|
|
|
|
PSP_CTRL_MASK_IGNORE_BUTTON_MASK = 1,
|
|
|
|
/** Set the buttons defined by the button bit mask (they will be simulated as being pressed).
|
|
|
|
* You can only set user buttons for applications running in user mode. */
|
|
|
|
PSP_CTRL_MASK_SET_BUTTON_MASK = 2,
|
2011-11-24 18:18:36 +00:00
|
|
|
};
|
|
|
|
|
2011-12-15 19:17:25 +00:00
|
|
|
/**
|
|
|
|
* Initialize the controller library.
|
|
|
|
*
|
|
|
|
* @return 0 on success, otherwise < 0.
|
|
|
|
*/
|
|
|
|
int sceCtrlInit();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Terminate the controller library.
|
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
|
|
|
int sceCtrlEnd();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Suspend the controller library.
|
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
|
|
|
int sceCtrlSuspend();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Resume the controller library after it has been suspended.
|
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
|
|
|
int sceCtrlResume();
|
|
|
|
|
2011-11-24 18:18:36 +00:00
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Enable/disable controller input.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param pollMode One of ::pspCtrlPadPollMode. 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-02-04 21:40:00 +00:00
|
|
|
int sceCtrlSetPollingMode(PspCtrlPadPollMode pollMode);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2011-11-24 21:44:37 +00:00
|
|
|
* Get the current controller input mode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-04 21:56:29 +00:00
|
|
|
* @param mode Receiving the current controller mode. One of ::pspCtrlPadInputMode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
|
|
|
* @return 0.
|
|
|
|
*/
|
2012-02-04 21:40:00 +00:00
|
|
|
PspCtrlPadInputMode sceCtrlGetSamplingMode(PspCtrlPadInputMode *mode);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2011-11-24 21:44:37 +00:00
|
|
|
* Set the controller input mode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-04 21:40:00 +00:00
|
|
|
* @param mode The new controller input mode. One of ::pspCtrlPadInputMode.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @return The previous input mode on success, or < 0 (invalid argument).
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-02-04 21:40:00 +00:00
|
|
|
PspCtrlPadInputMode sceCtrlSetSamplingMode(PspCtrlPadInputMode mode);
|
2011-11-24 18:18:36 +00:00
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Get the current cycle specifying the update frequency of the internal controller buffer.
|
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.
|
|
|
|
*/
|
|
|
|
int sceCtrlGetSamplingCycle(int *cycle);
|
|
|
|
|
|
|
|
/**
|
2012-02-02 15:19:54 +00:00
|
|
|
* Set the update frequency of the internal controller buffer. Default update frequency is 60 hz (every VBlank-event).
|
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.
|
2011-11-24 18:18:36 +00:00
|
|
|
* Setting to 0 triggers sampling at every VSYNC-event (60 updates/second). If you want to set an own
|
2012-02-02 15:19:54 +00:00
|
|
|
* time period for updating the internal controller buffer(s), cycle has to be > 5554 and < 20001.
|
2011-11-24 18:18:36 +00:00
|
|
|
*
|
2012-02-02 15:19:54 +00:00
|
|
|
* @return The previous cycle on success, or < 0 (invalid argument).
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
|
|
|
int sceCtrlSetSamplingCycle(int cycle);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-02-02 15:19:54 +00:00
|
|
|
* @return 0 on success, otherwise < 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
|
|
|
int sceCtrlGetIdleCancelThreshold(int *idleReset, int *idleBack);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-02-02 15:19:54 +00:00
|
|
|
* @return 0 on success, otherwise < 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
|
|
|
int sceCtrlSetIdleCancelThreshold(int idlereset, int idleback);
|
|
|
|
|
|
|
|
/**
|
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.
|
|
|
|
*/
|
|
|
|
u16 sceCtrlGetSuspendingExtraSamples();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @return 0 on success, or < 0 (invalid arguments).
|
|
|
|
*/
|
|
|
|
int sceCtrlSetSuspendingExtraSamples(u16 suspendSamples);
|
|
|
|
|
|
|
|
/**
|
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.
|
|
|
|
* @param arg2 Unknown.
|
|
|
|
* @param arg3 Unknown.
|
|
|
|
*
|
2012-02-04 21:40:00 +00:00
|
|
|
* @return 0 on success, otherwise < 0.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int sceCtrlExtendInternalCtrlBuffers(u8 mode, int arg2, int 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-04-26 22:16:42 +00:00
|
|
|
* @return The amount of reads of the internal latch buffer, without being reseted, on success, or < 0 on error.
|
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
|
|
|
*/
|
|
|
|
int sceCtrlPeekLatch(SceCtrlLatch *latch);
|
|
|
|
|
|
|
|
/**
|
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-02-02 15:19:54 +00:00
|
|
|
* @return The amount of reads of the internal latch buffer without being reseted (typically 1) on success, or < 0 on error.
|
2011-11-24 18:18:36 +00:00
|
|
|
*/
|
|
|
|
int sceCtrlReadLatch(SceCtrlLatch *latch);
|
|
|
|
|
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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers, or < 0 on error.
|
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-02-02 15:19:54 +00:00
|
|
|
int 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-02-04 21:40:00 +00:00
|
|
|
* Check ::pspCtrlPadButtons 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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers, or < 0 on error.
|
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-02-02 15:19:54 +00:00
|
|
|
int 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-02-04 21:56:29 +00:00
|
|
|
* @return The amount of read internal controller buffers on success, or < 0 on error.
|
2011-12-01 19:44:30 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int 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-02-04 21:40:00 +00:00
|
|
|
* Check ::pspCtrlPadButtons 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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers on success, or < 0 on error.
|
2011-12-01 19:44:30 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int 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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers on success, or < 0 on error.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int sceCtrlPeekBufferPositiveExt(int 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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers, or < 0 on error.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int sceCtrlPeekBufferNegativeExt(int 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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers, or < 0 on error.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int sceCtrlReadBufferPositiveExt(int 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-02-04 21:40:00 +00:00
|
|
|
* @return The amount of read internal controller buffers, or < 0 on error.
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int sceCtrlReadBufferNegativeExt(int 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-02-02 15:19:54 +00:00
|
|
|
* @return 0 on success, otherwise < 0 (invalid argument).
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int 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-02-04 21:40:00 +00:00
|
|
|
* @param pressedBtnRange The pressed-button-range to check for. One or more buttons of ::pspCtrlPadButtons.
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* @return 0 on success, otherwise < 0 (invalid arguments).
|
|
|
|
*
|
|
|
|
* @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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int sceCtrlSetRapidFire(u8 slot, u32 pressedBtnRange, u32 reqBtnsEventTrigger, u32 reqBtn, u8 reqBtnEventOnTime, u8 reqBtnOnTime, u8 reqBtnOffTime);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-02-04 21:40:00 +00:00
|
|
|
* @return 0 on success, otherwise < 0 (invalid arguments).
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int 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.
|
|
|
|
* @param uModeBtnEmu Emulated user buttons of ::pspCtrlPadButtons. 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-02-04 21:40:00 +00:00
|
|
|
* @param kModeBtnEmu Emulated buttons of ::pspCtrlPadButtons (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-02-04 21:40:00 +00:00
|
|
|
* @return 0 on success, otherwise < 0 (invalid arguments).
|
2011-12-15 19:17:25 +00:00
|
|
|
*/
|
2012-02-02 15:19:54 +00:00
|
|
|
int sceCtrlSetButtonEmulation(u8 slot, u32 uModeBtnEmu, u32 kModeBtnEmu, u32 bufUpdates);
|
|
|
|
|
|
|
|
/**
|
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-02-04 21:40:00 +00:00
|
|
|
* @param btnMask The button bit value to check for (one or more buttons of ::pspCtrlPadButtons).
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
2012-02-04 21:40:00 +00:00
|
|
|
* @return The button mask mode for the given btnMask. One of ::pspCtrlPadButtonMaskMode.
|
2012-02-02 16:46:18 +00:00
|
|
|
* PSP_CTRL_MASK_DELETE_BUTTON_MASK_SETTING (0), if btnMask (or parts of it) is/are included in the currently set button mask.
|
|
|
|
* PSP_CTRL_MASK_IGNORE_BUTTON_MASK (1), if btnMask is not included in the current button mask.
|
2012-02-02 15:19:54 +00:00
|
|
|
* PSP_CTRL_MASK_SET_BUTTON_MASK (2), if btnMask (or parts of it) are set to ON by the current set button mask.
|
|
|
|
*/
|
2012-02-04 21:40:00 +00:00
|
|
|
PspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask);
|
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.
|
|
|
|
*
|
|
|
|
* @param btnMask The button value for which the button mask mode will be applied.
|
2012-02-04 21:40:00 +00:00
|
|
|
* One or more buttons of ::pspCtrlPadButtons.
|
|
|
|
* @param btnMaskMode Specifies the mask mode of the button mask. One of ::pspCtrlPadButtonMaskMode.
|
2012-02-02 15:19:54 +00:00
|
|
|
*
|
|
|
|
* @return The button mask mode regarding the new btnMask compared with the previously set btnMask.
|
|
|
|
* PSP_CTRL_MASK_DELETE_BUTTON_MASK_SETTING (0) for the new btnMask (or parts of it) already being supported by the previously set btnMask,
|
|
|
|
* PSP_CTRL_MASK_IGNORE_BUTTON_MASK (1) for the new btnMask already being ignored by the previously btnMask or
|
|
|
|
* PSP_CTRL_MASK_SET_BUTTON_MASK (2) for the new btnMask (or parts of being) being already being set to ON
|
|
|
|
* 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-02-04 21:40:00 +00:00
|
|
|
PspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 btnMask, PspCtrlPadButtonMaskMode 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-02-04 21:40:00 +00:00
|
|
|
* @param btnMask Bitwise OR'ed button values which will be checked for being pressed. One or more buttons of ::pspCtrlPadButtons.
|
|
|
|
* @param cbFunc Pointer to the callback function (int currBtns, int 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.
|
|
|
|
*
|
|
|
|
* @return 0 on success, or < 0 (invalid arguments).
|
|
|
|
*/
|
|
|
|
int 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
|
|
|
/** @} */
|