From 40b311900f4bf7e5944647ad0a56afaf5b559aa5 Mon Sep 17 00:00:00 2001 From: emmaus Date: Wed, 1 Aug 2018 10:10:22 +0000 Subject: [PATCH] move npad style set event to hid service --- Ryujinx.HLE/OsHle/Horizon.cs | 8 +------- Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs | 7 ++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Horizon.cs b/Ryujinx.HLE/OsHle/Horizon.cs index ffbd169440..c8207ebfc6 100644 --- a/Ryujinx.HLE/OsHle/Horizon.cs +++ b/Ryujinx.HLE/OsHle/Horizon.cs @@ -25,8 +25,7 @@ namespace Ryujinx.HLE.OsHle internal HSharedMem HidSharedMem { get; private set; } internal HSharedMem FontSharedMem { get; private set; } - internal KEvent VsyncEvent { get; private set; } - internal KEvent NpadStyleSetUpdateEvent { get; private set; } + internal KEvent VsyncEvent { get; private set; } public Horizon(Switch Ns) { @@ -44,7 +43,6 @@ namespace Ryujinx.HLE.OsHle FontSharedMem = new HSharedMem(); VsyncEvent = new KEvent(); - NpadStyleSetUpdateEvent = new KEvent(); } public void LoadCart(string ExeFsDir, string RomFsFile = null) @@ -126,8 +124,6 @@ namespace Ryujinx.HLE.OsHle public void SignalVsync() => VsyncEvent.WaitEvent.Set(); - public void SignalNpadStyleSetUpdate() => NpadStyleSetUpdateEvent.WaitEvent.Set(); - private Process MakeProcess() { Process Process; @@ -213,8 +209,6 @@ namespace Ryujinx.HLE.OsHle VsyncEvent.Dispose(); - NpadStyleSetUpdateEvent.Dispose(); - Scheduler.Dispose(); } } diff --git a/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs b/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs index 75776127da..2ded7215d7 100644 --- a/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs @@ -1,6 +1,7 @@ using Ryujinx.HLE.Input; using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Ipc; +using Ryujinx.HLE.OsHle.Handles; using System.Collections.Generic; namespace Ryujinx.HLE.OsHle.Services.Hid @@ -9,6 +10,8 @@ namespace Ryujinx.HLE.OsHle.Services.Hid { private Dictionary m_Commands; + private KEvent NpadStyleSetUpdateEvent { get; set; } + public override IReadOnlyDictionary Commands => m_Commands; public IHidServer() @@ -40,6 +43,8 @@ namespace Ryujinx.HLE.OsHle.Services.Hid { 203, CreateActiveVibrationDeviceList }, { 206, SendVibrationValues } }; + + NpadStyleSetUpdateEvent = new KEvent(); } public long CreateAppletResource(ServiceCtx Context) @@ -107,7 +112,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid public long AcquireNpadStyleSetUpdateEventHandle(ServiceCtx Context) { - int Handle = Context.Process.HandleTable.OpenHandle(Context.Ns.Os.NpadStyleSetUpdateEvent); + int Handle = Context.Process.HandleTable.OpenHandle(NpadStyleSetUpdateEvent); Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);