diff --git a/src/BizHawk.Client.Common/movie/MovieSession.cs b/src/BizHawk.Client.Common/movie/MovieSession.cs index 4786be8124..83c9423005 100644 --- a/src/BizHawk.Client.Common/movie/MovieSession.cs +++ b/src/BizHawk.Client.Common/movie/MovieSession.cs @@ -238,13 +238,13 @@ namespace BizHawk.Client.Common public void RunQueuedMovie(bool recordMode, IEmulator emulator, IDictionary preferredCores) { MovieController = new Bk2Controller(emulator.ControllerDefinition); - _queuedMovie.Attach(emulator); foreach (var previousPref in _preferredCores) { preferredCores[previousPref.Key] = previousPref.Value; } Movie = _queuedMovie; + Movie.Attach(emulator); _queuedMovie = null; Movie.ProcessSavestate(Movie.Emulator); diff --git a/src/BizHawk.Client.EmuHawk/IControlMainform.cs b/src/BizHawk.Client.EmuHawk/IControlMainform.cs index 792dd83da3..fb0e263cdf 100644 --- a/src/BizHawk.Client.EmuHawk/IControlMainform.cs +++ b/src/BizHawk.Client.EmuHawk/IControlMainform.cs @@ -2,6 +2,9 @@ { public interface IControlMainform { + bool WantsToControlReboot { get; } + void RebootCore(); + bool WantsToControlSavestates { get; } void SaveState(); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 3d159e3d2f..ab3a2d823e 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -1033,8 +1033,19 @@ namespace BizHawk.Client.EmuHawk public void RebootCore() { - if (CurrentlyOpenRomArgs == null) return; - LoadRom(CurrentlyOpenRomArgs.OpenAdvanced.SimplePath, CurrentlyOpenRomArgs); + if (IsSlave && Master.WantsToControlReboot) + { + Master.RebootCore(); + } + else + { + if (CurrentlyOpenRomArgs == null) + { + return; + } + + LoadRom(CurrentlyOpenRomArgs.OpenAdvanced.SimplePath, CurrentlyOpenRomArgs); + } } public void PauseEmulator() diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs index b10352a3e4..10d24d0e35 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs @@ -2,6 +2,12 @@ { public partial class GenericDebugger : IControlMainform { + + public bool WantsToControlReboot => false; + public void RebootCore() + { + } + public bool WantsToControlSavestates => false; public void SaveState() { } diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IControlMainForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IControlMainForm.cs index f3e8b2a5e7..c17d3ade71 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IControlMainForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IControlMainForm.cs @@ -128,5 +128,14 @@ namespace BizHawk.Client.EmuHawk RefreshDialog(); } } + + public bool WantsToControlReboot { get; private set; } = true; + + public void RebootCore() + { + WantsToControlReboot = false; + NewTasMenuItem_Click(null, null); + WantsToControlReboot = true; + } } }