diff options
Diffstat (limited to 'Ryujinx.HLE/DeviceMemory.cs')
-rw-r--r-- | Ryujinx.HLE/DeviceMemory.cs | 8 |
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 +} |