gambatte: change memory domain check to mod instead of and (because domains can be not power of 2 sizes)

This commit is contained in:
goyuken 2012-12-27 22:50:34 +00:00
parent 3bb975752b
commit 714292c77c
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}