mgba - try resetting sram memdomain after frame advance, so sram autodetection can progress and feed into frontend. addresses #1620, maybe not in the best way

This commit is contained in:
zeromus 2020-06-18 03:08:57 -04:00
parent 1efc91cb94
commit 25327b510d
2 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
WireMemoryDomainPointers();
}
private void WireMemoryDomainPointers_SaveRam()
{
var s = new LibmGBA.MemoryAreas();
LibmGBA.BizGetMemoryAreas(Core, s);
_sram.Data = s.sram;
if (s.sram == IntPtr.Zero) s.sram_size = 0;
_sram.SetSize(s.sram_size);
}
private void WireMemoryDomainPointers()
{
var s = new LibmGBA.MemoryAreas();
@ -73,6 +83,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
_oam.Data = s.oam;
_rom.Data = s.rom;
_sram.Data = s.sram;
if (s.sram == IntPtr.Zero) s.sram_size = 0;
_sram.SetSize(s.sram_size);
// special combined ram memory domain

View File

@ -127,6 +127,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
(short)controller.AxisValue("Tilt Z"),
(byte)(255 - controller.AxisValue("Light Sensor")));
//autodetection may have progressed.
//this isn't a great time to do it, but we have to do it some time. maybe it's the best time.
WireMemoryDomainPointers_SaveRam();
if (IsLagFrame)
{
LagCount++;