From c813cd853b4971cae1ff896cd7e5fa05ef886cc1 Mon Sep 17 00:00:00 2001 From: "phillip.grimsrud" Date: Mon, 28 May 2012 04:59:22 +0000 Subject: [PATCH] Fixed a rewind buffer problem. A recent hack started the rewind buffer by saving the state after frame 0 to the start of the rewind buffer. This fix saves the state to LastState at the end of the rom load. This way the rewind buffer starts with a diff between the state after rom load and the state after frame 0. --- BizHawk.MultiClient/MainForm.cs | 3 +++ BizHawk.MultiClient/Rewind.cs | 13 ------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 672a3884c8..e6a998edb6 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1337,6 +1337,9 @@ namespace BizHawk.MultiClient StateSlots.Clear(); UpdateStatusSlots(); UpdateDumpIcon(); + + LastState = Global.Emulator.SaveStateBinary(); + return true; } } diff --git a/BizHawk.MultiClient/Rewind.cs b/BizHawk.MultiClient/Rewind.cs index 37bf02bc22..07544e05a6 100644 --- a/BizHawk.MultiClient/Rewind.cs +++ b/BizHawk.MultiClient/Rewind.cs @@ -25,19 +25,6 @@ namespace BizHawk.MultiClient Global.OSD.AddMessage("See 'Arcade Card Rewind Hack' in Emulation->PC Engine options."); } - var ms = new MemoryStream(); - var writer = new BinaryWriter(ms); - for (int i = 0; i < LastState.Length; i++) - { - if (i == 254 || i == LastState.Length - 1) - { - writer.Write((byte)(i + 1)); - writer.Write((ushort) 0); - writer.Write(LastState, 0, i + 1); - } - } - RewindBuf.Push(ms); - return; }