GBA memory domain fix
This commit is contained in:
parent
04c7837aec
commit
0ae8bf13f7
|
@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
[DllImport(dll, CallingConvention = cc)]
|
||||
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);
|
||||
public static extern void BizPutSaveRam(IntPtr ctx, byte[] src, int size);
|
||||
|
||||
/// <summary>
|
||||
/// start a savestate operation
|
||||
|
|
|
@ -211,8 +211,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
|
||||
#region IMemoryDomains
|
||||
|
||||
unsafe byte PeekWRAM(IntPtr xwram, long addr) { return ((byte*)xwram.ToPointer())[addr];}
|
||||
unsafe void PokeWRAM(IntPtr xwram, long addr, byte value) { ((byte*)xwram.ToPointer())[addr] = value; }
|
||||
unsafe byte PeekWRAM(IntPtr xwram, long addr) { return ((byte*)xwram)[addr];}
|
||||
unsafe void PokeWRAM(IntPtr xwram, long addr, byte value) { ((byte*)xwram)[addr] = value; }
|
||||
|
||||
void WireMemoryDomainPointers()
|
||||
{
|
||||
|
@ -234,7 +234,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
_cwram.Peek =
|
||||
delegate(long addr)
|
||||
{
|
||||
LibmGBA.BizGetMemoryAreas(_core, s);
|
||||
if (addr < 0 || addr >= (256 + 32) * 1024)
|
||||
throw new IndexOutOfRangeException();
|
||||
if (addr >= 256 * 1024)
|
||||
|
@ -349,10 +348,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
{
|
||||
data = LegacyFix(data);
|
||||
}
|
||||
if (!LibmGBA.BizPutSaveRam(_core, data, data.Length))
|
||||
{
|
||||
throw new InvalidOperationException("BizPutSaveRam returned NULL!");
|
||||
}
|
||||
LibmGBA.BizPutSaveRam(_core, data, data.Length);
|
||||
}
|
||||
|
||||
public bool SaveRamModified
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue