fix stuff with PCE multicontroller config which already worked without any sort of config at all years ago
This commit is contained in:
parent
a6c87a7262
commit
7a7a7783dc
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue