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.

This commit is contained in:
phillip.grimsrud 2012-05-28 04:59:22 +00:00
parent 9a1e18045e
commit c813cd853b
2 changed files with 3 additions and 13 deletions

View File

@ -1337,6 +1337,9 @@ namespace BizHawk.MultiClient
StateSlots.Clear();
UpdateStatusSlots();
UpdateDumpIcon();
LastState = Global.Emulator.SaveStateBinary();
return true;
}
}

View File

@ -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;
}