From 6f4b85146c1c9f5cd3c100bd1db76cb7974dc7b6 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 23 Feb 2011 06:46:03 +0000 Subject: [PATCH] make rewind track the currently chosen speed% --- BizHawk.MultiClient/MainForm.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index ab9e08f9a5..072c5f4cc6 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -30,6 +30,7 @@ namespace BizHawk.MultiClient public bool EmulatorPaused; bool runloop_frameadvance; Throttle throttle = new Throttle(); + int rewindCredits; //For handling automatic pausing when entering the menu private bool wasPaused = false; @@ -615,10 +616,19 @@ namespace BizHawk.MultiClient if (/*Global.Config.RewindEnabled && */Global.ClientControls["Rewind"]) { - Rewind(Global.ClientControls["Fast Forward"] ? 4 : 2); - suppressCaptureRewind = true; - runFrame = true; + rewindCredits += Global.Config.SpeedPercent; + int rewindTodo = rewindCredits / 100; + if (rewindTodo >= 1) + { + rewindCredits -= 100 * rewindTodo; + Rewind(1 + rewindTodo); + suppressCaptureRewind = true; + runFrame = true; + } + else + runFrame = false; } + else rewindCredits = 0; bool genSound = false; if (runFrame)