diff --git a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs index fb7bff8d65..cc1507c832 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs @@ -8,9 +8,9 @@ namespace BizHawk.Client.Common { public void RemoveFrom(int frame) { - if (frame > 0 && frame < this.Count) + if (frame > 0 && frame <= this.Count) { - this.RemoveRange(frame - 1, this.Count - frame); + this.RemoveRange(frame - 1, this.Count - (frame - 1)); } } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 176998acbf..28c0a621ab 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -287,14 +287,16 @@ namespace BizHawk.Client.Common public override IController GetInputState(int frame) { - // TODO: states and lag capture + if (Global.Emulator.Frame - 1 == frame) + { + if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary with frame values? + { + LagLog.Add(Global.Emulator.IsLagFrame); + } + } + if (Global.Emulator.Frame == frame) // Take this opportunity to capture lag and state info if we do not have it { - // TODO - //if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary with frame values? - //{ - // LagLog.Add(Global.Emulator.IsLagFrame); - //} if (!StateManager.HasState(frame)) {