|
|
@@ -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<int, ServiceProcessRequest> m_Commands;
|
|
|
|
|
|
+ private KEvent NpadStyleSetUpdateEvent;
|
|
|
+
|
|
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|