Added appletIsVrModeEnabled and appletSetVrModeEnabled.

This commit is contained in:
yellows8 2019-04-21 13:45:49 -04:00
parent 6b50fddd9b
commit 76b6f521fe
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 33 additions and 0 deletions

View File

@ -301,6 +301,22 @@ Result appletHomeButtonReaderLockAccessorGetEvent(Event *out_event);
*/
Result appletPushToGeneralChannel(AppletStorage *s);
/**
* @brief Gets whether VrMode is enabled.
* @note Only available with [3.0.0+].
* @param out Output flag
*/
Result appletIsVrModeEnabled(bool *out);
/**
* @brief Sets whether VrMode is enabled.
* @note This is only fully usable system-side with [6.0.0+].
* @note For checking Parental Controls, see \ref pctlIsStereoVisionPermitted.
* @note On pre-7.0.0 this uses cmd SetVrModeEnabled internally, while on [7.0.0+] this uses cmds BeginVrModeEx/EndVrModeEx.
* @param flag Flag
*/
Result appletSetVrModeEnabled(bool flag);
/**
* @brief Sets the \ref ApmCpuBoostMode.
* @note Only available with [7.0.0+] (not fully usable system-side with 6.x).

View File

@ -1670,6 +1670,23 @@ Result appletPushToGeneralChannel(AppletStorage *s) {
return _appletCmdInStorage(&g_appletICommonStateGetter, s, 20);
}
Result appletIsVrModeEnabled(bool *out) {
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoInOutBool(&g_appletICommonStateGetter, out, 50);
}
Result appletSetVrModeEnabled(bool flag) {
if (hosversionBefore(6,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
if (hosversionBefore(7,0,0))
return _appletCmdInBool(&g_appletICommonStateGetter, flag, 51);
return _appletCmdNoIO(&g_appletICommonStateGetter, flag ? 53 : 54);
}
Result appletSetCpuBoostMode(ApmCpuBoostMode mode) {
Result rc=0;
if (hosversionBefore(7,0,0))