aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs9
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Lbl/ILblController.cs92
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Lbl/LblControllerServer.cs54
-rw-r--r--src/Ryujinx.HLE/HOS/Services/ServerBase.cs8
4 files changed, 13 insertions, 150 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
index 0d2ec8bc..602fc2c4 100644
--- a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
@@ -5,6 +5,7 @@ using Ryujinx.HLE.HOS.Services.Settings.Types;
using Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.Horizon.Common;
+using Ryujinx.Horizon.Sdk.Lbl;
using System;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
@@ -15,7 +16,6 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
private readonly Apm.ManagerServer _apmManagerServer;
private readonly Apm.SystemManagerServer _apmSystemManagerServer;
- private readonly Lbl.LblControllerServer _lblControllerServer;
private bool _vrModeEnabled;
#pragma warning disable CS0414, IDE0052 // Remove unread private member
@@ -34,7 +34,6 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_apmManagerServer = new Apm.ManagerServer(context);
_apmSystemManagerServer = new Apm.SystemManagerServer(context);
- _lblControllerServer = new Lbl.LblControllerServer(context);
_acquiredSleepLockEvent = new KEvent(context.Device.System.KernelContext);
}
@@ -215,13 +214,15 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
_vrModeEnabled = vrModeEnabled;
+ using var lblApi = new LblApi();
+
if (vrModeEnabled)
{
- _lblControllerServer.EnableVrMode();
+ lblApi.EnableVrMode().AbortOnFailure();
}
else
{
- _lblControllerServer.DisableVrMode();
+ lblApi.DisableVrMode().AbortOnFailure();
}
// TODO: It signals an internal event of ICommonStateGetter. We have to determine where this event is used.
diff --git a/src/Ryujinx.HLE/HOS/Services/Lbl/ILblController.cs b/src/Ryujinx.HLE/HOS/Services/Lbl/ILblController.cs
deleted file mode 100644
index 75d78743..00000000
--- a/src/Ryujinx.HLE/HOS/Services/Lbl/ILblController.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-namespace Ryujinx.HLE.HOS.Services.Lbl
-{
- abstract class ILblController : IpcService
- {
- public ILblController(ServiceCtx context) { }
-
- protected abstract void SetCurrentBrightnessSettingForVrMode(float currentBrightnessSettingForVrMode);
- protected abstract float GetCurrentBrightnessSettingForVrMode();
- internal abstract void EnableVrMode();
- internal abstract void DisableVrMode();
- protected abstract bool IsVrModeEnabled();
-
- [CommandCmif(17)]
- // SetBrightnessReflectionDelayLevel(float, float)
- public ResultCode SetBrightnessReflectionDelayLevel(ServiceCtx context)
- {
- return ResultCode.Success;
- }
-
- [CommandCmif(18)]
- // GetBrightnessReflectionDelayLevel(float) -> float
- public ResultCode GetBrightnessReflectionDelayLevel(ServiceCtx context)
- {
- context.ResponseData.Write(0.0f);
-
- return ResultCode.Success;
- }
-
- [CommandCmif(21)]
- // SetCurrentAmbientLightSensorMapping(unknown<0xC>)
- public ResultCode SetCurrentAmbientLightSensorMapping(ServiceCtx context)
- {
- return ResultCode.Success;
- }
-
- [CommandCmif(22)]
- // GetCurrentAmbientLightSensorMapping() -> unknown<0xC>
- public ResultCode GetCurrentAmbientLightSensorMapping(ServiceCtx context)
- {
- return ResultCode.Success;
- }
-
- [CommandCmif(24)] // 3.0.0+
- // SetCurrentBrightnessSettingForVrMode(float)
- public ResultCode SetCurrentBrightnessSettingForVrMode(ServiceCtx context)
- {
- float currentBrightnessSettingForVrMode = context.RequestData.ReadSingle();
-
- SetCurrentBrightnessSettingForVrMode(currentBrightnessSettingForVrMode);
-
- return ResultCode.Success;
- }
-
- [CommandCmif(25)] // 3.0.0+
- // GetCurrentBrightnessSettingForVrMode() -> float
- public ResultCode GetCurrentBrightnessSettingForVrMode(ServiceCtx context)
- {
- float currentBrightnessSettingForVrMode = GetCurrentBrightnessSettingForVrMode();
-
- context.ResponseData.Write(currentBrightnessSettingForVrMode);
-
- return ResultCode.Success;
- }
-
- [CommandCmif(26)] // 3.0.0+
- // EnableVrMode()
- public ResultCode EnableVrMode(ServiceCtx context)
- {
- EnableVrMode();
-
- return ResultCode.Success;
- }
-
- [CommandCmif(27)] // 3.0.0+
- // DisableVrMode()
- public ResultCode DisableVrMode(ServiceCtx context)
- {
- DisableVrMode();
-
- return ResultCode.Success;
- }
-
- [CommandCmif(28)] // 3.0.0+
- // IsVrModeEnabled() -> bool
- public ResultCode IsVrModeEnabled(ServiceCtx context)
- {
- context.ResponseData.Write(IsVrModeEnabled());
-
- return ResultCode.Success;
- }
- }
-}
diff --git a/src/Ryujinx.HLE/HOS/Services/Lbl/LblControllerServer.cs b/src/Ryujinx.HLE/HOS/Services/Lbl/LblControllerServer.cs
deleted file mode 100644
index 899e882e..00000000
--- a/src/Ryujinx.HLE/HOS/Services/Lbl/LblControllerServer.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-namespace Ryujinx.HLE.HOS.Services.Lbl
-{
- [Service("lbl")]
- class LblControllerServer : ILblController
- {
- private bool _vrModeEnabled;
- private float _currentBrightnessSettingForVrMode;
-
- public LblControllerServer(ServiceCtx context) : base(context) { }
-
- protected override void SetCurrentBrightnessSettingForVrMode(float currentBrightnessSettingForVrMode)
- {
- if (float.IsNaN(currentBrightnessSettingForVrMode) || float.IsInfinity(currentBrightnessSettingForVrMode))
- {
- _currentBrightnessSettingForVrMode = 0.0f;
-
- return;
- }
-
- _currentBrightnessSettingForVrMode = currentBrightnessSettingForVrMode;
- }
-
- protected override float GetCurrentBrightnessSettingForVrMode()
- {
- if (float.IsNaN(_currentBrightnessSettingForVrMode) || float.IsInfinity(_currentBrightnessSettingForVrMode))
- {
- return 0.0f;
- }
-
- return _currentBrightnessSettingForVrMode;
- }
-
- internal override void EnableVrMode()
- {
- _vrModeEnabled = true;
-
- // NOTE: Service check _vrModeEnabled field value in a thread and then change the screen brightness.
- // Since we don't support that. It's fine to do nothing.
- }
-
- internal override void DisableVrMode()
- {
- _vrModeEnabled = false;
-
- // NOTE: Service check _vrModeEnabled field value in a thread and then change the screen brightness.
- // Since we don't support that. It's fine to do nothing.
- }
-
- protected override bool IsVrModeEnabled()
- {
- return _vrModeEnabled;
- }
- }
-}
diff --git a/src/Ryujinx.HLE/HOS/Services/ServerBase.cs b/src/Ryujinx.HLE/HOS/Services/ServerBase.cs
index f107f502..9d7e4d4c 100644
--- a/src/Ryujinx.HLE/HOS/Services/ServerBase.cs
+++ b/src/Ryujinx.HLE/HOS/Services/ServerBase.cs
@@ -6,6 +6,7 @@ using Ryujinx.HLE.HOS.Kernel;
using Ryujinx.HLE.HOS.Kernel.Ipc;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Kernel.Threading;
+using Ryujinx.Horizon;
using Ryujinx.Horizon.Common;
using System;
using System.Buffers;
@@ -172,6 +173,13 @@ namespace Ryujinx.HLE.HOS.Services
_selfProcess = KernelStatic.GetCurrentProcess();
_selfThread = KernelStatic.GetCurrentThread();
+ HorizonStatic.Register(
+ default,
+ _context.Syscall,
+ _selfProcess.CpuMemory,
+ _selfThread.ThreadContext,
+ (int)_selfThread.ThreadContext.GetX(1));
+
if (SmObjectFactory != null)
{
_context.Syscall.ManageNamedPort(out int serverPortHandle, "sm:", 50);