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 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; _memoryDomains = core;
Parallel.ForEach<Watch>(_watchList, watch => Parallel.ForEach<Watch>(_watchList, watch =>
{ {
if (watch.IsSeparator)
return;
watch.Domain = core[watch.Domain.Name]; watch.Domain = core[watch.Domain.Name];
watch.ResetPrevious(); watch.ResetPrevious();
watch.Update(); watch.Update();

View File

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