From d254548548398977a45dbfc03f2cc091c5a74f03 Mon Sep 17 00:00:00 2001 From: emmauss Date: Mon, 22 Jul 2019 20:15:46 +0300 Subject: Little rewrite of HID input (#723) * change hid sharedmem writing to use structures --- Ryujinx.HLE/Input/Touch/TouchData.cs | 18 ++++++++++++++++++ Ryujinx.HLE/Input/Touch/TouchEntry.cs | 11 +++++++++++ Ryujinx.HLE/Input/Touch/TouchHeader.cs | 14 ++++++++++++++ Ryujinx.HLE/Input/Touch/TouchPoint.cs | 11 +++++++++++ 4 files changed, 54 insertions(+) create mode 100644 Ryujinx.HLE/Input/Touch/TouchData.cs create mode 100644 Ryujinx.HLE/Input/Touch/TouchEntry.cs create mode 100644 Ryujinx.HLE/Input/Touch/TouchHeader.cs create mode 100644 Ryujinx.HLE/Input/Touch/TouchPoint.cs (limited to 'Ryujinx.HLE/Input/Touch') diff --git a/Ryujinx.HLE/Input/Touch/TouchData.cs b/Ryujinx.HLE/Input/Touch/TouchData.cs new file mode 100644 index 00000000..8489ef70 --- /dev/null +++ b/Ryujinx.HLE/Input/Touch/TouchData.cs @@ -0,0 +1,18 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.HLE.Input +{ + [StructLayout(LayoutKind.Sequential)] + public struct TouchData + { + public long SampleTimestamp; + public int Padding; + public int Index; + public int X; + public int Y; + public int DiameterX; + public int DiameterY; + public int Angle; + public int Padding2; + } +} diff --git a/Ryujinx.HLE/Input/Touch/TouchEntry.cs b/Ryujinx.HLE/Input/Touch/TouchEntry.cs new file mode 100644 index 00000000..2ef09d75 --- /dev/null +++ b/Ryujinx.HLE/Input/Touch/TouchEntry.cs @@ -0,0 +1,11 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.HLE.Input +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct TouchEntry + { + public long SamplesTimestamp; + public long TouchCount; + } +} diff --git a/Ryujinx.HLE/Input/Touch/TouchHeader.cs b/Ryujinx.HLE/Input/Touch/TouchHeader.cs new file mode 100644 index 00000000..dd93137c --- /dev/null +++ b/Ryujinx.HLE/Input/Touch/TouchHeader.cs @@ -0,0 +1,14 @@ +using System.Runtime.InteropServices; + +namespace Ryujinx.HLE.Input +{ + [StructLayout(LayoutKind.Sequential)] + public struct TouchHeader + { + public long Timestamp; + public long EntryCount; + public long CurrentEntryIndex; + public long MaxEntries; + public long SamplesTimestamp; + } +} diff --git a/Ryujinx.HLE/Input/Touch/TouchPoint.cs b/Ryujinx.HLE/Input/Touch/TouchPoint.cs new file mode 100644 index 00000000..a9b095de --- /dev/null +++ b/Ryujinx.HLE/Input/Touch/TouchPoint.cs @@ -0,0 +1,11 @@ +namespace Ryujinx.HLE.Input +{ + public struct TouchPoint + { + public int X; + public int Y; + public int DiameterX; + public int DiameterY; + public int Angle; + } +} \ No newline at end of file -- cgit v1.2.3