diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 7de156e57a..0e7b896a6d 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -295,6 +295,7 @@ namespace BizHawk.Client.Common public RecentFiles RecentLua = new RecentFiles(8); public RecentFiles RecentLuaSession = new RecentFiles(8); public bool DisableLuaScriptsOnLoad = false; + public bool RunLuaDuringTurbo = true; // Watch Settings public RecentFiles RecentWatches = new RecentFiles(8); diff --git a/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs b/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs index d4649d5388..0be33d4de3 100644 --- a/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs @@ -56,6 +56,7 @@ this.label4 = new System.Windows.Forms.Label(); this.LogWindowAsConsoleCheckbox = new System.Windows.Forms.CheckBox(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.LuaDuringTurboCheckbox = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage3.SuspendLayout(); @@ -248,6 +249,7 @@ // // tabPage3 // + this.tabPage3.Controls.Add(this.LuaDuringTurboCheckbox); this.tabPage3.Controls.Add(this.label12); this.tabPage3.Controls.Add(this.label13); this.tabPage3.Controls.Add(this.FrameAdvSkipLagCheckbox); @@ -338,6 +340,16 @@ this.LogWindowAsConsoleCheckbox.Text = "Create the log window as a console window"; this.LogWindowAsConsoleCheckbox.UseVisualStyleBackColor = true; // + // LuaDuringTurboCheckbox + // + this.LuaDuringTurboCheckbox.AutoSize = true; + this.LuaDuringTurboCheckbox.Location = new System.Drawing.Point(6, 180); + this.LuaDuringTurboCheckbox.Name = "LuaDuringTurboCheckbox"; + this.LuaDuringTurboCheckbox.Size = new System.Drawing.Size(166, 17); + this.LuaDuringTurboCheckbox.TabIndex = 15; + this.LuaDuringTurboCheckbox.Text = "Run lua scripts when turboing"; + this.LuaDuringTurboCheckbox.UseVisualStyleBackColor = true; + // // EmuHawkOptions // this.AcceptButton = this.OkBtn; @@ -391,5 +403,6 @@ private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; private System.Windows.Forms.CheckBox StartFullScreenCheckbox; + private System.Windows.Forms.CheckBox LuaDuringTurboCheckbox; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/GuiOptions.cs b/BizHawk.Client.EmuHawk/config/GuiOptions.cs index ebe9d64efa..8576ba9f08 100644 --- a/BizHawk.Client.EmuHawk/config/GuiOptions.cs +++ b/BizHawk.Client.EmuHawk/config/GuiOptions.cs @@ -33,6 +33,7 @@ namespace BizHawk.Client.EmuHawk BackupSRamCheckbox.Checked = Global.Config.BackupSaveram; FrameAdvSkipLagCheckbox.Checked = Global.Config.SkipLagFrame; LogWindowAsConsoleCheckbox.Checked = Global.Config.WIN32_CONSOLE; + LuaDuringTurboCheckbox.Checked = Global.Config.RunLuaDuringTurbo; if (LogConsole.ConsoleVisible) { @@ -58,6 +59,7 @@ namespace BizHawk.Client.EmuHawk Global.Config.BackupSaveram = BackupSRamCheckbox.Checked; Global.Config.SkipLagFrame = FrameAdvSkipLagCheckbox.Checked; Global.Config.WIN32_CONSOLE = LogWindowAsConsoleCheckbox.Checked; + Global.Config.RunLuaDuringTurbo = LuaDuringTurboCheckbox.Checked; Close(); DialogResult = DialogResult.OK; diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index 334f2c6594..26d4511156 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -549,6 +549,11 @@ namespace BizHawk.Client.EmuHawk public void FastUpdateAfter() { + if (Global.Config.RunLuaDuringTurbo && Has()) + { + LuaConsole.ResumeScripts(true); + } + var afterList = _tools.Where(x => !x.UpdateBefore); foreach (var tool in afterList) {