Updated ctrl.c and ctrl.h to 6.60 OFW ctrl module version.

This commit is contained in:
_Felix_ 2012-02-04 21:40:00 +00:00
parent 885ae76920
commit 8a698aa827
2 changed files with 136 additions and 136 deletions

View File

@ -6,7 +6,7 @@
* ctrl.c
* Reverse engineered controller libraries of the SCE PSP system.
* Author: _Felix_
* Version: 6.39
* Version: 6.60
*
*/
@ -60,13 +60,13 @@ typedef struct _SceCtrl {
SceSysTimerId timerID; //0
int eventFlag; //4
u32 btnCycle; //8
pspCtrlPadInputMode samplingMode[CTRL_SAMPLING_MODE_MODES]; //12 -- samplingMode[0] for User mode, samplingMode[1] for Kernel mode
PspCtrlPadInputMode samplingMode[CTRL_SAMPLING_MODE_MODES]; //12 -- samplingMode[0] for User mode, samplingMode[1] for Kernel mode
u8 unk_Byte_0; //14
u8 unk_Byte_1; //15
u8 unk_Byte_8; //16
char unk_Byte_7; //17
u8 unk_Byte_2; //20
pspCtrlPadPollMode pollMode; //21
PspCtrlPadPollMode pollMode; //21
u16 suspendSamples; //22
int unk_1; //24
SceSysconPacket sysPacket[2]; //28 -- size of one array member is 96.
@ -103,31 +103,31 @@ typedef struct _SceCtrl {
SceCtrlButtonCallback buttonCallback[CTRL_BUTTON_CALLBACK_SLOTS]; //704
int unk_array2[2]; //768 -- array of functions?
int unk_array3[3]; //776
} SceCtrl; //sizeof SceCtrl: 788 (0x314)
} SceCtrl; //size of SceCtrl: 788 (0x314)
typedef struct _SceCtrlRapidFire {
/** The pressed-button-range to check for. */
u32 pressedButtonRange; //0
/** The button(s) which will fire the pressed/unpressed period for a button/buttons when being pressed.
/** The button(s) which will fire the pressed/un-pressed period for a button/buttons when being pressed.
* The button(s) has/have to be included in the pressed-button-range. *
*/
u32 reqButtonsEventTrigger; //4
/** The requested button(s) on which the pressed/unpressed period (the rapid fire event) will be applied to.
/** The requested button(s) on which the pressed/un-pressed period (the rapid fire event) will be applied to.
* User mode buttons ONLY.
*/
u32 reqButtons; //8
/** Apply data for a rapidFire period. Keeps track of the apply mode of the requested button(s) (pressed/unpressed)
/** Apply data for a rapidFire period. Keeps track of the apply mode of the requested button(s) (pressed/un-pressed)
* + the amount of left internal controller buffer updates for the current apply mode of the requested button(s).
*/
u8 eventData; //12
/** For how many (consecutive) internal controller buffer updates the requested button(s) will be set to ON (pressed). */
u8 reqButtonsOnTime; //13
/** For how many (consecutive) internal controller buffer updates the requested button(s) will be set to OFF (unpressed). */
/** For how many (consecutive) internal controller buffer updates the requested button(s) will be set to OFF (un-pressed). */
u8 reqButtonsOffTime; //14;
/** For how many (consecutive) internal controller buffer updates the requested button(s) will be set to ON.
* It will only be applied for the first ON period of a (not canceled) rapid fire event. */
u8 reqButtonsEventOnTime; //15;
} SceCtrlRapidFire; //sizeof SceCtrlRapidFire: 16
} SceCtrlRapidFire; //size of SceCtrlRapidFire: 16
typedef struct _SceCtrlEmulatedData {
/** Emulated analog pad X-axis offset. */
@ -146,14 +146,14 @@ typedef struct _SceCtrlEmulatedData {
u32 kModeBtnEmulation; //12
/** How many internal controller buffer updates the emulated buttons will be applied for. */
u32 intCtrlBufUpdates2; //16
} SceCtrlEmulatedData; //sizeof SceCtrlEmulatedData: 20
} SceCtrlEmulatedData; //size of SceCtrlEmulatedData: 20
typedef struct _SceCtrlButtonCallback {
/** Bitwise OR'ed button values (of ::PspCtrlButtons) which will be checked for being pressed. */
u32 btnMask; //0
/** Pointer to a callback function handling the button input effects. */
SceCtrlCb callbackFunc; //4
/** The global pointer ($gp) value of the controller module. */
/** The global pointer value of the controller module. */
u32 gp; //8
/** An optional pointer being passed as the third argument to the callback function. */
void *arg; //12
@ -172,9 +172,9 @@ typedef struct _SceCtrlInternalData {
u32 readLatchCount; //16
u32 ctrlBufStartIndex; //20
u32 ctrlBufIndex; //24
/** sceCtrlBuf[0] points to 64 internal ctrl buffers of type sceCtrlData. */
/** sceCtrlBuf[0] points to 64 internal controller buffers of type sceCtrlData. */
void *sceCtrlBuf[3]; //28
} SceCtrlInternalData; //sizeof SceCtrlLatchInt: 40
} SceCtrlInternalData; //size of SceCtrlLatchInt: 40
//copied from http://holdpsp.googlecode.com/svn/trunk/sysconhk.h
typedef struct _SceSysconPacket {
@ -201,7 +201,7 @@ typedef struct _SceSysconPacket {
u8 old_sts; //69 -- old rx_sts
u8 cur_sts; //70 -- current rx_sts
u8 unk47[33]; //71
} SceSysconPacket; //sizeof SceSysconPacket: 96
} SceSysconPacket; //size of SceSysconPacket: 96
typedef UnknownType;
@ -415,17 +415,17 @@ static int _sceCtrlUpdateButtons(u32 pureButtons, u8 aX, u8 aY) {
sysTimeLow = sceKernelGetSystemTimeLow(); //0x000009A0
//User buffer
index = ctrl.userModeData.ctrlBufIndex; //0x000009B4 && 0x000009C4
index = ctrl.userModeData.ctrlBufIndex; //0x000009B4 & 0x000009C4
ctrlUserBuf = (SceCtrlData *)(ctrl.userModeData.sceCtrlBuf[0] + index * sizeof(SceCtrlData)); //0x000009CC
ctrlUserBuf->activeTime = sysTimeLow; //0x000009D0
//Kernel buffer
index = ctrl.kernelModeData.ctrlBufIndex; //0x000009C0 && 0x000009D4
index = ctrl.kernelModeData.ctrlBufIndex; //0x000009C0 & 0x000009D4
ctrlKernelBuf = (SceCtrlData *)(ctrl.kernelModeData.sceCtrlBuf[0] + index * sizeof(SceCtrlData)); //0x000009D8
ctrlUserBuf->activeTime = sysTimeLow; //x000009E8
int i;
for (i = 0; 0 < 4; i++) { //0x00000A08 && 0x000009F0
for (i = 0; i < CTRL_DATA_EMULATION_SLOTS; i++) { //0x00000A08 & 0x000009F0
if (ctrl.emulatedData[i].intCtrlBufUpdates > 0) { //0x000009F4
ctrl.emulatedData[i].intCtrlBufUpdates--; //0x000009F8
analogX = ctrl.emulatedData[i].analogXEmulation; //0x00000A00
@ -438,21 +438,21 @@ static int _sceCtrlUpdateButtons(u32 pureButtons, u8 aX, u8 aY) {
ctrlKernelBuf->aY = analogY; //0x00000A24
//User Mode
if (ctrl.samplingMode[USER_MODE] == PSP_CTRL_INPUT_DIGITAL_ONLY) { //0x00000A2C -- if only the Digital input is to be recongnized
if (ctrl.samplingMode[USER_MODE] == PSP_CTRL_INPUT_DIGITAL_ONLY) { //0x00000A2C
ctrlUserBuf->aY = CTRL_ANALOG_PAD_DEFAULT_VALUE; //0x00000A38
ctrlUserBuf->aX = CTRL_ANALOG_PAD_DEFAULT_VALUE; //0x00000A3C
}
//Kernel Mode
if (ctrl.samplingMode[KERNEL_MODE] == PSP_CTRL_INPUT_DIGITAL_ONLY) { //0x00000A44 -- if only the Digital input is to be recongnized
if (ctrl.samplingMode[KERNEL_MODE] == PSP_CTRL_INPUT_DIGITAL_ONLY) { //0x00000A44
ctrlKernelBuf->aY = CTRL_ANALOG_PAD_DEFAULT_VALUE; //0x00000A50
ctrlKernelBuf->aX = CTRL_ANALOG_PAD_DEFAULT_VALUE; //0x00000A54
}
//0x00000A6C && 0x00000A7C && 0x00000A88
for (i = 0; i < 6; i++) {
for (i = 0; i < sizeof ctrlUserBuf->rsrv; i++) {
ctrlUserBuf->rsrv[i] = 0;
}
//0x00000A8C && 0x00000AA0 && 0x00000AA4
for (i = 0; i < 6; i++) {
for (i = 0; i < sizeof ctrlKernelBuf->rsrv; i++) {
ctrlKernelBuf->rsrv[i] = 0;
}
//0x00000AB8 && 0x00000AC0
@ -468,7 +468,7 @@ static int _sceCtrlUpdateButtons(u32 pureButtons, u8 aX, u8 aY) {
if (ret < 0) { //0x00000F78
//0x000011AC && 0x000011B8
int j;
for (j = 0; j < 6; j++) {
for (j = 0; j < sizeof ctrlKernelBufExt->rsrv; j++) {
ctrlKernelBufExt->rsrv[j] = 0;
}
ctrlKernelBufExt->activeTime = 0; //0x000011B0
@ -551,9 +551,9 @@ static int _sceCtrlUpdateButtons(u32 pureButtons, u8 aX, u8 aY) {
ctrlUserBufExt->buttons = ctrlKernelBufExt->buttons; //0x000010AC && 0x000010C4
ctrlUserBufExt->aX = ctrlKernelBufExt->aX; //0x000010B0 && 0x000010C8
ctrlUserBufExt->aY = ctrlKernelBufExt->aY; //0x000010B0 && 0x000010C8
//0x000010B0 && 0x000010C8 && 0x000010B4 && 0x000010D0
//0x000010B0 & 0x000010C8 & 0x000010B4 & 0x000010D0
int j;
for (j = 0; j < 6; j++) {
for (j = 0; j < sizeof ctrlUserBufExt->rsrv; j++) {
ctrlUserBufExt->rsrv[j] = ctrlKernelBufExt->rsrv[j];
}
ctrlUserBufExt->unk1 = ctrlKernelBufExt->unk1;
@ -695,7 +695,7 @@ static int _sceCtrlUpdateButtons(u32 pureButtons, u8 aX, u8 aY) {
updatedButtons = pureButtons & CTRL_PSP_HARDWARE_IO_BUTTONS; //0x00000BB0 -- only I/O Buttons permitted?
}
//0x00000BB8 & 0x00000BC0 & 0x00000BC8
for (i = 0; i < 3; i++) {
for (i = 0; i < CTRL_DATA_EMULATION_SLOTS; i++) {
updatedButtons = updatedButtons | ctrl.emulatedData[i].kModeBtnEmulation; //0x00000BBC & 0x00000BCC
}
ctrlKernelBuf->buttons = updatedButtons; //0x00000BD0
@ -855,7 +855,7 @@ static int _sceCtrlReadBuf(void *pad, u8 reqBufReads, int arg3, u8 mode) {
int i; /* Used as a counter variable in for-loops for storing data into a SceCtrlData member. */
u32 buttons;
char bufIndex;
/* Number of internal ctrl buffers read. */
/* Number of read internal controller buffers. */
int readIntBufs;
char startBufIndex;
int res;
@ -1022,7 +1022,7 @@ static int _sceCtrlReadBuf(void *pad, u8 reqBufReads, int arg3, u8 mode) {
}
/*
* Subroutine sceCtrl_driver_4FAA342D - Address 0x00000000
* Subroutine sceCtrl_driver_121097D5 - Address 0x00000000
* Exported in sceCtrl_driver
*/
int sceCtrlInit() {
@ -1055,7 +1055,7 @@ int sceCtrlInit() {
SysTimerForKernel_B53534B4(timerId, 1, 0x30); //0x00000094
ctrl.unk_Byte_1 = -1; //0x000000A0
sceKernelRegisterSysEventHandler(&ctrlSysEvent); //0x000000A4
sceSyscon_driver_C325BF4B(0); //0x000000AC
sceSyscon_driver_B72DDFD2(0); //0x000000AC
keyConfig = sceKernelInitKeyConfig(); //0x000000B4
if (keyConfig == PSP_INIT_KEYCONFIG_UPDATER) { //0x000000C0
@ -1081,9 +1081,9 @@ int sceCtrlInit() {
ctrl.maskSupportButtons = supportedUserButtons; //0x00000104
pspModel = sceKernelGetModel();
if (pspModel < 10) { //0x0000010C
if (pspModel < 11) { //0x0000010C
switch (pspModel) { //0x00000128
case 0: case 1: case 2: case 3: case 6: case 8:
case 0: case 1: case 2: case 3: case 6: case 8: case 10:
unk_2 = 0x1FFF3F9; //0x00000130 & 0x00000138
break;
case 4: case 5: case 7: case 9:
@ -1115,14 +1115,14 @@ int sceCtrlInit() {
}
/*
* Subroutine sceCtrl_driver_08DE9E04 - Address 0x0000020C
* Subroutine sceCtrl_driver_1A1A7D40 - Address 0x0000020C
* Exported in sceCtrl_driver
*/
int sceCtrlEnd() {
SceSysTimerId timerId;
sceKernelUnregisterSysEventHandler(&ctrlSysEvent); //0x00000220
sceSyscon_driver_C325BF4B(1); //0x00000228
sceSyscon_driver_B72DDFD2(1); //0x00000228
sceDisplayWaitVblankStart(); //0x00000230
timerId = ctrl.timerID; //0x0000023C
@ -1141,7 +1141,7 @@ int sceCtrlEnd() {
}
/*
* Subroutine sceCtrl_driver_1CDEDDBC - Address 0x00001A50
* Subroutine sceCtrl_driver_55497589 - Address 0x00001A50
* Exported in sceCtrl_driver
*/
int sceCtrlSuspend() {
@ -1158,14 +1158,14 @@ int sceCtrlSuspend() {
}
/*
* Subroutine sceCtrl_driver_8543BB3B - Address 0x000002AC
* Subroutine sceCtrl_driver_33D03FD5 - Address 0x000002AC
* Exported in sceCtrl_driver
*/
int sceCtrlResume() {
int retVal;
int prevButtons;
retVal = sceSyscon_driver_A59F82EB(); //0x000002B8
retVal = sceSyscon_driver_97765E27(); //0x000002B8
if (retVal != 0) { //0x000002C4
if (retVal == 1) { //0x00000344
prevButtons = ctrl.prevButtons; //0x00000350
@ -1190,20 +1190,20 @@ int sceCtrlResume() {
}
/*
* Subroutine sceCtrl_driver_196CF2F4 - Address 0x00001C30
* Subroutine sceCtrl_driver_F0074903 - Address 0x00001C30
* Exported in sceCtrl_driver
*/
int sceCtrlSetPollingMode(pspCtrlPadPollMode pollMode) {
int sceCtrlSetPollingMode(PspCtrlPadPollMode pollMode) {
ctrl.pollMode = pollMode; //0x00001C3C
return 0;
}
/*
* Subroutine sceCtrl_DA6B76A1 - Address 0x00001330 - Aliases: sceCtrl_driver_410833B7
* Subroutine sceCtrl_DA6B76A1 - Address 0x00001330 - Aliases: sceCtrl_driver_F8EC18BD
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
pspCtrlPadInputMode sceCtrlGetSamplingMode(pspCtrlPadInputMode *mode) {
PspCtrlPadInputMode sceCtrlGetSamplingMode(PspCtrlPadInputMode *mode) {
int privMode;
int index;
@ -1215,15 +1215,15 @@ pspCtrlPadInputMode sceCtrlGetSamplingMode(pspCtrlPadInputMode *mode) {
return 0;
}
/* Subroutine sceCtrl_1F4011E6 - Address 0x000012C8 - Aliases: sceCtrl_driver_6CB49301
/* Subroutine sceCtrl_1F4011E6 - Address 0x000012C8 - Aliases: sceCtrl_driver_F6E94EA3
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
pspCtrlPadInputMode sceCtrlSetSamplingMode(pspCtrlPadInputMode mode) {
PspCtrlPadInputMode sceCtrlSetSamplingMode(PspCtrlPadInputMode mode) {
int suspendFlag;
int privMode;
u8 index;
pspCtrlPadInputMode prevMode;
PspCtrlPadInputMode prevMode;
if (mode > CTRL_SAMPLING_MODE_MAX_MODE) { //0x000012D0 & 0x000012E4
return SCE_ERROR_INVALID_MODE;
@ -1240,7 +1240,7 @@ pspCtrlPadInputMode sceCtrlSetSamplingMode(pspCtrlPadInputMode mode) {
}
/*
* Subroutine sceCtrl_02BAAD91 - Address 0x00001AB8 - Aliases: sceCtrl_driver_4E972A76
* Subroutine sceCtrl_02BAAD91 - Address 0x00001AB8 - Aliases: sceCtrl_driver_501E0C70
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1255,14 +1255,14 @@ int sceCtrlGetSamplingCycle(u32 *cycle) {
}
/*
* Subroutine sceCtrl_6A2774F3 - Address 0x0000136C - Aliases: sceCtrl_driver_855C255D
* Subroutine sceCtrl_6A2774F3 - Address 0x0000136C - Aliases: sceCtrl_driver_83B15A81
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
int sceCtrlSetSamplingCycle(u32 cycle) {
int k1;
int suspendFlag;
int prevCycle;
u32 prevCycle;
int sdkVersion;
u32 nCycle;
@ -1300,7 +1300,7 @@ int sceCtrlSetSamplingCycle(u32 cycle) {
}
/*
* Subroutine sceCtrl_687660FA - Address 0x0000170C - Aliases: sceCtrl_driver_390D1A49
* Subroutine sceCtrl_687660FA - Address 0x0000170C - Aliases: sceCtrl_driver_E54253E7
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1334,7 +1334,7 @@ int sceCtrlGetIdleCancelThreshold(int *idleReset, int *idleBack) {
}
/*
* Subroutine sceCtrl_A7144800 - Address 0x00001680 - Aliases: sceCtrl_driver_84CEAE74
* Subroutine sceCtrl_A7144800 - Address 0x00001680 - Aliases: sceCtrl_driver_37533267
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1354,7 +1354,7 @@ int sceCtrlSetIdleCancelThreshold(int idlereset, int idleback) {
}
/*
* Subroutine sceCtrl_AF5960F3 - Address 0x00001C6C - Aliases: sceCtrl_driver_525D27AC
* Subroutine sceCtrl_AF5960F3 - Address 0x00001C6C - Aliases: sceCtrl_driver_BC8D1A3B
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1366,7 +1366,7 @@ u16 sceCtrlGetSuspendingExtraSamples() {
}
/*
* Subroutine sceCtrl_348D99D4 - Address 0x00001C40 - Aliases: sceCtrl_driver_53E67075
* Subroutine sceCtrl_348D99D4 - Address 0x00001C40 - Aliases: sceCtrl_driver_547F89D3
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1383,7 +1383,7 @@ int sceCtrlSetSuspendingExtraSamples(u16 suspendSamples) {
}
/*
* Subroutine sceCtrl_driver_65698764 - Address 0x000011F0
* Subroutine sceCtrl_driver_E467BEC8 - Address 0x000011F0
* Exported in sceCtrl_driver
*/
int sceCtrlExtendInternalCtrlBuffers(u8 mode, int arg2, int arg3) {
@ -1411,7 +1411,7 @@ int sceCtrlExtendInternalCtrlBuffers(u8 mode, int arg2, int arg3) {
}
/*
* Subroutine sceCtrl_B1D0E5CD - Address 0x00001490 - Aliases: sceCtrl_driver_6574DC7C
* Subroutine sceCtrl_B1D0E5CD - Address 0x00001490 - Aliases: sceCtrl_driver_637CB76C
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1446,7 +1446,7 @@ int sceCtrlPeekLatch(SceCtrlLatch *latch) {
}
/*
* Subroutine sceCtrl_0B588501 - Address 0x0000153C - Aliases: sceCtrl_driver_D883CAF9
* Subroutine sceCtrl_0B588501 - Address 0x0000153C - Aliases: sceCtrl_driver_7F7C4E0A
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1460,7 +1460,7 @@ int sceCtrlReadLatch(SceCtrlLatch *latch) {
pspSdkSetK1(k1 << 11); //0x00001548
suspendFlag = sceKernelCpuSuspendIntr(); //0x00001554
if ((pspSdkGetK1() & latch) < 0) { //0x00001564 -- protect kernel address from usermode
if ((pspSdkGetK1() & latch) < 0) { //0x00001564 -- protect kernel address from user mode
sceKernelCpuResumeIntr(suspendFlag); //0x00001620
pspSdkSetK1(k1); //0x0000162C
return SCE_ERROR_PRIV_REQUIRED; //0x00001634
@ -1491,7 +1491,7 @@ int sceCtrlReadLatch(SceCtrlLatch *latch) {
}
/*
* Subroutine sceCtrl_3A622550 - Address 0x00001AE0 - Aliases: sceCtrl_driver_18654FC0
* Subroutine sceCtrl_3A622550 - Address 0x00001AE0 - Aliases: sceCtrl_driver_2BA616AF
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1503,7 +1503,7 @@ int sceCtrlPeekBufferPositive(SceCtrlData *pad, u8 reqBufReads) {
}
/*
* Subroutine sceCtrl_C152080A - Address 0x00001B00 - Aliases: sceCtrl_driver_02DD57CF
* Subroutine sceCtrl_C152080A - Address 0x00001B00 - Aliases: sceCtrl_driver_E6085C33
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1515,7 +1515,7 @@ int sceCtrlPeekBufferNegative(SceCtrlData *pad, u8 reqBufReads) {
}
/*
* Subroutine sceCtrl_1F803938 - Address 0x00001B20 - Aliases: sceCtrl_driver_9F3038AC
* Subroutine sceCtrl_1F803938 - Address 0x00001B20 - Aliases: sceCtrl_driver_BE30CED0
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1527,7 +1527,7 @@ int sceCtrlReadBufferPositive(SceCtrlData *pad, u8 reqBufReads) {
}
/*
* Subroutine sceCtrl_60B81F86 - Address 0x00001B40 - Aliases: sceCtrl_driver_EB5F1D7A
* Subroutine sceCtrl_60B81F86 - Address 0x00001B40 - Aliases: sceCtrl_driver_3A6A612A
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1539,7 +1539,7 @@ int sceCtrlReadBufferNegative(SceCtrlData *pad, u8 reqBufReads) {
}
/*
* Subroutine sceCtrl_5A36B1C2 - Address 0x00001B60 - Aliases: sceCtrl_driver_1D75C1D4
* Subroutine sceCtrl_5A36B1C2 - Address 0x00001B60 - Aliases: sceCtrl_driver_D4692E77
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1551,7 +1551,7 @@ int sceCtrlPeekBufferPositiveExt(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)
}
/*
* Subroutine sceCtrl_239A6BA7 - Address 0x00001B8C - Aliases: sceCtrl_driver_6E552572
* Subroutine sceCtrl_239A6BA7 - Address 0x00001B8C - Aliases: sceCtrl_driver_41BCD9ED
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1563,7 +1563,7 @@ int sceCtrlPeekBufferNegativeExt(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)
}
/*
* Subroutine sceCtrl_1098030B - Address 0x00001BB8 - Aliases: sceCtrl_driver_16BB4085
* Subroutine sceCtrl_1098030B - Address 0x00001BB8 - Aliases: sceCtrl_driver_3BD76EDE
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1575,7 +1575,7 @@ int sceCtrlReadBufferPositiveExt(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)
}
/*
* Subroutine sceCtrl_7C3675AB - Address 0x00001BE4 - Aliases: sceCtrl_driver_4870C6AF
* Subroutine sceCtrl_7C3675AB - Address 0x00001BE4 - Aliases: sceCtrl_driver_7ABDEBAA
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1587,7 +1587,7 @@ int sceCtrlReadBufferNegativeExt(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)
}
/*
* Subroutine sceCtrl_A68FD260 - Address 0x00001DA8 - Aliases: sceCtrl_driver_FAF675CB
* Subroutine sceCtrl_A68FD260 - Address 0x00001DA8 - Aliases: sceCtrl_driver_994488EC
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1600,7 +1600,7 @@ int sceCtrlClearRapidFire(u8 slot) {
}
/*
* Subroutine sceCtrl_6841BE1A - Address 0x000018DC - Aliases: sceCtrl_driver_E96A4D84
* Subroutine sceCtrl_6841BE1A - Address 0x000018DC - Aliases: sceCtrl_driver_89438C13
* Exported in sceCtrl
* Exported in sceCtrl_driver
*/
@ -1646,7 +1646,7 @@ int sceCtrlSetRapidFire(u8 slot, u32 pressedBtnRange, u32 reqBtnsEventTrigger, u
}
/*
* Subroutine sceCtrl_driver_A759DB6A - Address 0x00001CB8
* Subroutine sceCtrl_driver_DB76878D - Address 0x00001CB8
* Exported in sceCtrl_driver
*/
int sceCtrlSetAnalogEmulation(u8 slot, u8 aXEmu, u8 aYEmu, u32 bufUpdates) {
@ -1665,7 +1665,7 @@ int sceCtrlSetAnalogEmulation(u8 slot, u8 aXEmu, u8 aYEmu, u32 bufUpdates) {
}
/*
* Subroutine sceCtrl_driver_094EF1BB - Address 0x00001C78
* Subroutine sceCtrl_driver_5130DAE3 - Address 0x00001C78
* Exported in sceCtrl_driver
*/
int sceCtrlSetButtonEmulation(u8 slot, u32 uModeBtnEmu, u32 kModeBtnEmu, u32 bufUpdates) {
@ -1681,14 +1681,14 @@ int sceCtrlSetButtonEmulation(u8 slot, u32 uModeBtnEmu, u32 kModeBtnEmu, u32 buf
}
/* Subroutine sceCtrl_driver_33AB5BDB - Address 0x00001878
/* Subroutine sceCtrl_driver_1809B9FC - Address 0x00001878
* Exported in sceCtrl_driver
*/
pspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask) {
PspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask) {
int suspendFlag;
int curMaskSupBtns;
int curMaskSetBtns;
pspCtrlPadButtonMaskMode btnMaskMode = PSP_CTRL_MASK_IGNORE_BUTTON_MASK;
PspCtrlPadButtonMaskMode btnMaskMode = PSP_CTRL_MASK_IGNORE_BUTTON_MASK;
suspendFlag = sceKernelCpuSuspendIntr(); //0x0000188C
curMaskSetBtns = ctrl.maskSetButtons; //0x0000189C
@ -1702,16 +1702,16 @@ pspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask) {
return btnMaskMode;
}
/* Subroutine sceCtrl_driver_5B15473C - Address 0x000017C4
/* Subroutine sceCtrl_driver_F8346777 - Address 0x000017C4
* Exported in sceCtrl_driver
*/
pspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 mask, pspCtrlPadButtonMaskMode buttonMaskMode) {
PspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 mask, PspCtrlPadButtonMaskMode buttonMaskMode) {
int curMaskSupBtns = ctrl.maskSupportButtons;
int newMaskSupBtns;
int curMaskSetBtns = ctrl.maskSetButtons;
int newMaskSetBtns;
int suspendFlag;
pspCtrlPadButtonMaskMode prevBtnMaskMode = PSP_CTRL_MASK_IGNORE_BUTTON_MASK;
PspCtrlPadButtonMaskMode prevBtnMaskMode = PSP_CTRL_MASK_IGNORE_BUTTON_MASK;
suspendFlag = sceKernelCpuSuspendIntr(); //0x000017E0
@ -1739,7 +1739,7 @@ pspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 mask, pspCtrlPadButtonMas
return prevBtnMaskMode;
}
/* Subroutine sceCtrl_driver_5D8CE0B2 - Address 0x00001D04
/* Subroutine sceCtrl_driver_DF53E160 - Address 0x00001D04
* Exported in sceCtrl_driver
*/
int sceCtrlSetSpecialButtonCallback(u32 slot, u32 btnMask, SceCtrlCb cb, void *arg) {
@ -1761,7 +1761,7 @@ int sceCtrlSetSpecialButtonCallback(u32 slot, u32 btnMask, SceCtrlCb cb, void *a
}
/*
* Subroutine sceCtrl_driver_DEFAD580 - Address 0x00001AA8
* Subroutine sceCtrl_driver_6C86AF22 - Address 0x00001AA8
* Exported in sceCtrl_driver
*/
int sceCtrl_driver_DEFAD580(int arg1) {
@ -1770,7 +1770,7 @@ int sceCtrl_driver_DEFAD580(int arg1) {
}
/*
* Subroutine sceCtrl_driver_BD119FAB - Address 0x00001638
* Subroutine sceCtrl_driver_7511CCFE - Address 0x00001638
* Exported in sceCtrl_driver
*/
int sceCtrlGetIdleCancelKey(int *arg1, int *arg2, int *arg3, int *arg4) {
@ -1791,7 +1791,7 @@ int sceCtrlGetIdleCancelKey(int *arg1, int *arg2, int *arg3, int *arg4) {
}
/*
* sceCtrl_driver_0D627B90 - Address 0x00001C10
* sceCtrl_driver_6A1DF4CB - Address 0x00001C10
* Exported in sceCtrl_driver
*/
int sceCtrlSetIdleCancelKey(int arg1, int arg2, int arg3, int arg4) {
@ -1804,7 +1804,7 @@ int sceCtrlSetIdleCancelKey(int arg1, int arg2, int arg3, int arg4) {
}
/*
* Subroutine sceCtrl_driver_BEF3B4C9 - Address 0x00001A98
* Subroutine sceCtrl_driver_5886194C - Address 0x00001A98
* Exported in sceCtrl_driver
*/
int sceCtrl_driver_BEF3B4C9(char arg1) {
@ -1813,7 +1813,7 @@ int sceCtrl_driver_BEF3B4C9(char arg1) {
}
/*
* sceCtrl_driver_5F20A0F0 - Address 0x00001D94
* sceCtrl_driver_365BE224 - Address 0x00001D94
* Exported in sceCtrl_driver
*/
int sceCtrlUpdateCableTypeReq(char arg1) {

View File

@ -6,7 +6,7 @@
* ctrl.h
*
* @author _Felix_
* @version 6.39
* @version 6.60
*
* Controller libraries of the SCE PSP system.
*/
@ -39,17 +39,17 @@ int sceCtrl_1098030B(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__
/** Custom function name. */
int sceCtrl_7C3675AB(int arg1, SceCtrlDataExt *pad, u8 reqBufReads)__attribute__((alias("sceCtrlReadBufferNegativeExt")));
/** Custom function name. */
int sceCtrl_driver_65698764(u8 mode, int arg2, int arg3)__attribute__((alias("sceCtrlExtendInternalCtrlBuffers")));
int sceCtrl_driver_E467BEC8(u8 mode, int arg2, int arg3)__attribute__((alias("sceCtrlExtendInternalCtrlBuffers")));
/** The callback function used by ::sceCtrlSetSpecialButtonCallback. */
typedef void (*SceCtrlCb)(int curr, int last, void *opt);
typedef void (*SceCtrlCb)(int currBtns, int lastBtns, void *opt);
/** Type definition for improved style. */
typedef u8 pspCtrlPadInputMode;
typedef u8 PspCtrlPadInputMode;
/** Type definition for improved style. */
typedef u8 pspCtrlPadPollMode;
typedef u8 PspCtrlPadPollMode;
/** Type definition for improved style. */
typedef u8 pspCtrlPadButtonMaskMode;
typedef u8 PspCtrlPadButtonMaskMode;
/** General information about an internal PSP controller buffer. Including current pressed button(s) and current position
* of the analog controller.
@ -121,7 +121,7 @@ typedef struct _SceCtrlLatch {
* @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,
* PSP_CTRL_MS can only be read in kernel mode.
*/
enum PspCtrlPadButtons {
enum pspCtrlPadButtons {
/** Select button. Negative value = 0xFFFFFFFE. */
PSP_CTRL_SELECT = 0x1,
/** Start button. Negative value = 0xFFFFFFF7. */
@ -150,7 +150,7 @@ enum PspCtrlPadButtons {
PSP_CTRL_HOME = 0x10000,
/** Hold button. Negative value = 0xFFFDFFFF. */
PSP_CTRL_HOLD = 0x20000,
/** Wlan switch up. Negative value = 0xFFFBFFFF. */
/** W-LAN switch up. Negative value = 0xFFFBFFFF. */
PSP_CTRL_WLAN_UP = 0x40000,
/** Remote hold position. Negative value = 0xFFF7FFFF. */
PSP_CTRL_REMOTE = 0x80000,
@ -169,15 +169,15 @@ enum PspCtrlPadButtons {
};
/** Controller input modes. */
enum PspCtrlPadInputMode {
/** Digitial input only. No recognizing of analog input. */
enum pspCtrlPadInputMode {
/** Digital input only. No recognizing of analog input. */
PSP_CTRL_INPUT_DIGITAL_ONLY = 0,
/** Recognizing of both digital and analog input. */
PSP_CTRL_INPUT_DIGITAL_ANALOG = 1,
};
/** Controller input poll modes. */
enum PspCtrlPadPollMode {
enum pspCtrlPadPollMode {
/** No controller input is recognized. */
PSP_CTRL_POLL_NO_POLLING = 0,
/** Controller input is recognized. */
@ -185,10 +185,10 @@ enum PspCtrlPadPollMode {
};
/** Button mask settings. */
enum PspCtrlPadButtonMaskMode {
enum pspCtrlPadButtonMaskMode {
/** Remove any custom mask settings involving the specified button bit mask. */
PSP_CTRL_MASK_DELETE_BUTTON_MASK_SETTING = 0,
/** Block the buttons defined by the button bit mask (their button status (pressed/unpressed) won't be recognized).
/** Block the buttons defined by the button bit mask (their button status (pressed/un-pressed) won't be recognized).
* 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).
@ -227,30 +227,30 @@ int sceCtrlResume();
/**
* Enable/disable controller input.
*
* @param pollMode One of ::PspCtrlPadPollMode. If set to 0, no button/analog input is recognized.
* @param pollMode One of ::pspCtrlPadPollMode. If set to 0, no button/analog input is recognized.
* Set to 1 to enable button/analog input.
*
* @return 0.
*/
int sceCtrlSetPollingMode(pspCtrlPadPollMode pollMode);
int sceCtrlSetPollingMode(PspCtrlPadPollMode pollMode);
/**
* Get the current controller input mode.
*
* @param mode Pointer to int receiving the current controller mode. One of ::PspCtrlPadInputMode.
* @param mode Pointer to int receiving the current controller mode. One of ::pspCtrlPadInputMode.
*
* @return 0.
*/
pspCtrlPadInputMode sceCtrlGetSamplingMode(pspCtrlPadInputMode *mode);
PspCtrlPadInputMode sceCtrlGetSamplingMode(PspCtrlPadInputMode *mode);
/**
* Set the controller input mode.
*
* @param mode The new controller input mode. One of ::PspCtrlPadInputMode.
* @param mode The new controller input mode. One of ::pspCtrlPadInputMode.
*
* @return The previous input mode on success, or < 0 (invalid argument).
*/
pspCtrlPadInputMode sceCtrlSetSamplingMode(pspCtrlPadInputMode mode);
PspCtrlPadInputMode sceCtrlSetSamplingMode(PspCtrlPadInputMode mode);
/**
* Get the current cycle specifying the update frequency of the internal controller buffer.
@ -289,7 +289,7 @@ int sceCtrlGetIdleCancelThreshold(int *idleReset, int *idleBack);
* @param idleback Movement needed by the analog to bring the PSP back from an idle state.
*
* Set to -1 for analog to not cancel idle timer.
* Set to 0 for idle timer to be cancelled even if the analog is not moved.
* Set to 0 for idle timer to be canceled even if the analog is not moved.
* Set between 1 - 128 to specify the movement on either axis needed by the analog to fire the event.
*
* @return 0 on success, otherwise < 0.
@ -321,7 +321,7 @@ int sceCtrlSetSuspendingExtraSamples(u16 suspendSamples);
* @param arg2 Unknown.
* @param arg3 Unknown.
*
* @return 0 on succss, otherwise < 0.
* @return 0 on success, otherwise < 0.
*/
int sceCtrlExtendInternalCtrlBuffers(u8 mode, int arg2, int arg3);
@ -334,7 +334,7 @@ int sceCtrlExtendInternalCtrlBuffers(u8 mode, int arg2, int arg3);
*
* @param latch Pointer to a SceCtrlLatch struct retrieving the current internal latch buffer.
*
* @return The amount of reads of the internal latch buffer without being reseted on succes, or < 0 on error.
* @return The amount of reads of the internal latch buffer without being reseted on success, or < 0 on error.
*
* @par Example:
* @code
@ -367,11 +367,11 @@ int sceCtrlReadLatch(SceCtrlLatch *latch);
/**
* Read the current internal ctrl buffer. Does not wait for the next VBlank.
*
* @param pad Pointer to a SceCtrlData struct retrieving the current internal ctrl buffer.
* @param count The number of internal buffers to read. There are 64 internal ctrl buffers which can be read.
* @param pad Pointer to a SceCtrlData struct retrieving the current internal controller buffer.
* @param count 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.
*
* @return The amount of read internal ctrl buffers, or < 0 on error.
* @return The amount of read internal controller buffers, or < 0 on error.
*
* @par Example:
* @code
@ -395,12 +395,12 @@ int sceCtrlPeekBufferPositive(SceCtrlData *pad, u8 reqBufReads);
* Read the current internal SceCtrlData buffer. Does not wait for the next VBlank.
*
* @param pad Pointer to a SceCtrlData struct retrieving the current internal controller buffer. Negative button values have to be used.
* Check ::PspCtrlPadButtons for the negative active values of the buttons. If no button is active, the internal
* Check ::pspCtrlPadButtons for the negative active values of the buttons. If no button is active, the internal
* button value is 0xFFFFFFFF.
* @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.
*
* @return The amount of read internal ctrl buffers, or < 0 on error.
* @return The amount of read internal controller buffers, or < 0 on error.
*
* @par Example:
* @code
@ -437,12 +437,12 @@ int sceCtrlReadBufferPositive(SceCtrlData *pad, u8 reqBufReads);
* You can set your own update time by calling ::sceCtrlSetSamplingCycle.
*
* @param pad Pointer to a SceCtrlData struct retrieving the current internal controller buffer. Negative button values have to be used.
* Check ::PspCtrlPadButtons for the negative active values of the buttons. If no button is active, the internal
* Check ::pspCtrlPadButtons for the negative active values of the buttons. If no button is active, the internal
* button value is 0xFFFFFFFF.
* @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.
*
* @return The amount of read internal ctrl buffers on success, or < 0 on error.
* @return The amount of read internal controller buffers on success, or < 0 on error.
*/
int sceCtrlReadBufferNegative(SceCtrlData *pad, u8 reqBufReads);
@ -452,9 +452,9 @@ int sceCtrlReadBufferNegative(SceCtrlData *pad, u8 reqBufReads);
*
* @param arg1 Pass 1 or 2.
* @param padExt Pointer to a SceCtrlData struct retrieving the current internal controller buffer.
* @param reqBufReads. Number of requested internal controller buffers reads. Has to be set to a value in the range of 1 - 64.
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
*
* @return The amount of read internal ctrl buffers on success, or < 0 on error.
* @return The amount of read internal controller buffers on success, or < 0 on error.
*/
int sceCtrlPeekBufferPositiveExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
@ -464,9 +464,9 @@ int sceCtrlPeekBufferPositiveExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufRead
*
* @param arg1 Unknown. Pass 1 or 2.
* @param padExt Pointer to a SceCtrlData struct retrieving the current internal controller buffer.
* @param reqBufReads. Number of requested internal controller buffers reads. Has to be set to a value in the range of 1 - 64.
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
*
* @return The amount of read internal ontroller buffers, or < 0 on error.
* @return The amount of read internal controller buffers, or < 0 on error.
*/
int sceCtrlPeekBufferNegativeExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
@ -475,22 +475,22 @@ int sceCtrlPeekBufferNegativeExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufRead
* You need to call ::sceCtrlExtendInternalCtrlBuffers before use.
*
* @param arg1 Pass 1 or 2.
* @param padExt Pointer to a SceCtrlData struct retrieving the current internal ctrl buffer.
* @param reqBufReads. Number of requested internal controller buffers reads. Has to be set to a value in the range of 1 - 64.
* @param padExt Pointer to a SceCtrlData struct retrieving the current internal controller buffer.
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
*
* @return The amount of read internal ontroller buffers, or < 0 on error.
* @return The amount of read internal controller buffers, or < 0 on error.
*/
int sceCtrlReadBufferPositiveExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
/**
* Extended ::sceCtrlReadBufferNegative. See description for more info.
* You need to call ::sceCtrlExtendInternalCtrlBuf before use.
* You need to call ::sceCtrlExtendInternalCtrlBuffers before use.
*
* @param arg1 Pass 1 or 2.
* @param padExt Pointer to a SceCtrlData struct retrieving the current internal ctrl buffer.
* @param reqBufReads. Number of requested internal controller buffers reads. Has to be set to a value in the range of 1 - 64.
* @param padExt Pointer to a SceCtrlData struct retrieving the current internal controller buffer.
* @param reqBufReads. Number of requested reads of the internal controller buffers. Has to be set to a value in the range of 1 - 64.
*
* @return The amount of read internal ontroller buffers, or < 0 on error.
* @return The amount of read internal controller buffers, or < 0 on error.
*/
int sceCtrlReadBufferNegativeExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufReads);
@ -504,13 +504,13 @@ int sceCtrlReadBufferNegativeExt(int arg1, SceCtrlDataExt *padExt, u8 reqBufRead
int sceCtrlClearRapidFire(u8 slot);
/**
* Set a pressed/unpressed period for a button.
* Set a pressed/un-pressed period for a button.
*
* @param slot The slot used to set the custom values. Between 0 - 15. Multiple slots can be used.
* @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/unpressed period for a button/buttons when being pressed.
* @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.
* Has to be included in pressedBtnRange.
* @param reqBtn The requested button(s) on which the pressed/unpressed period (the rapid fire event) will be applied to.
* @param reqBtn The requested button(s) on which the pressed/un-pressed period (the rapid fire event) will be applied to.
* 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
@ -520,7 +520,7 @@ int sceCtrlClearRapidFire(u8 slot);
* It will be applied for 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 - 64. If set to 0, the reqButton will be turned ON
* for 1 internal controller buffer update.
* @param reqBtnOffTime For how many (consecutive) internal controller buffer updates the requested button(s) will be set to OFF (unpressed).
* @param reqBtnOffTime For how many (consecutive) internal controller buffer updates the requested button(s) will be set to OFF (un-pressed).
* 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
* (i.e. the pressing of a different PSP button). Set to 0 - 64. If set to 0, the reqButton will be turned OFF
@ -548,26 +548,26 @@ int sceCtrlSetRapidFire(u8 slot, u32 pressedBtnRange, u32 reqBtnsEventTrigger, u
/**
* Emulate values for the analog pad's X- and Y-axis.
*
* @param slot The slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are or'ed together.
* @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 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.
*
* @return 0 on succes, otherwise < 0 (invalid arguments).
* @return 0 on success, otherwise < 0 (invalid arguments).
*/
int sceCtrlSetAnalogEmulation(u8 slot, u8 aXEmu, u8 aYEmu, u32 bufUpdates);
/**
* Emulate buttons for the digital pad.
*
* @param slot The slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are or'ed together.
* @param uModeBtnEmu Emulated user buttons of ::PspCtrlPadButtons. You cannot emulate kernel buttons and
* @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
* the emulated buttons will only be applied for applications running in user mode.
* @param kModeBtnEmu Emulated buttons of ::PspCtrlPadButtons (you can emulate both user and kernel buttons).
* @param kModeBtnEmu Emulated buttons of ::pspCtrlPadButtons (you can emulate both user and kernel buttons).
* 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.
*
* @return 0 on succes, otherwise < 0 (invalid arguments).
* @return 0 on success, otherwise < 0 (invalid arguments).
*/
int sceCtrlSetButtonEmulation(u8 slot, u32 uModeBtnEmu, u32 kModeBtnEmu, u32 bufUpdates);
@ -576,14 +576,14 @@ int sceCtrlSetButtonEmulation(u8 slot, u32 uModeBtnEmu, u32 kModeBtnEmu, u32 buf
*
* @note In the PSPSDK, this function is defined as sceCtrlGetButtonMask.
*
* @param btnMask The button bit value to check for (one or more buttons of ::PspCtrlPadButtons).
* @param btnMask The button bit value to check for (one or more buttons of ::pspCtrlPadButtons).
*
* @return The button mask mode for the given btnMask. One of ::PspCtrlPadButtonMaskMode.
* @return The button mask mode for the given btnMask. One of ::pspCtrlPadButtonMaskMode.
* 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.
* PSP_CTRL_MASK_SET_BUTTON_MASK (2), if btnMask (or parts of it) are set to ON by the current set button mask.
*/
pspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask);
PspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask);
/**
* Set a button mask mode for one or more buttons. You can only mask user mode buttons in user applications.
@ -592,8 +592,8 @@ pspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask);
* @note In the PSPSDK, this function is defined as sceCtrlSetButtonMask.
*
* @param btnMask The button value for which the button mask mode will be applied.
* One or more buttons of ::PspCtrlPadButtons.
* @param btnMaskMode Specifies the mask mode of the button mask. One of ::PspCtrlPadButtonMaskMode.
* One or more buttons of ::pspCtrlPadButtons.
* @param btnMaskMode Specifies the mask mode of the button mask. One of ::pspCtrlPadButtonMaskMode.
*
* @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,
@ -611,7 +611,7 @@ pspCtrlPadButtonMaskMode sceCtrlGetButtonIntercept(u32 btnMask);
* sceCtrlSetButtonIntercept(0xFFFF, 0);
* @endcode
*/
pspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 btnMask, pspCtrlPadButtonMaskMode btnMaskMode);
PspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 btnMask, PspCtrlPadButtonMaskMode btnMaskMode);
/**
* Register a button callback.
@ -619,8 +619,8 @@ pspCtrlPadButtonMaskMode sceCtrlSetButtonIntercept(u32 btnMask, pspCtrlPadButton
* @note In the PSPSDK, this function is defined as sceCtrlRegisterButtonCallback.
*
* @param slot The slot used to register the callback (0-3).
* @param btnMask Bitwise OR'ed button values which will be checked for being pressed.
* @param cbFunc Pointer to the callback function (int curr, int last, void *arg), which handles button input effects.
* @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.
* @param opt Optional user argument. Passed to the callback function as its third argument.
*
* @return 0 on success, or < 0 (invalid arguments).