From 281fdb871d2303308121d8663cecec38cf69d626 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 28 Feb 2018 20:27:58 -0300 Subject: [PATCH] Don't use magic values --- Ryujinx.Core/Hid/Hid.cs | 4 +++- Ryujinx.Core/Hid/HidControllerConnState.cs | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Ryujinx.Core/Hid/HidControllerConnState.cs diff --git a/Ryujinx.Core/Hid/Hid.cs b/Ryujinx.Core/Hid/Hid.cs index 35aab94ba6..72e7a29cb3 100644 --- a/Ryujinx.Core/Hid/Hid.cs +++ b/Ryujinx.Core/Hid/Hid.cs @@ -142,7 +142,9 @@ namespace Ryujinx.Core.Input WriteInt32(ControllerOffset + 0x1c, LeftStick.DY); WriteInt64(ControllerOffset + 0x20, RightStick.DX); WriteInt64(ControllerOffset + 0x24, RightStick.DY); - WriteInt64(ControllerOffset + 0x28, 3); + WriteInt64(ControllerOffset + 0x28, + (uint)HidControllerConnState.Controller_State_Connected | + (uint)HidControllerConnState.Controller_State_Wired); } public void SetTouchPoints(params HidTouchPoint[] Points) diff --git a/Ryujinx.Core/Hid/HidControllerConnState.cs b/Ryujinx.Core/Hid/HidControllerConnState.cs new file mode 100644 index 0000000000..7f47a7f92f --- /dev/null +++ b/Ryujinx.Core/Hid/HidControllerConnState.cs @@ -0,0 +1,11 @@ +using System; + +namespace Ryujinx.Core.Input +{ + [Flags] + public enum HidControllerConnState + { + Controller_State_Connected = (1 << 0), + Controller_State_Wired = (1 << 1) + } +} \ No newline at end of file