diff --git a/BizHawk.Client.Common/movie/tasproj/IStateManager.cs b/BizHawk.Client.Common/movie/tasproj/IStateManager.cs index d63313f015..2524c33c32 100644 --- a/BizHawk.Client.Common/movie/tasproj/IStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/IStateManager.cs @@ -37,6 +37,8 @@ namespace BizHawk.Client.Common // TODO: rename to Last int LastStatedFrame { get; } + bool IsMarkerState(int frame); + // ********* Delete these ********** void MountWriteAccess(); @@ -50,8 +52,6 @@ namespace BizHawk.Client.Common bool RemoveState(int frame); - bool StateIsMarker(int frame); - int StateCount { get; } int GetStateIndexByFrame(int frame); diff --git a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs index 4479e8c60e..8769b1277b 100644 --- a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs +++ b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs @@ -78,7 +78,7 @@ namespace BizHawk.Client.Common { int currentFrame = _tsm.GetStateFrameByIndex(currentStateIndex); - if (_tsm.StateIsMarker(currentFrame)) + if (_tsm.IsMarkerState(currentFrame)) { continue; } @@ -123,7 +123,7 @@ namespace BizHawk.Client.Common { int currentFrame = _tsm.GetStateFrameByIndex(currentStateIndex); - if (_tsm.StateIsMarker(currentFrame)) + if (_tsm.IsMarkerState(currentFrame)) { continue; } diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index be8cd25dc0..6de8df4211 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -150,7 +150,7 @@ namespace BizHawk.Client.Common /// /// 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 + /// Unless force is true, the state may or may not be captured depending on the logic employed by "green-zone" management /// public void Capture(bool force = false) { @@ -165,13 +165,13 @@ namespace BizHawk.Client.Common { shouldCapture = force; } - else if (frame == 0) // For now, long term, TasMovie should have a .StartState property, and a tasproj file for the start state in non-savestate anchored movies + else if (frame == 0) // For now, long term, TasMovie should have a .StartState property, and a .tasproj file for the start state in non-savestate anchored movies { shouldCapture = true; } - else if (StateIsMarker(frame)) + else if (IsMarkerState(frame)) { - shouldCapture = true; // Markers shoudl always get priority + shouldCapture = true; // Markers should always get priority } else { @@ -184,18 +184,6 @@ namespace BizHawk.Client.Common } } - private void MoveStateToDisk(int index) - { - Used -= (ulong)_states[index].Length; - _states[index].MoveToDisk(); - } - - private void MoveStateToMemory(int index) - { - _states[index].MoveToRAM(); - Used += (ulong)_states[index].Length; - } - internal void SetState(int frame, byte[] state, bool skipRemoval = true) { if (!skipRemoval) // skipRemoval: false only when capturing new states @@ -252,7 +240,7 @@ namespace BizHawk.Client.Common return anyInvalidated; } - public bool StateIsMarker(int frame) + public bool IsMarkerState(int frame) { if (frame == -1) { @@ -310,7 +298,7 @@ namespace BizHawk.Client.Common { int frame = GetStateFrameByIndex(i); - if (StateIsMarker(frame) || frame % _fileStateGap < _stateFrequency) + if (IsMarkerState(frame) || frame % _fileStateGap < _stateFrequency) { continue; } @@ -339,7 +327,7 @@ namespace BizHawk.Client.Common break; } } - while (StateIsMarker(GetStateFrameByIndex(index))); + while (IsMarkerState(GetStateFrameByIndex(index))); if (index >= _states.Count) { @@ -547,15 +535,5 @@ namespace BizHawk.Client.Common return 0; } } - - private int FindState(StateManagerState s) - { - if (!_states.ContainsValue(s)) - { - return -1; - } - - return s.Frame; - } } }