SceCtrl: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 20: Line 20:
| 1.69 || [[SceCtrl#SceCtrl|SceCtrl]] || Non-secure || User || 0xD197E3C7
| 1.69 || [[SceCtrl#SceCtrl|SceCtrl]] || Non-secure || User || 0xD197E3C7
|}
|}
== Ctrl processor ==
The control core of SceCtrl is in ctrl_intr_handler.
ctrl_intr_handler is always called at intervals of 60fps (maybe variable interval?), and internally calls syscon_ctrl_read command from sceSysconCmdExecAsync. Also calls sceKernelPowerTick(0) depending on flag A1.
Flag A1 is set inside the callback function called from sceSysconCmdExecAsync.
Unknown the details, but maybe pressing the button updates this flag.


== SceCtrlForDriver ==
== SceCtrlForDriver ==
Line 172: Line 182:
  * note - This flag is reset when the process using SceCtrl is switched.
  * note - This flag is reset when the process using SceCtrl is switched.
  */
  */
int sceCtrlSetInhibitFlagProcForDriver(SceUID pid, SceUInt32 flag);
int sceCtrlSetInhibitFlagProcForDriver(SceUID pid, SceBool flag);
</source>
</source>


Line 215: Line 225:
</source>
</source>


=== SceCtrlForDriver_02081494 ===
=== _sceCtrlBdRemoconSendMergedNotifyForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 225: Line 235:
Notifies a callback (?driver?).
Notifies a callback (?driver?).


<source lang="C">int SceCtrlForDriver_02081494(int a1, int a2, int a2);</source>
<source lang="C">int _sceCtrlBdRemoconSendMergedNotifyForDriver(int a1, int a2, int a2);</source>


=== sceCtrlChangePortAssignForDriver ===
=== sceCtrlChangePortAssignForDriver ===
Line 773: Line 783:
|}
|}


 
[[Category:ARM]]
[[Category:Kernel]]
[[Category:Modules]]
[[Category:Modules]]
[[Category:Kernel]]
[[Category:Library]]

Latest revision as of 11:44, 7 June 2023

Module

Version World Privilege
1.69-3.65 Non-secure Kernel

Libraries

Known NIDs

Version Name World Visibility NID
1.69 SceCtrlForDriver Non-secure Kernel 0x7823A5D1
1.69 SceCtrl Non-secure User 0xD197E3C7

Ctrl processor

The control core of SceCtrl is in ctrl_intr_handler.

ctrl_intr_handler is always called at intervals of 60fps (maybe variable interval?), and internally calls syscon_ctrl_read command from sceSysconCmdExecAsync. Also calls sceKernelPowerTick(0) depending on flag A1.

Flag A1 is set inside the callback function called from sceSysconCmdExecAsync.

Unknown the details, but maybe pressing the button updates this flag.

SceCtrlForDriver

sceCtrlRegisterVirtualControllerDriverForDriver

Version NID
3.60 0x18823EEA

This is a guessed name.

On PSTV, SceDS3 module calls this function to register the DualShock3/DualShock4 USB/Bluetooth driver. Only one virtual controller driver can be registered at a time: the new driver replaces the previous one.

typedef struct SceCtrlVirtualControllerDriver { // size is 0x34
	int (*readButtons)(int port, SceCtrlData *pad_data, int count);
	int (*setActuator)(int port, const SceCtrlActuator* pState);
	int (*getBatteryInfo)(int port, SceUInt8 *batt);
	int (*disconnect)(int port);
	int (*setTurnOffInterval)(int port);
	int (*getActiveControllerPort)(void);
	int (*changePortAssign)(int port1, int port2);
	int (*unk0)(void); // SceCtrlForDriver_69E45836 equivalent
	int (*getControllerPortInfo)(SceCtrlPortInfo *info);
	int (*setLightBar)(int port, SceUInt8 r, SceUInt8 g, SceUInt8 b);
	int (*resetLightBar)(int port);
	int (*unk1)(int pid); // sceCtrlSetActiveProcessForDriver equivalent
	int (*singleControllerMode)(int port);
} SceCtrlVirtualControllerDriver;

int sceCtrlRegisterVirtualControllerDriverForDriver(SceCtrlVirtualControllerDriver *driver);

sceCtrlSetActiveProcessForDriver

Version NID
0.990-3.60 0xB26C2231

This is a guessed name.

int sceCtrlSetActiveProcessForDriver(SceUID pid);

SceCtrlForDriver_69E45836

Version NID
3.60 0x69E45836

Clear active process. Maybe disconnect device.

int SceCtrlForDriver_69E45836(void);

