diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 7ad14037bb..01b27cbd77 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -334,6 +334,7 @@ namespace BizHawk.MultiClient throttle.SetCoreFps(Global.Emulator.CoreOutputComm.VsyncRate); + throttle.signal_paused = EmulatorPaused || Global.Emulator is NullEmulator; throttle.signal_unthrottle = unthrottled; if (fastforward) throttle.SetSpeedPercent(Global.Config.SpeedPercentAlternate); diff --git a/BizHawk.MultiClient/Throttle.cs b/BizHawk.MultiClient/Throttle.cs index 3d2cce697b..d26a94c24d 100644 --- a/BizHawk.MultiClient/Throttle.cs +++ b/BizHawk.MultiClient/Throttle.cs @@ -14,6 +14,8 @@ namespace BizHawk.MultiClient int framesskipped; public bool skipnextframe; + //if the emulator is paused then we dont need to behave as if unthrottled + public bool signal_paused; public bool signal_frameAdvance; public bool signal_unthrottle; public bool signal_continuousframeAdvancing; //continuousframeAdvancing @@ -64,9 +66,9 @@ namespace BizHawk.MultiClient if (framestoskip < 1) framestoskip += ffSkipRate; } - else if ((/*autoframeskipenab && frameskiprate ||*/ cfg_frameLimit) && allowSleep) + else if ((signal_paused || /*autoframeskipenab && frameskiprate ||*/ cfg_frameLimit) && allowSleep) { - SpeedThrottle(); + SpeedThrottle(signal_paused); } if (cfg_autoframeskipenab && cfg_frameskiprate!=0) @@ -303,7 +305,7 @@ namespace BizHawk.MultiClient } - void SpeedThrottle() + void SpeedThrottle(bool paused) { AutoFrameSkip_BeforeThrottle(); @@ -322,7 +324,7 @@ namespace BizHawk.MultiClient sleepy /= afsfreq; else sleepy = 0; - if (sleepy >= 10) + if (sleepy >= 10 || paused) { Thread.Sleep((int) (sleepy/2)); // reduce it further beacuse Sleep usually sleeps for more than the amount we tell it to