From 64665f0e8237fa7cdbdeb38b207482c938514809 Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 12 Mar 2017 17:28:54 +0300 Subject: [PATCH] tastudio: use LatchSticky() when adding new frames fixes autohold behavior, making it operate like it did before banning user input latch in replay mode now in replay mode all input is ignored except for autohold, which is set via tastudio gui --- BizHawk.Client.Common/movie/MovieSession.cs | 8 ++++++-- .../movie/bk2/Bk2ControllerAdapter.cs | 11 +++++++++++ .../movie/bkm/BkmControllerAdapter.cs | 11 +++++++++++ .../movie/interfaces/IMovieController.cs | 2 ++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index 153fe99738..08181f14d7 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -294,8 +294,12 @@ namespace BizHawk.Client.Common private void HandleFrameLoopForRecordMode() { - // tasmovie is appended via recording frames, but we don't want it to latch input outside its internal recording mode - if (!(Movie is TasMovie) || !Movie.IsPlaying) + // we don't want tasmovie to latch user input outside its internal recording mode, so limit it to autohold + if (Movie is TasMovie && Movie.IsPlaying) + { + MovieControllerAdapter.LatchSticky(); + } + else { if (MultiTrack.IsActive) { diff --git a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs index 5c8f80df7c..61a73f0221 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs @@ -143,6 +143,17 @@ namespace BizHawk.Client.Common } } + /// + /// latches sticky buttons from Global.AutofireStickyXORAdapter + /// + public void LatchSticky() + { + foreach (var button in Definition.BoolButtons) + { + MyBoolButtons[button] = Global.AutofireStickyXORAdapter.IsSticky(button); + } + } + /// /// latches all buttons from the supplied mnemonic string /// diff --git a/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs b/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs index 60328dc448..38527cb516 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs @@ -64,6 +64,17 @@ namespace BizHawk.Client.Common } } + /// + /// latches sticky buttons from Global.AutofireStickyXORAdapter + /// + public void LatchSticky() + { + foreach (var button in Definition.BoolButtons) + { + MyBoolButtons[button] = Global.AutofireStickyXORAdapter.IsSticky(button); + } + } + /// /// latches all buttons from the supplied mnemonic string /// diff --git a/BizHawk.Client.Common/movie/interfaces/IMovieController.cs b/BizHawk.Client.Common/movie/interfaces/IMovieController.cs index ac1569ee9f..efaa2f45cb 100644 --- a/BizHawk.Client.Common/movie/interfaces/IMovieController.cs +++ b/BizHawk.Client.Common/movie/interfaces/IMovieController.cs @@ -10,6 +10,8 @@ namespace BizHawk.Client.Common void LatchFromSource(IController source); + void LatchSticky(); + void SetControllersAsMnemonic(string mnemonic); } }