Little rewrite of HID input (#723)

* change hid sharedmem writing to use structures
This commit is contained in:
emmauss 2019-07-22 20:15:46 +03:00 committed by GitHub
parent 1f3a34dd7a
commit d254548548
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 682 additions and 409 deletions

View file

@ -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);
}
}
}
}