Change the movie RewindToFrame to load the proper state even if the current frame is before the one in the argument. This will now send you to any frame on or before the end of the savestate log. Also change Tastudio to take advantage of this.

This commit is contained in:
phillip.grimsrud 2012-11-03 00:20:40 +00:00
parent f8f4fa6967
commit 4727ee72f0
2 changed files with 7 additions and 1 deletions

View File

@ -557,6 +557,11 @@ namespace BizHawk.MultiClient
}
}
}
else if (frame <= Log.StateLastIndex)
{
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Log.GetState(frame - 1))));
Global.MainForm.UpdateFrame = true;
}
else
{
Global.MainForm.UnpauseEmulator();

View File

@ -413,13 +413,14 @@ namespace BizHawk.MultiClient
private void TASView_DoubleClick(object sender, EventArgs e)
{
if (TASView.selectedItem <= Global.Emulator.Frame)
if (TASView.selectedItem <= Global.MovieSession.Movie.StateLastIndex)
{
this.stopOnFrame = 0;
Global.MovieSession.Movie.RewindToFrame(TASView.selectedItem);
}
else
{
Global.MovieSession.Movie.RewindToFrame(Global.MovieSession.Movie.StateLastIndex);
this.stopOnFrame = TASView.selectedItem;
Global.MainForm.PressFrameAdvance = true;
}