add bulk read of intptr memory domains.
speeds up ram search in quicknes
This commit is contained in:
parent
e566d8e258
commit
a49a372410
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue