diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs index 058fdc867f..772f8cec7a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs @@ -3,6 +3,7 @@ using System.Windows.Forms; using BizHawk.Emulation.Common; using BizHawk.Client.Common; +using BizHawk.Common.NumberExtensions; namespace BizHawk.Client.EmuHawk { @@ -34,10 +35,8 @@ namespace BizHawk.Client.EmuHawk MemStateGapDividerNumeric.Maximum = Statable.SaveStateBinary().Length / 1024 / 2 + 1; MemStateGapDividerNumeric.Minimum = Statable.SaveStateBinary().Length / 1024 / 16; - - // props to .net for this amazing Clamp() implementation - MemStateGapDividerNumeric.Value = Math.Min(Math.Max(_settings.MemStateGapDivider, - MemStateGapDividerNumeric.Minimum), MemStateGapDividerNumeric.Maximum); + MemStateGapDividerNumeric.Value = NumberExtensions.Clamp(_settings.MemStateGapDivider, + MemStateGapDividerNumeric.Minimum, MemStateGapDividerNumeric.Maximum); FileStateGapNumeric.Value = _settings.FileStateGap; SavestateSizeLabel.Text = Math.Round(_stateSizeMb, 2).ToString() + " MB";