add a new field to IEmulator: bool BinarySaveStatesPreferred { get; }. a core should set it to true to indicate that it would prefer to save and load binary savestates (but both types must be supported). set to true on 7800, gb, dgb, gba, n64, snes, saturn cores, as they all create text savestates that are simply dumps of the binary savestate. for the moment, frontend does nothing with this new information.
This commit is contained in:
parent
beb0452275
commit
7b7b95e95d
|
@ -140,6 +140,8 @@ namespace BizHawk.Emulation.Computers.Commodore64
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
private void SetupMemoryDomains()
|
||||
{
|
||||
// chips must be initialized before this code runs!
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace BizHawk
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
private readonly IList<MemoryDomain> memoryDomains;
|
||||
public IList<MemoryDomain> MemoryDomains { get { return memoryDomains; } }
|
||||
public MemoryDomain MainMemory { get { return memoryDomains[0]; } }
|
||||
|
|
|
@ -117,6 +117,9 @@ namespace BizHawk.Emulation
|
|||
bw.Flush();
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
void SyncState(Serializer ser)
|
||||
{
|
||||
byte[] core = null;
|
||||
|
|
|
@ -588,6 +588,8 @@ namespace BizHawk.Emulation.Consoles.Calculator
|
|||
return new byte[0];
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
public string SystemId { get { return "TI83"; } }
|
||||
|
||||
private IList<MemoryDomain> memoryDomains;
|
||||
|
|
|
@ -204,6 +204,8 @@ namespace BizHawk.Emulation.Consoles.Coleco
|
|||
return buf;
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
public void SaveStateBinary(BinaryWriter writer)
|
||||
{
|
||||
Cpu.SaveStateBinary(writer);
|
||||
|
|
|
@ -179,6 +179,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
|
|||
return new byte[0];
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
public CoreComm CoreComm { get; private set; }
|
||||
|
||||
public IList<MemoryDomain> MemoryDomains
|
||||
|
|
|
@ -176,6 +176,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
#endregion
|
||||
|
||||
public CoreComm CoreComm { get; private set; }
|
||||
|
|
|
@ -405,6 +405,8 @@ namespace BizHawk.Emulation.Consoles.GB
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region memorycallback
|
||||
|
|
|
@ -284,6 +284,8 @@ namespace BizHawk.Emulation.Consoles.GB
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
#endregion
|
||||
|
||||
public CoreComm CoreComm { get; private set; }
|
||||
|
|
|
@ -176,6 +176,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
public IList<MemoryDomain> MemoryDomains { get; private set; }
|
||||
public MemoryDomain MainMemory { get; private set; }
|
||||
|
||||
|
|
|
@ -849,6 +849,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
|||
bw.Flush();
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -787,6 +787,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
|
|||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
/// <summary>
|
||||
/// handle the unmanaged part of loadstating
|
||||
/// </summary>
|
||||
|
|
|
@ -535,6 +535,8 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
|||
return buf;
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
void SetupMemoryDomains()
|
||||
{
|
||||
var domains = new List<MemoryDomain>(10);
|
||||
|
|
|
@ -252,6 +252,7 @@ namespace BizHawk.Emulation.Consoles.PSX
|
|||
public void SaveStateBinary(BinaryWriter writer) { }
|
||||
public void LoadStateBinary(BinaryReader reader) { }
|
||||
public byte[] SaveStateBinary() { return new byte[1]; }
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
public int[] GetVideoBuffer() { return frameBuffer; }
|
||||
public int VirtualWidth { get; private set; }
|
||||
public int BufferWidth { get; private set; }
|
||||
|
|
|
@ -408,6 +408,8 @@ namespace BizHawk.Emulation.Consoles.Sega
|
|||
return buf;
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
IList<MemoryDomain> memoryDomains;
|
||||
|
||||
void SetupMemoryDomains()
|
||||
|
|
|
@ -315,6 +315,8 @@ namespace BizHawk.Emulation.Consoles.Sega
|
|||
return buf;
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
|
||||
public void SaveStateBinary(BinaryWriter writer)
|
||||
{
|
||||
Cpu.SaveStateBinary(writer);
|
||||
|
|
|
@ -310,6 +310,8 @@ namespace BizHawk.Emulation.Consoles.Sega.Saturn
|
|||
Frame = reader.ReadInt32();
|
||||
}
|
||||
|
||||
public bool BinarySaveStatesPreferred { get { return true; } }
|
||||
|
||||
public byte[] SaveStateBinary()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
|
|
@ -54,6 +54,7 @@ namespace BizHawk
|
|||
public void SaveStateBinary(BinaryWriter writer) { }
|
||||
public void LoadStateBinary(BinaryReader reader) { }
|
||||
public byte[] SaveStateBinary() { return new byte[1]; }
|
||||
public bool BinarySaveStatesPreferred { get { return false; } }
|
||||
public int[] GetVideoBuffer() { return frameBuffer; }
|
||||
public int VirtualWidth { get { return 256; } }
|
||||
public int BufferWidth { get { return 256; } }
|
||||
|
|
|
@ -62,6 +62,11 @@ namespace BizHawk
|
|||
void LoadStateBinary(BinaryReader reader);
|
||||
byte[] SaveStateBinary();
|
||||
|
||||
/// <summary>
|
||||
/// true if the core would rather give a binary savestate than a text one. both must function regardless
|
||||
/// </summary>
|
||||
bool BinarySaveStatesPreferred { get; }
|
||||
|
||||
/// <summary>
|
||||
/// the corecomm module in use by this core.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue