From 650607cfd7ca3e9bf824dc39fbd52c40e09fe63d Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 3 May 2014 11:59:11 +0000 Subject: [PATCH] Put Lua FrameBefore and FrameAfter event firing into the event loop instead of tools, so that it isn't bypassed when turboing. Probably works, couldn't test. --- BizHawk.Client.EmuHawk/MainForm.cs | 13 +++++++++++-- BizHawk.Client.EmuHawk/tools/ToolManager.cs | 3 --- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index ea105cdadb..43768f5ed5 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -2500,8 +2500,11 @@ namespace BizHawk.Client.EmuHawk Global.ClickyVirtualPadController.FrameTick(); Global.LuaAndAdaptor.FrameTick(); - //zero 03-may-2014 - there is a bug in here: lua should be updating even when turboing - //please remove lua event-firing from gui viewing tools -related code + if (GlobalWin.Tools.Has()) + { + GlobalWin.Tools.LuaConsole.LuaImp.CallFrameBeforeEvent(); + } + if (!isTurboing) { GlobalWin.Tools.UpdateToolsBefore(); @@ -2565,6 +2568,12 @@ namespace BizHawk.Client.EmuHawk } PressFrameAdvance = false; + + if (GlobalWin.Tools.Has()) + { + GlobalWin.Tools.LuaConsole.LuaImp.CallFrameAfterEvent(); + } + if (!isTurboing) { UpdateToolsAfter(); diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index dd4ed20846..c0afa86ab9 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -229,8 +229,6 @@ namespace BizHawk.Client.EmuHawk { LuaConsole.StartLuaDrawing(); } - - LuaConsole.LuaImp.CallFrameBeforeEvent(); } UpdateBefore(); @@ -247,7 +245,6 @@ namespace BizHawk.Client.EmuHawk if (Has()) { - LuaConsole.LuaImp.CallFrameAfterEvent(); if (!fromLua) { LuaConsole.EndLuaDrawing();