gpu-backtrack a little bit from r4073, which introduced bugs involved with flashing colors during fully-faded transitions between game modes. i left insufficient records at the time to know what i was trying to fix by r4073, so I can't double check it, but I think this checkin is even better than before while fixing the noted regressions.

This commit is contained in:
zeromus 2012-03-30 05:50:39 +00:00
parent 25b77c1b31
commit cf6345497b
1 changed files with 21 additions and 8 deletions

View File

@ -1,7 +1,8 @@
/* Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 Theo Berkau
Copyright (C) 2007 shash
Copyright (C) 2008-2011 DeSmuME team
/*
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 Theo Berkau
Copyright (C) 2007 shash
Copyright (C) 2008-2012 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -17,6 +18,7 @@
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <string.h>
#include <stdlib.h>
@ -2033,13 +2035,24 @@ static void GPU_RenderLine_layer(NDS_Screen * screen, u16 l)
//we need to write backdrop colors in the same way as we do BG pixels in order to do correct window processing
//this is currently eating up 2fps or so. it is a reasonable candidate for optimization.
gpu->currBgNum = 5;
switch(gpu->setFinalColorBck_funcNum) {
//for backdrops, effects arent applied.
case 0: case 1:
case 2: case 3:
switch(gpu->setFinalColorBck_funcNum)
{
//for backdrops, blend isnt applied (it's illogical, isnt it?)
case 0:
case 1:
memset_u16_le<256>(gpu->currDst,backdrop_color);
break;
//for backdrops, fade in and fade out can be applied if it's a 1st target screen
case 2:
if(gpu->BLDCNT & 0x20) //backdrop is selected for color effect
memset_u16_le<256>(gpu->currDst,gpu->currentFadeInColors[backdrop_color]);
break;
case 3:
if(gpu->BLDCNT & 0x20) //backdrop is selected for color effect
memset_u16_le<256>(gpu->currDst,gpu->currentFadeOutColors[backdrop_color]);
break;
//windowed cases apparently need special treatment? why? can we not render the backdrop? how would that even work?
case 4: for(int x=0;x<256;x++) gpu->___setFinalColorBck<false,true,4>(backdrop_color,x,1); break;
case 5: for(int x=0;x<256;x++) gpu->___setFinalColorBck<false,true,5>(backdrop_color,x,1); break;