gpgx support text savestates
This commit is contained in:
parent
4eaeb06986
commit
6e91ffe45f
|
@ -256,10 +256,26 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
|
||||
public void SaveStateText(System.IO.TextWriter writer)
|
||||
{
|
||||
var temp = SaveStateBinary();
|
||||
temp.SaveAsHexFast(writer);
|
||||
// write extra copy of stuff we don't use
|
||||
writer.WriteLine("Frame {0}", Frame);
|
||||
}
|
||||
|
||||
public void LoadStateText(System.IO.TextReader reader)
|
||||
{
|
||||
string hex = reader.ReadLine();
|
||||
if (hex.StartsWith("emuVersion")) // movie save
|
||||
{
|
||||
do // theoretically, our portion should start right after StartsFromSavestate, maybe...
|
||||
{
|
||||
hex = reader.ReadLine();
|
||||
} while (!hex.StartsWith("StartsFromSavestate"));
|
||||
hex = reader.ReadLine();
|
||||
}
|
||||
byte[] state = new byte[hex.Length / 2];
|
||||
state.ReadFromHexFast(hex);
|
||||
LoadStateBinary(new System.IO.BinaryReader(new System.IO.MemoryStream(state)));
|
||||
}
|
||||
|
||||
public void SaveStateBinary(System.IO.BinaryWriter writer)
|
||||
|
|
Loading…
Reference in New Issue