Delete Atari7800.IStatable.cs

This commit is contained in:
alyosha-tas 2017-08-29 09:40:35 -04:00 committed by GitHub
parent 1c989d0432
commit 17ee643a95
1 changed files with 0 additions and 66 deletions

View File

@ -1,66 +0,0 @@
using System.IO;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using EMU7800.Core;
namespace BizHawk.Emulation.Cores.Atari.Atari7800
{
public partial class Atari7800 : IStatable
{
public bool BinarySaveStatesPreferred => true;
public void SaveStateText(TextWriter writer)
{
SyncState(new Serializer(writer));
}
public void LoadStateText(TextReader reader)
{
SyncState(new Serializer(reader));
}
public void SaveStateBinary(BinaryWriter bw)
{
SyncState(new Serializer(bw));
}
public void LoadStateBinary(BinaryReader br)
{
SyncState(new Serializer(br));
}
public byte[] SaveStateBinary()
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
SaveStateBinary(bw);
bw.Flush();
return ms.ToArray();
}
private void SyncState(Serializer ser)
{
byte[] core = null;
if (ser.IsWriter)
{
var ms = new MemoryStream();
_theMachine.Serialize(new BinaryWriter(ms));
ms.Close();
core = ms.ToArray();
}
ser.BeginSection("Atari7800");
ser.Sync("core", ref core, false);
ser.Sync("Lag", ref _lagcount);
ser.Sync("Frame", ref _frame);
ser.Sync("IsLag", ref _islag);
ser.EndSection();
if (ser.IsReader)
{
_theMachine = MachineBase.Deserialize(new BinaryReader(new MemoryStream(core, false)));
_avProvider.ConnectToMachine(_theMachine, _gameInfo);
}
}
}
}