diff options
Diffstat (limited to 'include/user/appmgr.h')
-rw-r--r-- | include/user/appmgr.h | 92 |
1 files changed, 78 insertions, 14 deletions
diff --git a/include/user/appmgr.h b/include/user/appmgr.h index a6e09c6..b55859a 100644 --- a/include/user/appmgr.h +++ b/include/user/appmgr.h @@ -13,8 +13,9 @@ typedef enum SceAppMgrErrorCode { SCE_APPMGR_ERROR_STATE = 0x80802013, //!< Invalid state SCE_APPMGR_ERROR_NULL_POINTER = 0x80802016, //!< NULL pointer SCE_APPMGR_ERROR_INVALID = 0x8080201A, //!< Invalid param + SCE_APPMGR_ERROR_TOO_LONG_ARGV = 0x8080201D, //!< argv is too long SCE_APPMGR_ERROR_INVALID_SELF_PATH = 0x8080201E, //!< Invalid SELF path - SCE_APPMGR_ERROR_TOO_LONG_ARGV = 0x8080201D //!< argv is too long + SCE_APPMGR_ERROR_BGM_PORT_BUSY = 0x80803000 //!< BGM port was occupied and could not be secured } SceAppMgrErrorCode; typedef enum SceAppMgrSystemEventType { @@ -79,7 +80,13 @@ typedef struct SceAppMgrSaveDataSlotDelete { SceAppUtilSaveDataMountPoint mountPoint; //!< Savedata mountpoint } SceAppMgrSaveDataSlotDelete; -typedef struct SceAppMgrAppState SceAppMgrAppState; // Missing struct +typedef struct SceAppMgrAppState { + SceUInt32 systemEventNum; + SceUInt32 appEventNum; + SceBool isSystemUiOverlaid; + SceUInt8 reserved[116]; +} SceAppMgrAppState; + typedef struct SceAppMgrExecOptParam SceAppMgrExecOptParam; // Missing struct typedef struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam; // Missing struct @@ -89,6 +96,34 @@ typedef struct sceAppMgrLoadExecOptParam { #define SCE_APPMGR_MAX_APP_NAME_LENGTH (31) +typedef struct SceAppMgrBudgetInfo { +// 0x00 + SceSize size; + SceUInt32 mode; + SceUInt32 unk_8; + SceUInt32 budgetLPDDR2; +// 0x10 + SceUInt32 freeLPDDR2; + SceUInt32 allow0x0E208060; + SceUInt32 unk_14; + SceUInt32 budget0x0E208060; +// 0x20 + SceUInt32 free0x0E208060; + SceUInt32 unk_24; + SceUInt32 unk_28; + SceUInt32 budgetPHYCONT; +// 0x30 + SceUInt32 freePHYCONT; + SceUInt32 allow; + SceUChar8 unk_38[0x20]; + SceUInt32 unk_58; + SceUInt32 budgetCDRAM; +// 0x60 + SceUInt32 freeCDRAM; + SceUChar8 reserved_64[0x24]; +// 0x88 +} SceAppMgrBudgetInfo; + /** * Save data on savedata0: partition * @@ -177,7 +212,7 @@ int sceAppMgrDestroyOtherApp(void); * * @return 0 on success, < 0 on error. */ -int sceAppMgrDestroyAppByName(char *name); +int sceAppMgrDestroyAppByName(const char *name); /** * Destroy an application by Application ID @@ -230,7 +265,7 @@ int sceAppMgrReceiveSystemEvent(SceAppMgrSystemEvent *systemEvent); /** * Copies app param to an array * - * @param[in] param - pointer to a 1024 byte location to store the app param + * @param[out] param - pointer to a 1024 byte location to store the app param * * @return 0 on success, < 0 on error. * @@ -290,7 +325,7 @@ int sceAppMgrLoadExec(const char *appPath, char * const argv[], * * @note If flags != 0x20000, Livearea is opened. */ -int sceAppMgrLaunchAppByUri(int flags, char *uri); +int sceAppMgrLaunchAppByUri(int flags, const char *uri); /** * Start an application by Title ID @@ -325,7 +360,7 @@ SceUID sceAppMgrLaunchAppByName2ForShell(const char *name, const char *param, Sc * @return 0 on success, < 0 on error. * */ -int sceAppMgrGameDataMount(const char *path, int unk1, int unk2, char *mount_point); +int sceAppMgrGameDataMount(const char *path, int unk1, int unk2, const char *mount_point); /** * Mount application data @@ -337,7 +372,7 @@ int sceAppMgrGameDataMount(const char *path, int unk1, int unk2, char *mount_poi * * @note id: 100 (photo0), 101 (friends), 102 (messages), 103 (near), 105 (music), 108 (calendar) */ -int sceAppMgrAppDataMount(int id, char *mount_point); +int sceAppMgrAppDataMount(int id, const char *mount_point); /** * Mount application data by Title ID @@ -350,7 +385,7 @@ int sceAppMgrAppDataMount(int id, char *mount_point); * * @note id: 106 (ad), 107 (ad) */ -int sceAppMgrAppDataMountById(int id, char *titleid, char *mount_point); +int sceAppMgrAppDataMountById(int id, const char *titleid, const char *mount_point); /** * Get application params from SFO descriptor @@ -362,7 +397,7 @@ int sceAppMgrAppDataMountById(int id, char *titleid, char *mount_point); * * @return 0 on success, < 0 on error. * - * @note param: 8 (category), 9 (stitle/title?), 10 (title/stitle?), 12 (titleid) + * @note param: 6 (contentid) 8 (category), 9 (stitle/title?), 10 (title/stitle?), 12 (titleid) */ int sceAppMgrAppParamGetString(int pid, int param, char *string, int length); @@ -377,7 +412,7 @@ int sceAppMgrAppParamGetString(int pid, int param, char *string, int length); * * @note dev: ux0: */ -int sceAppMgrGetDevInfo(char *dev, uint64_t *max_size, uint64_t *free_size); +int sceAppMgrGetDevInfo(const char *dev, uint64_t *max_size, uint64_t *free_size); /** * Mount application data (PSPEmu) @@ -389,7 +424,7 @@ int sceAppMgrGetDevInfo(char *dev, uint64_t *max_size, uint64_t *free_size); * * @note id: 400 (ad), 401 (ad), 402 (ad) */ -int sceAppMgrMmsMount(int id, char *mount_point); +int sceAppMgrMmsMount(int id, const char *mount_point); /** * Mount PSPEmu virtual memory stick @@ -400,7 +435,7 @@ int sceAppMgrMmsMount(int id, char *mount_point); * * @note mount_point: ms */ -int sceAppMgrPspSaveDataRootMount(char *mount_point); +int sceAppMgrPspSaveDataRootMount(const char *mount_point); /** * Mount working directory @@ -412,7 +447,7 @@ int sceAppMgrPspSaveDataRootMount(char *mount_point); * * @note id: 200 (td), 201 (td), 203 (td), 204 (td), 206 (td) */ -int sceAppMgrWorkDirMount(int id, char *mount_point); +int sceAppMgrWorkDirMount(int id, const char *mount_point); /** * Mount working directory by Title ID @@ -425,7 +460,7 @@ int sceAppMgrWorkDirMount(int id, char *mount_point); * * @note id: 205 (cache0), 207 (td) */ -int sceAppMgrWorkDirMountById(int id, char *titleid, char *mount_point); +int sceAppMgrWorkDirMountById(int id, const char *titleid, const char *mount_point); /** * Unmount a mountpoint @@ -460,6 +495,35 @@ int sceAppMgrConvertVs0UserDrivePath(char *path, char *mount_point, int unk); */ int sceAppMgrGetRawPath(char *path, char *mount_point, char *unk); +/** + * Resolve a path to the corresponding true path (uses ::sceFiosKernelOverlayResolveSync underneath). + * + * @param[in] path - Path to convert (e.g. app0:) + * @param[out] resolved_path - True resolved path + * @param[in] unk - Unknown, provide an empty buffer + * + * @return 0 on success, < 0 on error. + */ +int _sceAppMgrGetRawPath(char *path, char *resolved_path, int resolved_path_size, char unk[16]); + +/** + * Get the real/resolved path of app0: (where it's actually mounted) + * + * @param[in] appId - Use -2 for the current application + * @param[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). + * + * @return 0 on success. + */ +int _sceAppMgrGetRawPathOfApp0ByAppIdForShell(int appId, char resolved_path[292]); + +/** + * Get application memory budget info. + * + * @return 0 on success, < 0 on error. + * + */ +int sceAppMgrGetBudgetInfo(SceAppMgrBudgetInfo *info); + #ifdef __cplusplus } #endif |