Permalink
Browse files

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.)
  • Loading branch information...
rogerman committed Dec 2, 2016
1 parent a0f8b7a commit ac69f1e229455cae35fac33ec527318f887bf775
Showing with 12 additions and 10 deletions.
  1. +12 −10 desmume/src/GPU.cpp
View
@@ -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<OUTPUTFORMAT, true>();
}
if (CommonSettings.showGpu.sub && this->_engineSub->GetIsMasterBrightFullIntensity())
{
this->_engineSub->ApplyMasterBrightness<OUTPUTFORMAT, true>();
}
}
}
@@ -7440,11 +7450,7 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested)
{
if (CommonSettings.showGpu.main)
{
if (this->_engineMain->GetIsMasterBrightFullIntensity())
{
this->_engineMain->ApplyMasterBrightness<OUTPUTFORMAT, true>();
}
else
if (!this->_engineMain->GetIsMasterBrightFullIntensity())
{
this->_engineMain->ApplyMasterBrightness<OUTPUTFORMAT, false>();
}
@@ -7456,11 +7462,7 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested)
if (CommonSettings.showGpu.sub)
{
if (this->_engineSub->GetIsMasterBrightFullIntensity())
{
this->_engineSub->ApplyMasterBrightness<OUTPUTFORMAT, true>();
}
else
if (!this->_engineSub->GetIsMasterBrightFullIntensity())
{
this->_engineSub->ApplyMasterBrightness<OUTPUTFORMAT, false>();
}

0 comments on commit ac69f1e

Please sign in to comment.