update mgba, saveram still broken

This commit is contained in:
nattthebear 2016-10-08 11:58:52 -04:00
parent 609b01408b
commit a76226fcc2
3 changed files with 5 additions and 3 deletions

View File

@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
public static extern void BizGetMemoryAreas(IntPtr ctx, [Out]MemoryAreas dst);
[DllImport(dll, CallingConvention = cc)]
public static extern int BizGetSaveRam(IntPtr ctx, byte[] dest);
public static extern int BizGetSaveRam(IntPtr ctx, byte[] dest, int maxsize);
[DllImport(dll, CallingConvention = cc)]
public static extern bool BizPutSaveRam(IntPtr ctx, byte[] src, int size);

View File

@ -317,7 +317,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
public byte[] CloneSaveRam()
{
int len = LibmGBA.BizGetSaveRam(_core, _saveScratch);
int len = LibmGBA.BizGetSaveRam(_core, _saveScratch, _saveScratch.Length);
if (len == _saveScratch.Length)
throw new InvalidOperationException("Save buffer not long enough");
if (len == 0)
return null;
@ -362,7 +364,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
{
get
{
return LibmGBA.BizGetSaveRam(_core, _saveScratch) > 0;
return LibmGBA.BizGetSaveRam(_core, _saveScratch, _saveScratch.Length) > 0;
}
}

Binary file not shown.