Add bulk peek byte for waterbox cores

This should speed up the hex editor significantly in one byte mode, but it doesn't because the hex editor is buggy
This commit is contained in:
nattthebear 2020-05-14 18:40:56 -04:00
parent a49a372410
commit 5892059fc3
1 changed files with 24 additions and 0 deletions

View File

@ -150,6 +150,30 @@ namespace BizHawk.Emulation.Cores.Waterbox
}
}
public override void BulkPeekByte(Range<long> addresses, byte[] values)
{
if (_addressMangler != 0)
{
base.BulkPeekByte(addresses, values);
return;
}
var start = (ulong)addresses.Start;
var count = addresses.Count();
if (start < (ulong)Size && (start + count) <= (ulong)Size)
{
using (_monitor.EnterExit())
{
Marshal.Copy(Z.US((ulong)_data + start), values, 0, (int)count);
}
}
else
{
throw new ArgumentOutOfRangeException(nameof(addresses));
}
}
public WaterboxMemoryDomain(MemoryArea m, IMonitor monitor)
{
Name = Marshal.PtrToStringAnsi(m.Name);