add in c# side code to actually use new saturnus saveram interface
This commit is contained in:
parent
2ce3bbffa5
commit
446fac3242
|
@ -0,0 +1,15 @@
|
|||
using BizHawk.BizInvoke;
|
||||
using BizHawk.Emulation.Cores.Waterbox;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn
|
||||
{
|
||||
public abstract class LibSaturnus : LibNymaCore
|
||||
{
|
||||
[BizImport(CC)]
|
||||
public abstract int GetSaveRamLength();
|
||||
[BizImport(CC)]
|
||||
public abstract void GetSaveRam(byte[] data);
|
||||
[BizImport(CC)]
|
||||
public abstract void PutSaveRam(byte[] data, int length);
|
||||
}
|
||||
}
|
|
@ -9,6 +9,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn
|
|||
[PortedCore(CoreNames.Saturnus, "Mednafen Team", "1.29.0", "https://mednafen.github.io/releases/")]
|
||||
public class Saturnus : NymaCore, IRegionable
|
||||
{
|
||||
private readonly LibSaturnus _saturnus;
|
||||
|
||||
private Saturnus(CoreComm comm)
|
||||
: base(comm, VSystemID.Raw.NULL, null, null, null)
|
||||
{
|
||||
|
@ -42,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn
|
|||
{ "FIRMWARE:$ULTRA", new("SAT", "ULTRAMAN") },
|
||||
// { "FIRMWARE:$SATAR", new("SAT", "AR") }, // action replay garbage
|
||||
};
|
||||
DoInit<LibNymaCore>(lp, "ss.wbx", firmwares);
|
||||
_saturnus = DoInit<LibSaturnus>(lp, "ss.wbx", firmwares);
|
||||
|
||||
_cachedSettingsInfo ??= SettingsInfo.Clone();
|
||||
}
|
||||
|
@ -99,5 +101,17 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public new bool SaveRamModified => true;
|
||||
|
||||
public new byte[] CloneSaveRam()
|
||||
{
|
||||
var data = new byte[_saturnus.GetSaveRamLength()];
|
||||
_saturnus.GetSaveRam(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
public new void StoreSaveRam(byte[] data)
|
||||
=> _saturnus.PutSaveRam(data, data.Length);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue