add bulk read of intptr memory domains.

speeds up ram search in quicknes
This commit is contained in:
nattthebear 2020-05-04 14:36:51 -04:00
parent e566d8e258
commit a49a372410
1 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,6 @@
using BizHawk.Common;
using System;
using System.Runtime.InteropServices;
namespace BizHawk.Emulation.Common
{
@ -160,6 +161,21 @@ namespace BizHawk.Emulation.Common
}
}
public override void BulkPeekByte(Range<long> addresses, byte[] values)
{
var start = (ulong)addresses.Start;
var count = addresses.Count();
if (start < (ulong)Size && (start + count) <= (ulong)Size)
{
Marshal.Copy((IntPtr)((ulong)Data + start), values, 0, (int)count);
}
else
{
throw new ArgumentOutOfRangeException(nameof(addresses));
}
}
public void SetSize(long size)
{
Size = size;