fix 2 watch-related bugs and a typo in an error message

This commit is contained in:
zeromus 2016-04-15 22:43:14 -05:00
parent b82cc74a5d
commit 859f4e3c01
3 changed files with 7 additions and 5 deletions

View File

@ -736,7 +736,7 @@ namespace BizHawk.Client.Common
}
else
{
throw new InvalidOperationException("You cannot set diffrent domain to a watch on the fly");
throw new InvalidOperationException("You cannot set a different domain to a watch on the fly");
}
}
}

View File

@ -326,7 +326,9 @@ namespace BizHawk.Client.Common
{
_memoryDomains = core;
Parallel.ForEach<Watch>(_watchList, watch =>
{
{
if (watch.IsSeparator)
return;
watch.Domain = core[watch.Domain.Name];
watch.ResetPrevious();
watch.Update();

View File

@ -67,8 +67,8 @@ namespace BizHawk.Emulation.Common
public IntPtr Data { get; set; }
public override byte PeekByte(long addr)
{
if ((ulong)addr >= (ulong)Size)
{
if ((ulong)addr < (ulong)Size)
return ((byte*)Data)[addr];
else
throw new ArgumentOutOfRangeException("addr");
@ -78,7 +78,7 @@ namespace BizHawk.Emulation.Common
{
if (Writable)
{
if ((ulong)addr >= (ulong)Size)
if ((ulong)addr < (ulong)Size)
((byte*)Data)[addr] = val;
else
throw new ArgumentOutOfRangeException("addr");