From 4deda7eb914d9576d2aeb811eaf5baf163a902c2 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 3 Aug 2014 22:19:55 +0000 Subject: [PATCH] settings cleanup --- .../Consoles/Nintendo/Gameboy/Gambatte.cs | 16 ++++++---------- .../Consoles/Sega/Saturn/Yabause.cs | 10 ++++++++-- .../Consoles/Sega/gpgx/GPGX.cs | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index 68c1061077..d53091099d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -990,16 +990,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public bool PutSyncSettings(object o) { var s = (GambatteSyncSettings)o; - bool ret; - if (s.ForceDMG != _SyncSettings.ForceDMG || - s.GBACGB != _SyncSettings.GBACGB || - s.MulticartCompat != _SyncSettings.MulticartCompat || - s.RealTimeRTC != _SyncSettings.RealTimeRTC || - s.RTCInitialTime != _SyncSettings.RTCInitialTime) - ret = true; - else - ret = false; - + bool ret = GambatteSyncSettings.NeedsReboot(_SyncSettings, s); _SyncSettings = s; return ret; } @@ -1073,6 +1064,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy { return (GambatteSyncSettings)MemberwiseClone(); } + + public static bool NeedsReboot(GambatteSyncSettings x, GambatteSyncSettings y) + { + return !DeepEquality.DeepEquals(x, y); + } } #endregion diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs index 7fecbd9239..9e9cea4c4b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs @@ -739,18 +739,23 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn [DefaultValue(1)] public int DispFactor { get { return _DispFactor; } set { _DispFactor = Math.Max(1, Math.Min(value, 4)); } } [JsonIgnore] + [DeepEqualsIgnore] private int _DispFactor; [DisplayName("Display Free")] [Description("In OpenGL mode, set to true to use a custom resolution and ignore DispFactor.")] [DefaultValue(false)] - public bool DispFree { get; set; } + public bool DispFree { get { return _DispFree; } set { _DispFree = value; } } + [JsonIgnore] + [DeepEqualsIgnore] + private bool _DispFree; [DisplayName("DispFree Final Width")] [Description("In OpenGL mode and when DispFree is true, the width of the final resolution.")] [DefaultValue(640)] public int GLW { get { return _GLW; } set { _GLW = Math.Max(320, Math.Min(value, 2048)); } } [JsonIgnore] + [DeepEqualsIgnore] private int _GLW; [DisplayName("DispFree Final Height")] @@ -758,6 +763,7 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn [DefaultValue(480)] public int GLH { get { return _GLH; } set { _GLH = Math.Max(224, Math.Min(value, 1024)); } } [JsonIgnore] + [DeepEqualsIgnore] private int _GLH; [DisplayName("Ram Cart Type")] @@ -782,7 +788,7 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn public static bool NeedsReboot(SaturnSyncSettings x, SaturnSyncSettings y) { - return x.UseGL != y.UseGL || x.CartType != y.CartType || x.SkipBios != y.SkipBios || x.RealTimeRTC != y.RealTimeRTC || x.RTCInitialTime != y.RTCInitialTime; + return !DeepEquality.DeepEquals(x, y); } public SaturnSyncSettings Clone() { diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs index 1ce4e6af54..a77d572f2e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs @@ -824,7 +824,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public static bool NeedsReboot(GPGXSyncSettings x, GPGXSyncSettings y) { - return x.UseSixButton != y.UseSixButton || x.ControlType != y.ControlType || x.Region != y.Region; + return !DeepEquality.DeepEquals(x, y); } }