diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-12-04 22:52:39 -0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-04 22:52:39 -0200 |
| commit | 3615a70cae3f89197fe185dfc5d0a47fa42151d9 (patch) | |
| tree | 8e4737422fba15199c1a6ce7c6345996c0e907b5 /Ryujinx.HLE/Input | |
| parent | 85dbb9559ad317a657dafd24da27fec4b3f5250f (diff) | |
Revert "Adjust naming conventions and general refactoring in HLE Project (#490)" (#526)
This reverts commit 85dbb9559ad317a657dafd24da27fec4b3f5250f.
Diffstat (limited to 'Ryujinx.HLE/Input')
| -rw-r--r-- | Ryujinx.HLE/Input/Hid.cs | 132 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidBaseController.cs | 68 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidControllerColorDesc.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidControllerConnState.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidControllerId.cs | 20 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidControllerLayouts.cs | 14 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidJoystickPosition.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidNpadController.cs | 80 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidProController.cs | 42 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/HidValues.cs | 6 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/IHidDevice.cs | 6 | ||||
| -rw-r--r-- | Ryujinx.HLE/Input/NpadColor.cs | 28 |
12 files changed, 207 insertions, 199 deletions
diff --git a/Ryujinx.HLE/Input/Hid.cs b/Ryujinx.HLE/Input/Hid.cs index c35fb07c..edcfe42d 100644 --- a/Ryujinx.HLE/Input/Hid.cs +++ b/Ryujinx.HLE/Input/Hid.cs @@ -5,130 +5,130 @@ namespace Ryujinx.HLE.Input { public partial class Hid { - private Switch _device; + private Switch Device; public HidControllerBase PrimaryController { get; private set; } internal long HidPosition; - public Hid(Switch device, long hidPosition) + public Hid(Switch Device, long HidPosition) { - _device = device; - HidPosition = hidPosition; + this.Device = Device; + this.HidPosition = HidPosition; - device.Memory.FillWithZeros(hidPosition, Horizon.HidSize); + Device.Memory.FillWithZeros(HidPosition, Horizon.HidSize); } - public void InitilizePrimaryController(HidControllerType controllerType) + public void InitilizePrimaryController(HidControllerType ControllerType) { - HidControllerId controllerId = controllerType == HidControllerType.Handheld ? - HidControllerId.ControllerHandheld : HidControllerId.ControllerPlayer1; + HidControllerId ControllerId = ControllerType == HidControllerType.Handheld ? + HidControllerId.CONTROLLER_HANDHELD : HidControllerId.CONTROLLER_PLAYER_1; - if (controllerType == HidControllerType.ProController) + if (ControllerType == HidControllerType.ProController) { - PrimaryController = new HidProController(_device); + PrimaryController = new HidProController(Device); } else { - PrimaryController = new HidNpadController(controllerType, - _device, - (NpadColor.BodyNeonRed, NpadColor.BodyNeonRed), - (NpadColor.ButtonsNeonBlue, NpadColor.ButtonsNeonBlue)); + PrimaryController = new HidNpadController(ControllerType, + Device, + (NpadColor.Body_Neon_Red, NpadColor.Body_Neon_Red), + (NpadColor.Buttons_Neon_Blue, NpadColor.Buttons_Neon_Blue)); } - PrimaryController.Connect(controllerId); + PrimaryController.Connect(ControllerId); } private HidControllerButtons UpdateStickButtons( - HidJoystickPosition leftStick, - HidJoystickPosition rightStick) + HidJoystickPosition LeftStick, + HidJoystickPosition RightStick) { - HidControllerButtons result = 0; + HidControllerButtons Result = 0; - if (rightStick.Dx < 0) + if (RightStick.DX < 0) { - result |= HidControllerButtons.RStickLeft; + Result |= HidControllerButtons.RStickLeft; } - if (rightStick.Dx > 0) + if (RightStick.DX > 0) { - result |= HidControllerButtons.RStickRight; + Result |= HidControllerButtons.RStickRight; } - if (rightStick.Dy < 0) + if (RightStick.DY < 0) { - result |= HidControllerButtons.RStickDown; + Result |= HidControllerButtons.RStickDown; } - if (rightStick.Dy > 0) + if (RightStick.DY > 0) { - result |= HidControllerButtons.RStickUp; + Result |= HidControllerButtons.RStickUp; } - if (leftStick.Dx < 0) + if (LeftStick.DX < 0) { - result |= HidControllerButtons.LStickLeft; + Result |= HidControllerButtons.LStickLeft; } - if (leftStick.Dx > 0) + if (LeftStick.DX > 0) { - result |= HidControllerButtons.LStickRight; + Result |= HidControllerButtons.LStickRight; } - if (leftStick.Dy < 0) + if (LeftStick.DY < 0) { - result |= HidControllerButtons.LStickDown; + Result |= HidControllerButtons.LStickDown; } - if (leftStick.Dy > 0) + if (LeftStick.DY > 0) { - result |= HidControllerButtons.LStickUp; + Result |= HidControllerButtons.LStickUp; } - return result; + return Result; } - public void SetTouchPoints(params HidTouchPoint[] points) + public void SetTouchPoints(params HidTouchPoint[] Points) { - long touchScreenOffset = HidPosition + HidTouchScreenOffset; - long lastEntry = _device.Memory.ReadInt64(touchScreenOffset + 0x10); - long currEntry = (lastEntry + 1) % HidEntryCount; - long timestamp = GetTimestamp(); + long TouchScreenOffset = HidPosition + HidTouchScreenOffset; + long LastEntry = Device.Memory.ReadInt64(TouchScreenOffset + 0x10); + long CurrEntry = (LastEntry + 1) % HidEntryCount; + long Timestamp = GetTimestamp(); - _device.Memory.WriteInt64(touchScreenOffset + 0x00, timestamp); - _device.Memory.WriteInt64(touchScreenOffset + 0x08, HidEntryCount); - _device.Memory.WriteInt64(touchScreenOffset + 0x10, currEntry); - _device.Memory.WriteInt64(touchScreenOffset + 0x18, HidEntryCount - 1); - _device.Memory.WriteInt64(touchScreenOffset + 0x20, timestamp); + Device.Memory.WriteInt64(TouchScreenOffset + 0x00, Timestamp); + Device.Memory.WriteInt64(TouchScreenOffset + 0x08, HidEntryCount); + Device.Memory.WriteInt64(TouchScreenOffset + 0x10, CurrEntry); + Device.Memory.WriteInt64(TouchScreenOffset + 0x18, HidEntryCount - 1); + Device.Memory.WriteInt64(TouchScreenOffset + 0x20, Timestamp); - long touchEntryOffset = touchScreenOffset + HidTouchHeaderSize; - long lastEntryOffset = touchEntryOffset + lastEntry * HidTouchEntrySize; - long sampleCounter = _device.Memory.ReadInt64(lastEntryOffset) + 1; + long TouchEntryOffset = TouchScreenOffset + HidTouchHeaderSize; + long LastEntryOffset = TouchEntryOffset + LastEntry * HidTouchEntrySize; + long SampleCounter = Device.Memory.ReadInt64(LastEntryOffset) + 1; - touchEntryOffset += currEntry * HidTouchEntrySize; + TouchEntryOffset += CurrEntry * HidTouchEntrySize; - _device.Memory.WriteInt64(touchEntryOffset + 0x00, sampleCounter); - _device.Memory.WriteInt64(touchEntryOffset + 0x08, points.Length); + Device.Memory.WriteInt64(TouchEntryOffset + 0x00, SampleCounter); + Device.Memory.WriteInt64(TouchEntryOffset + 0x08, Points.Length); - touchEntryOffset += HidTouchEntryHeaderSize; + TouchEntryOffset += HidTouchEntryHeaderSize; - const int padding = 0; + const int Padding = 0; - int index = 0; + int Index = 0; - foreach (HidTouchPoint point in points) + foreach (HidTouchPoint Point in Points) { - _device.Memory.WriteInt64(touchEntryOffset + 0x00, sampleCounter); - _device.Memory.WriteInt32(touchEntryOffset + 0x08, padding); - _device.Memory.WriteInt32(touchEntryOffset + 0x0c, index++); - _device.Memory.WriteInt32(touchEntryOffset + 0x10, point.X); - _device.Memory.WriteInt32(touchEntryOffset + 0x14, point.Y); - _device.Memory.WriteInt32(touchEntryOffset + 0x18, point.DiameterX); - _device.Memory.WriteInt32(touchEntryOffset + 0x1c, point.DiameterY); - _device.Memory.WriteInt32(touchEntryOffset + 0x20, point.Angle); - _device.Memory.WriteInt32(touchEntryOffset + 0x24, padding); - - touchEntryOffset += HidTouchEntryTouchSize; + Device.Memory.WriteInt64(TouchEntryOffset + 0x00, SampleCounter); + Device.Memory.WriteInt32(TouchEntryOffset + 0x08, Padding); + Device.Memory.WriteInt32(TouchEntryOffset + 0x0c, Index++); + Device.Memory.WriteInt32(TouchEntryOffset + 0x10, Point.X); + Device.Memory.WriteInt32(TouchEntryOffset + 0x14, Point.Y); + Device.Memory.WriteInt32(TouchEntryOffset + 0x18, Point.DiameterX); + Device.Memory.WriteInt32(TouchEntryOffset + 0x1c, Point.DiameterY); + Device.Memory.WriteInt32(TouchEntryOffset + 0x20, Point.Angle); + Device.Memory.WriteInt32(TouchEntryOffset + 0x24, Padding); + + TouchEntryOffset += HidTouchEntryTouchSize; } } diff --git a/Ryujinx.HLE/Input/HidBaseController.cs b/Ryujinx.HLE/Input/HidBaseController.cs index 8b29d891..9b9bb7ea 100644 --- a/Ryujinx.HLE/Input/HidBaseController.cs +++ b/Ryujinx.HLE/Input/HidBaseController.cs @@ -11,18 +11,18 @@ namespace Ryujinx.HLE.Input public long Offset { get; private set; } public bool Connected { get; protected set; } - public HidControllerBase(HidControllerType controllerType, Switch device) + public HidControllerBase(HidControllerType ControllerType, Switch Device) { - Device = device; + this.Device = Device; - HidControllerType = controllerType; + HidControllerType = ControllerType; } - public virtual void Connect(HidControllerId controllerId) + public virtual void Connect(HidControllerId ControllerId) { - ControllerId = controllerId; + this.ControllerId = ControllerId; - Offset = Device.Hid.HidPosition + HidControllersOffset + (int)controllerId * HidControllerSize; + Offset = Device.Hid.HidPosition + HidControllersOffset + (int)ControllerId * HidControllerSize; Device.Memory.FillWithZeros(Offset, 0x5000); @@ -30,47 +30,47 @@ namespace Ryujinx.HLE.Input } public abstract void SendInput( - HidControllerButtons buttons, - HidJoystickPosition leftStick, - HidJoystickPosition rightStick); + HidControllerButtons Buttons, + HidJoystickPosition LeftStick, + HidJoystickPosition RightStick); protected long WriteInput( - HidControllerButtons buttons, - HidJoystickPosition leftStick, - HidJoystickPosition rightStick, - HidControllerLayouts controllerLayout) + HidControllerButtons Buttons, + HidJoystickPosition LeftStick, + HidJoystickPosition RightStick, + HidControllerLayouts ControllerLayout) { - long controllerOffset = Offset + HidControllerHeaderSize; + long ControllerOffset = Offset + HidControllerHeaderSize; - controllerOffset += (int)controllerLayout * HidControllerLayoutsSize; + ControllerOffset += (int)ControllerLayout * HidControllerLayoutsSize; - long lastEntry = Device.Memory.ReadInt64(controllerOffset + 0x10); - long currEntry = (lastEntry + 1) % HidEntryCount; - long timestamp = GetTimestamp(); + long LastEntry = Device.Memory.ReadInt64(ControllerOffset + 0x10); + long CurrEntry = (LastEntry + 1) % HidEntryCount; + long Timestamp = GetTimestamp(); - Device.Memory.WriteInt64(controllerOffset + 0x00, timestamp); - Device.Memory.WriteInt64(controllerOffset + 0x08, HidEntryCount); - Device.Memory.WriteInt64(controllerOffset + 0x10, currEntry); - Device.Memory.WriteInt64(controllerOffset + 0x18, HidEntryCount - 1); + Device.Memory.WriteInt64(ControllerOffset + 0x00, Timestamp); + Device.Memory.WriteInt64(ControllerOffset + 0x08, HidEntryCount); + Device.Memory.WriteInt64(ControllerOffset + 0x10, CurrEntry); + Device.Memory.WriteInt64(ControllerOffset + 0x18, HidEntryCount - 1); - controllerOffset += HidControllersLayoutHeaderSize; + ControllerOffset += HidControllersLayoutHeaderSize; - long lastEntryOffset = controllerOffset + lastEntry * HidControllersInputEntrySize; + long LastEntryOffset = ControllerOffset + LastEntry * HidControllersInputEntrySize; - controllerOffset += currEntry * HidControllersInputEntrySize; + ControllerOffset += CurrEntry * HidControllersInputEntrySize; - long sampleCounter = Device.Memory.ReadInt64(lastEntryOffset) + 1; + long SampleCounter = Device.Memory.ReadInt64(LastEntryOffset) + 1; - Device.Memory.WriteInt64(controllerOffset + 0x00, sampleCounter); - Device.Memory.WriteInt64(controllerOffset + 0x08, sampleCounter); - Device.Memory.WriteInt64(controllerOffset + 0x10, (uint)buttons); + Device.Memory.WriteInt64(ControllerOffset + 0x00, SampleCounter); + Device.Memory.WriteInt64(ControllerOffset + 0x08, SampleCounter); + Device.Memory.WriteInt64(ControllerOffset + 0x10, (uint)Buttons); - Device.Memory.WriteInt32(controllerOffset + 0x18, leftStick.Dx); - Device.Memory.WriteInt32(controllerOffset + 0x1c, leftStick.Dy); - Device.Memory.WriteInt32(controllerOffset + 0x20, rightStick.Dx); - Device.Memory.WriteInt32(controllerOffset + 0x24, rightStick.Dy); + Device.Memory.WriteInt32(ControllerOffset + 0x18, LeftStick.DX); + Device.Memory.WriteInt32(ControllerOffset + 0x1c, LeftStick.DY); + Device.Memory.WriteInt32(ControllerOffset + 0x20, RightStick.DX); + Device.Memory.WriteInt32(ControllerOffset + 0x24, RightStick.DY); - return controllerOffset; + return ControllerOffset; } } } diff --git a/Ryujinx.HLE/Input/HidControllerColorDesc.cs b/Ryujinx.HLE/Input/HidControllerColorDesc.cs index 85ece5f1..b8cf2a5e 100644 --- a/Ryujinx.HLE/Input/HidControllerColorDesc.cs +++ b/Ryujinx.HLE/Input/HidControllerColorDesc.cs @@ -5,6 +5,6 @@ namespace Ryujinx.HLE.Input [Flags] public enum HidControllerColorDesc { - ColorDescColorsNonexistent = (1 << 1) + ColorDesc_ColorsNonexistent = (1 << 1) } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Input/HidControllerConnState.cs b/Ryujinx.HLE/Input/HidControllerConnState.cs index ef41cbb8..1fc9482a 100644 --- a/Ryujinx.HLE/Input/HidControllerConnState.cs +++ b/Ryujinx.HLE/Input/HidControllerConnState.cs @@ -5,7 +5,7 @@ namespace Ryujinx.HLE.Input [Flags] public enum HidControllerConnState { - ControllerStateConnected = (1 << 0), - ControllerStateWired = (1 << 1) + Controller_State_Connected = (1 << 0), + Controller_State_Wired = (1 << 1) } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Input/HidControllerId.cs b/Ryujinx.HLE/Input/HidControllerId.cs index 60faf822..e4a0e26c 100644 --- a/Ryujinx.HLE/Input/HidControllerId.cs +++ b/Ryujinx.HLE/Input/HidControllerId.cs @@ -2,15 +2,15 @@ namespace Ryujinx.HLE.Input { public enum HidControllerId { - ControllerPlayer1 = 0, - ControllerPlayer2 = 1, - ControllerPlayer3 = 2, - ControllerPlayer4 = 3, - ControllerPlayer5 = 4, - ControllerPlayer6 = 5, - ControllerPlayer7 = 6, - ControllerPlayer8 = 7, - ControllerHandheld = 8, - ControllerUnknown = 9 + CONTROLLER_PLAYER_1 = 0, + CONTROLLER_PLAYER_2 = 1, + CONTROLLER_PLAYER_3 = 2, + CONTROLLER_PLAYER_4 = 3, + CONTROLLER_PLAYER_5 = 4, + CONTROLLER_PLAYER_6 = 5, + CONTROLLER_PLAYER_7 = 6, + CONTROLLER_PLAYER_8 = 7, + CONTROLLER_HANDHELD = 8, + CONTROLLER_UNKNOWN = 9 } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Input/HidControllerLayouts.cs b/Ryujinx.HLE/Input/HidControllerLayouts.cs index 3548175f..39fdd3fe 100644 --- a/Ryujinx.HLE/Input/HidControllerLayouts.cs +++ b/Ryujinx.HLE/Input/HidControllerLayouts.cs @@ -2,12 +2,12 @@ namespace Ryujinx.HLE.Input { public enum HidControllerLayouts { - ProController = 0, - HandheldJoined = 1, - Joined = 2, - Left = 3, - Right = 4, - MainNoAnalog = 5, - Main = 6 + Pro_Controller = 0, + Handheld_Joined = 1, + Joined = 2, + Left = 3, + Right = 4, + Main_No_Analog = 5, + Main = 6 } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Input/HidJoystickPosition.cs b/Ryujinx.HLE/Input/HidJoystickPosition.cs index a1fe1608..a06ef7b2 100644 --- a/Ryujinx.HLE/Input/HidJoystickPosition.cs +++ b/Ryujinx.HLE/Input/HidJoystickPosition.cs @@ -2,7 +2,7 @@ namespace Ryujinx.HLE.Input { public struct HidJoystickPosition { - public int Dx; - public int Dy; + public int DX; + public int DY; } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Input/HidNpadController.cs b/Ryujinx.HLE/Input/HidNpadController.cs index 90cffbdd..7b3fa64c 100644 --- a/Ryujinx.HLE/Input/HidNpadController.cs +++ b/Ryujinx.HLE/Input/HidNpadController.cs @@ -2,85 +2,85 @@ { public class HidNpadController : HidControllerBase { - private (NpadColor Left, NpadColor Right) _npadBodyColors; - private (NpadColor Left, NpadColor Right) _npadButtonColors; + private (NpadColor Left, NpadColor Right) NpadBodyColors; + private (NpadColor Left, NpadColor Right) NpadButtonColors; - private HidControllerLayouts _currentLayout; + private HidControllerLayouts CurrentLayout; - private bool _isHalf; + private bool IsHalf; public HidNpadController( - HidControllerType controllerType, - Switch device, - (NpadColor, NpadColor) npadBodyColors, - (NpadColor, NpadColor) npadButtonColors) : base(controllerType, device) + HidControllerType ControllerType, + Switch Device, + (NpadColor, NpadColor) NpadBodyColors, + (NpadColor, NpadColor) NpadButtonColors) : base(ControllerType, Device) { - _npadBodyColors = npadBodyColors; - _npadButtonColors = npadButtonColors; + this.NpadBodyColors = NpadBodyColors; + this.NpadButtonColors = NpadButtonColors; - _currentLayout = HidControllerLayouts.HandheldJoined; + CurrentLayout = HidControllerLayouts.Handheld_Joined; - switch (controllerType) + switch (ControllerType) { case HidControllerType.NpadLeft: - _currentLayout = HidControllerLayouts.Left; + CurrentLayout = HidControllerLayouts.Left; break; case HidControllerType.NpadRight: - _currentLayout = HidControllerLayouts.Right; + CurrentLayout = HidControllerLayouts.Right; break; case HidControllerType.NpadPair: - _currentLayout = HidControllerLayouts.Joined; + CurrentLayout = HidControllerLayouts.Joined; break; } } - public override void Connect(HidControllerId controllerId) + public override void Connect(HidControllerId ControllerId) { if(HidControllerType != HidControllerType.NpadLeft && HidControllerType != HidControllerType.NpadRight) { - _isHalf = false; + IsHalf = false; } - base.Connect(_currentLayout == HidControllerLayouts.HandheldJoined ? HidControllerId.ControllerHandheld : controllerId); + base.Connect(CurrentLayout == HidControllerLayouts.Handheld_Joined ? HidControllerId.CONTROLLER_HANDHELD : ControllerId); - HidControllerColorDesc singleColorDesc = - HidControllerColorDesc.ColorDescColorsNonexistent; + HidControllerColorDesc SingleColorDesc = + HidControllerColorDesc.ColorDesc_ColorsNonexistent; - HidControllerColorDesc splitColorDesc = 0; + HidControllerColorDesc SplitColorDesc = 0; - NpadColor singleColorBody = NpadColor.Black; - NpadColor singleColorButtons = NpadColor.Black; + NpadColor SingleColorBody = NpadColor.Black; + NpadColor SingleColorButtons = NpadColor.Black; - Device.Memory.WriteInt32(Offset + 0x04, _isHalf ? 1 : 0); + Device.Memory.WriteInt32(Offset + 0x04, IsHalf ? 1 : 0); - if (_isHalf) + if (IsHalf) { - Device.Memory.WriteInt32(Offset + 0x08, (int)singleColorDesc); - Device.Memory.WriteInt32(Offset + 0x0c, (int)singleColorBody); - Device.Memory.WriteInt32(Offset + 0x10, (int)singleColorButtons); - Device.Memory.WriteInt32(Offset + 0x14, (int)splitColorDesc); + Device.Memory.WriteInt32(Offset + 0x08, (int)SingleColorDesc); + Device.Memory.WriteInt32(Offset + 0x0c, (int)SingleColorBody); + Device.Memory.WriteInt32(Offset + 0x10, (int)SingleColorButtons); + Device.Memory.WriteInt32(Offset + 0x14, (int)SplitColorDesc); } else { - Device.Memory.WriteInt32(Offset + 0x18, (int)_npadBodyColors.Left); - Device.Memory.WriteInt32(Offset + 0x1c, (int)_npadButtonColors.Left); - Device.Memory.WriteInt32(Offset + 0x20, (int)_npadBodyColors.Right); - Device.Memory.WriteInt32(Offset + 0x24, (int)_npadButtonColors.Right); + Device.Memory.WriteInt32(Offset + 0x18, (int)NpadBodyColors.Left); + Device.Memory.WriteInt32(Offset + 0x1c, (int)NpadButtonColors.Left); + Device.Memory.WriteInt32(Offset + 0x20, (int)NpadBodyColors.Right); + Device.Memory.WriteInt32(Offset + 0x24, (int)NpadButtonColors.Right); } Connected = true; } public override void SendInput - (HidControllerButtons buttons, - HidJoystickPosition leftStick, - HidJoystickPosition rightStick) + (HidControllerButtons Buttons, + HidJoystickPosition LeftStick, + HidJoystickPosition RightStick) { - long controllerOffset = WriteInput(buttons, leftStick, rightStick, _currentLayout); + long ControllerOffset = WriteInput(Buttons, LeftStick, RightStick, CurrentLayout); - Device.Memory.WriteInt64(controllerOffset + 0x28, - (Connected ? (uint)HidControllerConnState.ControllerStateConnected : 0) | - (_currentLayout == HidControllerLayouts.HandheldJoined ? (uint)HidControllerConnState.ControllerStateWired : 0)); + Device.Memory.WriteInt64(ControllerOffset + 0x28, + (Connected ? (uint)HidControllerConnState.Controller_State_Connected : 0) | + (CurrentLayout == HidControllerLayouts.Handheld_Joined ? (uint)HidControllerConnState.Controller_State_Wired : 0)); } } } diff --git a/Ryujinx.HLE/Input/HidProController.cs b/Ryujinx.HLE/Input/HidProController.cs index f08fb085..40c79fed 100644 --- a/Ryujinx.HLE/Input/HidProController.cs +++ b/Ryujinx.HLE/Input/HidProController.cs @@ -2,43 +2,43 @@ { public class HidProController : HidControllerBase { - bool _wired = false; + bool Wired = false; - public HidProController(Switch device) : base(HidControllerType.ProController, device) + public HidProController(Switch Device) : base(HidControllerType.ProController, Device) { - _wired = true; + Wired = true; } - public override void Connect(HidControllerId controllerId) + public override void Connect(HidControllerId ControllerId) { - base.Connect(controllerId); + base.Connect(ControllerId); - HidControllerColorDesc singleColorDesc = - HidControllerColorDesc.ColorDescColorsNonexistent; + HidControllerColorDesc SingleColorDesc = + HidControllerColorDesc.ColorDesc_ColorsNonexistent; - HidControllerColorDesc splitColorDesc = 0; + HidControllerColorDesc SplitColorDesc = 0; - NpadColor singleColorBody = NpadColor.Black; - NpadColor singleColorButtons = NpadColor.Black; + NpadColor SingleColorBody = NpadColor.Black; + NpadColor SingleColorButtons = NpadColor.Black; - Device.Memory.WriteInt32(Offset + 0x08, (int)singleColorDesc); - Device.Memory.WriteInt32(Offset + 0x0c, (int)singleColorBody); - Device.Memory.WriteInt32(Offset + 0x10, (int)singleColorButtons); - Device.Memory.WriteInt32(Offset + 0x14, (int)splitColorDesc); + Device.Memory.WriteInt32(Offset + 0x08, (int)SingleColorDesc); + Device.Memory.WriteInt32(Offset + 0x0c, (int)SingleColorBody); + Device.Memory.WriteInt32(Offset + 0x10, (int)SingleColorButtons); + Device.Memory.WriteInt32(Offset + 0x14, (int)SplitColorDesc); Connected = true; } public override void SendInput( - HidControllerButtons buttons, - HidJoystickPosition leftStick, - HidJoystickPosition rightStick) + HidControllerButtons Buttons, + HidJoystickPosition LeftStick, + HidJoystickPosition RightStick) { - long controllerOffset = WriteInput(buttons, leftStick, rightStick, HidControllerLayouts.ProController); + long ControllerOffset = WriteInput(Buttons, LeftStick, RightStick, HidControllerLayouts.Pro_Controller); - Device.Memory.WriteInt64(controllerOffset + 0x28, - (Connected ? (uint)HidControllerConnState.ControllerStateConnected : 0) | - (_wired ? (uint)HidControllerConnState.ControllerStateWired : 0)); + Device.Memory.WriteInt64(ControllerOffset + 0x28, + (Connected ? (uint)HidControllerConnState.Controller_State_Connected : 0) | + (Wired ? (uint)HidControllerConnState.Controller_State_Wired : 0)); } } } diff --git a/Ryujinx.HLE/Input/HidValues.cs b/Ryujinx.HLE/Input/HidValues.cs index ae02bb42..62bf0707 100644 --- a/Ryujinx.HLE/Input/HidValues.cs +++ b/Ryujinx.HLE/Input/HidValues.cs @@ -1,4 +1,8 @@ -namespace Ryujinx.HLE.Input +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ryujinx.HLE.Input { public partial class Hid { diff --git a/Ryujinx.HLE/Input/IHidDevice.cs b/Ryujinx.HLE/Input/IHidDevice.cs index 0b07e767..cc67b01a 100644 --- a/Ryujinx.HLE/Input/IHidDevice.cs +++ b/Ryujinx.HLE/Input/IHidDevice.cs @@ -1,4 +1,8 @@ -namespace Ryujinx.HLE.Input +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ryujinx.HLE.Input { interface IHidDevice { diff --git a/Ryujinx.HLE/Input/NpadColor.cs b/Ryujinx.HLE/Input/NpadColor.cs index b15c45d8..b152b789 100644 --- a/Ryujinx.HLE/Input/NpadColor.cs +++ b/Ryujinx.HLE/Input/NpadColor.cs @@ -4,20 +4,20 @@ namespace Ryujinx.HLE.Input { Black = 0, - BodyGrey = 0x828282, - BodyNeonBlue = 0x0AB9E6, - BodyNeonRed = 0xFF3C28, - BodyNeonYellow = 0xE6FF00, - BodyNeonPink = 0xFF3278, - BodyNeonGreen = 0x1EDC00, - BodyRed = 0xE10F00, + Body_Grey = 0x828282, + Body_Neon_Blue = 0x0AB9E6, + Body_Neon_Red = 0xFF3C28, + Body_Neon_Yellow = 0xE6FF00, + Body_Neon_Pink = 0xFF3278, + Body_Neon_Green = 0x1EDC00, + Body_Red = 0xE10F00, - ButtonsGrey = 0x0F0F0F, - ButtonsNeonBlue = 0x001E1E, - ButtonsNeonRed = 0x1E0A0A, - ButtonsNeonYellow = 0x142800, - ButtonsNeonPink = 0x28001E, - ButtonsNeonGreen = 0x002800, - ButtonsRed = 0x280A0A + Buttons_Grey = 0x0F0F0F, + Buttons_Neon_Blue = 0x001E1E, + Buttons_Neon_Red = 0x1E0A0A, + Buttons_Neon_Yellow = 0x142800, + Buttons_Neon_Pink = 0x28001E, + Buttons_Neon_Green = 0x002800, + Buttons_Red = 0x280A0A } }
\ No newline at end of file |
