From 8d1fcd0b8a8c25814877ebe2027361bac0bde58c Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 17 Mar 2013 18:11:30 +0000 Subject: [PATCH] snes: movie recording starting from now now supported --- .../Consoles/Nintendo/SNES/LibsnesCore.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs index f151be9d73..508fb5dc5c 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -627,17 +627,24 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES { var temp = SaveStateBinary(); temp.SaveAsHex(writer); - // write extra copy of stuff we don't use - writer.WriteLine("Frame {0}", Frame); + writer.WriteLine("Frame {0}", Frame); // we don't parse this, it's only for the client to use writer.WriteLine("Profile {0}", CoreComm.SNES_Profile); } public void LoadStateText(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.ReadFromHex(hex); LoadStateBinary(new BinaryReader(new MemoryStream(state))); - reader.ReadLine(); + reader.ReadLine(); // Frame # var profile = reader.ReadLine().Split(' ')[1]; ValidateLoadstateProfile(profile); }