From a8964711642af7c3f6f3d7ac188deb6f5c26d3bd Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Thu, 5 Jan 2023 18:47:49 -0800 Subject: [PATCH] fix MAME memory domains --- .../Arcades/MAME/MAME.MemoryDomains.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs index 2e91f881b8..fc7dbbda94 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.MemoryDomains.cs @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME public override byte PeekByte(long addr) { - if ((ulong)addr < (ulong)_systemBusSize) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); + if ((ulong)addr >= (ulong)_systemBusSize) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); addr += _firstOffset; return _core.mame_read_byte((uint)addr << _systemBusAddressShift); } @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME { if (Writable) { - if ((ulong)addr < (ulong)_systemBusSize) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); + if ((ulong)addr >= (ulong)_systemBusSize) throw new ArgumentOutOfRangeException(paramName: nameof(addr), addr, message: "address out of range"); addr += _firstOffset; _core.mame_lua_execute($"{MAMELuaCommand.GetSpace}:write_u8({addr << _systemBusAddressShift}, {val})"); } @@ -105,4 +105,4 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME (ServiceProvider as BasicServiceProvider).Register(_memoryDomains); } } -} \ No newline at end of file +}