From e34a1c81cdd6fc9ac406c656bda8118e51ae8d64 Mon Sep 17 00:00:00 2001 From: Sour Date: Mon, 25 Mar 2019 19:10:39 -0400 Subject: [PATCH] PPU: Apply windows to mode 7 --- Core/Ppu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/Ppu.cpp b/Core/Ppu.cpp index 81991f6..2e5b9e7 100644 --- a/Core/Ppu.cpp +++ b/Core/Ppu.cpp @@ -838,6 +838,7 @@ void Ppu::RenderTilemapMode7() lutY[x] = lutY[x - 1] + _mode7.Matrix[2]; } + uint8_t activeWindowCount = (uint8_t)_window[0].ActiveLayers[layerIndex] + (uint8_t)_window[1].ActiveLayers[layerIndex]; uint8_t pixelFlags = PixelFlags::Filled | (((_colorMathEnabled >> layerIndex) & 0x01) ? PixelFlags::AllowColorMath : 0); for(int x = _drawStartX; x <= _drawEndX; x++) { @@ -853,6 +854,11 @@ void Ppu::RenderTilemapMode7() } } + if(activeWindowCount && ProcessMaskWindow(activeWindowCount, x)) { + //This pixel was masked, skip it + continue; + } + int32_t xOffset = (lutX[realX] >> 8); int32_t yOffset = (lutY[realX] >> 8);