PSX - properly clone sync settings and flag core reboot properly when changing controller settings

This commit is contained in:
adelikat 2015-02-01 14:44:08 +00:00
parent 271193251c
commit c1308b7528
1 changed files with 12 additions and 2 deletions

View File

@ -14,6 +14,7 @@ using System;
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.IO; using System.IO;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -925,7 +926,10 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
{ {
public SyncSettings Clone() public SyncSettings Clone()
{ {
return (SyncSettings)MemberwiseClone(); var ret = (SyncSettings)MemberwiseClone();
ret.Controllers = Controllers.Select(x => x.Clone()).ToArray();
return ret;
} }
public ControllerSetting[] Controllers = public ControllerSetting[] Controllers =
@ -945,6 +949,11 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
public class ControllerSetting public class ControllerSetting
{ {
public ControllerSetting Clone()
{
return (ControllerSetting)this.MemberwiseClone();
}
public bool IsConnected { get; set; } public bool IsConnected { get; set; }
public ControllerType Type { get; set; } public ControllerType Type { get; set; }
@ -1042,8 +1051,9 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
public bool PutSyncSettings(SyncSettings o) public bool PutSyncSettings(SyncSettings o)
{ {
var ret = !DeepEquality.DeepEquals(_SyncSettings, o);
_SyncSettings = o; _SyncSettings = o;
return false; return ret;
} }
#endregion #endregion