diff options
| author | Ac_K <Acoustik666@gmail.com> | 2020-11-15 22:30:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-15 22:30:20 +0100 |
| commit | 313f8d2eb6e4833170d685d6afd940c077e066f6 (patch) | |
| tree | e5840f885fa0a7c83244806e11103748b6c928c0 /Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy | |
| parent | 4bc4cacdd0b615553a11cdcdb2aa7d3b563eac0b (diff) | |
am/lbl/hid/pctl: Enabled VR Rendering (#1688)
* am/lbl/hid/pctl: Enabled VR Rendering
This PR enable VR rendering on games which support it through the Toy-Con VR Goggles.
Please remember Ryujinx currently don't support console SixAxis sensor and for now, in some games, the view can't be moved.
Everything is implemented accordingly to RE:
- am: ICommonStateGetter: SetVrModeEnabled, BeginVrModeEx, EndVrModeEx.
- lbl: ILblController: SetBrightnessReflectionDelayLevel, GetBrightnessReflectionDelayLevel, SetCurrentAmbientLightSensorMapping, GetCurrentAmbientLightSensorMapping, SetCurrentBrightnessSettingForVrMode, GetCurrentBrightnessSettingForVrMode, EnableVrMode, DisableVrMode, IsVrModeEnabled.
- pctl: IParentalControlService: ConfirmStereoVisionPermission, ConfirmStereoVisionRestrictionConfigurable, GetStereoVisionRestriction, SetStereoVisionRestriction, ResetConfirmedStereoVisionPermission, IsStereoVisionPermitted.
- hid: IHidServer: ResetSevenSixAxisSensorTimestamp is stubbed because we don't support console SixAxisSensor for now.
Maybe we could add a setting later to enable or disable VR. But I think it's fine to keep this always available since you have to enable it in games.
* Fix permission flag check
* Address gdkchan feedback
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs | 68 |
1 files changed, 60 insertions, 8 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs index 82e18922..16b78734 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs @@ -8,15 +8,17 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { class ICommonStateGetter : IpcService { - private Apm.ManagerServer apmManagerServer; - private Apm.SystemManagerServer apmSystemManagerServer; + private Apm.ManagerServer _apmManagerServer; + private Apm.SystemManagerServer _apmSystemManagerServer; + private Lbl.LblControllerServer _lblControllerServer; - private bool _vrModeEnabled = false; + private bool _vrModeEnabled = true; public ICommonStateGetter(ServiceCtx context) { - apmManagerServer = new Apm.ManagerServer(context); - apmSystemManagerServer = new Apm.SystemManagerServer(context); + _apmManagerServer = new Apm.ManagerServer(context); + _apmSystemManagerServer = new Apm.SystemManagerServer(context); + _lblControllerServer = new Lbl.LblControllerServer(context); } [Command(0)] @@ -66,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // GetPerformanceMode() -> nn::apm::PerformanceMode public ResultCode GetPerformanceMode(ServiceCtx context) { - return (ResultCode)apmManagerServer.GetPerformanceMode(context); + return (ResultCode)_apmManagerServer.GetPerformanceMode(context); } [Command(8)] @@ -98,6 +100,56 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys return ResultCode.Success; } + [Command(51)] // 3.0.0+ + // SetVrModeEnabled(b8) + public ResultCode SetVrModeEnabled(ServiceCtx context) + { + bool vrModeEnabled = context.RequestData.ReadBoolean(); + + UpdateVrMode(vrModeEnabled); + + return ResultCode.Success; + } + + [Command(53)] // 7.0.0+ + // BeginVrModeEx() + public ResultCode BeginVrModeEx(ServiceCtx context) + { + UpdateVrMode(true); + + return ResultCode.Success; + } + + [Command(54)] // 7.0.0+ + // EndVrModeEx() + public ResultCode EndVrModeEx(ServiceCtx context) + { + UpdateVrMode(false); + + return ResultCode.Success; + } + + private void UpdateVrMode(bool vrModeEnabled) + { + if (_vrModeEnabled == vrModeEnabled) + { + return; + } + + _vrModeEnabled = vrModeEnabled; + + if (vrModeEnabled) + { + _lblControllerServer.EnableVrMode(); + } + else + { + _lblControllerServer.DisableVrMode(); + } + + // TODO: It signals an internal event of ICommonStateGetter. We have to determine where this event is used. + } + [Command(60)] // 3.0.0+ // GetDefaultDisplayResolution() -> (u32, u32) public ResultCode GetDefaultDisplayResolution(ServiceCtx context) @@ -135,7 +187,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys return ResultCode.InvalidParameters; } - apmSystemManagerServer.SetCpuBoostMode((Apm.CpuBoostMode)cpuBoostMode); + _apmSystemManagerServer.SetCpuBoostMode((Apm.CpuBoostMode)cpuBoostMode); // TODO: It signals an internal event of ICommonStateGetter. We have to determine where this event is used. @@ -146,7 +198,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context) { - return (ResultCode)apmSystemManagerServer.GetCurrentPerformanceConfiguration(context); + return (ResultCode)_apmSystemManagerServer.GetCurrentPerformanceConfiguration(context); } } }
\ No newline at end of file |
