have Tastudio control RebootCore when it is open, fixes #2201

This commit is contained in:
adelikat 2020-07-18 10:24:46 -05:00
parent 5c250a7ca5
commit 0925997557
5 changed files with 32 additions and 3 deletions

View File

@ -238,13 +238,13 @@ namespace BizHawk.Client.Common
public void RunQueuedMovie(bool recordMode, IEmulator emulator, IDictionary<string, string> 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);

View File

@ -2,6 +2,9 @@
{
public interface IControlMainform
{
bool WantsToControlReboot { get; }
void RebootCore();
bool WantsToControlSavestates { get; }
void SaveState();

View File

@ -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()

View File

@ -2,6 +2,12 @@
{
public partial class GenericDebugger : IControlMainform
{
public bool WantsToControlReboot => false;
public void RebootCore()
{
}
public bool WantsToControlSavestates => false;
public void SaveState() { }

View File

@ -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;
}
}
}