aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Hid
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2019-06-28 13:08:23 +0200
committerjduncanator <1518948+jduncanator@users.noreply.github.com>2019-06-28 21:08:23 +1000
commitba86a5d7f3aa0127c4732c739af3f6086fb6acd9 (patch)
tree64d2308ad44f4b87cf9aa5aaacb8933ec7bda679 /Ryujinx.HLE/HOS/Services/Hid
parenta8965aad970549b3fca87520616674aa3600a9dd (diff)
nfp:user: Implement IUser (#714)
* nfp:user: Implement IUser - Based on RE of sysmod FW 1.0 and 3.0 with help of https://github.com/switchbrew/libnx/ and https://reswitched.github.io/SwIPC/ifaces.html#nn::nfp::detail::IUser - Accurate implementation of Initialize, AttachActivateEvent, AttachDeactivateEvent, GetState, GetDeviceState, GetNpadId and GetDeviceState. - Implementation of Finalize and ListDevices (close #638). * reorder private var * fix nits
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Hid')
-rw-r--r--Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs b/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs
index 64252ce8..051be7a8 100644
--- a/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs
+++ b/Ryujinx.HLE/HOS/Services/Hid/HidUtils.cs
@@ -23,5 +23,24 @@ namespace Ryujinx.HLE.HOS.Services.Hid
default: throw new ArgumentOutOfRangeException(nameof(npadIdType));
}
}
+
+ public static NpadIdType GetNpadIdTypeFromIndex(HidControllerId 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;
+
+ default: throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ }
}
} \ No newline at end of file