sceCtrlUpdateMaskForNonShellForDriver

Version NID
3.60 0x03777131

This is a guessed name.

int sceCtrlUpdateMaskForNonShellForDriver(SceUInt32 clear_mask, SceUInt32 set_mask);

sceCtrlUpdateMaskForAllForDriver

Version NID
3.60 0x12C13A72

This is a guessed name.

int sceCtrlUpdateMaskForAllForDriver(SceUInt32 clear_mask, SceUInt32 set_mask);

sceCtrlGetMaskForNonShellForDriver

Version NID
3.60 0xB25BD8FD

This is a guessed name.

int sceCtrlGetMaskForNonShellForDriver(SceUInt32 *puiMask);

sceCtrlGetMaskForAllForDriver

Version NID
3.60 0x46ABDDE8

This is a guessed name.

int sceCtrlGetMaskForAllForDriver(SceUInt32 *puiMask);

sceCtrlGetCurrentProcessIdForDriver

Version NID
3.60 0xDA07E970

This is a guessed name.

int sceCtrlGetCurrentProcessIdForDriver(SceUID *pPid);

sceCtrlSetInhibitFlagForDriver

Version NID
3.60 0xC8CE3E43

This is a guessed name.

/*
 * param[in] flag - if value one, all operations are inhibited.
 */
int sceCtrlSetInhibitFlagForDriver(SceUInt32 flag);

sceCtrlSetInhibitFlagProcForDriver

Version NID
3.60 0x5B708A15

This is a guessed name.

/*
 * param[in] flag - if value one, all operations are inhibited in target process (PS button is not disabled)
 *
 * note - This flag is reset when the process using SceCtrl is switched.
 */
int sceCtrlSetInhibitFlagProcForDriver(SceUID pid, SceBool flag);

SceCtrlForDriver_FF9D4DD4

Version NID
3.60 0xFF9D4DD4

Register some callback and get current hold button.

Using by ScePower.

/*
 * param[in]  some_button - The SceCtrlButtons type value
 * param[in]  cb          - The callback function pointer
 * param[in]  a2          - Unknown, set zero
 * param[out] button      - The current hold button
 */

int SceCtrlForDriver_FF9D4DD4(int some_button, const void *cb, int a2, uint32_t *button)

SceCtrlForDriver_4CCB2153

Version NID
3.60 0x4CCB2153

Clear the information set in #SceCtrlForDriver_FF9D4DD4.

/*
 * param[in] port - pass 0~3
 */
int SceCtrlForDriver_4CCB2153(int port);

_sceCtrlBdRemoconSendMergedNotifyForDriver

Version NID
3.60 0x02081494

Notifies a callback (?driver?).

int _sceCtrlBdRemoconSendMergedNotifyForDriver(int a1, int a2, int a2);

sceCtrlChangePortAssignForDriver

Version NID
3.60 0x53381364

Name derived from SceVshBridge.

sceCtrlGetActiveControllerPortForDriver

Version NID
3.60 0xFA88D837

Name derived from SceVshBridge.

sceCtrlGetControllerPortInfoForDriver

Version NID
3.60 0xF11D0D30

sceCtrlSetIdleCancelKeyForDriver

Version NID
3.60 0x0A679512

Name derived from SceVshBridge.

sceCtrlGetIdleCancelKeyForDriver

Version NID
3.60 0x30801AE9

sceCtrlSetIdleCancelThresholdForDriver

Version NID
3.60 0x345E74FD

Name derived from SceVshBridge.

sceCtrlGetIdleCancelThresholdForDriver

Version NID
3.60 0xB9402CEF

sceCtrlGetSamplingModeForDriver

Version NID
3.60 0x145B13BC

sceCtrlSetSamplingModeForDriver

Version NID
3.60 0x80F5E418

sceCtrlIsBdRemoconConnectedForDriver

Version NID
3.60 0x5B849B22

Name derived from SceVshBridge.

sceCtrlSetBdRemoconConnectedForDriver

Version NID
3.60 0xAA36F578

This is a guessed name.

sceCtrlPeekBufferNegativeForDriver

Version NID
3.60 0x19895843

sceCtrlPeekBufferPositiveForDriver

Version NID
3.60 0xEA1D3A34

sceCtrlReadBufferNegativeForDriver

Version NID
3.60 0x8D4E0DD1

sceCtrlReadBufferPositiveForDriver

Version NID
3.60 0x9B96A1AA

sceCtrlRegisterNotifyCallBackForDriver

Version NID
3.60 0xE170883E

Name derived from SceVshBridge.

sceCtrlUnregisterNotifyCallBackForDriver

