vitasdk
Documentation of the vitasdk

Detailed Description

Exports for User


Using this library in your project

Include the header file in your project:

#include <psp2/appmgr.h>


Link the library to the executable:

SceAppMgr_stub



Functions

int _sceAppMgrSaveDataDataSave (SceAppMgrSaveDataData *data)
 Save data on savedata0: partition. More...
 
int _sceAppMgrSaveDataDataRemove (SceAppMgrSaveDataDataDelete *data)
 Remove data on savedata0: partition. More...
 
int _sceAppMgrSaveDataSlotCreate (SceAppMgrSaveDataSlot *data)
 Create a savedata slot. More...
 
int _sceAppMgrSaveDataSlotGetParam (SceAppMgrSaveDataSlot *data)
 Get current param of a savedata slot. More...
 
int _sceAppMgrSaveDataSlotSetParam (SceAppMgrSaveDataSlot *data)
 Set current param of a savedata slot. More...
 
int _sceAppMgrSaveDataSlotDelete (SceAppMgrSaveDataSlotDelete *data)
 Delete a savedata slot. More...
 
int sceAppMgrGetIdByName (SceUID *pid, const char *name)
 Get Process ID by Title ID. More...
 
int sceAppMgrGetNameById (SceUID pid, char *name)
 Get Title ID by Process ID. More...
 
int sceAppMgrDestroyOtherApp (void)
 Destroy other apps. More...
 
int sceAppMgrDestroyAppByName (const char *name)
 Destroy an application by Title ID. More...
 
int sceAppMgrDestroyAppByAppId (SceUID appId)
 Destroy an application by Application ID. More...
 
SceUID sceAppMgrGetProcessIdByAppIdForShell (SceUID appId)
 Get PID of an application for Shell. More...
 
int sceAppMgrGetRunningAppIdListForShell (SceUID *appIds, int count)
 Get a list of running applications. More...
 
int _sceAppMgrGetAppState (SceAppMgrAppState *appState, SceSize len, uint32_t version)
 Get an application state. More...
 
int sceAppMgrReceiveSystemEvent (SceAppMgrSystemEvent *systemEvent)
 Receive system event. More...
 
int sceAppMgrGetAppParam (char *param)
 Copies app param to an array. More...
 
int sceAppMgrAcquireBgmPort (void)
 Obtains the BGM port, even when it is not in front. More...
 
int sceAppMgrReleaseBgmPort (void)
 Release acquired BGM port. More...
 
int sceAppMgrSetInfobarState (SceAppMgrInfoBarVisibility visibility, SceAppMgrInfoBarColor color, SceAppMgrInfoBarTransparency transparency)
 Set infobar state. More...
 
int sceAppMgrLoadExec (const char *appPath, char *const argv[], const SceAppMgrExecOptParam *optParam)
 Load and start a SELF executable. More...
 
int sceAppMgrLaunchAppByUri (int flags, const char *uri)
 Start an application by URI. More...
 
int sceAppMgrLaunchAppByName2 (const char *name, const char *param, SceAppMgrLaunchAppOptParam *optParam)
 Start an application by Title ID. More...
 
SceUID sceAppMgrLaunchAppByName2ForShell (const char *name, const char *param, SceAppMgrLaunchAppOptParam *optParam)
 Start an application by Title ID for Shell. More...
 
int sceAppMgrGameDataMount (const char *path, int unk1, int unk2, const char *mount_point)
 Mount game data. More...
 
int sceAppMgrAppDataMount (int id, const char *mount_point)
 Mount application data. More...
 
int sceAppMgrAppDataMountById (int id, const char *titleid, const char *mount_point)
 Mount application data by Title ID. More...
 
int sceAppMgrAppParamGetString (int pid, int param, char *string, SceSize length)
 Get application params from SFO descriptor. More...
 
int sceAppMgrGetDevInfo (const char *dev, uint64_t *max_size, uint64_t *free_size)
 Get device info. More...
 
