diff options
Diffstat (limited to 'include/user/appmgr.h')
-rw-r--r-- | include/user/appmgr.h | 119 |
1 files changed, 73 insertions, 46 deletions
diff --git a/include/user/appmgr.h b/include/user/appmgr.h index e4ba75e..8333372 100644 --- a/include/user/appmgr.h +++ b/include/user/appmgr.h @@ -1,13 +1,15 @@ #ifndef _PSP2_APPMGR_H_ #define _PSP2_APPMGR_H_ -#include <psp2/types.h> -#include <psp2/apputil.h> +#include <psp2common/appmgr.h> +#include <psp2/scebase.h> #ifdef __cplusplus extern "C" { #endif +#define _SCE_APPMGR_VERSION (SCE_PSP2_SDK_VERSION & 0xffff0000) + typedef enum SceAppMgrErrorCode { SCE_APPMGR_ERROR_BUSY = 0x80802000, //!< Busy SCE_APPMGR_ERROR_STATE = 0x80802013, //!< Invalid state @@ -40,12 +42,6 @@ typedef enum SceAppMgrInfoBarTransparency { SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT = 1 } SceAppMgrInfoBarTransparency; -typedef enum SceAppMgrApplicationMode { - SCE_APPMGR_APPLICATION_MODE_A = 2, //!< Application without physically contiguous memory access - SCE_APPMGR_APPLICATION_MODE_B = 3, //!< Application with physically contiguous memory access - SCE_APPMGR_APPLICATION_MODE_C = 4 //!< Application with physically contiguous memory and extra memory access -} SceAppMgrApplicationMode; - typedef struct SceAppMgrSystemEvent { int systemEvent; //!< One of ::SceAppMgrSystemEventType uint8_t reserved[60]; //!< Reserved data @@ -54,36 +50,36 @@ typedef struct SceAppMgrSystemEvent { typedef struct SceAppMgrSaveDataData { int size; //!< Must be 0x4C unsigned int slotId; //!< Save slot to use - SceAppUtilSaveDataSlotParam* slotParam; //!< Save slot params + SceAppMgrSaveDataSlotParam* slotParam; //!< Save slot params uint8_t reserved[32]; //!< Reserved data - SceAppUtilSaveDataFile* files; //!< Pointer to an array of files + SceAppMgrSaveDataDataSaveItem* files; //!< Pointer to an array of files int fileNum; //!< Number of files to save - SceAppUtilSaveDataMountPoint mountPoint; //!< Savedata mountpoint + SceAppMgrMountPoint mountPoint; //!< Savedata mountpoint unsigned int* requiredSizeKB; //!< Required size in KBs } SceAppMgrSaveDataData; typedef struct SceAppMgrSaveDataDataDelete { int size; //!< Must be 0x44 unsigned int slotId; //!< Save slot to use - SceAppUtilSaveDataSlotParam* slotParam; //!< Save slot params + SceAppMgrSaveDataSlotParam* slotParam; //!< Save slot params uint8_t reserved[32]; //!< Reserved data - SceAppUtilSaveDataFile* files; //!< Pointer to an array of files + SceAppMgrSaveDataDataSaveItem* files; //!< Pointer to an array of files int fileNum; //!< Number of files to delete - SceAppUtilSaveDataMountPoint mountPoint; //!< Savedata mountpoint + SceAppMgrMountPoint mountPoint; //!< Savedata mountpoint } SceAppMgrSaveDataDataDelete; typedef struct SceAppMgrSaveDataSlot { int size; //!< Must be 0x418 unsigned int slotId; //!< Save slot to use - SceAppUtilSaveDataSlotParam slotParam; //!< Save slot params + SceAppMgrSaveDataSlotParam slotParam; //!< Save slot params uint8_t reserved[116]; //!< Reserved data - SceAppUtilSaveDataMountPoint mountPoint; //!< Savedata mountpoint + SceAppMgrMountPoint mountPoint; //!< Savedata mountpoint } SceAppMgrSaveDataSlot; typedef struct SceAppMgrSaveDataSlotDelete { int size; //!< Must be 0x18 unsigned int slotId; //!< Save slot to use - SceAppUtilSaveDataMountPoint mountPoint; //!< Savedata mountpoint + SceAppMgrMountPoint mountPoint; //!< Savedata mountpoint } SceAppMgrSaveDataSlotDelete; typedef struct SceAppMgrAppState { @@ -93,25 +89,6 @@ typedef struct SceAppMgrAppState { SceUInt8 reserved[116]; } SceAppMgrAppState; -typedef struct SceAppMgrBudgetInfo { - 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 -} SceAppMgrBudgetInfo; - typedef struct SceAppMgrExecOptParam SceAppMgrExecOptParam; // Missing struct typedef struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam; // Missing struct @@ -121,6 +98,38 @@ typedef struct sceAppMgrLoadExecOptParam { #define SCE_APPMGR_MAX_APP_NAME_LENGTH (31) +#define SCE_APPMGR_BUDGET_MODE_MAIN 2 // Main LPDDR2 only +#define SCE_APPMGR_BUDGET_MODE_MAIN_PHYCONT 3 // Main and phycont or CDLG which is also contiguous +#define SCE_APPMGR_BUDGET_MODE_MAIN_PHYCONT_CDLG 4 // Main and phycont and CDLG + +typedef struct SceAppMgrBudgetInfo { +// 0x00 + SceSize size; //!< Sizes if 0x88 bytes + SceUInt32 mode; //!< Application budget mode + SceUInt32 unk_8; + SceUInt32 budgetMain; //!< Main LPDDR2 budget in bytes +// 0x10 + SceUInt32 freeMain; //!< Free main LPDDR2 in bytes + SceUInt32 hasCdlg; //!< Has CDLG memory type in budget + SceUInt32 unk_14; //!< Non-zero if CDLG is used, otherwise 0 + SceUInt32 budgetCdlg; //!< CDLG budget in bytes +// 0x20 + SceUInt32 freeCdlg; //!< Free CDLG in bytes + SceUInt32 unk_24; //!< always 0 + SceUInt32 unk_28; //!< Non-zero if phycont is used, otherwise 0 + SceUInt32 budgetPhycont; //!< Phycont budget in bytes +// 0x30 + SceUInt32 freePhycont; //!< Free phycont in bytes + SceUInt32 allow; //!< Some memory type? + SceUChar8 unk_38[0x20]; //!< Some memory type? + SceUInt32 unk_58; + SceUInt32 budgetCdram; //!< Cdram budget in bytes +// 0x60 + SceUInt32 freeCdram; //!< Free Cdram in bytes + SceUChar8 reserved_64[0x24]; +// 0x88 +} SceAppMgrBudgetInfo; + /** * Save data on savedata0: partition * @@ -245,7 +254,7 @@ int sceAppMgrGetRunningAppIdListForShell(SceUID *appIds, int count); * @param[out] appState - State of the application * @param[in] len - sizeof(SceAppMgrState) * @param[in] version - Version (?) - + * @return 0 on success, < 0 on error. */ int _sceAppMgrGetAppState(SceAppMgrAppState *appState, SceSize len, uint32_t version); @@ -254,7 +263,7 @@ int _sceAppMgrGetAppState(SceAppMgrAppState *appState, SceSize len, uint32_t ver * Receive system event * * @param[out] systemEvent - Received system event - + * @return 0 on success, < 0 on error. */ int sceAppMgrReceiveSystemEvent(SceAppMgrSystemEvent *systemEvent); @@ -493,7 +502,7 @@ 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). + * 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 @@ -502,28 +511,46 @@ int sceAppMgrGetRawPath(char *path, char *mount_point, char *unk); * @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 memory budget info for a running system application + * Get application memory budget info. * - * @param[out] info - Info related to the memory budget of the running application. - * * @return 0 on success, < 0 on error. * - * @note This function will always return an error if used in a normal application. */ int sceAppMgrGetBudgetInfo(SceAppMgrBudgetInfo *info); +/** + * Shared Framebuffer + */ + +typedef struct SceSharedFbInfo SceSharedFbInfo; + +SceUID _sceSharedFbOpen(int index, SceUInt32 buildVersion); + +static __inline__ +SceUID sceSharedFbOpen(int index) { + return _sceSharedFbOpen(index, SCE_PSP2_SDK_VERSION); +} + +int sceSharedFbClose(SceUID fbId); + +int sceSharedFbBegin(SceUID fbId, SceSharedFbInfo *fbInfo); + +int sceSharedFbEnd(SceUID fbId); + +int sceSharedFbGetInfo(SceUID fbId, SceSharedFbInfo *fbInfo); + #ifdef __cplusplus } #endif |