diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 089f9af9e4..7dfca2fd03 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -579,11 +579,17 @@ namespace BizHawk.Emulation.Cores.PCEngine ret = false; _settings = n; - SetControllerButtons(); return ret; } - public bool PutSyncSettings(object o) { return false; } + public bool PutSyncSettings(object o) + { + var newsyncsettings = (PCESyncSettings)o; + bool ret = PCESyncSettings.NeedsReboot(newsyncsettings, _syncSettings); + _syncSettings = newsyncsettings; + // SetControllerButtons(); // not safe to change the controller during emulation, so instead make it a reboot event + return ret; + } public class PCESettings { @@ -628,6 +634,16 @@ namespace BizHawk.Emulation.Cores.PCEngine { public bool IsConnected { get; set; } } + + public static bool NeedsReboot(PCESyncSettings x, PCESyncSettings y) + { + for (int i = 0; i < x.Controllers.Length; i++) + { + if (x.Controllers[i].IsConnected != y.Controllers[i].IsConnected) + return true; + } + return false; + } } } }