vitasdk
Documentation of the vitasdk

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceCtrlForDriver_stub



Functions

 VITASDK_BUILD_ASSERT_EQ (0x34, SceCtrlVirtualControllerDriver)
 
int ksceCtrlSetSamplingMode (int mode)
 Set the controller mode. More...
 
int ksceCtrlGetSamplingMode (int *pMode)
 Get the current controller mode. More...
 
int ksceCtrlPeekBufferPositive (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (polling, positive logic). More...
 
int ksceCtrlPeekBufferNegative (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (polling, negative logic). More...
 
int ksceCtrlReadBufferPositive (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (blocking, positive logic). More...
 
int ksceCtrlReadBufferNegative (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (blocking, negative logic). More...
 
int ksceCtrlSetRapidFire (int port, int idx, const SceCtrlRapidFireRule *pRule)
 Set rules for button rapid fire. More...
 
int ksceCtrlClearRapidFire (int port, int idx)
 Clear rules for button rapid fire. More...
 
int ksceCtrlGetControllerPortInfo (SceCtrlPortInfo *info)
 Get controller port information. More...
 
int ksceCtrlSetButtonIntercept (int intercept)
 Sets intercept. More...
 
int ksceCtrlGetButtonIntercept (int *intercept)
 Gets intercept. More...
 
int ksceCtrlSetButtonEmulation (unsigned int port, unsigned char slot, unsigned int userButtons, unsigned int kernelButtons, unsigned int uiMake)
 Emulate buttons for the digital pad. More...
 
int ksceCtrlSetAnalogEmulation (unsigned int port, unsigned char slot, unsigned char user_lX, unsigned char user_lY, unsigned char user_rX, unsigned char user_rY, unsigned char kernel_lX, unsigned char kernel_lY, unsigned char kernel_rX, unsigned char kernel_rY, unsigned int uiMake)
 Emulate values for the analog pad's X- and Y-axis. More...
 
int ksceCtrlRegisterVirtualControllerDriver (SceCtrlVirtualControllerDriver *driver)
 Register virtual controller driver. More...
 
int ksceCtrlUpdateMaskForNonShell (int clear_mask, int set_mask)
 Update ctrl mask for non shell process. More...
 
int ksceCtrlUpdateMaskForAll (int clear_mask, int set_mask)
 Update ctrl mask for all process. More...
 
int ksceCtrlGetMaskForNonShell (uint32_t *mask)
 Get ctrl mask for non shell process. More...
 
int ksceCtrlGetMaskForAll (uint32_t *mask)
 Get ctrl mask for all process. More...
 

Data Structure Documentation

◆ SceCtrlVirtualControllerDriver

struct SceCtrlVirtualControllerDriver

Structure to pass as argument to ksceCtrlRegisterVirtualControllerDriver.

Data Fields

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)
 
int(* getControllerPortInfo )(SceCtrlPortInfo *info)
 
int(* setLightBar )(int port, SceUInt8 r, SceUInt8 g, SceUInt8 b)
 
int(* resetLightBar )(int port)
 
int(* unk1 )(int port)
 
int(* singleControllerMode )(int port)
 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ()

VITASDK_BUILD_ASSERT_EQ ( 0x34  ,
SceCtrlVirtualControllerDriver   
)

◆ ksceCtrlSetSamplingMode()

int ksceCtrlSetSamplingMode ( int  mode)

Set the controller mode.

Parameters
[in]mode- One of SceCtrlPadInputMode.
Returns
The previous mode, <0 on error.

◆ ksceCtrlGetSamplingMode()

int ksceCtrlGetSamplingMode ( int *  pMode)

Get the current controller mode.

Parameters
[out]pMode- Return value, see SceCtrlPadInputMode.
Returns
The current mode, <0 on error.

◆ ksceCtrlPeekBufferPositive()

int ksceCtrlPeekBufferPositive ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (polling, positive logic).

Parameters
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns
Buffers count, between 1 and 'count'. <0 on error.

◆ ksceCtrlPeekBufferNegative()

int ksceCtrlPeekBufferNegative ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (polling, negative logic).

Parameters
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns
Buffers count, between 1 and 'count'. <0 on error.

◆ ksceCtrlReadBufferPositive()

int ksceCtrlReadBufferPositive ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (blocking, positive logic).

Parameters
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns
Buffers count, between 1 and 'count'. <0 on error.

◆ ksceCtrlReadBufferNegative()

int ksceCtrlReadBufferNegative ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (blocking, negative logic).

Parameters
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns
Buffers count, between 1 and 'count'. <0 on error.

◆ ksceCtrlSetRapidFire()

int ksceCtrlSetRapidFire ( int  port,
int  idx,
const SceCtrlRapidFireRule pRule 
)

Set rules for button rapid fire.

Parameters
[in]port- use 0.
[in]idx- rule index between 0-15
[in]pRule- structure SceCtrlRapidFireRule.
Returns
0, <0 on error.

◆ ksceCtrlClearRapidFire()

int ksceCtrlClearRapidFire ( int  port,
int  idx 
)

Clear rules for button rapid fire.

Parameters
[in]port- use 0.
[in]idx- rule index between 0-15
Returns
0, <0 on error.

◆ ksceCtrlGetControllerPortInfo()

int ksceCtrlGetControllerPortInfo ( SceCtrlPortInfo info)

Get controller port information.

Parameters
[out]info- see SceCtrlPortInfo
Returns
0, <0 on error

◆ ksceCtrlSetButtonIntercept()

int ksceCtrlSetButtonIntercept ( int  intercept)

Sets intercept.

If true, allows the current thread to intercept controls. The use case might be, for example, a game plugin that wishes to capture input without having the input sent to the game thread.

Parameters
[in]interceptBoolean value
Returns
0, < 0 on error

◆ ksceCtrlGetButtonIntercept()

int ksceCtrlGetButtonIntercept ( int *  intercept)

Gets intercept.

Parameters
[out]interceptBoolean value
Returns
0, < 0 on error

◆ ksceCtrlSetButtonEmulation()

int ksceCtrlSetButtonEmulation ( unsigned int  port,
unsigned char  slot,
unsigned int  userButtons,
unsigned int  kernelButtons,
unsigned int  uiMake 
)

Emulate buttons for the digital pad.

Parameters
portUse 0
slotThe slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are combined.
userButtonsEmulated user buttons of SceCtrlButtons. You cannot emulate kernel buttons and the emulated buttons will only be applied for applications running in user mode.
kernelButtonsEmulated buttons of SceCtrlButtons (you can emulate both user and kernel buttons). The emulated buttons will only be applied for applications running in kernel mode.
uiMakeSpecifies the duration of the emulation. Measured in sampling counts.
Returns
0 on success.

◆ ksceCtrlSetAnalogEmulation()

int ksceCtrlSetAnalogEmulation ( unsigned int  port,
unsigned char  slot,
unsigned char  user_lX,
unsigned char  user_lY,
unsigned char  user_rX,
unsigned char  user_rY,
unsigned char  kernel_lX,
unsigned char  kernel_lY,
unsigned char  kernel_rX,
unsigned char  kernel_rY,
unsigned int  uiMake 
)

Emulate values for the analog pad's X- and Y-axis.

Parameters
portUse 0
slotThe slot used to set the custom values. Between 0 - 3. If multiple slots are used, their settings are combined.
user_lXNew emulated value for the left joystick's X-axis (userspace). Between 0 - 0xFF.
user_lYNew emulate value for the left joystick's Y-axis (userspace). Between 0 - 0xFF.
user_rXNew emulated value for the right joystick's X-axis (userspace). Between 0 - 0xFF.
user_rYNew emulate value for the right joystick's Y-axis (userspace). Between 0 - 0xFF.
kernel_lXNew emulated value for the left joystick's X-axis (kernelspace). Between 0 - 0xFF.
kernel_lYNew emulate value for the left joystick's Y-axis (kernelspace). Between 0 - 0xFF.
kernel_rXNew emulated value for the right joystick's X-axis (kernelspace). Between 0 - 0xFF.
kernel_rYNew emulate value for the right joystick's Y-axis (kernelspace). Between 0 - 0xFF.
uiMakeSpecifies the duration of the emulation. Measured in sampling counts.
Returns
0 on success.

◆ ksceCtrlRegisterVirtualControllerDriver()

int ksceCtrlRegisterVirtualControllerDriver ( SceCtrlVirtualControllerDriver driver)

Register virtual controller driver.

This function always overwrites global settings and not exist unregister method.

Parameters
[in]driver- See SceCtrlVirtualControllerDriver
Returns
0 on success. <0 on error

◆ ksceCtrlUpdateMaskForNonShell()

int ksceCtrlUpdateMaskForNonShell ( int  clear_mask,
int  set_mask 
)

Update ctrl mask for non shell process.

Parameters
[in]clear_mask- The SceCtrlButtons type value
[in]set_mask- The SceCtrlButtons type value
Returns
always 0.

note - Some values cannot be clear/set.

◆ ksceCtrlUpdateMaskForAll()

int ksceCtrlUpdateMaskForAll ( int  clear_mask,
int  set_mask 
)

Update ctrl mask for all process.

Parameters
[in]clear_mask- The SceCtrlButtons type value
[in]set_mask- The SceCtrlButtons type value
Returns
always 0.

note - Some values cannot be clear/set.

◆ ksceCtrlGetMaskForNonShell()

int ksceCtrlGetMaskForNonShell ( uint32_t *  mask)

Get ctrl mask for non shell process.

Parameters
[out]mask- The pointer of SceCtrlButtons type value output
Returns
0 on success. < 0 on error.

◆ ksceCtrlGetMaskForAll()

int ksceCtrlGetMaskForAll ( uint32_t *  mask)

Get ctrl mask for all process.

Parameters
[out]mask- The pointer of SceCtrlButtons type value output
Returns
0 on success. < 0 on error.