From d56306d1e9d9c3cda39e9f2e62fff0a3c7808f59 Mon Sep 17 00:00:00 2001 From: Sour Date: Wed, 6 Mar 2019 22:24:35 -0500 Subject: [PATCH] PPU: Fixed some effects not being applied to the right-most pixels --- Core/Ppu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Ppu.cpp b/Core/Ppu.cpp index a4c0984..6013f32 100644 --- a/Core/Ppu.cpp +++ b/Core/Ppu.cpp @@ -510,7 +510,7 @@ void Ppu::RenderSprites() } } } else { - for(int x = _drawStartX; x < _drawEndX; x++) { + for(int x = _drawStartX; x <= _drawEndX; x++) { if(!_subScreenFilled[x] && _spritePriority[x] == priority) { if(activeWindowCount && ProcessMaskWindow(activeWindowCount, x)) { //This pixel was masked @@ -898,7 +898,7 @@ void Ppu::ApplyColorMath() uint8_t activeWindowCount = (uint8_t)_window[0].ActiveLayers[Ppu::ColorWindowIndex] + (uint8_t)_window[1].ActiveLayers[Ppu::ColorWindowIndex]; - for(int x = _drawStartX; x < _drawEndX; x++) { + for(int x = _drawStartX; x <= _drawEndX; x++) { if(_rowPixelFlags[x] & PixelFlags::AllowColorMath) { uint8_t halfShift = _colorMathHalveResult ? 1 : 0; uint16_t &mainPixel = _mainScreenBuffer[x]; @@ -980,7 +980,7 @@ template void Ppu::ApplyBrightness() { if(_screenBrightness != 15) { - for(int x = _drawStartX; x < _drawEndX; x++) { + for(int x = _drawStartX; x <= _drawEndX; x++) { uint16_t &pixel = (forMainScreen ? _mainScreenBuffer : _subScreenBuffer)[x]; uint16_t r = (pixel & 0x1F) * _screenBrightness / 15; uint16_t g = ((pixel >> 5) & 0x1F) * _screenBrightness / 15;