mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
on the DS, windows with backward coordinates end up inside-out. revise window code accordingly. fixes #287.
This commit is contained in:
@ -988,25 +988,19 @@ void GPU2D::CalculateWindowMask(u32 line, u8* mask)
|
|||||||
if ((DispCnt & (1<<14)) && Win1Active)
|
if ((DispCnt & (1<<14)) && Win1Active)
|
||||||
{
|
{
|
||||||
// window 1
|
// window 1
|
||||||
u32 x1 = Win1Coords[0];
|
u8 x1 = Win1Coords[0];
|
||||||
u32 x2 = Win1Coords[1];
|
u8 x2 = Win1Coords[1];
|
||||||
if (x2 == 0 && x1 > 0) x2 = 256;
|
|
||||||
if (x1 > x2) x2 = 255; // checkme
|
|
||||||
|
|
||||||
for (u32 i = x1; i < x2; i++)
|
while (x1 != x2) mask[x1++] = WinCnt[1];
|
||||||
mask[i] = WinCnt[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DispCnt & (1<<13)) && Win0Active)
|
if ((DispCnt & (1<<13)) && Win0Active)
|
||||||
{
|
{
|
||||||
// window 0
|
// window 0
|
||||||
u32 x1 = Win0Coords[0];
|
u8 x1 = Win0Coords[0];
|
||||||
u32 x2 = Win0Coords[1];
|
u8 x2 = Win0Coords[1];
|
||||||
if (x2 == 0 && x1 > 0) x2 = 256;
|
|
||||||
if (x1 > x2) x2 = 255; // checkme
|
|
||||||
|
|
||||||
for (u32 i = x1; i < x2; i++)
|
while (x1 != x2) mask[x1++] = WinCnt[0];
|
||||||
mask[i] = WinCnt[0];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user