From ac69f1e229455cae35fac33ec527318f887bf775 Mon Sep 17 00:00:00 2001 From: rogerman Date: Fri, 2 Dec 2016 13:50:17 -0800 Subject: [PATCH] GPU: If a GPU engine has master brightness at full intensity , revert to filling the output framebuffer on line 0. Fix bug where the screen may end up fully black or white if the master brightness is modified in the middle of the frame. Fixes SourceForge #1603. (Regression from r5538.) --- desmume/src/GPU.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index bd82708f5..afd7fcb23 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -7360,6 +7360,16 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested) if (!isFrameSkipRequested) { this->UpdateRenderProperties(); + + if (CommonSettings.showGpu.main && this->_engineMain->GetIsMasterBrightFullIntensity()) + { + this->_engineMain->ApplyMasterBrightness(); + } + + if (CommonSettings.showGpu.sub && this->_engineSub->GetIsMasterBrightFullIntensity()) + { + this->_engineSub->ApplyMasterBrightness(); + } } } @@ -7440,11 +7450,7 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested) { if (CommonSettings.showGpu.main) { - if (this->_engineMain->GetIsMasterBrightFullIntensity()) - { - this->_engineMain->ApplyMasterBrightness(); - } - else + if (!this->_engineMain->GetIsMasterBrightFullIntensity()) { this->_engineMain->ApplyMasterBrightness(); } @@ -7456,11 +7462,7 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested) if (CommonSettings.showGpu.sub) { - if (this->_engineSub->GetIsMasterBrightFullIntensity()) - { - this->_engineSub->ApplyMasterBrightness(); - } - else + if (!this->_engineSub->GetIsMasterBrightFullIntensity()) { this->_engineSub->ApplyMasterBrightness(); }