move npad style set event to hid service

This commit is contained in:
emmaus 2018-08-01 10:10:22 +00:00
commit 40b311900f
2 changed files with 7 additions and 8 deletions

View file

@ -25,8 +25,7 @@ namespace Ryujinx.HLE.OsHle
internal HSharedMem HidSharedMem { get; private set; } internal HSharedMem HidSharedMem { get; private set; }
internal HSharedMem FontSharedMem { get; private set; } internal HSharedMem FontSharedMem { get; private set; }
internal KEvent VsyncEvent { get; private set; } internal KEvent VsyncEvent { get; private set; }
internal KEvent NpadStyleSetUpdateEvent { get; private set; }
public Horizon(Switch Ns) public Horizon(Switch Ns)
{ {
@ -44,7 +43,6 @@ namespace Ryujinx.HLE.OsHle
FontSharedMem = new HSharedMem(); FontSharedMem = new HSharedMem();
VsyncEvent = new KEvent(); VsyncEvent = new KEvent();
NpadStyleSetUpdateEvent = new KEvent();
} }
public void LoadCart(string ExeFsDir, string RomFsFile = null) public void LoadCart(string ExeFsDir, string RomFsFile = null)
@ -126,8 +124,6 @@ namespace Ryujinx.HLE.OsHle
public void SignalVsync() => VsyncEvent.WaitEvent.Set(); public void SignalVsync() => VsyncEvent.WaitEvent.Set();
public void SignalNpadStyleSetUpdate() => NpadStyleSetUpdateEvent.WaitEvent.Set();
private Process MakeProcess() private Process MakeProcess()
{ {
Process Process; Process Process;
@ -213,8 +209,6 @@ namespace Ryujinx.HLE.OsHle
VsyncEvent.Dispose(); VsyncEvent.Dispose();
NpadStyleSetUpdateEvent.Dispose();
Scheduler.Dispose(); Scheduler.Dispose();
} }
} }

View file

@ -1,6 +1,7 @@
using Ryujinx.HLE.Input; using Ryujinx.HLE.Input;
using Ryujinx.HLE.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.HLE.OsHle.Ipc; using Ryujinx.HLE.OsHle.Ipc;
using Ryujinx.HLE.OsHle.Handles;
using System.Collections.Generic; using System.Collections.Generic;
namespace Ryujinx.HLE.OsHle.Services.Hid namespace Ryujinx.HLE.OsHle.Services.Hid
@ -9,6 +10,8 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
{ {
private Dictionary<int, ServiceProcessRequest> m_Commands; private Dictionary<int, ServiceProcessRequest> m_Commands;
private KEvent NpadStyleSetUpdateEvent { get; set; }
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
public IHidServer() public IHidServer()
@ -40,6 +43,8 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
{ 203, CreateActiveVibrationDeviceList }, { 203, CreateActiveVibrationDeviceList },
{ 206, SendVibrationValues } { 206, SendVibrationValues }
}; };
NpadStyleSetUpdateEvent = new KEvent();
} }
public long CreateAppletResource(ServiceCtx Context) public long CreateAppletResource(ServiceCtx Context)
@ -107,7 +112,7 @@ namespace Ryujinx.HLE.OsHle.Services.Hid
public long AcquireNpadStyleSetUpdateEventHandle(ServiceCtx Context) 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); Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);