TasStateManager - capture every other frame for now

This commit is contained in:
adelikat 2014-08-27 20:43:45 +00:00
parent e65e9d8a22
commit bbc84471d8
1 changed files with 27 additions and 13 deletions

View File

@ -65,8 +65,21 @@ namespace BizHawk.Client.Common
/// <summary>
/// Requests that the current emulator state be captured
/// Unless force is true, the state may or may not be captured depending on the logic employed by "greenzone" management
/// </summary>
public void Capture()
public void Capture(bool force = false)
{
bool shouldCapture = false;
if (force)
{
shouldCapture = force;
}
else
{
shouldCapture = Global.Emulator.Frame % 2 > 0;
}
if (shouldCapture)
{
var frame = Global.Emulator.Frame;
var state = (byte[])Global.Emulator.SaveStateBinary().Clone();
@ -87,6 +100,7 @@ namespace BizHawk.Client.Common
Used += state.Length;
}
}
}
public bool HasState(int frame)
{