diff options
author | emmauss <emmausssss@gmail.com> | 2019-07-22 20:15:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-22 20:15:46 +0300 |
commit | d254548548398977a45dbfc03f2cc091c5a74f03 (patch) | |
tree | e153a29676f6f83d44b25cc42ecd1efc8cc701e6 /Ryujinx.HLE/Input/Controller/ProController.cs | |
parent | 1f3a34dd7a5977fc340de310b2109493e5e6973f (diff) |
Little rewrite of HID input (#723)
* change hid sharedmem writing to use structures
Diffstat (limited to 'Ryujinx.HLE/Input/Controller/ProController.cs')
-rw-r--r-- | Ryujinx.HLE/Input/Controller/ProController.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Ryujinx.HLE/Input/Controller/ProController.cs b/Ryujinx.HLE/Input/Controller/ProController.cs new file mode 100644 index 00000000..ae574260 --- /dev/null +++ b/Ryujinx.HLE/Input/Controller/ProController.cs @@ -0,0 +1,42 @@ +namespace Ryujinx.HLE.Input +{ + public class ProController : BaseController + { + private bool _wired = false; + + private NpadColor _bodyColor; + private NpadColor _buttonColor; + + public ProController(Switch device, + NpadColor bodyColor, + NpadColor buttonColor) : base(device, ControllerStatus.ProController) + { + _wired = true; + + _bodyColor = bodyColor; + _buttonColor = buttonColor; + } + + public override void Connect(ControllerId controllerId) + { + ControllerColorDescription singleColorDesc = + ControllerColorDescription.ColorDescriptionColorsNonexistent; + + ControllerColorDescription splitColorDesc = 0; + + ConnectionState = ControllerConnectionState.ControllerStateConnected | ControllerConnectionState.ControllerStateWired; + + Initialize(false, + (0, 0), + (0, 0), + singleColorDesc, + splitColorDesc, + _bodyColor, + _buttonColor); + + base.Connect(controllerId); + + SetLayout(ControllerLayouts.ProController); + } + } +} |