gba: throw exceptions if saveram gets accessed when disposed, while i remember about it. will actually fix it some other time, if the core actually gets used.
This commit is contained in:
parent
aa73071870
commit
89f61e6daa
|
@ -78,6 +78,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA
|
||||||
|
|
||||||
public byte[] ReadSaveRam()
|
public byte[] ReadSaveRam()
|
||||||
{
|
{
|
||||||
|
if (disposed)
|
||||||
|
throw new ObjectDisposedException(this.GetType().ToString());
|
||||||
if (!LibMeteor.libmeteor_hassaveram())
|
if (!LibMeteor.libmeteor_hassaveram())
|
||||||
return null;
|
return null;
|
||||||
IntPtr data = IntPtr.Zero;
|
IntPtr data = IntPtr.Zero;
|
||||||
|
@ -92,17 +94,30 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA
|
||||||
|
|
||||||
public void StoreSaveRam(byte[] data)
|
public void StoreSaveRam(byte[] data)
|
||||||
{
|
{
|
||||||
|
if (disposed)
|
||||||
|
throw new ObjectDisposedException(this.GetType().ToString());
|
||||||
if (!LibMeteor.libmeteor_loadsaveram(data, (uint)data.Length))
|
if (!LibMeteor.libmeteor_loadsaveram(data, (uint)data.Length))
|
||||||
throw new Exception("libmeteor_loadsaveram() returned false!");
|
throw new Exception("libmeteor_loadsaveram() returned false!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearSaveRam()
|
public void ClearSaveRam()
|
||||||
{
|
{
|
||||||
|
if (disposed)
|
||||||
|
throw new ObjectDisposedException(this.GetType().ToString());
|
||||||
LibMeteor.libmeteor_clearsaveram();
|
LibMeteor.libmeteor_clearsaveram();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SaveRamModified
|
public bool SaveRamModified
|
||||||
{ get { return LibMeteor.libmeteor_hassaveram(); } set { } }
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (disposed)
|
||||||
|
throw new ObjectDisposedException(this.GetType().ToString());
|
||||||
|
return LibMeteor.libmeteor_hassaveram();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue