Tastudio - make green/red drawing for lag correspond with FCEUX's taseditor. Rather than show what the lag counter is saying, show what the next frame will be. The logic here is that green means a frame in which an edit will have an effect on emulation and red means it will not.

This commit is contained in:
adelikat 2014-11-02 00:39:53 +00:00
parent 8197f96c98
commit f7460d1821
3 changed files with 18 additions and 8 deletions

View File

@ -8,14 +8,20 @@ namespace BizHawk.Client.Common
{
public void RemoveFrom(int frame)
{
if (frame + 1 < this.Count)
if (frame > 0 && frame < this.Count)
{
this.RemoveRange(frame + 1, this.Count - frame - 1);
this.RemoveRange(frame - 1, this.Count - frame);
}
}
public bool? Lagged(int index)
{
// Hacky but effective, we haven't record the lag information for the current frame yet
if (index == Global.Emulator.Frame - 1)
{
return Global.Emulator.IsLagFrame;
}
if (index < this.Count)
{
return this[index];

View File

@ -14,8 +14,11 @@ namespace BizHawk.Client.Common
{
base.RecordFrame(frame, source);
LagLog.RemoveFrom(frame);
LagLog.Add(Global.Emulator.IsLagFrame);
if (frame > 0)
{
LagLog.RemoveFrom(frame);
LagLog.Add(Global.Emulator.IsLagFrame);
}
StateManager.Capture();
}

View File

@ -290,10 +290,11 @@ namespace BizHawk.Client.Common
// TODO: states and lag capture
if (Global.Emulator.Frame == frame) // Take this opportunity to capture lag and state info if we do not have it
{
if (frame == LagLog.Count) // I intentionally did not do >=, if it were >= we missed some entries somewhere, oops, maybe this shoudl be a dictionary<int, bool> with frame values?
{
LagLog.Add(Global.Emulator.IsLagFrame);
}
// 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<int, bool> with frame values?
//{
// LagLog.Add(Global.Emulator.IsLagFrame);
//}
if (!StateManager.HasState(frame))
{