add IsLagFrame, LagCount, Frame to Snes savestates

This commit is contained in:
goyuken 2012-09-11 01:50:55 +00:00
parent f2ce38851a
commit d84f13275e
1 changed files with 13 additions and 3 deletions

View File

@ -454,16 +454,26 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
fixed (byte* pbuf = &buf[0])
LibsnesDll.snes_serialize(new IntPtr(pbuf), size);
writer.Write(buf);
// other variables
writer.Write(IsLagFrame);
writer.Write(LagCount);
writer.Write(Frame);
writer.Flush();
}
public void LoadStateBinary(BinaryReader reader)
{
int size = LibsnesDll.snes_serialize_size();
var ms = new MemoryStream();
reader.BaseStream.CopyTo(ms);
var buf = ms.ToArray();
byte[] buf = reader.ReadBytes(size);
fixed (byte* pbuf = &buf[0])
LibsnesDll.snes_unserialize(new IntPtr(pbuf), size);
// other variables
IsLagFrame = reader.ReadBoolean();
LagCount = reader.ReadInt32();
Frame = reader.ReadInt32();
}
public byte[] SaveStateBinary()
{