From cf1c53f3fb673c361c59d5f64c02acbb282deb7b Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 16 Sep 2015 14:02:36 -0500 Subject: [PATCH] fix quicknes lua rendering being offset incorrectly sometimes. fixes #498 --- .../tools/Lua/Libraries/EmuLuaLibrary.Gui.cs | 1 + .../Consoles/Nintendo/QuickNES/QuickNES.ISettable.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs index f2619226b8..77197f4aac 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs @@ -116,6 +116,7 @@ namespace BizHawk.Client.EmuHawk { var g = _luaSurface == null ? Graphics.FromImage(_nullGraphicsBitmap) : _luaSurface.GetGraphics(); + //we don't like CoreComm, right? Someone should find a different way to do this then. var tx = Global.Emulator.CoreComm.ScreenLogicalOffsetX; var ty = Global.Emulator.CoreComm.ScreenLogicalOffsetY; if (tx != 0 || ty != 0) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.ISettable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.ISettable.cs index 7f9695a89f..110ae38c60 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.ISettable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.ISettable.cs @@ -27,6 +27,10 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES LibQuickNES.qn_set_sprite_limit(Context, _settings.NumSprites); RecalculateCrops(); CalculatePalette(); + + CoreComm.ScreenLogicalOffsetX = o.ClipLeftAndRight ? 8 : 0; + CoreComm.ScreenLogicalOffsetY = o.ClipTopAndBottom ? 8 : 0; + return false; }