int sceAppMgrMmsMount (int id, const char *mount_point)
 Mount application data (PSPEmu) More...
 
int sceAppMgrPspSaveDataRootMount (const char *mount_point)
 Mount PSPEmu virtual memory stick. More...
 
int sceAppMgrWorkDirMount (int id, const char *mount_point)
 Mount working directory. More...
 
int sceAppMgrWorkDirMountById (int id, const char *titleid, const char *mount_point)
 Mount working directory by Title ID. More...
 
int sceAppMgrUmount (const char *mount_point)
 Unmount a mountpoint. More...
 
int sceAppMgrConvertVs0UserDrivePath (char *path, char *mount_point, int unk)
 Convert vs0 path string to a new one usable by applications. More...
 
int sceAppMgrGetRawPath (char *path, char *mount_point, char *unk)
 Get raw path for a given path. More...
 
int _sceAppMgrGetRawPath (char *path, char *resolved_path, int resolved_path_size, char unk[16])
 Resolve a path to the corresponding true path (uses ksceFiosKernelOverlayResolveSync underneath). More...
 
int _sceAppMgrGetRawPathOfApp0ByAppIdForShell (int appId, char resolved_path[292])
 Get the real/resolved path of app0: (where it's actually mounted) More...
 
int sceAppMgrGetBudgetInfo (SceAppMgrBudgetInfo *info)
 Get memory budget info for a running system application. More...
 

Typedefs

typedef struct SceAppMgrExecOptParam SceAppMgrExecOptParam
 
typedef struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam
 

Macros

#define SCE_APPMGR_MAX_APP_NAME_LENGTH   (31)
 

Data Structure Documentation

◆ SceAppMgrSystemEvent

struct SceAppMgrSystemEvent
Data Fields
int systemEvent One of SceAppMgrSystemEventType.
uint8_t reserved[60] Reserved data.

◆ SceAppMgrSaveDataData

struct SceAppMgrSaveDataData
Data Fields
int size Must be 0x4C.
unsigned int slotId Save slot to use.
SceAppUtilSaveDataSlotParam * slotParam Save slot params.
uint8_t reserved[32] Reserved data.
SceAppUtilSaveDataFile * files Pointer to an array of files.
int fileNum Number of files to save.
SceAppUtilSaveDataMountPoint mountPoint Savedata mountpoint.
unsigned int * requiredSizeKB Required size in KBs.

◆ SceAppMgrSaveDataDataDelete

struct SceAppMgrSaveDataDataDelete
Data Fields
int size Must be 0x44.
unsigned int slotId Save slot to use.
SceAppUtilSaveDataSlotParam * slotParam Save slot params.
uint8_t reserved[32] Reserved data.
SceAppUtilSaveDataFile * files Pointer to an array of files.
int fileNum Number of files to delete.
SceAppUtilSaveDataMountPoint mountPoint Savedata mountpoint.

◆ SceAppMgrSaveDataSlot

struct SceAppMgrSaveDataSlot
Data Fields
int size Must be 0x418.
unsigned int slotId Save slot to use.
SceAppUtilSaveDataSlotParam slotParam Save slot params.
uint8_t reserved[116] Reserved data.
SceAppUtilSaveDataMountPoint mountPoint Savedata mountpoint.

◆ SceAppMgrSaveDataSlotDelete

struct SceAppMgrSaveDataSlotDelete
Data Fields
int size Must be 0x18.
unsigned int slotId Save slot to use.
SceAppUtilSaveDataMountPoint mountPoint Savedata mountpoint.

◆ SceAppMgrAppState

struct SceAppMgrAppState
Data Fields
SceUInt32 systemEventNum
SceUInt32 appEventNum
SceBool isSystemUiOverlaid
SceUInt8 reserved[116]

◆ SceAppMgrBudgetInfo

struct SceAppMgrBudgetInfo
Data Fields
int size Must be 0x88.
int app_mode One of SceAppMgrApplicationMode.
int unk0 Unknown Data.
unsigned int total_user_rw_mem Total amount of accessible USER_RW memory.
unsigned int free_user_rw Free amount of accessible USER_RW memory.
SceBool extra_mem_allowed Flag for extra memory accessibility.
int unk1 Unknown Data.
unsigned int total_extra_mem Total amount of accessible extra memory.
unsigned int free_extra_mem Free amount of accessible extra memory.
int unk2[2] Unknown Data.
unsigned int total_phycont_mem Total amount of accessible physically contiguous memory.
unsigned int free_phycont_mem Free amount of accessible physically contiguous memory.
int unk3[10] Unknown Data.
unsigned int total_cdram_mem Total amount of accessible CDRAM memory.
unsigned int free_cdram_mem Free amount of accessible CDRAM memory.
int reserved[9] Reserved data.

◆ sceAppMgrLoadExecOptParam

struct sceAppMgrLoadExecOptParam
Data Fields
int reserved[64] Reserved data.

Macro Definition Documentation

◆ SCE_APPMGR_MAX_APP_NAME_LENGTH

#define SCE_APPMGR_MAX_APP_NAME_LENGTH   (31)

Typedef Documentation

◆ SceAppMgrExecOptParam

◆ SceAppMgrLaunchAppOptParam

Enumeration Type Documentation

◆ SceAppMgrErrorCode

Enumerator
SCE_APPMGR_ERROR_BUSY 

Busy.

SCE_APPMGR_ERROR_STATE 

Invalid state.

SCE_APPMGR_ERROR_NULL_POINTER 

NULL pointer.

SCE_APPMGR_ERROR_INVALID 

Invalid param.

SCE_APPMGR_ERROR_TOO_LONG_ARGV 

argv is too long

SCE_APPMGR_ERROR_INVALID_SELF_PATH 

Invalid SELF path.

SCE_APPMGR_ERROR_NOEXEC 

The process is not authorized to run this function.

SCE_APPMGR_ERROR_BGM_PORT_BUSY 

BGM port was occupied and could not be secured.

◆ SceAppMgrSystemEventType

Enumerator
SCE_APPMGR_SYSTEMEVENT_ON_RESUME 
SCE_APPMGR_SYSTEMEVENT_ON_STORE_PURCHASE 
SCE_APPMGR_SYSTEMEVENT_ON_NP_MESSAGE_ARRIVED 
SCE_APPMGR_SYSTEMEVENT_ON_STORE_REDEMPTION 

◆ SceAppMgrInfoBarVisibility

Enumerator
SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE 
SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE 

◆ SceAppMgrInfoBarColor

Enumerator
SCE_APPMGR_INFOBAR_COLOR_BLACK 
SCE_APPMGR_INFOBAR_COLOR_WHITE 

◆ SceAppMgrInfoBarTransparency

Enumerator
SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE 
SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT 

◆ SceAppMgrApplicationMode

Enumerator
SCE_APPMGR_APPLICATION_MODE_A 

Application without physically contiguous memory access.

SCE_APPMGR_APPLICATION_MODE_B 

Application with physically contiguous memory access.

SCE_APPMGR_APPLICATION_MODE_C 

Application with physically contiguous memory and extra memory access.

Function Documentation

◆ _sceAppMgrSaveDataDataSave()

int _sceAppMgrSaveDataDataSave ( SceAppMgrSaveDataData data)

Save data on savedata0: partition.

Parameters
[in]data- Data to save
Returns
0 on success, < 0 on error.

◆ _sceAppMgrSaveDataDataRemove()

int _sceAppMgrSaveDataDataRemove ( SceAppMgrSaveDataDataDelete data)

Remove data on savedata0: partition.

Parameters
[in]data- Data to remove
Returns
0 on success, < 0 on error.

◆ _sceAppMgrSaveDataSlotCreate()

int _sceAppMgrSaveDataSlotCreate ( SceAppMgrSaveDataSlot data)

Create a savedata slot.

Parameters
[in]data- Slot data
Returns
0 on success, < 0 on error.

◆ _sceAppMgrSaveDataSlotGetParam()

int _sceAppMgrSaveDataSlotGetParam ( SceAppMgrSaveDataSlot data)

Get current param of a savedata slot.

Parameters
[out]data- Slot data
Returns
0 on success, < 0 on error.

◆ _sceAppMgrSaveDataSlotSetParam()

int _sceAppMgrSaveDataSlotSetParam ( SceAppMgrSaveDataSlot data)

Set current param of a savedata slot.

Parameters
[in]data- Slot data
Returns
0 on success, < 0 on error.

◆ _sceAppMgrSaveDataSlotDelete()

int _sceAppMgrSaveDataSlotDelete ( SceAppMgrSaveDataSlotDelete data)

Delete a savedata slot.

Parameters
[in]data- Slot data
Returns
0 on success, < 0 on error.

◆ sceAppMgrGetIdByName()

int sceAppMgrGetIdByName ( SceUID pid,
const char *  name 
)

Get Process ID by Title ID.

Parameters
[out]pid- Process ID
[in]name- Title ID
Returns
0 on success, < 0 on error.

◆ sceAppMgrGetNameById()

int sceAppMgrGetNameById ( SceUID  pid,
char *  name 
)

Get Title ID by Process ID.

Parameters
[in]pid- Process ID
[out]name- Title ID
Returns
0 on success, < 0 on error.

◆ sceAppMgrDestroyOtherApp()

int sceAppMgrDestroyOtherApp ( void  )

Destroy other apps.

Returns
0 on success, < 0 on error.

◆ sceAppMgrDestroyAppByName()

int sceAppMgrDestroyAppByName ( const char *  name)

Destroy an application by Title ID.

Parameters
[in]name- Title ID of the application
Returns
0 on success, < 0 on error.

◆ sceAppMgrDestroyAppByAppId()

int sceAppMgrDestroyAppByAppId ( SceUID  appId)

Destroy an application by Application ID.

Parameters
[in]appId- Application ID of the application
Returns
0 on success, < 0 on error.

◆ sceAppMgrGetProcessIdByAppIdForShell()

SceUID sceAppMgrGetProcessIdByAppIdForShell ( SceUID  appId)

Get PID of an application for Shell.

Parameters
[in]appId- Application ID of the application
Returns
The PID on success, < 0 on error.

◆ sceAppMgrGetRunningAppIdListForShell()

int sceAppMgrGetRunningAppIdListForShell ( SceUID appIds,
int  count 
)

Get a list of running applications.

Parameters
[out]appIds- Array of running application IDs
[in]count- Max number of running applications to search
Returns
Number of running applications.

◆ _sceAppMgrGetAppState()

int _sceAppMgrGetAppState ( SceAppMgrAppState appState,
SceSize  len,
uint32_t  version 
)

Get an application state.

Parameters
[out]appState- State of the application
[in]len- sizeof(SceAppMgrState)
[in]version- Version (?)
Returns
0 on success, < 0 on error.

◆ sceAppMgrReceiveSystemEvent()

int sceAppMgrReceiveSystemEvent ( SceAppMgrSystemEvent systemEvent)

Receive system event.

Parameters
[out]systemEvent- Received system event
Returns
0 on success, < 0 on error.

◆ sceAppMgrGetAppParam()

int sceAppMgrGetAppParam ( char *  param)

Copies app param to an array.

Parameters
[out]param- pointer to a 1024 byte location to store the app param
Returns
0 on success, < 0 on error.
Note
App param example: type=LAUNCH_APP_BY_URI&uri=psgm:play?titleid=NPXS10031

◆ sceAppMgrAcquireBgmPort()

int sceAppMgrAcquireBgmPort ( void  )

Obtains the BGM port, even when it is not in front.

Returns
0 on success, < 0 on error.

◆ sceAppMgrReleaseBgmPort()

int sceAppMgrReleaseBgmPort ( void  )

Release acquired BGM port.

Returns
0 on success, < 0 on error.

◆ sceAppMgrSetInfobarState()

int sceAppMgrSetInfobarState ( SceAppMgrInfoBarVisibility  visibility,
SceAppMgrInfoBarColor  color,
SceAppMgrInfoBarTransparency  transparency 
)

Set infobar state.

Parameters
[in]visibility- Infobar visibility
[in]color- Infobar color
[in]transparency- Infobar transparency
Returns
0 on success, < 0 on error.

◆ sceAppMgrLoadExec()

int sceAppMgrLoadExec ( const char *  appPath,
char *const  argv[],
const SceAppMgrExecOptParam optParam 
)

Load and start a SELF executable.

Parameters
[in]appPath- Path of the SELF file
[in]argv- Args to pass to SELF module_start
[in]optParam- Optional params
Returns
0 on success, < 0 on error.
Note
SELF file must be located in app0: partition.

◆ sceAppMgrLaunchAppByUri()

int sceAppMgrLaunchAppByUri ( int  flags,
const char *  uri 
)

Start an application by URI.

Parameters
[in]flags- Must be 0x20000
[in]uri- Uri to launch
Returns
0 on success, < 0 on error.
Note
If flags != 0x20000, Livearea is opened.

◆ sceAppMgrLaunchAppByName2()

int sceAppMgrLaunchAppByName2 ( const char *  name,
const char *  param,
SceAppMgrLaunchAppOptParam optParam 
)

Start an application by Title ID.

Parameters
[in]name- Title ID of the application
[in]param- The params passed to the application which can be retrieved with sceAppMgrGetAppParam
[in]optParam- Optional params
Returns
0 on success, < 0 on error.

◆ sceAppMgrLaunchAppByName2ForShell()

SceUID sceAppMgrLaunchAppByName2ForShell ( const char *  name,
const char *  param,
SceAppMgrLaunchAppOptParam optParam 
)

Start an application by Title ID for Shell.

Parameters
[in]name- Title ID of the application
[in]param- The params passed to the application which can be retrieved with sceAppMgrGetAppParam
[in]optParam- Optional params
Returns
Application ID (?)

◆ sceAppMgrGameDataMount()

int sceAppMgrGameDataMount ( const char *  path,
int  unk1,
int  unk2,
const char *  mount_point 
)

Mount game data.

Parameters
[in]path- ux0:app/TITLEID
[in]unk1- Unknown, set 0
[in]unk2- Unknown, set 0
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.

◆ sceAppMgrAppDataMount()

int sceAppMgrAppDataMount ( int  id,
const char *  mount_point 
)

Mount application data.

Parameters
[in]id- App data ID
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.
Note
id: 100 (photo0), 101 (friends), 102 (messages), 103 (near), 105 (music), 108 (calendar)

◆ sceAppMgrAppDataMountById()

int sceAppMgrAppDataMountById ( int  id,
const char *  titleid,
const char *  mount_point 
)

Mount application data by Title ID.

Parameters
[in]id- App data ID
[in]titleid- Application title ID
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.
Note
id: 106 (ad), 107 (ad)

◆ sceAppMgrAppParamGetString()

int sceAppMgrAppParamGetString ( int  pid,
int  param,
char *  string,
SceSize  length 
)

Get application params from SFO descriptor.

Parameters
[in]pid- Process ID
[in]param- Param ID in the SFO descriptor
[out]string- Param data
[in]length- Length of the param data
Returns
0 on success, < 0 on error.
Note
param: 6 (contentid) 8 (category), 9 (stitle/title?), 10 (title/stitle?), 12 (titleid)

◆ sceAppMgrGetDevInfo()

int sceAppMgrGetDevInfo ( const char *  dev,
uint64_t *  max_size,
uint64_t *  free_size 
)

Get device info.

Parameters
[in]dev- Device to get info about
[out]max_size- Capacity of the device
[out]free_size- Free space of the device
Returns
0 on success, < 0 on error.
Note
dev: ux0:

◆ sceAppMgrMmsMount()

int sceAppMgrMmsMount ( int  id,
const char *  mount_point 
)

Mount application data (PSPEmu)

Parameters
[in]id- App data ID
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.
Note
id: 400 (ad), 401 (ad), 402 (ad)

◆ sceAppMgrPspSaveDataRootMount()

int sceAppMgrPspSaveDataRootMount ( const char *  mount_point)

Mount PSPEmu virtual memory stick.

Parameters
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.
Note
mount_point: ms

◆ sceAppMgrWorkDirMount()

int sceAppMgrWorkDirMount ( int  id,
const char *  mount_point 
)

Mount working directory.

Parameters
[in]id- Working directory ID
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.
Note
id: 200 (td), 201 (td), 203 (td), 204 (td), 206 (td)

◆ sceAppMgrWorkDirMountById()

int sceAppMgrWorkDirMountById ( int  id,
const char *  titleid,
const char *  mount_point 
)

Mount working directory by Title ID.

Parameters
[in]id- Working directory ID
[in]titleid- Application Title ID
[in]mount_point- Mountpoint to use
Returns
0 on success, < 0 on error.
Note
id: 205 (cache0), 207 (td)

◆ sceAppMgrUmount()

int sceAppMgrUmount ( const char *  mount_point)

Unmount a mountpoint.

Parameters
[in]mount_point- Mountpoint to unmount
Returns
0 on success, < 0 on error.
Note
Unmount app0: for example to enable write access to ux0:app/TITLEID

◆ sceAppMgrConvertVs0UserDrivePath()

int sceAppMgrConvertVs0UserDrivePath ( char *  path,
char *  mount_point,
int  unk 
)

Convert vs0 path string to a new one usable by applications.

Parameters
[in]path- Path to convert
[in]mount_point- Mountpoint to use
[in]unk- Unknown
Returns
0 on success, < 0 on error.

◆ sceAppMgrGetRawPath()

int sceAppMgrGetRawPath ( char *  path,
char *  mount_point,
char *  unk 
)

Get raw path for a given path.

Parameters
[in]path- Path to convert
[in]mount_point- Mountpoint to use
[in]unk- Unknown
Returns
0 on success, < 0 on error.

◆ _sceAppMgrGetRawPath()

int _sceAppMgrGetRawPath ( char *  path,
char *  resolved_path,
int  resolved_path_size,
char  unk[16] 
)

Resolve a path to the corresponding true path (uses ksceFiosKernelOverlayResolveSync underneath).

Parameters
[in]path- Path to convert (e.g. app0:)
[out]resolved_path- True resolved path
[in]unk- Unknown, provide an empty buffer
Returns
0 on success, < 0 on error.

◆ _sceAppMgrGetRawPathOfApp0ByAppIdForShell()

int _sceAppMgrGetRawPathOfApp0ByAppIdForShell ( int  appId,
char  resolved_path[292] 
)

Get the real/resolved path of app0: (where it's actually mounted)

Parameters
[in]appId- Use -2 for the current application
[out]resolved_path- Buffer that will hold the resolved path. It should have enough room to hold 292 characters or it will buffer overflow (noname120).
Returns
0 on success.

◆ sceAppMgrGetBudgetInfo()

int sceAppMgrGetBudgetInfo ( SceAppMgrBudgetInfo info)

Get memory budget info for a running system application.

Parameters
[out]info- Info related to the memory budget of the running application.
Returns
0 on success, < 0 on error.
Note
This function will always return an error if used in a normal application.
appmgr.h