diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 70060c122e..9609a76a2c 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -122,14 +122,6 @@ namespace BizHawk.Client.Common { if (States.Count > 0 && frame > 0) // Never invalidate frame 0, TODO: Only if movie is a power-on movie should we keep frame 0, check this { - // TODO be more efficient, this could get slow - //while (LastKey >= frame) - //{ - // var state = States[LastKey]; - // Used -= state.Length; - // States.RemoveAt(States.Count - 1); - //} - var statesToRemove = States .Where(x => x.Key >= frame) .ToList(); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index ef398ee1d0..9df60871f4 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -190,20 +190,27 @@ namespace BizHawk.Client.EmuHawk } // TODO: a better name + /// + /// Only goes to go to the frame if it is an event before current emulation, otherwise it is just a future event that can freely be edited + /// private void GoToLastEmulatedFrameIfNecessary(int frame) { if (frame != Global.Emulator.Frame) // Don't go to a frame if you are already on it! { var restoreFrame = Global.Emulator.Frame; - if (frame <= _currentTasMovie.LastEmulatedFrame) + if (frame <= Global.Emulator.Frame) { GoToFrame(frame); + } - if (Global.Config.TAStudioAutoRestoreLastPosition) + if (Global.Config.TAStudioAutoRestoreLastPosition) + { + if (restoreFrame > Global.Emulator.Frame) // Don't unpause if we are already on the desired frame, else runaway seek { - GlobalWin.MainForm.UnpauseEmulator(); - GlobalWin.MainForm.PauseOnFrame = restoreFrame; + + GlobalWin.MainForm.UnpauseEmulator(); + GlobalWin.MainForm.PauseOnFrame = restoreFrame; } } }