diff --git a/src/BizHawk.Client.EmuHawk/Throttle.cs b/src/BizHawk.Client.EmuHawk/Throttle.cs index ce8c6bea8b..a63c5547b3 100644 --- a/src/BizHawk.Client.EmuHawk/Throttle.cs +++ b/src/BizHawk.Client.EmuHawk/Throttle.cs @@ -230,8 +230,7 @@ namespace BizHawk.Client.EmuHawk // reset way-out-of-range values if (diff > 1.0f) diff = 1.0f; - if (!(-1.0f).RangeTo(1.0f).Contains(error)) - error = 0.0f; + if (Math.Abs(error) > 1.0f) error = 0.0f; if (diffUnthrottled > 1.0f) diffUnthrottled = desiredspf; diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index 6a6c9aefcc..b9d1564b46 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -8,7 +8,6 @@ using System.Xml.XPath; using System.Xml.Linq; using BizHawk.Client.Common; -using BizHawk.Common; using BizHawk.Emulation.Cores.Nintendo.NES; using BizHawk.Emulation.Common; @@ -63,11 +62,7 @@ namespace BizHawk.Client.EmuHawk float a = FreqTable[i - 1]; float b = FreqTable[i]; float c = FreqTable[i + 1]; - var range = ((a + b) / 2).RangeTo((b + c) / 2); - if (range.Contains(freq)) - { - return i - 1; - } + if ((a + b) / 2 <= freq && freq <= (b + c) / 2) return i - 1; } return 95; // I guess?