From 8d0307596c0cbe236b1332bfa585cc535e99958f Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sun, 26 Apr 2020 09:37:35 -0400 Subject: [PATCH] GBHawk: window bug fix, fixes Zen --- .../Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs | 6 ++++++ .../Consoles/Nintendo/GBHawk/GBC_PPU.cs | 6 ++++++ BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs index be2336c31f..f10cb53b6c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs @@ -169,6 +169,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk break; case 0xFF4A: // WY window_y = value; + if (!window_started) + { + window_y_latch = window_y; + window_y_tile = 0; + window_y_tile_inc = 0; + } break; case 0xFF4B: // WX window_x = value; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs index 5ff0b35f0d..03b4f783a7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs @@ -165,6 +165,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk break; case 0xFF4A: // WY window_y = value; + if (!window_started) + { + window_y_latch = window_y; + window_y_tile = 0; + window_y_tile_inc = 0; + } break; case 0xFF4B: // WX window_x = value; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs index a1a5960866..8bc41f4b4c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs @@ -49,7 +49,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // don't draw for one frame after turning on blank_frame = true; } - LCDC = value; break; case 0xFF41: // STAT @@ -121,6 +120,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk break; case 0xFF4A: // WY window_y = value; + if (!window_started) + { + window_y_latch = window_y; + window_y_tile = 0; + window_y_tile_inc = 0; + } break; case 0xFF4B: // WX window_x = value;