From baf85f3b938d1d8d40f5bd1684aa60c093c07dab Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 13 Mar 2024 15:32:02 +0000 Subject: [PATCH] More progress --- .../HOS/Services/Hid/HidDevices/BaseDevice.cs | 14 -- .../HOS/Services/Hid/IHidServer.cs | 11 +- src/Ryujinx.HLE/Switch.cs | 1 + src/Ryujinx.Horizon/Hid/HidServer.cs | 7 + .../Sdk}/Hid/Hid.cs | 26 ++- .../Sdk/Hid/HidDevices/BaseDevice.cs | 12 ++ .../Sdk}/Hid/HidDevices/DebugPadDevice.cs | 4 +- .../Sdk}/Hid/HidDevices/KeyboardDevice.cs | 5 +- .../Sdk}/Hid/HidDevices/MouseDevice.cs | 4 +- .../Sdk}/Hid/HidDevices/NpadDevices.cs | 16 +- .../Sdk}/Hid/HidDevices/TouchDevice.cs | 5 +- src/Ryujinx.Horizon/Sdk/Hid/IHidServer.cs | 150 ++++++++++++++++++ .../Sdk/Hid/KeyboardLockKeyEvent.cs | 18 +++ .../Sdk/Hid/{ => Npad}/NpadJoyHoldType.cs | 2 +- .../PalmaApplicationSectionAccessBuffer.cs | 10 ++ .../Sdk/Hid/PalmaConnectionHandle.cs | 10 ++ src/Ryujinx.Horizon/Sdk/Hid/PalmaFeature.cs | 13 ++ src/Ryujinx.Horizon/Sdk/Hid/PalmaWaveSet.cs | 9 ++ .../SharedMemory/Common/AnalogStickState.cs | 2 +- .../Hid/SharedMemory/Common/AtomicStorage.cs | 2 +- .../SharedMemory/Common/ISampledDataStruct.cs | 4 +- .../Sdk/Hid/SharedMemory/Common/RingLifo.cs | 2 +- .../DebugPad/DebugPadAttribute.cs | 2 +- .../SharedMemory/DebugPad/DebugPadButton.cs | 2 +- .../SharedMemory/DebugPad/DebugPadState.cs | 3 +- .../Hid/SharedMemory/Keyboard/KeyboardKey.cs | 2 +- .../SharedMemory/Keyboard/KeyboardKeyShift.cs | 2 +- .../SharedMemory/Keyboard/KeyboardModifier.cs | 2 +- .../SharedMemory/Keyboard/KeyboardState.cs | 3 +- .../Hid/SharedMemory/Mouse/MouseAttribute.cs | 2 +- .../Sdk/Hid/SharedMemory/Mouse/MouseButton.cs | 2 +- .../Sdk/Hid/SharedMemory/Mouse/MouseState.cs | 3 +- .../Sdk/Hid/SharedMemory/Npad/DeviceType.cs | 2 +- .../Hid/SharedMemory/Npad/NpadAttribute.cs | 2 +- .../Hid/SharedMemory/Npad/NpadBatteryLevel.cs | 2 +- .../Sdk/Hid/SharedMemory/Npad/NpadButton.cs | 2 +- .../SharedMemory/Npad/NpadColorAttribute.cs | 2 +- .../Hid/SharedMemory/Npad/NpadCommonState.cs | 3 +- .../Npad/NpadFullKeyColorState.cs | 2 +- .../SharedMemory/Npad/NpadGcTriggerState.cs | 3 +- .../SharedMemory/Npad/NpadInternalState.cs | 3 +- .../Npad/NpadJoyAssignmentMode.cs | 2 +- .../SharedMemory/Npad/NpadJoyColorState.cs | 2 +- .../Sdk/Hid/SharedMemory/Npad/NpadLarkType.cs | 2 +- .../Hid/SharedMemory/Npad/NpadLuciaType.cs | 2 +- .../Sdk/Hid/SharedMemory/Npad/NpadState.cs | 2 +- .../Sdk/Hid/SharedMemory/Npad/NpadStyleTag.cs | 2 +- .../Npad/NpadSystemButtonProperties.cs | 2 +- .../SharedMemory/Npad/NpadSystemProperties.cs | 2 +- .../Npad/SixAxisSensorAttribute.cs | 2 +- .../SharedMemory/Npad/SixAxisSensorState.cs | 3 +- .../Sdk/Hid/SharedMemory/SharedMemory.cs | 8 +- .../TouchScreen/TouchAttribute.cs | 2 +- .../TouchScreen/TouchScreenState.cs | 3 +- .../SharedMemory/TouchScreen/TouchState.cs | 2 +- .../Hid/SixAxis/ConsoleSixAxisSensorHandle.cs | 12 ++ .../Sdk/Hid/{ => SixAxis}/SixAxisInput.cs | 2 +- .../SixAxisSensorCalibrationParameter.cs | 10 ++ .../Sdk/Hid/SixAxis/SixAxisSensorHandle.cs | 13 ++ .../Hid/SixAxis/SixAxisSensorIcInformation.cs | 10 ++ src/Ryujinx.Horizon/Sdk/Hid/TouchPoint.cs | 2 - .../Sdk/Hid/TouchScreenConfigurationForNx.cs | 10 ++ .../Sdk/Hid/TouchScreenModeForNx.cs | 9 ++ .../Vibration/VibrationDeviceInfoForIpc.cs | 11 ++ .../Hid/Vibration/VibrationDevicePosition.cs | 8 +- .../Sdk/Hid/Vibration/VibrationDeviceType.cs | 9 +- .../Sdk/Hid/Vibration/VibrationDeviceValue.cs | 2 +- .../Hid/Vibration/VibrationGcErmCommand.cs | 12 ++ src/Ryujinx.Input/HLE/NpadController.cs | 1 + src/Ryujinx.Input/HLE/NpadManager.cs | 2 + 70 files changed, 403 insertions(+), 117 deletions(-) delete mode 100644 src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/BaseDevice.cs create mode 100644 src/Ryujinx.Horizon/Hid/HidServer.cs rename src/{Ryujinx.HLE/HOS/Services => Ryujinx.Horizon/Sdk}/Hid/Hid.cs (82%) create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/HidDevices/BaseDevice.cs rename src/{Ryujinx.HLE/HOS/Services => Ryujinx.Horizon/Sdk}/Hid/HidDevices/DebugPadDevice.cs (82%) rename src/{Ryujinx.HLE/HOS/Services => Ryujinx.Horizon/Sdk}/Hid/HidDevices/KeyboardDevice.cs (82%) rename src/{Ryujinx.HLE/HOS/Services => Ryujinx.Horizon/Sdk}/Hid/HidDevices/MouseDevice.cs (89%) rename src/{Ryujinx.HLE/HOS/Services => Ryujinx.Horizon/Sdk}/Hid/HidDevices/NpadDevices.cs (98%) rename src/{Ryujinx.HLE/HOS/Services => Ryujinx.Horizon/Sdk}/Hid/HidDevices/TouchDevice.cs (89%) create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/IHidServer.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/KeyboardLockKeyEvent.cs rename src/Ryujinx.Horizon/Sdk/Hid/{ => Npad}/NpadJoyHoldType.cs (66%) create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/PalmaApplicationSectionAccessBuffer.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/PalmaConnectionHandle.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/PalmaFeature.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/PalmaWaveSet.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/SixAxis/ConsoleSixAxisSensorHandle.cs rename src/Ryujinx.Horizon/Sdk/Hid/{ => SixAxis}/SixAxisInput.cs (87%) create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorCalibrationParameter.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorHandle.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorIcInformation.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/TouchScreenConfigurationForNx.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/TouchScreenModeForNx.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceInfoForIpc.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationGcErmCommand.cs diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/BaseDevice.cs b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/BaseDevice.cs deleted file mode 100644 index a6c21fdaf..000000000 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/BaseDevice.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Ryujinx.HLE.HOS.Services.Hid -{ - public abstract class BaseDevice - { - protected readonly Switch _device; - public bool Active; - - public BaseDevice(Switch device, bool active) - { - _device = device; - Active = active; - } - } -} diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index 2313af570..5834e0fee 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -5,6 +5,7 @@ using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Services.Hid.HidServer; using Ryujinx.Horizon.Common; using Ryujinx.Horizon.Sdk.Hid; +using Ryujinx.Horizon.Sdk.Hid.HidDevices; using Ryujinx.Horizon.Sdk.Hid.Npad; using Ryujinx.Horizon.Sdk.Hid.SixAxis; using Ryujinx.Horizon.Sdk.Hid.Vibration; @@ -83,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // Initialize entries to avoid issues with some games. - for (int entry = 0; entry < Hid.SharedMemEntryCount; entry++) + for (int entry = 0; entry < Ryujinx.Horizon.Sdk.Hid.Hid.SharedMemEntryCount; entry++) { context.Device.Hid.DebugPad.Update(); } @@ -103,7 +104,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // Initialize entries to avoid issues with some games. - for (int entry = 0; entry < Hid.SharedMemEntryCount; entry++) + for (int entry = 0; entry < Ryujinx.Horizon.Sdk.Hid.Hid.SharedMemEntryCount; entry++) { context.Device.Hid.Touchscreen.Update(); } @@ -123,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // Initialize entries to avoid issues with some games. - for (int entry = 0; entry < Hid.SharedMemEntryCount; entry++) + for (int entry = 0; entry < Ryujinx.Horizon.Sdk.Hid.Hid.SharedMemEntryCount; entry++) { context.Device.Hid.Mouse.Update(0, 0); } @@ -148,7 +149,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid Keys = new ulong[4], }; - for (int entry = 0; entry < Hid.SharedMemEntryCount; entry++) + for (int entry = 0; entry < Ryujinx.Horizon.Sdk.Hid.Hid.SharedMemEntryCount; entry++) { context.Device.Hid.Keyboard.Update(emptyInput); } @@ -859,7 +860,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid emptySixAxisInputs.Add(sixaxisInput); } - for (int entry = 0; entry < Hid.SharedMemEntryCount; entry++) + for (int entry = 0; entry < Ryujinx.Horizon.Sdk.Hid.Hid.SharedMemEntryCount; entry++) { context.Device.Hid.Npads.Update(emptyGamepadInputs); context.Device.Hid.Npads.UpdateSixAxis(emptySixAxisInputs); diff --git a/src/Ryujinx.HLE/Switch.cs b/src/Ryujinx.HLE/Switch.cs index 9dfc69892..7cbfed039 100644 --- a/src/Ryujinx.HLE/Switch.cs +++ b/src/Ryujinx.HLE/Switch.cs @@ -8,6 +8,7 @@ using Ryujinx.HLE.HOS.Services.Apm; using Ryujinx.HLE.HOS.Services.Hid; using Ryujinx.HLE.Loaders.Processes; using Ryujinx.HLE.UI; +using Ryujinx.Horizon.Sdk.Hid; using Ryujinx.Memory; using System; diff --git a/src/Ryujinx.Horizon/Hid/HidServer.cs b/src/Ryujinx.Horizon/Hid/HidServer.cs new file mode 100644 index 000000000..45ed4b265 --- /dev/null +++ b/src/Ryujinx.Horizon/Hid/HidServer.cs @@ -0,0 +1,7 @@ +namespace Ryujinx.Horizon.Hid +{ + class HidServer : IHidServer + { + + } +} diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/Hid.cs b/src/Ryujinx.Horizon/Sdk/Hid/Hid.cs similarity index 82% rename from src/Ryujinx.HLE/HOS/Services/Hid/Hid.cs rename to src/Ryujinx.Horizon/Sdk/Hid/Hid.cs index ff408f205..59d122a90 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/Hid.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/Hid.cs @@ -1,21 +1,18 @@ using Ryujinx.Common; using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Memory; -using Ryujinx.HLE.Exceptions; -using Ryujinx.HLE.HOS.Kernel.Memory; -using Ryujinx.Horizon.Sdk.Hid; +using Ryujinx.Horizon.Sdk.Hid.HidDevices; using Ryujinx.Horizon.Sdk.Hid.Npad; using System.Collections.Generic; using System.Runtime.CompilerServices; using ControllerType = Ryujinx.Horizon.Sdk.Hid.Npad.ControllerType; using PlayerIndex = Ryujinx.Horizon.Sdk.Hid.Npad.PlayerIndex; -namespace Ryujinx.HLE.HOS.Services.Hid +namespace Ryujinx.Horizon.Sdk.Hid { public class Hid { - private readonly Switch _device; - + internal const int HidSize = 0x40000; private readonly SharedMemoryStorage _storage; internal ref SharedMemory SharedMemory => ref _storage.GetRef(0); @@ -43,12 +40,11 @@ namespace Ryujinx.HLE.HOS.Services.Hid CheckTypeSizeOrThrow>(0x350); CheckTypeSizeOrThrow>(0x3D8); CheckTypeSizeOrThrow>(0x32000); - CheckTypeSizeOrThrow(Horizon.HidSize); + CheckTypeSizeOrThrow(HidSize); } - internal Hid(in Switch device, SharedMemoryStorage storage) + internal Hid(SharedMemoryStorage storage) { - _device = device; _storage = storage; SharedMemory = SharedMemory.Create(); @@ -58,11 +54,11 @@ namespace Ryujinx.HLE.HOS.Services.Hid private void InitDevices() { - DebugPad = new DebugPadDevice(_device, true); - Touchscreen = new TouchDevice(_device, true); - Mouse = new MouseDevice(_device, false); - Keyboard = new KeyboardDevice(_device, false); - Npads = new NpadDevices(_device, true); + DebugPad = new DebugPadDevice(true); + Touchscreen = new TouchDevice(true); + Mouse = new MouseDevice(false); + Keyboard = new KeyboardDevice(false); + Npads = new NpadDevices(true); } public void RefreshInputConfig(List inputConfig) @@ -75,7 +71,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid npadConfig[i].Type = (ControllerType)inputConfig[i].ControllerType; } - _device.Hid.Npads.Configure(npadConfig); + Npads.Configure(npadConfig); } public ControllerKeys UpdateStickButtons(JoystickPosition leftStick, JoystickPosition rightStick) diff --git a/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/BaseDevice.cs b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/BaseDevice.cs new file mode 100644 index 000000000..11ff18a04 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/BaseDevice.cs @@ -0,0 +1,12 @@ +namespace Ryujinx.Horizon.Sdk.Hid.HidDevices +{ + public abstract class BaseDevice + { + public bool Active; + + public BaseDevice(bool active) + { + Active = active; + } + } +} diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/DebugPadDevice.cs similarity index 82% rename from src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs rename to src/Ryujinx.Horizon/Sdk/Hid/HidDevices/DebugPadDevice.cs index a01763183..04ea1b37b 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/DebugPadDevice.cs @@ -1,8 +1,8 @@ -namespace Ryujinx.HLE.HOS.Services.Hid +namespace Ryujinx.Horizon.Sdk.Hid.HidDevices { public class DebugPadDevice : BaseDevice { - public DebugPadDevice(Switch device, bool active) : base(device, active) { } + public DebugPadDevice(bool active) : base(active) { } public void Update() { diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/KeyboardDevice.cs similarity index 82% rename from src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs rename to src/Ryujinx.Horizon/Sdk/Hid/HidDevices/KeyboardDevice.cs index 800729a3f..60c8125ef 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/KeyboardDevice.cs @@ -1,11 +1,10 @@ -using Ryujinx.Horizon.Sdk.Hid; using System; -namespace Ryujinx.HLE.HOS.Services.Hid +namespace Ryujinx.Horizon.Sdk.Hid.HidDevices { public class KeyboardDevice : BaseDevice { - public KeyboardDevice(Switch device, bool active) : base(device, active) { } + public KeyboardDevice(bool active) : base(active) { } public void Update(KeyboardInput keyState) { diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/MouseDevice.cs b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/MouseDevice.cs similarity index 89% rename from src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/MouseDevice.cs rename to src/Ryujinx.Horizon/Sdk/Hid/HidDevices/MouseDevice.cs index 7c7ae1d29..71b798cfa 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/MouseDevice.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/MouseDevice.cs @@ -1,8 +1,8 @@ -namespace Ryujinx.HLE.HOS.Services.Hid +namespace Ryujinx.Horizon.Sdk.Hid.HidDevices { public class MouseDevice : BaseDevice { - public MouseDevice(Switch device, bool active) : base(device, active) { } + public MouseDevice(bool active) : base(active) { } public void Update(int mouseX, int mouseY, uint buttons = 0, int scrollX = 0, int scrollY = 0, bool connected = false) { diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/NpadDevices.cs similarity index 98% rename from src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs rename to src/Ryujinx.Horizon/Sdk/Hid/HidDevices/NpadDevices.cs index f711fbde2..c1c969264 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/NpadDevices.cs @@ -1,15 +1,15 @@ using Ryujinx.Common; using Ryujinx.Common.Logging; -using Ryujinx.HLE.HOS.Kernel.Threading; -using Ryujinx.Horizon.Sdk.Hid; using Ryujinx.Horizon.Sdk.Hid.Npad; +using Ryujinx.Horizon.Sdk.Hid.SixAxis; using Ryujinx.Horizon.Sdk.Hid.Vibration; +using Ryujinx.Horizon.Sdk.OsTypes; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Runtime.CompilerServices; -namespace Ryujinx.HLE.HOS.Services.Hid +namespace Ryujinx.Horizon.Sdk.Hid.HidDevices { public class NpadDevices : BaseDevice { @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid public const int MaxControllers = 9; // Players 1-8 and Handheld private ControllerType[] _configuredTypes; - private readonly KEvent[] _styleSetUpdateEvents; + private readonly Event[] _styleSetUpdateEvents; private readonly bool[] _supportedPlayers; private VibrationValue _neutralVibrationValue = new() { @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid public Dictionary> RumbleQueues = new(); public Dictionary LastVibrationValues = new(); - public NpadDevices(Switch device, bool active = true) : base(device, active) + public NpadDevices(bool active = true) : base(active) { _configuredTypes = new ControllerType[MaxControllers]; @@ -47,10 +47,10 @@ namespace Ryujinx.HLE.HOS.Services.Hid _supportedPlayers = new bool[MaxControllers]; _supportedPlayers.AsSpan().Fill(true); - _styleSetUpdateEvents = new KEvent[MaxControllers]; + _styleSetUpdateEvents = new Event[MaxControllers]; for (int i = 0; i < _styleSetUpdateEvents.Length; ++i) { - _styleSetUpdateEvents[i] = new KEvent(_device.System.KernelContext); + _styleSetUpdateEvents[i] = new Event(_device.System.KernelContext); } _activeCount = 0; @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid JoyHold = NpadJoyHoldType.Vertical; } - internal ref KEvent GetStyleSetUpdateEvent(PlayerIndex player) + internal ref Event GetStyleSetUpdateEvent(PlayerIndex player) { return ref _styleSetUpdateEvents[(int)player]; } diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/TouchDevice.cs b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/TouchDevice.cs similarity index 89% rename from src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/TouchDevice.cs rename to src/Ryujinx.Horizon/Sdk/Hid/HidDevices/TouchDevice.cs index ae3a3cf5c..237d5c69d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/TouchDevice.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/HidDevices/TouchDevice.cs @@ -1,11 +1,10 @@ -using Ryujinx.Horizon.Sdk.Hid; using System; -namespace Ryujinx.HLE.HOS.Services.Hid +namespace Ryujinx.Horizon.Sdk.Hid.HidDevices { public class TouchDevice : BaseDevice { - public TouchDevice(Switch device, bool active) : base(device, active) { } + public TouchDevice(bool active) : base(active) { } public void Update(params TouchPoint[] points) { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/IHidServer.cs b/src/Ryujinx.Horizon/Sdk/Hid/IHidServer.cs new file mode 100644 index 000000000..a0fd3f121 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/IHidServer.cs @@ -0,0 +1,150 @@ +using Ryujinx.Horizon.Common; +using Ryujinx.Horizon.Sdk.Applet; +using Ryujinx.Horizon.Sdk.Hid.SixAxis; +using Ryujinx.Horizon.Sdk.Hid.Vibration; +using Ryujinx.Horizon.Sdk.Sf; +using System; + +namespace Ryujinx.Horizon.Sdk.Hid +{ + interface IHidServer : IServiceObject + { + Result CreateAppletResource(out IAppletResource arg0, AppletResourceUserId appletResourceUserId, ulong pid); + Result ActivateDebugPad(AppletResourceUserId appletResourceUserId, ulong pid); + Result ActivateTouchScreen(AppletResourceUserId appletResourceUserId, ulong pid); + Result ActivateMouse(AppletResourceUserId appletResourceUserId, ulong pid); + Result ActivateKeyboard(AppletResourceUserId appletResourceUserId, ulong pid); + Result SendKeyboardLockKeyEvent(AppletResourceUserId appletResourceUserId, KeyboardLockKeyEvent keyboardLockKeyEvent, ulong pid); + Result AcquireXpadIdEventHandle(out int arg0, ulong arg1); + Result ReleaseXpadIdEventHandle(ulong arg0); + Result ActivateXpad(AppletResourceUserId appletResourceUserId, BasicXpadId arg1, ulong pid); + Result GetXpadIds(out long arg0, Span arg1); + Result ActivateJoyXpad(JoyXpadId arg0); + Result GetJoyXpadLifoHandle(out int arg0, JoyXpadId arg1); + Result GetJoyXpadIds(out long arg0, Span arg1); + Result ActivateSixAxisSensor(BasicXpadId arg0); + Result DeactivateSixAxisSensor(BasicXpadId arg0); + Result GetSixAxisSensorLifoHandle(out int arg0, BasicXpadId arg1); + Result ActivateJoySixAxisSensor(JoyXpadId arg0); + Result DeactivateJoySixAxisSensor(JoyXpadId arg0); + Result GetJoySixAxisSensorLifoHandle(out int arg0, JoyXpadId arg1); + Result StartSixAxisSensor(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result StopSixAxisSensor(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result IsSixAxisSensorFusionEnabled(out bool arg0, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result EnableSixAxisSensorFusion(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, bool arg2, ulong pid); + Result SetSixAxisSensorFusionParameters(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, float arg2, float arg3, ulong pid); + Result GetSixAxisSensorFusionParameters(out float arg0, out float arg1, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result ResetSixAxisSensorFusionParameters(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result SetAccelerometerParameters(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, float arg2, float arg3, ulong pid); + Result GetAccelerometerParameters(out float arg0, out float arg1, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result ResetAccelerometerParameters(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result SetAccelerometerPlayMode(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, uint arg2, ulong pid); + Result GetAccelerometerPlayMode(out uint arg0, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result ResetAccelerometerPlayMode(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result SetGyroscopeZeroDriftMode(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, uint arg2, ulong pid); + Result GetGyroscopeZeroDriftMode(out uint arg0, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result ResetGyroscopeZeroDriftMode(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result IsSixAxisSensorAtRest(out bool arg0, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result IsFirmwareUpdateAvailableForSixAxisSensor(out bool arg0, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result EnableSixAxisSensorUnalteredPassthrough(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, bool arg2, ulong pid); + Result IsSixAxisSensorUnalteredPassthroughEnabled(out bool arg0, AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result StoreSixAxisSensorCalibrationParameter(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, in SixAxisSensorCalibrationParameter sixAxisSensorCalibrationParameter, ulong pid); + Result LoadSixAxisSensorCalibrationParameter(AppletResourceUserId appletResourceUserId, out SixAxisSensorCalibrationParameter sixAxisSensorCalibrationParameter, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result GetSixAxisSensorIcInformation(AppletResourceUserId appletResourceUserId, out SixAxisSensorIcInformation sixAxisSensorIcInformation, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result ResetIsSixAxisSensorDeviceNewlyAssigned(AppletResourceUserId appletResourceUserId, SixAxisSensorHandle sixAxisSensorHandle, ulong pid); + Result ActivateGesture(AppletResourceUserId appletResourceUserId, int arg1, ulong pid); + Result SetSupportedNpadStyleSet(AppletResourceUserId appletResourceUserId, NpadStyleTag arg1, ulong pid); + Result GetSupportedNpadStyleSet(AppletResourceUserId appletResourceUserId, out NpadStyleTag arg1, ulong pid); + Result SetSupportedNpadIdType(AppletResourceUserId appletResourceUserId, ReadOnlySpan arg1, ulong pid); + Result ActivateNpad(AppletResourceUserId appletResourceUserId, ulong pid); + Result DeactivateNpad(AppletResourceUserId appletResourceUserId, ulong pid); + Result AcquireNpadStyleSetUpdateEventHandle(AppletResourceUserId appletResourceUserId, out int arg1, uint arg2, ulong arg3, ulong pid); + Result DisconnectNpad(AppletResourceUserId appletResourceUserId, uint arg1, ulong pid); + Result GetPlayerLedPattern(out ulong arg0, uint arg1); + Result ActivateNpadWithRevision(AppletResourceUserId appletResourceUserId, int arg1, ulong pid); + Result SetNpadJoyHoldType(AppletResourceUserId appletResourceUserId, long arg1, ulong pid); + Result GetNpadJoyHoldType(AppletResourceUserId appletResourceUserId, out long arg1, ulong pid); + Result SetNpadJoyAssignmentModeSingleByDefault(AppletResourceUserId appletResourceUserId, uint arg1, ulong pid); + Result SetNpadJoyAssignmentModeSingle(AppletResourceUserId appletResourceUserId, uint arg1, long arg2, ulong pid); + Result SetNpadJoyAssignmentModeDual(AppletResourceUserId appletResourceUserId, uint arg1, ulong pid); + Result MergeSingleJoyAsDualJoy(AppletResourceUserId appletResourceUserId, uint arg1, uint arg2, ulong pid); + Result StartLrAssignmentMode(AppletResourceUserId appletResourceUserId, ulong pid); + Result StopLrAssignmentMode(AppletResourceUserId appletResourceUserId, ulong pid); + Result SetNpadHandheldActivationMode(AppletResourceUserId appletResourceUserId, long arg1, ulong pid); + Result GetNpadHandheldActivationMode(AppletResourceUserId appletResourceUserId, out long arg1, ulong pid); + Result SwapNpadAssignment(AppletResourceUserId appletResourceUserId, uint arg1, uint arg2, ulong pid); + Result IsUnintendedHomeButtonInputProtectionEnabled(out bool arg0, AppletResourceUserId appletResourceUserId, uint arg2, ulong pid); + Result EnableUnintendedHomeButtonInputProtection(AppletResourceUserId appletResourceUserId, uint arg1, bool arg2, ulong pid); + Result SetNpadJoyAssignmentModeSingleWithDestination(out bool arg0, out uint arg1, AppletResourceUserId appletResourceUserId, uint arg3, long arg4, ulong pid); + Result SetNpadAnalogStickUseCenterClamp(AppletResourceUserId appletResourceUserId, bool arg1, ulong pid); + Result SetNpadCaptureButtonAssignment(AppletResourceUserId appletResourceUserId, NpadStyleTag arg1, NpadButton arg2, ulong pid); + Result ClearNpadCaptureButtonAssignment(AppletResourceUserId appletResourceUserId, ulong pid); + Result GetVibrationDeviceInfo(out VibrationDeviceInfoForIpc vibrationDeviceInfoForIpc, VibrationDeviceHandle vibrationDeviceHandle); + Result SendVibrationValue(AppletResourceUserId appletResourceUserId, VibrationDeviceHandle vibrationDeviceHandle, VibrationValue arg2, ulong pid); + Result GetActualVibrationValue(out VibrationValue arg0, AppletResourceUserId appletResourceUserId, VibrationDeviceHandle vibrationDeviceHandle, ulong pid); + Result CreateActiveVibrationDeviceList(out IActiveVibrationDeviceList arg0); + Result PermitVibration(bool arg0); + Result IsVibrationPermitted(out bool arg0); + Result SendVibrationValues(AppletResourceUserId appletResourceUserId, ReadOnlySpan vibrationDeviceHandles, ReadOnlySpan vibrationValues); + Result SendVibrationGcErmCommand(AppletResourceUserId appletResourceUserId, VibrationDeviceHandle vibrationDeviceHandle, VibrationGcErmCommand vibrationGcErmCommand, ulong pid); + Result GetActualVibrationGcErmCommand(out VibrationGcErmCommand vibrationGcErmCommand, AppletResourceUserId appletResourceUserId, VibrationDeviceHandle vibrationDeviceHandle, ulong pid); + Result BeginPermitVibrationSession(AppletResourceUserId appletResourceUserId); + Result EndPermitVibrationSession(); + Result IsVibrationDeviceMounted(out bool arg0, AppletResourceUserId appletResourceUserId, VibrationDeviceHandle vibrationDeviceHandle, ulong pid); + Result SendVibrationValueInBool(AppletResourceUserId appletResourceUserId, VibrationDeviceHandle vibrationDeviceHandle, bool arg2, ulong pid); + Result ActivateConsoleSixAxisSensor(AppletResourceUserId appletResourceUserId, ulong pid); + Result StartConsoleSixAxisSensor(AppletResourceUserId appletResourceUserId, ConsoleSixAxisSensorHandle consoleSixAxisSensorHandle, ulong pid); + Result StopConsoleSixAxisSensor(AppletResourceUserId appletResourceUserId, ConsoleSixAxisSensorHandle consoleSixAxisSensorHandle, ulong pid); + Result ActivateSevenSixAxisSensor(AppletResourceUserId appletResourceUserId, ulong pid); + Result StartSevenSixAxisSensor(AppletResourceUserId appletResourceUserId, ulong pid); + Result StopSevenSixAxisSensor(AppletResourceUserId appletResourceUserId, ulong pid); + Result InitializeSevenSixAxisSensor(AppletResourceUserId appletResourceUserId, int arg1, ulong arg2, int arg3, ulong arg4, ulong pid); + Result FinalizeSevenSixAxisSensor(AppletResourceUserId appletResourceUserId, ulong pid); + Result SetSevenSixAxisSensorFusionStrength(AppletResourceUserId appletResourceUserId, float arg1, ulong pid); + Result GetSevenSixAxisSensorFusionStrength(out float arg0, AppletResourceUserId appletResourceUserId, ulong pid); + Result ResetSevenSixAxisSensorTimestamp(AppletResourceUserId appletResourceUserId, ulong pid); + Result IsUsbFullKeyControllerEnabled(out bool arg0); + Result EnableUsbFullKeyController(bool arg0); + Result IsUsbFullKeyControllerConnected(out bool arg0, uint arg1); + Result HasBattery(out bool arg0, uint arg1); + Result HasLeftRightBattery(out bool arg0, out bool arg1, uint arg2); + Result GetNpadInterfaceType(out byte arg0, uint arg1); + Result GetNpadLeftRightInterfaceType(out byte arg0, out byte arg1, uint arg2); + Result GetNpadOfHighestBatteryLevel(out uint arg0, ReadOnlySpan arg1, AppletResourceUserId appletResourceUserId, ulong pid); + Result GetPalmaConnectionHandle(out PalmaConnectionHandle palmaConnectionHandle, uint arg1, AppletResourceUserId appletResourceUserId, ulong pid); + Result InitializePalma(PalmaConnectionHandle palmaConnectionHandle); + Result AcquirePalmaOperationCompleteEvent(out int arg0, PalmaConnectionHandle palmaConnectionHandle); + Result GetPalmaOperationInfo(out ulong arg0, Span arg1, PalmaConnectionHandle palmaConnectionHandle); + Result PlayPalmaActivity(PalmaConnectionHandle palmaConnectionHandle, ulong arg1); + Result SetPalmaFrModeType(PalmaConnectionHandle palmaConnectionHandle, ulong arg1); + Result ReadPalmaStep(PalmaConnectionHandle palmaConnectionHandle); + Result EnablePalmaStep(PalmaConnectionHandle palmaConnectionHandle, bool arg1); + Result ResetPalmaStep(PalmaConnectionHandle palmaConnectionHandle); + Result ReadPalmaApplicationSection(PalmaConnectionHandle palmaConnectionHandle, ulong arg1, ulong arg2); + Result WritePalmaApplicationSection(PalmaConnectionHandle palmaConnectionHandle, ulong arg1, ulong arg2, in PalmaApplicationSectionAccessBuffer palmaApplicationSectionAccessBuffer); + Result ReadPalmaUniqueCode(PalmaConnectionHandle palmaConnectionHandle); + Result SetPalmaUniqueCodeInvalid(PalmaConnectionHandle palmaConnectionHandle); + Result WritePalmaActivityEntry(PalmaConnectionHandle palmaConnectionHandle, ulong arg1, ulong arg2, ulong arg3, ulong arg4); + Result WritePalmaRgbLedPatternEntry(PalmaConnectionHandle palmaConnectionHandle, ulong arg1, ReadOnlySpan arg2); + Result WritePalmaWaveEntry(PalmaConnectionHandle palmaConnectionHandle, PalmaWaveSet palmaWaveSet, ulong arg2, int arg3, ulong arg4, ulong arg5); + Result SetPalmaDataBaseIdentificationVersion(PalmaConnectionHandle palmaConnectionHandle, int arg1); + Result GetPalmaDataBaseIdentificationVersion(PalmaConnectionHandle palmaConnectionHandle); + Result SuspendPalmaFeature(PalmaConnectionHandle palmaConnectionHandle, PalmaFeature palmaFeature); + Result GetPalmaOperationResult(PalmaConnectionHandle palmaConnectionHandle); + Result ReadPalmaPlayLog(PalmaConnectionHandle palmaConnectionHandle, ushort arg1); + Result ResetPalmaPlayLog(PalmaConnectionHandle palmaConnectionHandle, ushort arg1); + Result SetIsPalmaAllConnectable(AppletResourceUserId appletResourceUserId, bool arg1, ulong pid); + Result SetIsPalmaPairedConnectable(AppletResourceUserId appletResourceUserId, bool arg1, ulong pid); + Result PairPalma(PalmaConnectionHandle palmaConnectionHandle); + Result SetPalmaBoostMode(bool arg0); + Result CancelWritePalmaWaveEntry(PalmaConnectionHandle palmaConnectionHandle); + Result EnablePalmaBoostMode(AppletResourceUserId appletResourceUserId, bool arg1, ulong pid); + Result GetPalmaBluetoothAddress(out Address arg0, PalmaConnectionHandle palmaConnectionHandle); + Result SetDisallowedPalmaConnection(AppletResourceUserId appletResourceUserId, ReadOnlySpan
arg1, ulong pid); + Result SetNpadCommunicationMode(AppletResourceUserId appletResourceUserId, long arg1, ulong pid); + Result GetNpadCommunicationMode(out long arg0); + Result SetTouchScreenConfiguration(AppletResourceUserId appletResourceUserId, TouchScreenConfigurationForNx arg1, ulong pid); + Result IsFirmwareUpdateNeededForNotification(out bool arg0, int arg1, AppletResourceUserId appletResourceUserId, ulong pid); + Result ActivateDigitizer(AppletResourceUserId appletResourceUserId, ulong pid); + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/KeyboardLockKeyEvent.cs b/src/Ryujinx.Horizon/Sdk/Hid/KeyboardLockKeyEvent.cs new file mode 100644 index 000000000..5abd5812c --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/KeyboardLockKeyEvent.cs @@ -0,0 +1,18 @@ +using System; + +namespace Ryujinx.Horizon.Sdk.Hid +{ + [Flags] + enum KeyboardLockKeyEvent + { + NumLockOn = 1 << 0, + NumLockOff = 1 << 1, + NumLockToggle = 1 << 2, + CapsLockOn = 1 << 3, + CapsLockOff = 1 << 4, + CapsLockToggle = 1 << 5, + ScrollLockOn = 1 << 6, + ScrollLockOff = 1 << 7, + ScrollLockToggle = 1 << 8 + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/NpadJoyHoldType.cs b/src/Ryujinx.Horizon/Sdk/Hid/Npad/NpadJoyHoldType.cs similarity index 66% rename from src/Ryujinx.Horizon/Sdk/Hid/NpadJoyHoldType.cs rename to src/Ryujinx.Horizon/Sdk/Hid/Npad/NpadJoyHoldType.cs index e8d7dffc3..114277ea1 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/NpadJoyHoldType.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/Npad/NpadJoyHoldType.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid +namespace Ryujinx.Horizon.Sdk.Hid.Npad { enum NpadJoyHoldType { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/PalmaApplicationSectionAccessBuffer.cs b/src/Ryujinx.Horizon/Sdk/Hid/PalmaApplicationSectionAccessBuffer.cs new file mode 100644 index 000000000..866bd959d --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/PalmaApplicationSectionAccessBuffer.cs @@ -0,0 +1,10 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid +{ + [StructLayout(LayoutKind.Sequential, Size = 0x100)] + struct PalmaApplicationSectionAccessBuffer + { + + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/PalmaConnectionHandle.cs b/src/Ryujinx.Horizon/Sdk/Hid/PalmaConnectionHandle.cs new file mode 100644 index 000000000..cadfd457f --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/PalmaConnectionHandle.cs @@ -0,0 +1,10 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid +{ + [StructLayout(LayoutKind.Sequential, Size = 0x8)] + struct PalmaConnectionHandle + { + + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/PalmaFeature.cs b/src/Ryujinx.Horizon/Sdk/Hid/PalmaFeature.cs new file mode 100644 index 000000000..5309e414c --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/PalmaFeature.cs @@ -0,0 +1,13 @@ +using System; + +namespace Ryujinx.Horizon.Sdk.Hid +{ + [Flags] + enum PalmaFeature + { + FrMode = 1 << 0, + RumbleFeedback = 1 << 1, + Step = 1 << 2, + MuteSwitch = 1 << 3 + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/PalmaWaveSet.cs b/src/Ryujinx.Horizon/Sdk/Hid/PalmaWaveSet.cs new file mode 100644 index 000000000..279aca049 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/PalmaWaveSet.cs @@ -0,0 +1,9 @@ +namespace Ryujinx.Horizon.Sdk.Hid +{ + enum PalmaWaveSet : ulong + { + Small = 0, + Medium = 1, + Large = 2 + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AnalogStickState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AnalogStickState.cs index c5a9dd7e2..b2313cf4b 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AnalogStickState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AnalogStickState.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common +namespace Ryujinx.Horizon.Sdk.Hid { struct AnalogStickState { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AtomicStorage.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AtomicStorage.cs index c9da845f7..2de8bed24 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AtomicStorage.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/AtomicStorage.cs @@ -1,6 +1,6 @@ using System.Threading; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common +namespace Ryujinx.Horizon.Sdk.Hid { struct AtomicStorage where T : unmanaged, ISampledDataStruct { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/ISampledDataStruct.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/ISampledDataStruct.cs index 1bde91c5f..12c42c582 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/ISampledDataStruct.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/ISampledDataStruct.cs @@ -2,7 +2,7 @@ using System; using System.Buffers.Binary; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common +namespace Ryujinx.Horizon.Sdk.Hid { /// /// This is a "marker interface" to add some compile-time safety to a convention-based optimization. @@ -57,7 +57,7 @@ namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common { return sampledDataStruct switch { - Npad.SixAxisSensorState _ => sizeof(ulong), + SixAxisSensorState _ => sizeof(ulong), _ => 0, }; } diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/RingLifo.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/RingLifo.cs index 35069a862..79292cfbf 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/RingLifo.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Common/RingLifo.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.CompilerServices; using System.Threading; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common +namespace Ryujinx.Horizon.Sdk.Hid { struct RingLifo where T : unmanaged, ISampledDataStruct { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadAttribute.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadAttribute.cs index 2e5e3fc95..66b90befe 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadAttribute.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.DebugPad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum DebugPadAttribute : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadButton.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadButton.cs index 719090165..d4bfb743d 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadButton.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadButton.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.DebugPad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum DebugPadButton : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadState.cs index d5ce06771..68e8cf5e7 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/DebugPad/DebugPadState.cs @@ -1,7 +1,6 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.DebugPad +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct DebugPadState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKey.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKey.cs index 06dce1ec7..c27492dcc 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKey.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKey.cs @@ -1,6 +1,6 @@ using Ryujinx.Common.Memory; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Keyboard +namespace Ryujinx.Horizon.Sdk.Hid { struct KeyboardKey { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKeyShift.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKeyShift.cs index 36be39190..542251122 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKeyShift.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardKeyShift.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Keyboard +namespace Ryujinx.Horizon.Sdk.Hid { enum KeyboardKeyShift { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardModifier.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardModifier.cs index 3cf338388..c4458aebf 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardModifier.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardModifier.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Keyboard +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum KeyboardModifier : ulong diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardState.cs index 2623b9963..d58ee2ce2 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Keyboard/KeyboardState.cs @@ -1,7 +1,6 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Keyboard +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct KeyboardState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseAttribute.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseAttribute.cs index e3ae92bff..5eaa4c10f 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseAttribute.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Mouse +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum MouseAttribute : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseButton.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseButton.cs index 08d9d557b..ef02f10db 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseButton.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseButton.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Mouse +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum MouseButton : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseState.cs index 985aa7a58..56f339274 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Mouse/MouseState.cs @@ -1,7 +1,6 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Mouse +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct MouseState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/DeviceType.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/DeviceType.cs index 0788cfc47..3497b0a36 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/DeviceType.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/DeviceType.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum DeviceType diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadAttribute.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadAttribute.cs index 27a505802..928e68ead 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadAttribute.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum NpadAttribute : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadBatteryLevel.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadBatteryLevel.cs index de922ec45..48d13afe9 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadBatteryLevel.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadBatteryLevel.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { enum NpadBatteryLevel { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadButton.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadButton.cs index b84edaaed..17ef6506d 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadButton.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadButton.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum NpadButton : ulong diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadColorAttribute.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadColorAttribute.cs index e720dcaca..bae1f950a 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadColorAttribute.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadColorAttribute.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { enum NpadColorAttribute : uint { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadCommonState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadCommonState.cs index efe4bfbd8..b17b3908e 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadCommonState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadCommonState.cs @@ -1,7 +1,6 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct NpadCommonState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadFullKeyColorState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadFullKeyColorState.cs index 232219fd1..467e2b9bd 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadFullKeyColorState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadFullKeyColorState.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { struct NpadFullKeyColorState { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadGcTriggerState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadGcTriggerState.cs index da5dc8ad0..a360a6dfa 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadGcTriggerState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadGcTriggerState.cs @@ -1,7 +1,6 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct NpadGcTriggerState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadInternalState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadInternalState.cs index 9c60e031b..82fa810fd 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadInternalState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadInternalState.cs @@ -1,7 +1,6 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { struct NpadInternalState { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyAssignmentMode.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyAssignmentMode.cs index 6d0127f21..adfbf3321 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyAssignmentMode.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyAssignmentMode.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { enum NpadJoyAssignmentMode : uint { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyColorState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyColorState.cs index 3512fb523..662174ae7 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyColorState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadJoyColorState.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { struct NpadJoyColorState { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLarkType.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLarkType.cs index a9a0567c6..c738904f3 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLarkType.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLarkType.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { enum NpadLarkType : uint { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLuciaType.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLuciaType.cs index 0a7eb0e87..7ef356bc8 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLuciaType.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadLuciaType.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { enum NpadLuciaType { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadState.cs index 05f5bcca9..b07ac8770 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadState.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Size = 0x5000)] struct NpadState diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadStyleTag.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadStyleTag.cs index c806c6f32..0eb45a315 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadStyleTag.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadStyleTag.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { /// /// Nintendo pad style diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemButtonProperties.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemButtonProperties.cs index 8ff1c12da..b7bf81daa 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemButtonProperties.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemButtonProperties.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum NpadSystemButtonProperties : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemProperties.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemProperties.cs index fa75f6f9c..f20d67ce2 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemProperties.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/NpadSystemProperties.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum NpadSystemProperties : ulong diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorAttribute.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorAttribute.cs index 921f3fc02..13edbb485 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorAttribute.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] enum SixAxisSensorAttribute : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorState.cs index 9ba1408f1..7e6ee6bb4 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/Npad/SixAxisSensorState.cs @@ -1,8 +1,7 @@ using Ryujinx.Common.Memory; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct SixAxisSensorState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/SharedMemory.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/SharedMemory.cs index 0fb931021..44a96a684 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/SharedMemory.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/SharedMemory.cs @@ -1,13 +1,7 @@ using Ryujinx.Common.Memory; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.DebugPad; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Keyboard; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Mouse; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Npad; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.TouchScreen; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory +namespace Ryujinx.Horizon.Sdk.Hid { /// /// Represent the shared memory shared between applications for input. diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchAttribute.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchAttribute.cs index 5cb2a6cfa..c5c8821d9 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchAttribute.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.TouchScreen +namespace Ryujinx.Horizon.Sdk.Hid { [Flags] public enum TouchAttribute : uint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchScreenState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchScreenState.cs index cd6017d9b..7e09e0d0e 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchScreenState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchScreenState.cs @@ -1,8 +1,7 @@ using Ryujinx.Common.Memory; -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.Common; using System.Runtime.InteropServices; -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.TouchScreen +namespace Ryujinx.Horizon.Sdk.Hid { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct TouchScreenState : ISampledDataStruct diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchState.cs b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchState.cs index f632bc22b..2c5e58fde 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchState.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SharedMemory/TouchScreen/TouchState.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.Horizon.Sdk.Hid.SharedMemory.TouchScreen +namespace Ryujinx.Horizon.Sdk.Hid { struct TouchState { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/ConsoleSixAxisSensorHandle.cs b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/ConsoleSixAxisSensorHandle.cs new file mode 100644 index 000000000..f9d8ba0d4 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/ConsoleSixAxisSensorHandle.cs @@ -0,0 +1,12 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid.SixAxis +{ + [StructLayout(LayoutKind.Sequential, Size = 0x4)] + struct ConsoleSixAxisSensorHandle + { + public int TypeValue; + public byte Unknown1; + public byte Unknown2; + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SixAxisInput.cs b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisInput.cs similarity index 87% rename from src/Ryujinx.Horizon/Sdk/Hid/SixAxisInput.cs rename to src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisInput.cs index dd0341487..23d7b5bac 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/SixAxisInput.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisInput.cs @@ -1,7 +1,7 @@ using Ryujinx.Horizon.Sdk.Hid.Npad; using System.Numerics; -namespace Ryujinx.Horizon.Sdk.Hid +namespace Ryujinx.Horizon.Sdk.Hid.SixAxis { public struct SixAxisInput { diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorCalibrationParameter.cs b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorCalibrationParameter.cs new file mode 100644 index 000000000..bab63644e --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorCalibrationParameter.cs @@ -0,0 +1,10 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid.SixAxis +{ + [StructLayout(LayoutKind.Sequential, Size = 0x744)] + struct SixAxisSensorCalibrationParameter + { + + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorHandle.cs b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorHandle.cs new file mode 100644 index 000000000..e3c893cf6 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorHandle.cs @@ -0,0 +1,13 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid.SixAxis +{ + [StructLayout(LayoutKind.Sequential, Size = 0x4)] + struct SixAxisSensorHandle + { + public int TypeValue; + public byte NpadStyleIndex; + public byte PlayerNumber; + public byte DeviceIdx; + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorIcInformation.cs b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorIcInformation.cs new file mode 100644 index 000000000..3ec3df114 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/SixAxis/SixAxisSensorIcInformation.cs @@ -0,0 +1,10 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid.SixAxis +{ + [StructLayout(LayoutKind.Sequential, Size = 0xC8)] + public struct SixAxisSensorIcInformation + { + + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/TouchPoint.cs b/src/Ryujinx.Horizon/Sdk/Hid/TouchPoint.cs index 1b6a97340..b8052391c 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/TouchPoint.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/TouchPoint.cs @@ -1,5 +1,3 @@ -using Ryujinx.Horizon.Sdk.Hid.SharedMemory.TouchScreen; - namespace Ryujinx.Horizon.Sdk.Hid { public struct TouchPoint diff --git a/src/Ryujinx.Horizon/Sdk/Hid/TouchScreenConfigurationForNx.cs b/src/Ryujinx.Horizon/Sdk/Hid/TouchScreenConfigurationForNx.cs new file mode 100644 index 000000000..dc269f842 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/TouchScreenConfigurationForNx.cs @@ -0,0 +1,10 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid +{ + [StructLayout(LayoutKind.Sequential, Size = 0x10)] + struct TouchScreenConfigurationForNx + { + public TouchScreenModeForNx Mode; + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/TouchScreenModeForNx.cs b/src/Ryujinx.Horizon/Sdk/Hid/TouchScreenModeForNx.cs new file mode 100644 index 000000000..9737fc1e5 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/TouchScreenModeForNx.cs @@ -0,0 +1,9 @@ +namespace Ryujinx.Horizon.Sdk.Hid +{ + enum TouchScreenModeForNx : byte + { + UseSystemSetting = 0, + Finger = 1, + Heat2 = 2 + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceInfoForIpc.cs b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceInfoForIpc.cs new file mode 100644 index 000000000..6c28c1ad9 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceInfoForIpc.cs @@ -0,0 +1,11 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.Horizon.Sdk.Hid.Vibration +{ + [StructLayout(LayoutKind.Sequential, Size = 0x8)] + struct VibrationDeviceInfoForIpc + { + public VibrationDeviceType DeviceType; + public VibrationDevicePosition Position; + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDevicePosition.cs b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDevicePosition.cs index 7cb61a8f7..e6634455f 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDevicePosition.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDevicePosition.cs @@ -1,9 +1,9 @@ namespace Ryujinx.Horizon.Sdk.Hid.Vibration { - public enum VibrationDevicePosition + enum VibrationDevicePosition { - None, - Left, - Right, + None = 0, + Left = 1, + Right = 2 } } diff --git a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceType.cs b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceType.cs index 308e635c4..9b960dcbb 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceType.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceType.cs @@ -1,9 +1,10 @@ namespace Ryujinx.Horizon.Sdk.Hid.Vibration { - public enum VibrationDeviceType + enum VibrationDeviceType { - None, - LinearResonantActuator, - GcErm, + Unknown = 0, + LinearResonantActuator = 1, + GcErm = 2, + Erm = 3 } } diff --git a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceValue.cs b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceValue.cs index 3f4be6deb..85113b6c4 100644 --- a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceValue.cs +++ b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationDeviceValue.cs @@ -1,6 +1,6 @@ namespace Ryujinx.Horizon.Sdk.Hid.Vibration { - public struct VibrationDeviceValue + struct VibrationDeviceValue { public VibrationDeviceType DeviceType; public VibrationDevicePosition Position; diff --git a/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationGcErmCommand.cs b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationGcErmCommand.cs new file mode 100644 index 000000000..8f51998fa --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Hid/Vibration/VibrationGcErmCommand.cs @@ -0,0 +1,12 @@ +namespace Ryujinx.Horizon.Sdk.Hid.Vibration +{ + enum VibrationGcErmCommand + { + // Stops the vibration with a decay phase. + Stop = 0, + // Starts the vibration. + Start = 1, + // Stops the vibration immediately, with no decay phase. + StopHard = 2 + } +} diff --git a/src/Ryujinx.Input/HLE/NpadController.cs b/src/Ryujinx.Input/HLE/NpadController.cs index 0eabeb695..6c25a2923 100644 --- a/src/Ryujinx.Input/HLE/NpadController.cs +++ b/src/Ryujinx.Input/HLE/NpadController.cs @@ -6,6 +6,7 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Services.Hid; using Ryujinx.Horizon.Sdk.Hid; using Ryujinx.Horizon.Sdk.Hid.Npad; +using Ryujinx.Horizon.Sdk.Hid.SixAxis; using Ryujinx.Horizon.Sdk.Hid.Vibration; using System; using System.Collections.Concurrent; diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs index 077c8fb6d..2c61c2435 100644 --- a/src/Ryujinx.Input/HLE/NpadManager.cs +++ b/src/Ryujinx.Input/HLE/NpadManager.cs @@ -3,6 +3,8 @@ using Ryujinx.Common.Configuration.Hid.Controller; using Ryujinx.Common.Configuration.Hid.Keyboard; using Ryujinx.HLE.HOS.Services.Hid; using Ryujinx.Horizon.Sdk.Hid; +using Ryujinx.Horizon.Sdk.Hid.HidDevices; +using Ryujinx.Horizon.Sdk.Hid.SixAxis; using System; using System.Collections.Generic; using System.Diagnostics;