GBA -add new "Combined WRAM" memory domain, which is the 256KB EWRAM immediately followed by the 32KB IWRAM

This commit is contained in:
goyuken 2013-09-29 15:43:49 +00:00
parent 665ceac228
commit e33396a548
1 changed files with 33 additions and 10 deletions

View File

@ -254,16 +254,39 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA
// even if the rom is less than 32MB, the whole is still valid in meteor
AddMemoryDomain(LibMeteor.MemoryArea.rom, 32 * 1024 * 1024, "ROM");
// special domain for system bus
MemoryDomain sb = new MemoryDomain("BUS", 1 << 28, Endian.Little,
delegate(int addr)
{
return LibMeteor.libmeteor_peekbus((uint)addr);
},
delegate(int addr, byte val)
{
LibMeteor.libmeteor_writebus((uint)addr, val);
});
_MemoryDomains.Add(sb);
{
MemoryDomain sb = new MemoryDomain("BUS", 1 << 28, Endian.Little,
delegate(int addr)
{
return LibMeteor.libmeteor_peekbus((uint)addr);
},
delegate(int addr, byte val)
{
LibMeteor.libmeteor_writebus((uint)addr, val);
});
_MemoryDomains.Add(sb);
}
// special combined ram memory domain
{
var ew = _MemoryDomains[1];
var iw = _MemoryDomains[0];
MemoryDomain cr = new MemoryDomain("Combined WRAM", (256 + 32) * 1024, Endian.Little,
delegate(int addr)
{
if (addr >= 256 * 1024)
return iw.PeekByte(addr & 32767);
else
return ew.PeekByte(addr);
},
delegate(int addr, byte val)
{
if (addr >= 256 * 1024)
iw.PokeByte(addr & 32767, val);
else
ew.PokeByte(addr, val);
});
_MemoryDomains.Add(cr);
}
}
public void GetGPUMemoryAreas(out IntPtr vram, out IntPtr palram, out IntPtr oam, out IntPtr mmio)