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/DeviceMemory.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Ryujinx.HLE/DeviceMemory.cs') diff --git a/Ryujinx.HLE/DeviceMemory.cs b/Ryujinx.HLE/DeviceMemory.cs index 524adb84..3553a6e7 100644 --- a/Ryujinx.HLE/DeviceMemory.cs +++ b/Ryujinx.HLE/DeviceMemory.cs @@ -1,5 +1,6 @@ using ChocolArm64.Memory; using System; +using System.Runtime.InteropServices; namespace Ryujinx.HLE { @@ -98,6 +99,11 @@ namespace Ryujinx.HLE *((ulong*)(_ramPtr + position)) = value; } + public unsafe void WriteStruct(long position, T value) + { + Marshal.StructureToPtr(value, (IntPtr)(_ramPtr + position), false); + } + public void FillWithZeros(long position, int size) { int size8 = size & ~(8 - 1); @@ -180,4 +186,4 @@ namespace Ryujinx.HLE MemoryManagement.Free(RamPointer); } } -} \ No newline at end of file +} -- cgit v1.2.3