From 859f4e3c01fd350e174ea22d364f28a8506e5c7f Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 15 Apr 2016 22:43:14 -0500 Subject: [PATCH] fix 2 watch-related bugs and a typo in an error message --- BizHawk.Client.Common/tools/Watch/Watch.cs | 2 +- BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs | 4 +++- .../Base Implementations/MemoryDomainImpls.cs | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BizHawk.Client.Common/tools/Watch/Watch.cs b/BizHawk.Client.Common/tools/Watch/Watch.cs index b6206576d1..9b8a6aab9a 100644 --- a/BizHawk.Client.Common/tools/Watch/Watch.cs +++ b/BizHawk.Client.Common/tools/Watch/Watch.cs @@ -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"); } } } diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs index 35e46be50a..b9a134798b 100644 --- a/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs @@ -326,7 +326,9 @@ namespace BizHawk.Client.Common { _memoryDomains = core; Parallel.ForEach(_watchList, watch => - { + { + if (watch.IsSeparator) + return; watch.Domain = core[watch.Domain.Name]; watch.ResetPrevious(); watch.Update(); diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs index 332b2af5a7..0db1663f20 100644 --- a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs +++ b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs @@ -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");