fix MAME memory domains

This commit is contained in:
CasualPokePlayer 2023-01-05 18:47:49 -08:00 committed by GitHub
parent 3f4aee0154
commit a896471164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
src/BizHawk.Emulation.Cores/Arcades/MAME

View File

@ -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<IMemoryDomains>(_memoryDomains);
}
}
}
}