From 7f18d9ebc0f7db35eac367994ae3b296456cd563 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 2 Nov 2014 01:10:19 +0000 Subject: [PATCH] Fix bugs in last commit --- BizHawk.Client.Common/movie/tasproj/TasLagLog.cs | 4 ++-- BizHawk.Client.Common/movie/tasproj/TasMovie.cs | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) 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)) {