tastudio: instead of capturing a tsm state after loading a branch, force greenzone creation when we're navigating past last greenzone frame

doesn't fire when you hit frame advance or > button tho

(don't know why it thinks mgba has changed)
This commit is contained in:
feos 2019-01-06 16:09:06 +03:00
parent c8c3ba1c39
commit ade701f873
2 changed files with 13 additions and 3 deletions

View File

@ -202,7 +202,6 @@ namespace BizHawk.Client.EmuHawk
Movie.LoadBranch(branch);
var stateInfo = new KeyValuePair<int, byte[]>(branch.Frame, branch.CoreData);
Tastudio.LoadState(stateInfo);
Movie.TasStateManager.Capture(true);
QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Tastudio.VideoProvider);
if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)

View File

@ -891,8 +891,19 @@ namespace BizHawk.Client.EmuHawk
_unpauseAfterSeeking = (fromRewinding || WasRecording) && !Mainform.EmulatorPaused;
TastudioPlayMode();
KeyValuePair<int, byte[]> closestState = CurrentTasMovie.TasStateManager.GetStateClosestToFrame(frame);
if (closestState.Value != null && (frame < Emulator.Frame || closestState.Key > Emulator.Frame))
// feos: if there is a state BETWEEN the current frame and the last valid (laglog) frame,
// prefer the latter and use state prior to that. otherwise greenzone will never be appended
// TODO: allow gaps in greenzone to overcome this
// we don't want to wait for seeking to end if there are states in the middle of invalid greenzone
// if there are such states, then we can navigate there, hence it's supposed to be a greenzone
KeyValuePair<int, byte[]> closestState = CurrentTasMovie.TasStateManager
.GetStateClosestToFrame(Math.Min(frame, CurrentTasMovie.LastValidFrame));
if (closestState.Value != null
&& (frame < Emulator.Frame
|| closestState.Key > Emulator.Frame
|| CurrentTasMovie.LastValidFrame < Emulator.Frame))
{
LoadState(closestState);
}