From 714292c77c23338b369509acbb46df26c14ab116 Mon Sep 17 00:00:00 2001 From: goyuken Date: Thu, 27 Dec 2012 22:50:34 +0000 Subject: [PATCH] gambatte: change memory domain check to mod instead of and (because domains can be not power of 2 sizes) --- BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs index b06eca96e4..71fb0fd483 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -501,7 +501,7 @@ namespace BizHawk.Emulation.Consoles.GB System.Runtime.InteropServices.Marshal.Copy(data, CachedMemory, 0, length); readneeded = false; } - return CachedMemory[addr & (CachedMemory.Length - 1)]; + return CachedMemory[addr % CachedMemory.Length]; } public void Poke(int addr, byte val) { @@ -513,7 +513,7 @@ namespace BizHawk.Emulation.Consoles.GB System.Runtime.InteropServices.Marshal.Copy(data, CachedMemory, 0, length); readneeded = false; } - CachedMemory[addr & (CachedMemory.Length - 1)] = val; + CachedMemory[addr % CachedMemory.Length] = val; writeneeded = true; } }