Tastudio - some improvements to go to frame logic, to deal with gaps being in the greenzone, still some bugs though, certainly

This commit is contained in:
adelikat 2014-08-30 00:03:33 +00:00
parent 17f109905b
commit 21ab01817f
1 changed files with 14 additions and 4 deletions

View File

@ -272,10 +272,15 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.DisplayManager.NeedsToPaint = true;
TasView.LastVisibleIndex = frame;
}
else//Goto last emulated frame, then unpause until we reach frame
else // Get as close as we can then emulate there
{
_currentTasMovie.SwitchToPlay();
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_currentTasMovie[_currentTasMovie.LastEmulatedFrame].State.ToArray())));
var closestState = _currentTasMovie.GetStateClosestToFrame(frame);
if (closestState != null)
{
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(closestState.ToArray())));
}
GlobalWin.MainForm.UnpauseEmulator();
GlobalWin.MainForm.PauseOnFrame = frame;
}
@ -291,10 +296,15 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.DisplayManager.NeedsToPaint = true;
TasView.LastVisibleIndex = frame;
}
else // TODO: this assume that there are no "gaps", instead of last emulated frame, we should do last frame from X
else
{
_currentTasMovie.SwitchToPlay();
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_currentTasMovie[_currentTasMovie.LastEmulatedFrame].State.ToArray())));
var closestState = _currentTasMovie.GetStateClosestToFrame(frame);
if (closestState != null)
{
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(closestState.ToArray())));
}
GlobalWin.MainForm.UnpauseEmulator();
GlobalWin.MainForm.PauseOnFrame = frame;
}