aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremmauss <emmausssss@gmail.com>2018-08-14 00:31:09 +0300
committergdkchan <gab.dark.100@gmail.com>2018-08-13 18:31:09 -0300
commit6e483120527c749854066b1ab0c5a1d53d49f0e3 (patch)
tree8b31d10bd152015fb65f3232990f8a2fc0614898
parent09593ae6d85b204b7bded803a56f0d81fbda1127 (diff)
Implement AcquireNpadStyleSetUpdate event (#306)
* implement get npad set event * move npad style set event to hid service * fix spacing * change event to field * dispose event
-rw-r--r--Ryujinx.HLE/OsHle/Horizon.cs2
-rw-r--r--Ryujinx.HLE/OsHle/Services/Hid/IHidServer.cs31
2 files changed, 31 insertions, 2 deletions
diff --git a/Ryujinx.HLE/OsHle/Horizon.cs b/Ryujinx.HLE/OsHle/Horizon.cs
index f420dc0d..f12bf37d 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 79d37fd4..f23164ce 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<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();
+ }
+ }
}
}