fix stuff with PCE multicontroller config which already worked without any sort of config at all years ago

This commit is contained in:
goyuken 2014-08-20 18:03:04 +00:00
parent a6c87a7262
commit 7a7a7783dc
1 changed files with 18 additions and 2 deletions

View File

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