aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authoremmauss <emmausssss@gmail.com>2019-07-22 20:15:46 +0300
committerGitHub <noreply@github.com>2019-07-22 20:15:46 +0300
commitd254548548398977a45dbfc03f2cc091c5a74f03 (patch)
treee153a29676f6f83d44b25cc42ecd1efc8cc701e6 /Ryujinx.HLE/HOS
parent1f3a34dd7a5977fc340de310b2109493e5e6973f (diff)
Little rewrite of HID input (#723)
* change hid sharedmem writing to use structures
Diffstat (limited to 'Ryujinx.HLE/HOS')
-rw-r--r--Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs44
-rw-r--r--Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs16
-rw-r--r--Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nfc/Nfp/Device.cs4
4 files changed, 33 insertions, 33 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs b/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs
index 051be7a8..fd540c7c 100644
--- a/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs
+++ b/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs
@@ -5,39 +5,39 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{
static class HidUtils
{
- public static HidControllerId GetIndexFromNpadIdType(NpadIdType npadIdType)
+ public static ControllerId GetIndexFromNpadIdType(NpadIdType npadIdType)
{
switch (npadIdType)
{
- case NpadIdType.Player1: return HidControllerId.ControllerPlayer1;
- case NpadIdType.Player2: return HidControllerId.ControllerPlayer2;
- case NpadIdType.Player3: return HidControllerId.ControllerPlayer3;
- case NpadIdType.Player4: return HidControllerId.ControllerPlayer4;
- case NpadIdType.Player5: return HidControllerId.ControllerPlayer5;
- case NpadIdType.Player6: return HidControllerId.ControllerPlayer6;
- case NpadIdType.Player7: return HidControllerId.ControllerPlayer7;
- case NpadIdType.Player8: return HidControllerId.ControllerPlayer8;
- case NpadIdType.Handheld: return HidControllerId.ControllerHandheld;
- case NpadIdType.Unknown: return HidControllerId.ControllerUnknown;
+ case NpadIdType.Player1: return ControllerId.ControllerPlayer1;
+ case NpadIdType.Player2: return ControllerId.ControllerPlayer2;
+ case NpadIdType.Player3: return ControllerId.ControllerPlayer3;
+ case NpadIdType.Player4: return ControllerId.ControllerPlayer4;
+ case NpadIdType.Player5: return ControllerId.ControllerPlayer5;
+ case NpadIdType.Player6: return ControllerId.ControllerPlayer6;
+ case NpadIdType.Player7: return ControllerId.ControllerPlayer7;
+ case NpadIdType.Player8: return ControllerId.ControllerPlayer8;
+ case NpadIdType.Handheld: return ControllerId.ControllerHandheld;
+ case NpadIdType.Unknown: return ControllerId.ControllerUnknown;
default: throw new ArgumentOutOfRangeException(nameof(npadIdType));
}
}
- public static NpadIdType GetNpadIdTypeFromIndex(HidControllerId index)
+ public static NpadIdType GetNpadIdTypeFromIndex(ControllerId index)
{
switch (index)
{
- case HidControllerId.ControllerPlayer1: return NpadIdType.Player1;
- case HidControllerId.ControllerPlayer2: return NpadIdType.Player2;
- case HidControllerId.ControllerPlayer3: return NpadIdType.Player3;
- case HidControllerId.ControllerPlayer4: return NpadIdType.Player4;
- case HidControllerId.ControllerPlayer5: return NpadIdType.Player5;
- case HidControllerId.ControllerPlayer6: return NpadIdType.Player6;
- case HidControllerId.ControllerPlayer7: return NpadIdType.Player7;
- case HidControllerId.ControllerPlayer8: return NpadIdType.Player8;
- case HidControllerId.ControllerHandheld: return NpadIdType.Handheld;
- case HidControllerId.ControllerUnknown: return NpadIdType.Unknown;
+ case ControllerId.ControllerPlayer1: return NpadIdType.Player1;
+ case ControllerId.ControllerPlayer2: return NpadIdType.Player2;
+ case ControllerId.ControllerPlayer3: return NpadIdType.Player3;
+ case ControllerId.ControllerPlayer4: return NpadIdType.Player4;
+ case ControllerId.ControllerPlayer5: return NpadIdType.Player5;
+ case ControllerId.ControllerPlayer6: return NpadIdType.Player6;
+ case ControllerId.ControllerPlayer7: return NpadIdType.Player7;
+ case ControllerId.ControllerPlayer8: return NpadIdType.Player8;
+ case ControllerId.ControllerHandheld: return NpadIdType.Handheld;
+ case ControllerId.ControllerUnknown: return NpadIdType.Unknown;
default: throw new ArgumentOutOfRangeException(nameof(index));
}
diff --git a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs
index 22bd28f3..7d77ff32 100644
--- a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs
+++ b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs
@@ -569,8 +569,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// SetSupportedNpadIdType(nn::applet::AppletResourceUserId, array<NpadIdType, 9>)
public ResultCode SetSupportedNpadIdType(ServiceCtx context)
{
- long appletResourceUserId = context.RequestData.ReadInt64();
- HidControllerId npadIdType = (HidControllerId)context.RequestData.ReadInt64();
+ long appletResourceUserId = context.RequestData.ReadInt64();
+ ControllerId npadIdType = (ControllerId)context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadIdType });
@@ -687,8 +687,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// SetNpadJoyAssignmentModeSingleByDefault(uint HidControllerId, nn::applet::AppletResourceUserId)
public ResultCode SetNpadJoyAssignmentModeSingleByDefault(ServiceCtx context)
{
- HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
- long appletResourceUserId = context.RequestData.ReadInt64();
+ ControllerId hidControllerId = (ControllerId)context.RequestData.ReadInt32();
+ long appletResourceUserId = context.RequestData.ReadInt64();
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single;
@@ -701,7 +701,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// SetNpadJoyAssignmentModeSingle(uint HidControllerId, nn::applet::AppletResourceUserId, long HidNpadJoyDeviceType)
public ResultCode SetNpadJoyAssignmentModeSingle(ServiceCtx context)
{
- HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
+ ControllerId hidControllerId = (ControllerId)context.RequestData.ReadInt32();
long appletResourceUserId = context.RequestData.ReadInt64();
HidNpadJoyDeviceType hidNpadJoyDeviceType = (HidNpadJoyDeviceType)context.RequestData.ReadInt64();
@@ -716,8 +716,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// SetNpadJoyAssignmentModeDual(uint HidControllerId, nn::applet::AppletResourceUserId)
public ResultCode SetNpadJoyAssignmentModeDual(ServiceCtx context)
{
- HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
- long appletResourceUserId = context.RequestData.ReadInt64();
+ ControllerId hidControllerId = (ControllerId)context.RequestData.ReadInt32();
+ long appletResourceUserId = context.RequestData.ReadInt64();
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Dual;
@@ -830,7 +830,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
// SetNpadJoyAssignmentModeSingleWithDestination(uint HidControllerId, long HidNpadJoyDeviceType, nn::applet::AppletResourceUserId) -> bool Unknown0, uint Unknown1
public ResultCode SetNpadJoyAssignmentModeSingleWithDestination(ServiceCtx context)
{
- HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
+ ControllerId hidControllerId = (ControllerId)context.RequestData.ReadInt32();
HidNpadJoyDeviceType hidNpadJoyDeviceType = (HidNpadJoyDeviceType)context.RequestData.ReadInt64();
long appletResourceUserId = context.RequestData.ReadInt64();
diff --git a/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs b/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs
index d6659fd8..d2991d0f 100644
--- a/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs
+++ b/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs
@@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
return ResultCode.NpadIdOutOfRange;
}
- HidControllerId irCameraHandle = HidUtils.GetIndexFromNpadIdType(npadIdType);
+ ControllerId irCameraHandle = HidUtils.GetIndexFromNpadIdType(npadIdType);
context.ResponseData.Write((int)irCameraHandle);
diff --git a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/Device.cs b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/Device.cs
index a1f58dae..3c49ee51 100644
--- a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/Device.cs
+++ b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/Device.cs
@@ -14,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
public DeviceState State = DeviceState.Unavailable;
- public HidControllerId Handle;
- public NpadIdType NpadIdType;
+ public ControllerId Handle;
+ public NpadIdType NpadIdType;
}
} \ No newline at end of file