add sram memdomain to mgba

This commit is contained in:
zeromus 2016-04-18 21:46:27 -05:00
parent 41dd8741d5
commit 75173f2596
4 changed files with 11 additions and 0 deletions

View File

@ -83,6 +83,11 @@ namespace BizHawk.Emulation.Common
else
throw new ArgumentOutOfRangeException("addr");
}
}
public void SetSize(long size)
{
Size = size;
}
public MemoryDomainIntPtr(string name, Endian endian, IntPtr data, long size, bool writable, int wordSize)

View File

@ -42,6 +42,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
public IntPtr vram;
public IntPtr oam;
public IntPtr rom;
public IntPtr sram;
public int sram_size;
}
[DllImport(dll, CallingConvention = cc)]

View File

@ -188,6 +188,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
_vram.Data = s.vram;
_oam.Data = s.oam;
_rom.Data = s.rom;
_sram.Data = s.sram;
_sram.SetSize(s.sram_size);
// special combined ram memory domain
@ -229,6 +231,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
private MemoryDomainIntPtr _vram;
private MemoryDomainIntPtr _oam;
private MemoryDomainIntPtr _rom;
private MemoryDomainIntPtr _sram;
private MemoryDomainDelegate _cwram;
private void CreateMemoryDomains(int romsize)
@ -243,6 +246,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
mm.Add(_vram = new MemoryDomainIntPtr("VRAM", LE, IntPtr.Zero, 96 * 1024, true, 4));
mm.Add(_oam = new MemoryDomainIntPtr("OAM", LE, IntPtr.Zero, 1024, true, 4));
mm.Add(_rom = new MemoryDomainIntPtr("ROM", LE, IntPtr.Zero, romsize, false, 4));
mm.Add(_sram = new MemoryDomainIntPtr("SRAM", LE, IntPtr.Zero, 0, true, 4)); //size will be fixed in wireup
mm.Add(_cwram = new MemoryDomainDelegate("Combined WRAM", (256 + 32) * 1024, LE, null, null, 4));
MemoryDomains = new MemoryDomainList(mm);

Binary file not shown.