Version NID
3.60 0x9DAB51C4

Name derived from SceVshBridge.

sceCtrlNotifyCallBacksForDriver

Version NID
3.60 0x6E183B9B

This is a guessed name.

sceCtrlSetAnalogEmulationForDriver

Version NID
3.60 0x06577FE8

This is a guessed name.

sceCtrlSetButtonEmulationForDriver

Version NID
3.60 0x1E750326

This is a guessed name.

sceCtrlSetButtonInterceptForDriver

Version NID
3.60 0x06AA5E1A

This is a guessed name.

sceCtrlGetButtonInterceptForDriver

Version NID
3.60 0x6BEB1CD7

This is a guessed name.

sceCtrlSetCtrlpCallbackForDriver

Version NID
3.60 0x7AD9467E

This is a guessed name.

sceCtrlSetRapidFireForDriver

Version NID
3.60 0xA248CDAE

sceCtrlClearRapidFireForDriver

Version NID
3.60 0xED138A26

sceCtrlSetTurnOffIntervalForDriver

Version NID
3.60 0xED8F0129

Name derived from SceVshBridge.

sceCtrlSetVibrationSettingForDriver

Version NID
3.60 0x4D8FE670

Name derived from SceVshBridge.

SceCtrl

sceCtrlPeekBufferNegative

Version NID
1.69-3.60 0x104ED1A7

sceCtrlReadBufferNegative

Version NID
1.69-3.60 0x15F96FB0

sceCtrlSetButtonIntercept

Version NID
1.69-3.60 0x433D71F4

sceCtrlReadBufferPositive

Version NID
1.69-3.60 0x67E7AB83

sceCtrlGetButtonIntercept

Version NID
1.69-3.60 0x6FAFAD05

sceCtrlSetSamplingMode

Version NID
1.69-3.60 0xA497B150

sceCtrlPeekBufferPositiveExt

Version NID
1.69-3.60 0xA59454D3

sceCtrlPeekBufferPositive

Version NID
1.69-3.60 0xA9C3CED6

sceCtrlSetSamplingModeExt

Version NID
1.69-3.60 0xB1DC4378

sceCtrlGetSamplingModeExt

Version NID
1.69-3.60 0xBD27F830

sceCtrlClearRapidFire

Version NID
1.69-3.60 0xD8294C9C

sceCtrlReadBufferPositiveExt

Version NID
1.69-3.60 0xE2D99296

sceCtrlSetRapidFire

Version NID
1.69-3.60 0xE9CB69C8

sceCtrlGetSamplingMode

Version NID
1.69-3.60 0xEC752AAF

sceCtrlDisconnect

Version NID
3.60 0x16D26DC7

sceCtrlGetAnalogStickCheckMode

Version NID
3.60 0x35BCD3BB

sceCtrlGetAnalogStickCheckTarget

Version NID
3.60 0xD01DE63A

sceCtrlGetBatteryInfo

Version NID
3.60 0x8F9B1CE5

sceCtrlGetControllerPortInfo

Version NID
3.60 0x324F1B66

sceCtrlGetProcessStatus

Version NID
3.60 0xA2A56685

sceCtrlGetWirelessControllerInfo

Version NID
3.60 0xB8844141

sceCtrlIsMultiControllerSupported

Version NID
3.60 0x1FFFD965

sceCtrlPeekBufferNegative2

Version NID
3.60 0x81A89660

sceCtrlPeekBufferPositive2

Version NID
3.60 0x15F81E8C

sceCtrlPeekBufferPositiveExt2

Version NID
3.60 0x860BF292

sceCtrlReadBufferNegative2

Version NID
3.60 0x27A0C5FB

sceCtrlReadBufferPositive2

Version NID
3.60 0xC4226A3E

sceCtrlReadBufferPositiveExt2

Version NID
3.60 0xA7178860

sceCtrlRegisterBdRMCCallback

Version NID
3.60 0x0A06B7E4

sceCtrlResetLightBar

Version NID
3.60 0x7E110E90

sceCtrlSetActuator

Version NID
3.60 0xDBCAA0C9

sceCtrlSetAnalogStickCheckMode

Version NID
3.60 0xB2C98244

sceCtrlSetAnalogStickCheckTarget

Version NID
3.60 0xFB12A0A7

sceCtrlSetButtonRemappingInfo

Version NID
3.60 0x8A187F98

sceCtrlSetLightBar

Version NID
3.60 0xDA11D433

sceCtrlSingleControllerMode

Version NID
3.60 0x031BE396

sceCtrlUnregisterBdRMCCallback

Version NID
3.60 0x103EB2B0