aboutsummaryrefslogtreecommitdiff
path: root/src/GPU2D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GPU2D.cpp')
-rw-r--r--src/GPU2D.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index 891c7e0..b510767 100644
--- a/src/GPU2D.cpp
+++ b/src/GPU2D.cpp
@@ -1465,6 +1465,8 @@ void GPU2D::DrawScanline_BGOBJ(u32 line)
else
memset(WindowMask, 0xFF, 256);
+ ApplySpriteMosaicX();
+
switch (DispCnt & 0x7)
{
case 0: DrawScanlineBGMode<0>(line); break;
@@ -2236,30 +2238,32 @@ void GPU2D::DrawBG_Large(u32 line) // BG is always BG2
BGYRefInternal[0] += rotD;
}
-void GPU2D::InterleaveSprites(u32 prio)
+void GPU2D::ApplySpriteMosaicX()
{
// apply X mosaic if needed
// X mosaic for sprites is applied after all sprites are rendered
- if (OBJMosaicSize[0] > 0)
- {
- u32 lastcolor = OBJLine[0];
+ if (OBJMosaicSize[0] == 0) return;
- for (u32 i = 1; i < 256; i++)
- {
- if (!(OBJLine[i] & 0x100000))
- {
- // not a mosaic'd sprite pixel
- continue;
- }
+ u32 lastcolor = OBJLine[0];
- if ((!(OBJLine[i-1] & 0x100000)) || (CurOBJXMosaicTable[i] == 0))
- lastcolor = OBJLine[i];
- else
- OBJLine[i] = lastcolor;
+ for (u32 i = 1; i < 256; i++)
+ {
+ if (!(OBJLine[i] & 0x100000))
+ {
+ // not a mosaic'd sprite pixel
+ continue;
}
+
+ if ((!(OBJLine[i-1] & 0x100000)) || (CurOBJXMosaicTable[i] == 0))
+ lastcolor = OBJLine[i];
+ else
+ OBJLine[i] = lastcolor;
}
+}
+void GPU2D::InterleaveSprites(u32 prio)
+{
u16* pal = (u16*)&GPU::Palette[Num ? 0x600 : 0x200];
if (DispCnt & 0x80000000)