From ec582fb35c2cb40a8e1d7d9a0cb80af1d908eeff Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Thu, 15 Sep 2016 16:06:31 -0400 Subject: [PATCH] Properly check draw_bg every pixel --- .../Consoles/Nintendo/NES/PPU.run.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs index 2fd132bf32..90222b7827 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs @@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //check all the conditions that can cause things to render in these 8px bool renderspritenow = reg_2001.show_obj && (xt > 0 || reg_2001.show_obj_leftmost); - bool renderbgnow = reg_2001.show_bg && (xt > 0 || reg_2001.show_bg_leftmost); + bool renderbgnow; for (int xp = 0; xp < 8; xp++, rasterpos++) { @@ -295,13 +295,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - ////////////////////////////////////////////////// - //Sprite Evaluation End - ////////////////////////////////////////////////// + ////////////////////////////////////////////////// + //Sprite Evaluation End + ////////////////////////////////////////////////// + renderbgnow = reg_2001.show_bg && (xt > 0 || reg_2001.show_bg_leftmost); - //process the current clock's worth of bg data fetching - //this needs to be split into 8 pieces or else exact sprite 0 hitting wont work due to the cpu not running while the sprite renders below - Read_bgdata(xp, ref bgdata[xt + 2]); + //process the current clock's worth of bg data fetching + //this needs to be split into 8 pieces or else exact sprite 0 hitting wont work due to the cpu not running while the sprite renders below + Read_bgdata(xp, ref bgdata[xt + 2]); //bg pos is different from raster pos due to its offsetability. //so adjust for that here