2014-11-30 15:22:08 +00:00
namespace BizHawk.Emulation.Common
{
2016-03-02 02:10:09 +00:00
/// <summary>
2017-05-06 22:50:36 +00:00
/// This service provides the system by which a client can request SaveRAM data to be stored by the client
2016-03-02 02:10:09 +00:00
/// SaveRam encompasses things like battery backed ram, memory cards, and data saved to disk drives
2016-12-14 15:11:07 +00:00
/// If available, save files will be automatically loaded when loading a ROM,
2017-04-19 14:41:26 +00:00
/// In addition the client will provide features like SRAM-anchored movies, and ways to clear SaveRam
2016-03-02 02:10:09 +00:00
/// </summary>
2014-12-15 01:01:02 +00:00
public interface ISaveRam : IEmulatorService
2014-11-30 15:22:08 +00:00
{
/// <summary>
2017-04-19 14:41:26 +00:00
/// Returns a copy of the SaveRAM. Editing it won't do you any good unless you later call StoreSaveRam()
2017-05-06 22:50:36 +00:00
/// TODO: Prescribe whether this is allowed to return null in case there is no SaveRAM
2014-11-30 15:22:08 +00:00
/// </summary>
byte [ ] CloneSaveRam ( ) ;
/// <summary>
2017-04-19 14:41:26 +00:00
/// store new SaveRAM to the emu core. the data should be the same size as the return from ReadSaveRam()
2014-11-30 15:22:08 +00:00
/// </summary>
void StoreSaveRam ( byte [ ] data ) ;
/// <summary>
2017-04-19 14:41:26 +00:00
/// Gets a value indicating whether or not SaveRAM has been modified since the last save
2017-05-06 22:50:36 +00:00
/// TODO: This is not the best interface. What defines a "save"? I suppose a Clone(), right? at least specify that here.
2019-10-29 18:59:08 +00:00
/// Clone() should probably take an option that says whether to clear the dirty flag.
2017-05-06 22:50:36 +00:00
/// And anyway, cores might not know if they can even track a functional dirty flag -- we should convey that fact somehow
2019-10-29 18:59:08 +00:00
/// (reminder: do that with flags, so we don't have to change the interface 10000 times)
2017-05-06 22:50:36 +00:00
/// Dirty SaveRAM can in principle be determined by the frontend in that case, but it could possibly be too slow for the file menu dropdown or other things
2014-11-30 15:22:08 +00:00
/// </summary>
bool SaveRamModified { get ; }
}
}