From 54b83bcad60b24b0005d3bc0bb5449ba95ec6e9c Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 26 Feb 2013 00:36:13 +0000 Subject: [PATCH] Lua - implement client.pause_av() and client.unpause_av() --- BizHawk.MultiClient/LuaImplementation.cs | 12 ++++++++++++ BizHawk.MultiClient/MainForm.cs | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/BizHawk.MultiClient/LuaImplementation.cs b/BizHawk.MultiClient/LuaImplementation.cs index 7c2ef41670..c060a8ec1f 100644 --- a/BizHawk.MultiClient/LuaImplementation.cs +++ b/BizHawk.MultiClient/LuaImplementation.cs @@ -515,6 +515,8 @@ namespace BizHawk.MultiClient "screenshot", "screenshottoclipboard", "setscreenshotosd", + "pause_av", + "unpause_av", }; public static string[] FormsFunctions = new string[] @@ -1204,6 +1206,16 @@ namespace BizHawk.MultiClient Global.Emulator.CoreComm.InputCallback = null; } + public void client_pause_av() + { + Global.MainForm.PauseAVI = true; + } + + public void client_unpause_av() + { + Global.MainForm.PauseAVI = false; + } + //---------------------------------------------------- //Memory library //---------------------------------------------------- diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 5c6d8ea35d..e7212723c4 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -35,6 +35,7 @@ namespace BizHawk.MultiClient public string CurrentlyOpenRom; SavestateManager StateSlots = new SavestateManager(); + public bool PauseAVI = false; public bool PressFrameAdvance = false; public bool PressRewind = false; public bool FastForward = false; @@ -2967,7 +2968,10 @@ namespace BizHawk.MultiClient MemoryPulse.Pulse(); //======================================= - AVIFrameAdvance(); + if (!PauseAVI) + { + AVIFrameAdvance(); + } if (Global.Emulator.IsLagFrame && Global.Config.AutofireLagFrames) { @@ -2990,7 +2994,7 @@ namespace BizHawk.MultiClient } PressRewind = false; } - if (true == UpdateFrame) + if (UpdateFrame) { if (ReturnToRecording) {