Rewritten the incorrectly implemented setFinalBGColorSpecialIncreaseWnd and setFinalBGColorSpecialDecreaseWnd functions. This fixes the part 1 of the glitch #2488334 (SPP puzzle glitch).
This commit is contained in:
parent
3bb392c413
commit
d66fd4ab85
|
@ -431,9 +431,9 @@ u16 GPU::blend(u16 colA, u16 colB)
|
||||||
|
|
||||||
void GPU_setMasterBrightness (GPU *gpu, u16 val)
|
void GPU_setMasterBrightness (GPU *gpu, u16 val)
|
||||||
{
|
{
|
||||||
if(!nds.isInVblank()) {
|
if(!nds.isInVblank()) {
|
||||||
PROGINFO("Changing master brightness outside of vblank\n");
|
PROGINFO("Changing master brightness outside of vblank\n");
|
||||||
}
|
}
|
||||||
gpu->MasterBrightFactor = (val & 0x1F);
|
gpu->MasterBrightFactor = (val & 0x1F);
|
||||||
gpu->MasterBrightMode = (val>>14);
|
gpu->MasterBrightMode = (val>>14);
|
||||||
}
|
}
|
||||||
|
@ -777,20 +777,21 @@ static void setFinalBGColorSpecialIncreaseWnd (GPU *gpu, u8 *dst, u16 color, u8
|
||||||
|
|
||||||
gpu->renderline_checkWindows(x, windowDraw, windowEffect);
|
gpu->renderline_checkWindows(x, windowDraw, windowEffect);
|
||||||
|
|
||||||
if (((gpu->BLDCNT >> gpu->currBgNum)&1) && windowEffect) // the bg to draw has a special color effect
|
if(windowDraw)
|
||||||
{
|
{
|
||||||
if (gpu->BLDY_EVY != 0x0)
|
if((gpu->BLDCNT & (1 << gpu->currBgNum)) && windowEffect)
|
||||||
{ // dont slow down if there is nothing to do
|
|
||||||
}
|
|
||||||
|
|
||||||
T2WriteWord(dst, 0, color) ;
|
|
||||||
gpu->bgPixels[x] = gpu->currBgNum;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((windowEffect && (gpu->BLDCNT & (0x100 << gpu->currBgNum))) || windowDraw)
|
|
||||||
{
|
{
|
||||||
T2WriteWord(dst, 0, color);
|
if (gpu->BLDY_EVY != 0x0)
|
||||||
|
{
|
||||||
|
color = fadeInColors[gpu->BLDY_EVY][color&0x7FFF];
|
||||||
|
}
|
||||||
|
|
||||||
|
T2WriteWord(dst, 0, (color | 0x8000));
|
||||||
|
gpu->bgPixels[x] = gpu->currBgNum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
T2WriteWord(dst, 0, (color | 0x8000));
|
||||||
gpu->bgPixels[x] = gpu->currBgNum;
|
gpu->bgPixels[x] = gpu->currBgNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -802,20 +803,21 @@ static void setFinalBGColorSpecialDecreaseWnd (GPU *gpu, u8 *dst, u16 color, u8
|
||||||
|
|
||||||
gpu->renderline_checkWindows(x, windowDraw, windowEffect);
|
gpu->renderline_checkWindows(x, windowDraw, windowEffect);
|
||||||
|
|
||||||
if (((gpu->BLDCNT >> gpu->currBgNum)&1) && windowEffect) // the bg to draw has a special color effect
|
if(windowDraw)
|
||||||
{
|
{
|
||||||
if (gpu->BLDY_EVY != 0x0)
|
if((gpu->BLDCNT & (1 << gpu->currBgNum)) && windowEffect)
|
||||||
{ // dont slow down if there is nothing to do
|
|
||||||
color = (fadeOutColors[gpu->BLDY_EVY][color&0x7FFF] | 0x8000);
|
|
||||||
}
|
|
||||||
T2WriteWord(dst, 0, color) ;
|
|
||||||
gpu->bgPixels[x] = gpu->currBgNum;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((windowEffect && (gpu->BLDCNT & (0x100 << gpu->currBgNum))) || windowDraw)
|
|
||||||
{
|
{
|
||||||
T2WriteWord(dst, 0, color);
|
if (gpu->BLDY_EVY != 0x0)
|
||||||
|
{
|
||||||
|
color = fadeOutColors[gpu->BLDY_EVY][color&0x7FFF];
|
||||||
|
}
|
||||||
|
|
||||||
|
T2WriteWord(dst, 0, (color | 0x8000));
|
||||||
|
gpu->bgPixels[x] = gpu->currBgNum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
T2WriteWord(dst, 0, (color | 0x8000));
|
||||||
gpu->bgPixels[x] = gpu->currBgNum;
|
gpu->bgPixels[x] = gpu->currBgNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1423,15 +1425,15 @@ static void setFinal3DColorSpecialDecreaseWnd(GPU *gpu, u32 passing, u8 *dst, u1
|
||||||
//overhead was ridiculous and terrible
|
//overhead was ridiculous and terrible
|
||||||
FORCEINLINE void GPU::__setFinalColorBck(u8 *dst, u16 color, u8 x, bool opaque)
|
FORCEINLINE void GPU::__setFinalColorBck(u8 *dst, u16 color, u8 x, bool opaque)
|
||||||
{
|
{
|
||||||
//I commented out this line to make a point.
|
//I commented out this line to make a point.
|
||||||
//indeed, since x is a u8 we cannot pass in anything >=256
|
//indeed, since x is a u8 we cannot pass in anything >=256
|
||||||
//but in fact, someone is going to try. specifically, that is the map viewer debug tools
|
//but in fact, someone is going to try. specifically, that is the map viewer debug tools
|
||||||
//which try to render the enter BG. in cases where that is large, it could be up to 1024 wide.
|
//which try to render the enter BG. in cases where that is large, it could be up to 1024 wide.
|
||||||
//I think it survives this truncation to 8bits.
|
//I think it survives this truncation to 8bits.
|
||||||
//assert(x<256);
|
//assert(x<256);
|
||||||
|
|
||||||
int x_int;
|
int x_int;
|
||||||
|
|
||||||
//due to this early out, we will get incorrect behavior in cases where
|
//due to this early out, we will get incorrect behavior in cases where
|
||||||
//we enable mosaic in the middle of a frame. this is deemed unlikely.
|
//we enable mosaic in the middle of a frame. this is deemed unlikely.
|
||||||
if(!curr_mosaic_enabled) {
|
if(!curr_mosaic_enabled) {
|
||||||
|
|
Loading…
Reference in New Issue