diff --git a/Ryujinx.HLE/OsHle/Horizon.cs b/Ryujinx.HLE/OsHle/Horizon.cs index f420dc0df8..f12bf37d7f 100644 --- a/Ryujinx.HLE/OsHle/Horizon.cs +++ b/Ryujinx.HLE/OsHle/Horizon.cs @@ -233,4 +233,4 @@ namespace Ryujinx.HLE.OsHle } } } -} \ No newline at end of file +} diff --git a/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs b/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs index 79d37fd4c9..f23164ce3f 100644 --- a/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs @@ -1,14 +1,18 @@ using Ryujinx.HLE.Input; using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Ipc; +using Ryujinx.HLE.OsHle.Handles; +using System; using System.Collections.Generic; namespace Ryujinx.HLE.OsHle.Services.Hid { - class IHidServer : IpcService + class IHidServer : IpcService, IDisposable { private Dictionary m_Commands; + private KEvent NpadStyleSetUpdateEvent; + public override IReadOnlyDictionary Commands => m_Commands; public IHidServer() @@ -26,6 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid { 101, GetSupportedNpadStyleSet }, { 102, SetSupportedNpadIdType }, { 103, ActivateNpad }, + { 106, AcquireNpadStyleSetUpdateEventHandle }, { 108, GetPlayerLedPattern }, { 120, SetNpadJoyHoldType }, { 121, GetNpadJoyHoldType }, @@ -39,6 +44,8 @@ namespace Ryujinx.HLE.OsHle.Services.Hid { 203, CreateActiveVibrationDeviceList }, { 206, SendVibrationValues } }; + + NpadStyleSetUpdateEvent = new KEvent(); } public long CreateAppletResource(ServiceCtx Context) @@ -104,6 +111,15 @@ namespace Ryujinx.HLE.OsHle.Services.Hid return 0; } + public long AcquireNpadStyleSetUpdateEventHandle(ServiceCtx Context) + { + int Handle = Context.Process.HandleTable.OpenHandle(NpadStyleSetUpdateEvent); + + Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle); + + return 0; + } + public long GetSupportedNpadStyleSet(ServiceCtx Context) { Context.ResponseData.Write(0); @@ -266,5 +282,18 @@ namespace Ryujinx.HLE.OsHle.Services.Hid return 0; } + + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool Disposing) + { + if (Disposing) + { + NpadStyleSetUpdateEvent.Dispose(); + } + } } }