diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs index d660cc4f9d..6d672d139f 100644 --- a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs +++ b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Common public override byte PeekByte(long addr) { - if ((ulong)addr >= (ulong)Size) + if ((ulong)addr < (ulong)Size) return ((byte*)Data)[addr ^ 1]; else throw new ArgumentOutOfRangeException("addr"); @@ -117,8 +117,8 @@ namespace BizHawk.Emulation.Common public override void PokeByte(long addr, byte val) { if (Writable) - { - if ((ulong)addr >= (ulong)Size) + { + if ((ulong)addr < (ulong)Size) ((byte*)Data)[addr ^ 1] = val; else throw new ArgumentOutOfRangeException("addr");