From 35fbe354c1a163915c6d828c6b4bdd8b2ab3da97 Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 16 Apr 2012 08:18:41 +0000 Subject: [PATCH] add threaded display manager to allow heavy OSD/compositing/filtering to happen on another thread. add a lua layer accessible via GDI+ which can be automatically composited and the simplest possible demo of it. add some filtering infrastructure and a hq2x filter set ported to c# but need to work on a minimal selector gui before its usable. separate OSD from RenderPanel so that gdi+ presentation mode now gets full OSD support. the OSD is now a little uglier because its drawn entirely differently and could use some finetuning --- BizHawk.Emulation/Util.cs | 9 + .../BizHawk.MultiClient.csproj | 3 + .../DisplayManager/DisplayManager.cs | 688 ++++++++++++++++++ .../DisplayManager/Filters/Hq2x.cs | 535 ++++++++++++++ BizHawk.MultiClient/Global.cs | 2 + BizHawk.MultiClient/LuaImplementation.cs | 53 +- BizHawk.MultiClient/MainForm.Designer.cs | 13 +- BizHawk.MultiClient/MainForm.MenuItems.cs | 7 +- BizHawk.MultiClient/MainForm.Movie.cs | 4 +- BizHawk.MultiClient/MainForm.cs | 108 ++- .../NEStools/NESGraphicsConfig.cs | 4 +- BizHawk.MultiClient/Program.cs | 15 +- BizHawk.MultiClient/RenderPanel.cs | 327 ++------- BizHawk.MultiClient/Rewind.cs | 4 +- BizHawk.MultiClient/movie/Movie.cs | 10 +- BizHawk.MultiClient/tools/Cheats.cs | 6 +- BizHawk.MultiClient/tools/LuaConsole.cs | 2 +- BizHawk.MultiClient/tools/RamWatch.cs | 6 +- BizHawk.MultiClient/tools/TAStudio.cs | 2 +- 19 files changed, 1427 insertions(+), 371 deletions(-) create mode 100644 BizHawk.MultiClient/DisplayManager/DisplayManager.cs create mode 100644 BizHawk.MultiClient/DisplayManager/Filters/Hq2x.cs diff --git a/BizHawk.Emulation/Util.cs b/BizHawk.Emulation/Util.cs index ef41c4eb72..0c475239eb 100644 --- a/BizHawk.Emulation/Util.cs +++ b/BizHawk.Emulation/Util.cs @@ -638,6 +638,15 @@ namespace BizHawk bptr[i] = (byte)val; } + public static unsafe void memset32(void* ptr, int val, int len) + { + System.Diagnostics.Debug.Assert(len % 4 == 0); + int dwords = len / 4; + int* dwptr = (int*)ptr; + for (int i = 0; i < dwords; i++) + dwptr[i] = val; + } + public static byte[] ReadAllBytes(Stream stream) { const int BUFF_SIZE = 4096; diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index ffe2246277..e02ed1f455 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -158,6 +158,8 @@ SoundConfig.cs + + Form @@ -772,6 +774,7 @@ true +