fix bulkread mistakes (see #1903)

This commit is contained in:
zeromus 2020-03-30 05:21:07 -04:00
parent 4237d09d22
commit c3389f14e1
2 changed files with 5 additions and 5 deletions

View File

@ -604,7 +604,7 @@ namespace BizHawk.Client.EmuHawk
}
Dictionary<long, long> dict = new Dictionary<long, long>();
var range = new MutableRange<long>(addresses[0], addresses[0] + addresses.Count);
var range = new MutableRange<long>(addresses[0], addresses[0] + addresses.Count - 1);
switch (DataSize)
{

View File

@ -111,7 +111,7 @@ namespace BizHawk.Emulation.Common
throw new ArgumentException();
}
if (addresses.EndInclusive - addresses.Start != values.Length)
if (addresses.EndInclusive - addresses.Start + 1 != values.Length)
{
throw new InvalidOperationException("Invalid length of values array");
}
@ -147,14 +147,14 @@ namespace BizHawk.Emulation.Common
throw new ArgumentException();
}
if (addresses.EndInclusive - addresses.Start != values.Length)
if (addresses.EndInclusive - addresses.Start + 1 != values.Length)
{
throw new InvalidOperationException("Invalid length of values array");
}
for (var i = addresses.Start; i < addresses.EndInclusive; i++)
for (var i = addresses.Start; i <= addresses.EndInclusive; i++)
{
values[i] = PeekUint(i, bigEndian);
values[i - addresses.Start] = PeekUint(i, bigEndian);
}
}
}