From f4ed327722902073898ceddc3ce90aeebc9c9bd9 Mon Sep 17 00:00:00 2001 From: emmaus Date: Wed, 3 Oct 2018 20:17:05 +0000 Subject: [PATCH] stub irs --- .../HOS/Services/Irs/IIrSensorServer.cs | 48 +++++++++++++++++++ Ryujinx.HLE/HOS/Services/ServiceFactory.cs | 4 ++ 2 files changed, 52 insertions(+) create mode 100644 Ryujinx.HLE/HOS/Services/Irs/IIrSensorServer.cs diff --git a/Ryujinx.HLE/HOS/Services/Irs/IIrSensorServer.cs b/Ryujinx.HLE/HOS/Services/Irs/IIrSensorServer.cs new file mode 100644 index 0000000000..7831245ac7 --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Irs/IIrSensorServer.cs @@ -0,0 +1,48 @@ +using Ryujinx.HLE.HOS.Ipc; +using Ryujinx.HLE.HOS.Kernel; +using Ryujinx.HLE.Logging; +using System; +using System.Collections.Generic; + +namespace Ryujinx.HLE.HOS.Services.Irs +{ + class IIrSensorServer : IpcService + { + private Dictionary m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + private bool Activated; + + public IIrSensorServer() + { + m_Commands = new Dictionary() + { + { 302, ActivateIrsensor }, + { 303, DeactivateIrsensor } + }; + } + + public long ActivateIrsensor(ServiceCtx Context) + { + long AppletResourceUserId = Context.RequestData.ReadInt64(); + int IrsSensorHandle = Context.RequestData.ReadInt32(); + + Context.Device.Log.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {AppletResourceUserId} - " + + $"IrsSensorHandle: {IrsSensorHandle}"); + + return 0; + } + + public long DeactivateIrsensor(ServiceCtx Context) + { + long AppletResourceUserId = Context.RequestData.ReadInt64(); + int IrsSensorHandle = Context.RequestData.ReadInt32(); + + Context.Device.Log.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {AppletResourceUserId} - " + + $"IrsSensorHandle: {IrsSensorHandle}"); + + return 0; + } + } +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/ServiceFactory.cs b/Ryujinx.HLE/HOS/Services/ServiceFactory.cs index 5e1e780aac..fd5a06e6d9 100644 --- a/Ryujinx.HLE/HOS/Services/ServiceFactory.cs +++ b/Ryujinx.HLE/HOS/Services/ServiceFactory.cs @@ -6,6 +6,7 @@ using Ryujinx.HLE.HOS.Services.Bsd; using Ryujinx.HLE.HOS.Services.Caps; using Ryujinx.HLE.HOS.Services.FspSrv; using Ryujinx.HLE.HOS.Services.Hid; +using Ryujinx.HLE.HOS.Services.Irs; using Ryujinx.HLE.HOS.Services.Lm; using Ryujinx.HLE.HOS.Services.Mm; using Ryujinx.HLE.HOS.Services.Nfp; @@ -96,6 +97,9 @@ namespace Ryujinx.HLE.HOS.Services case "hid": return new IHidServer(System); + case "irs": + return new IIrSensorServer(); + case "lm": return new ILogService();