This commit is contained in:
RSDuck 2020-12-05 12:25:49 +01:00
parent c572996426
commit 40899940b5

View File

@ -1271,6 +1271,7 @@ void GPU2D::CalculateWindowMask(u32 line)
#define DoDrawBG(type, line, num) \ #define DoDrawBG(type, line, num) \
do \
{ \ { \
if ((BGCnt[num] & 0x0040) && (BGMosaicSize[0] > 0)) \ if ((BGCnt[num] & 0x0040) && (BGMosaicSize[0] > 0)) \
{ \ { \
@ -1282,7 +1283,7 @@ void GPU2D::CalculateWindowMask(u32 line)
if (Accelerated) DrawBG_##type<false, DrawPixel_Accel>(line, num); \ if (Accelerated) DrawBG_##type<false, DrawPixel_Accel>(line, num); \
else DrawBG_##type<false, DrawPixel_Normal>(line, num); \ else DrawBG_##type<false, DrawPixel_Normal>(line, num); \
} \ } \
} } while (false)
#define DoDrawBG_Large(line) \ #define DoDrawBG_Large(line) \
do \ do \
@ -1312,11 +1313,11 @@ void GPU2D::DrawScanlineBGMode(u32 line)
if (DispCnt & 0x0800) if (DispCnt & 0x0800)
{ {
if (bgmode >= 3) if (bgmode >= 3)
DoDrawBG(Extended, line, 3) DoDrawBG(Extended, line, 3);
else if (bgmode >= 1) else if (bgmode >= 1)
DoDrawBG(Affine, line, 3) DoDrawBG(Affine, line, 3);
else else
DoDrawBG(Text, line, 3) DoDrawBG(Text, line, 3);
} }
} }
if ((BGCnt[2] & 0x3) == i) if ((BGCnt[2] & 0x3) == i)
@ -1324,18 +1325,18 @@ void GPU2D::DrawScanlineBGMode(u32 line)
if (DispCnt & 0x0400) if (DispCnt & 0x0400)
{ {
if (bgmode == 5) if (bgmode == 5)
DoDrawBG(Extended, line, 2) DoDrawBG(Extended, line, 2);
else if (bgmode == 4 || bgmode == 2) else if (bgmode == 4 || bgmode == 2)
DoDrawBG(Affine, line, 2) DoDrawBG(Affine, line, 2);
else else
DoDrawBG(Text, line, 2) DoDrawBG(Text, line, 2);
} }
} }
if ((BGCnt[1] & 0x3) == i) if ((BGCnt[1] & 0x3) == i)
{ {
if (DispCnt & 0x0200) if (DispCnt & 0x0200)
{ {
DoDrawBG(Text, line, 1) DoDrawBG(Text, line, 1);
} }
} }
if ((BGCnt[0] & 0x3) == i) if ((BGCnt[0] & 0x3) == i)
@ -1345,7 +1346,7 @@ void GPU2D::DrawScanlineBGMode(u32 line)
if ((!Num) && (DispCnt & 0x8)) if ((!Num) && (DispCnt & 0x8))
DrawBG_3D(); DrawBG_3D();
else else
DoDrawBG(Text, line, 0) DoDrawBG(Text, line, 0);
} }
} }
if ((DispCnt & 0x1000) && NumSprites) if ((DispCnt & 0x1000) && NumSprites)
@ -1387,7 +1388,7 @@ void GPU2D::DrawScanlineBGMode7(u32 line)
{ {
if (DispCnt & 0x0200) if (DispCnt & 0x0200)
{ {
DoDrawBG(Text, line, 1) DoDrawBG(Text, line, 1);
} }
} }
if ((BGCnt[0] & 0x3) == i) if ((BGCnt[0] & 0x3) == i)
@ -1397,7 +1398,7 @@ void GPU2D::DrawScanlineBGMode7(u32 line)
if ((!Num) && (DispCnt & 0x8)) if ((!Num) && (DispCnt & 0x8))
DrawBG_3D(); DrawBG_3D();
else else
DoDrawBG(Text, line, 0) DoDrawBG(Text, line, 0);
} }
} }
if ((DispCnt & 0x1000) && NumSprites) if ((DispCnt & 0x1000) && NumSprites)
@ -1858,6 +1859,7 @@ void GPU2D::DrawBG_Affine(u32 line, u32 bgnum)
u8* bgvram; u8* bgvram;
u32 bgvrammask; u32 bgvrammask;
GetBGVRAM(Num, bgvram, bgvrammask);
if (Num) if (Num)
{ {