aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/DeviceMemory.cs
diff options
context:
space:
mode:
authoremmauss <emmausssss@gmail.com>2019-07-22 20:15:46 +0300
committerGitHub <noreply@github.com>2019-07-22 20:15:46 +0300
commitd254548548398977a45dbfc03f2cc091c5a74f03 (patch)
treee153a29676f6f83d44b25cc42ecd1efc8cc701e6 /Ryujinx.HLE/DeviceMemory.cs
parent1f3a34dd7a5977fc340de310b2109493e5e6973f (diff)
Little rewrite of HID input (#723)
* change hid sharedmem writing to use structures
Diffstat (limited to 'Ryujinx.HLE/DeviceMemory.cs')
-rw-r--r--Ryujinx.HLE/DeviceMemory.cs8
1 files changed, 7 insertions, 1 deletions
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<T>(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
+}