Added setsysGetPlatformRegion/setsysSetPlatformRegion and SetSysPlatformRegion.

This commit is contained in:
yellows8 2019-11-01 22:57:07 -04:00
parent df4bbcf2d7
commit e6d687990c
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 37 additions and 0 deletions

View File

@ -69,6 +69,12 @@ typedef struct {
char display_title[0x80];
} SetSysFirmwareVersion;
/// PlatformRegion. Other values not listed here should be handled as "Unknown".
typedef enum {
SetSysPlatformRegion_Global = 1,
SetSysPlatformRegion_China = 2,
} SetSysPlatformRegion;
/// Initialize set.
Result setInitialize(void);
@ -394,3 +400,17 @@ Result setsysGetRequiresRunRepairTimeReviser(bool *out);
* @param[in] flag Input flag.
*/
Result setsysSetRequiresRunRepairTimeReviser(bool flag);
/**
* @brief Gets the \ref SetSysPlatformRegion.
* @note Only available on [9.0.0+].
* @param[out] region \ref SetSysPlatformRegion
*/
Result setsysGetPlatformRegion(SetSysPlatformRegion *region);
/**
* @brief Sets the \ref SetSysPlatformRegion.
* @note Only available on [9.0.0+].
* @param[in] region \ref SetSysPlatformRegion
*/
Result setsysSetPlatformRegion(SetSysPlatformRegion region);

View File

@ -490,3 +490,20 @@ Result setsysSetRequiresRunRepairTimeReviser(bool flag) {
return _setCmdInBoolNoOut(&g_setsysSrv, flag, 142);
}
Result setsysGetPlatformRegion(SetSysPlatformRegion *region) {
if (hosversionBefore(9,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
u32 tmp=0;
Result rc = _setCmdNoInOutU32(&g_setsysSrv, &tmp, 183);
if (R_SUCCEEDED(rc) && region) *region = tmp;
return rc;
}
Result setsysSetPlatformRegion(SetSysPlatformRegion region) {
if (hosversionBefore(9,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _setCmdInU32NoOut(&g_setsysSrv, region, 184);
}