mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 00:19:22 +02:00
Added setsysGetPlatformRegion/setsysSetPlatformRegion and SetSysPlatformRegion.
This commit is contained in:
parent
df4bbcf2d7
commit
e6d687990c
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user