summaryrefslogtreecommitdiffstats
path: root/src/core/hid/hid_types.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-09 03:28:09 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:28 +0100
commit71f9b90dd90c442425900ee16af8b4e39ac54aed (patch)
treeffd9c7d6fdd3ab7d9e2ef0f439968906b36c8d53 /src/core/hid/hid_types.h
parentsettings: Remove includes of core.h (diff)
downloadyuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.tar
yuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.tar.gz
yuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.tar.bz2
yuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.tar.lz
yuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.tar.xz
yuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.tar.zst
yuzu-71f9b90dd90c442425900ee16af8b4e39ac54aed.zip
Diffstat (limited to '')
-rw-r--r--src/core/hid/hid_types.h67
1 files changed, 64 insertions, 3 deletions
diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h
index 22177b5ed..f224cb744 100644
--- a/src/core/hid/hid_types.h
+++ b/src/core/hid/hid_types.h
@@ -13,7 +13,7 @@
namespace Core::HID {
// This is nn::hid::NpadIdType
-enum class NpadIdType : u8 {
+enum class NpadIdType : u32 {
Player1 = 0x0,
Player2 = 0x1,
Player3 = 0x2,
@@ -25,7 +25,7 @@ enum class NpadIdType : u8 {
Other = 0x10,
Handheld = 0x20,
- Invalid = 0xFF,
+ Invalid = 0xFFFFFFFF,
};
/// Converts a NpadIdType to an array index.
@@ -104,10 +104,30 @@ enum class NpadStyleIndex : u8 {
MaxNpadType = 34,
};
+// This is nn::hid::NpadStyleSet
+enum class NpadStyleSet : u32 {
+ None = 0,
+ Fullkey = 1U << 0,
+ Handheld = 1U << 1,
+ JoyDual = 1U << 2,
+ JoyLeft = 1U << 3,
+ JoyRight = 1U << 4,
+ Gc = 1U << 5,
+ Palma = 1U << 6,
+ Lark = 1U << 7,
+ HandheldLark = 1U << 8,
+ Lucia = 1U << 9,
+ Lagoon = 1U << 10,
+ Lager = 1U << 11,
+ SystemExt = 1U << 29,
+ System = 1U << 30,
+};
+static_assert(sizeof(NpadStyleSet) == 4, "NpadStyleSet is an invalid size");
+
// This is nn::hid::NpadStyleTag
struct NpadStyleTag {
union {
- u32 raw{};
+ NpadStyleSet raw{};
BitField<0, 1, u32> fullkey;
BitField<1, 1, u32> handheld;
@@ -322,6 +342,47 @@ struct DebugPadButton {
};
static_assert(sizeof(DebugPadButton) == 0x4, "DebugPadButton is an invalid size");
+enum class DeviceIndex : u8 {
+ Left = 0,
+ Right = 1,
+ None = 2,
+ MaxDeviceIndex = 3,
+};
+
+// This is nn::hid::ConsoleSixAxisSensorHandle
+struct ConsoleSixAxisSensorHandle {
+ u8 unknown_1;
+ u8 unknown_2;
+ INSERT_PADDING_BYTES_NOINIT(2);
+};
+static_assert(sizeof(ConsoleSixAxisSensorHandle) == 4,
+ "ConsoleSixAxisSensorHandle is an invalid size");
+
+// This is nn::hid::SixAxisSensorHandle
+struct SixAxisSensorHandle {
+ NpadStyleIndex npad_type;
+ u8 npad_id;
+ DeviceIndex device_index;
+ INSERT_PADDING_BYTES_NOINIT(1);
+};
+static_assert(sizeof(SixAxisSensorHandle) == 4, "SixAxisSensorHandle is an invalid size");
+
+struct SixAxisSensorFusionParameters {
+ f32 parameter1;
+ f32 parameter2;
+};
+static_assert(sizeof(SixAxisSensorFusionParameters) == 8,
+ "SixAxisSensorFusionParameters is an invalid size");
+
+// This is nn::hid::VibrationDeviceHandle
+struct VibrationDeviceHandle {
+ NpadStyleIndex npad_type;
+ u8 npad_id;
+ DeviceIndex device_index;
+ INSERT_PADDING_BYTES_NOINIT(1);
+};
+static_assert(sizeof(VibrationDeviceHandle) == 4, "SixAxisSensorHandle is an invalid size");
+
// This is nn::hid::VibrationDeviceType
enum class VibrationDeviceType : u32 {
Unknown = 0,