Little rewrite of HID input (#723)
* change hid sharedmem writing to use structures
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user