diff --git a/src/BizHawk.Client.Common/Global.cs b/src/BizHawk.Client.Common/Global.cs
index 0d87001fb2..28501cc6f3 100644
--- a/src/BizHawk.Client.Common/Global.cs
+++ b/src/BizHawk.Client.Common/Global.cs
@@ -14,16 +14,6 @@ namespace BizHawk.Client.Common
public static IMovieSession MovieSession { get; set; }
- ///
- /// Used to disable secondary throttling (e.g. vsync, audio) for unthrottled modes or when the primary (clock) throttle is taking over (e.g. during fast forward/rewind).
- ///
- public static bool DisableSecondaryThrottling { get; set; }
-
- ///
- /// The maximum number of milliseconds the sound output buffer can go below full before causing a noticeable sound interruption.
- ///
- public static int SoundMaxBufferDeficitMs { get; set; }
-
public static InputManager InputManager { get; } = new InputManager();
public static Dictionary UserBag { get; set; } = new Dictionary();
diff --git a/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs
index 6629d5d3ab..86fe049f5d 100644
--- a/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs
+++ b/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs
@@ -914,7 +914,7 @@ namespace BizHawk.Client.EmuHawk
//this makes sense... but we don't have the infrastructure to support it now (we'd have to enable triple buffering or something like that)
//so what we're gonna do is disable vsync no matter what if throttling is off, and maybe nobody will notice.
//update 26-mar-2016: this upsets me. When fast-forwarding and skipping frames, vsync should still work. But I'm not changing it yet
- if (Global.DisableSecondaryThrottling)
+ if (GlobalWin.DisableSecondaryThrottling)
vsync = false;
//for now, it's assumed that the presentation panel is the main window, but that may not always be true
diff --git a/src/BizHawk.Client.EmuHawk/GlobalWin.cs b/src/BizHawk.Client.EmuHawk/GlobalWin.cs
index bd7ae5db29..60a4cb805d 100644
--- a/src/BizHawk.Client.EmuHawk/GlobalWin.cs
+++ b/src/BizHawk.Client.EmuHawk/GlobalWin.cs
@@ -27,5 +27,10 @@ namespace BizHawk.Client.EmuHawk
public static Communication.HttpCommunication httpCommunication = null;
public static Communication.SocketServer socketServer = null;
public static Communication.MemoryMappedFiles memoryMappedFiles = null;
+
+ ///
+ /// Used to disable secondary throttling (e.g. vsync, audio) for unthrottled modes or when the primary (clock) throttle is taking over (e.g. during fast forward/rewind).
+ ///
+ public static bool DisableSecondaryThrottling { get; set; }
}
}
diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs
index cefa9f204f..355f54b922 100644
--- a/src/BizHawk.Client.EmuHawk/MainForm.cs
+++ b/src/BizHawk.Client.EmuHawk/MainForm.cs
@@ -2030,7 +2030,7 @@ namespace BizHawk.Client.EmuHawk
speedPercent = Math.Max(speedPercent * Config.Rewind.SpeedMultiplier / Rewinder.RewindFrequency, 5);
}
- Global.DisableSecondaryThrottling = _unthrottled || turbo || fastForward || rewind;
+ GlobalWin.DisableSecondaryThrottling = _unthrottled || turbo || fastForward || rewind;
// realtime throttle is never going to be so exact that using a double here is wrong
_throttle.SetCoreFps(Emulator.VsyncRate());
diff --git a/src/BizHawk.Client.EmuHawk/Sound/Sound.cs b/src/BizHawk.Client.EmuHawk/Sound/Sound.cs
index cb92869efb..34ec195c1e 100644
--- a/src/BizHawk.Client.EmuHawk/Sound/Sound.cs
+++ b/src/BizHawk.Client.EmuHawk/Sound/Sound.cs
@@ -41,6 +41,11 @@ namespace BizHawk.Client.EmuHawk
_outputDevice = new DummySoundOutput(this);
}
+ ///
+ /// The maximum number of milliseconds the sound output buffer can go below full before causing a noticeable sound interruption.
+ ///
+ public int SoundMaxBufferDeficitMs { get; set; }
+
public void Dispose()
{
if (_disposed) return;
@@ -64,7 +69,7 @@ namespace BizHawk.Client.EmuHawk
_outputProvider.MaxSamplesDeficit = _outputDevice.MaxSamplesDeficit;
- Global.SoundMaxBufferDeficitMs = (int)Math.Ceiling(SamplesToMilliseconds(_outputDevice.MaxSamplesDeficit));
+ SoundMaxBufferDeficitMs = (int)Math.Ceiling(SamplesToMilliseconds(_outputDevice.MaxSamplesDeficit));
IsStarted = true;
}
@@ -77,7 +82,7 @@ namespace BizHawk.Client.EmuHawk
_bufferedProvider?.DiscardSamples();
- Global.SoundMaxBufferDeficitMs = 0;
+ SoundMaxBufferDeficitMs = 0;
IsStarted = false;
}
@@ -161,7 +166,7 @@ namespace BizHawk.Client.EmuHawk
_outputProvider.BaseSoundProvider.GetSamplesSync(out samples, out sampleCount);
sampleOffset = 0;
- if (Global.DisableSecondaryThrottling && sampleCount > samplesNeeded)
+ if (GlobalWin.DisableSecondaryThrottling && sampleCount > samplesNeeded)
{
return;
}
@@ -189,7 +194,7 @@ namespace BizHawk.Client.EmuHawk
}
else
{
- if (Global.DisableSecondaryThrottling) // This indicates rewind or fast-forward
+ if (GlobalWin.DisableSecondaryThrottling) // This indicates rewind or fast-forward
{
_outputProvider.OnVolatility();
}
diff --git a/src/BizHawk.Client.EmuHawk/Throttle.cs b/src/BizHawk.Client.EmuHawk/Throttle.cs
index 0247e73f9c..7c623d2559 100644
--- a/src/BizHawk.Client.EmuHawk/Throttle.cs
+++ b/src/BizHawk.Client.EmuHawk/Throttle.cs
@@ -322,7 +322,7 @@ namespace BizHawk.Client.EmuHawk
if (elapsedTime >= timePerFrame)
{
- int maxMissedFrames = (int)Math.Ceiling((Global.SoundMaxBufferDeficitMs / 1000.0) / ((double)timePerFrame / afsfreq));
+ int maxMissedFrames = (int)Math.Ceiling((GlobalWin.Sound.SoundMaxBufferDeficitMs / 1000.0) / ((double)timePerFrame / afsfreq));
if (maxMissedFrames < 3)
maxMissedFrames = 3;