sysapp: Add PFID functions, rename APP_ID_UPDATER -> APP_ID_HOME_MENU, other system app funcs

This commit is contained in:
Ash Logan 2020-03-14 11:04:28 +11:00
parent c9a2290196
commit 0fdbf66470
2 changed files with 49 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <wut.h> #include <wut.h>
#include <coreinit/mcp.h>
/** /**
* \defgroup sysapp_title SYSAPP Title * \defgroup sysapp_title SYSAPP Title
@ -16,7 +17,7 @@ extern "C" {
typedef enum SYSTEM_APP_ID typedef enum SYSTEM_APP_ID
{ {
SYSTEM_APP_ID_UPDATER = 0, SYSTEM_APP_ID_HOME_MENU = 0,
SYSTEM_APP_ID_SYSTEM_SETTINGS = 1, SYSTEM_APP_ID_SYSTEM_SETTINGS = 1,
SYSTEM_APP_ID_PARENTAL_CONTROLS = 2, SYSTEM_APP_ID_PARENTAL_CONTROLS = 2,
SYSTEM_APP_ID_USER_SETTINGS = 3, SYSTEM_APP_ID_USER_SETTINGS = 3,
@ -30,6 +31,10 @@ typedef enum SYSTEM_APP_ID
SYSTEM_APP_ID_SOFTWARE_DATA_TRANSFER = 11, SYSTEM_APP_ID_SOFTWARE_DATA_TRANSFER = 11,
} SYSTEM_APP_ID; } SYSTEM_APP_ID;
// for compatibility
WUT_DEPRECATED("This enum name is misleading and incorrect. Please use SYSTEM_APP_ID_HOME_MENU")
static const SYSTEM_APP_ID SYSTEM_APP_ID_UPDATER = SYSTEM_APP_ID_HOME_MENU;
/** /**
* Check if a given title exists and is installed on the system. * Check if a given title exists and is installed on the system.
* *
@ -72,6 +77,24 @@ SYSGetPFIDFromTitleID(uint64_t TitleId);
int32_t int32_t
SYSGetUPIDFromTitleID(uint64_t TitleId); SYSGetUPIDFromTitleID(uint64_t TitleId);
/**
* Gets the PFID/UPID of the calling (current) application.
*
* \note
* This function is identical to \link SYSGetCallerPFID \endlink.
*/
int32_t
SYSGetCallerUPID();
/**
* Gets the PFID/UPID of the calling (current) application.
*
* \note
* This function is identical to \link SYSGetCallerUPID \endlink.
*/
int32_t
SYSGetCallerPFID();
/** /**
* Gets the title id for a given SYSTEM_APP_ID. * Gets the title id for a given SYSTEM_APP_ID.
* *
@ -79,6 +102,21 @@ SYSGetUPIDFromTitleID(uint64_t TitleId);
uint64_t uint64_t
_SYSGetSystemApplicationTitleId(SYSTEM_APP_ID id); _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID id);
/**
* Gets the title id for a given SYSTEM_APP_ID in the given region.
*
*/
uint64_t
_SYSGetSystemApplicationTitleIdByProdArea(SYSTEM_APP_ID id,
MCPRegion prod_area);
/**
* Gets the title id of the calling (current) application.
*
*/
uint64_t
SYSGetCallerTitleId();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -9,3 +9,13 @@
#include "wut_structsize.h" #include "wut_structsize.h"
#include "wut_types.h" #include "wut_types.h"
#include "wut_rplwrap.h" #include "wut_rplwrap.h"
#ifdef __GNUC__
#define WUT_DEPRECATED(reason) __attribute__((deprecated(reason)))
#else // not __GNUC__
#define WUT_DEPRECATED(reason)
#endif //__GNUC__