diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-06-28 17:01:20 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-06-28 17:01:20 +0200 |
commit | 209a639461a9223af7114593ebd9aef0c5486aed (patch) | |
tree | 23fbbd34e7143fe5b4d38fca77e3ac47767a47f4 /src | |
parent | 5f6e8cc30bf541a71031c4f64c165a4dc4d8ea92 (diff) |
2D: implement enough of mode6 to fix #65 -- shows 3D layer. large BG still needs to be done.
Diffstat (limited to 'src')
-rw-r--r-- | src/GPU2D.cpp | 32 | ||||
-rw-r--r-- | src/GPU2D.h | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp index c3e4034..a9bd498 100644 --- a/src/GPU2D.cpp +++ b/src/GPU2D.cpp @@ -920,6 +920,36 @@ void GPU2D::DrawScanlineBGMode(u32 line, u32* spritebuf, u32* dst) } } +void GPU2D::DrawScanlineBGMode6(u32 line, u32* spritebuf, u32* dst) +{ + if (Num) + { + printf("GPU2D: MODE6 ON SUB GPU???\n"); + return; + } + + for (int i = 3; i >= 0; i--) + { + if ((BGCnt[2] & 0x3) == i) + { + if (DispCnt & 0x0400) + { + printf("GPU2D: MODE6 LARGE BG TODO\n"); + } + } + if ((BGCnt[0] & 0x3) == i) + { + if (DispCnt & 0x0100) + { + if (DispCnt & 0x8) + DrawBG_3D(line, dst); + } + } + if (DispCnt & 0x1000) + InterleaveSprites(spritebuf, 0x8000 | (i<<16), dst); + } +} + void GPU2D::DrawScanline_Mode1(u32 line, u32* dst) { u32 linebuf[256*2 + 64]; @@ -950,6 +980,7 @@ void GPU2D::DrawScanline_Mode1(u32 line, u32* dst) memset(spritebuf, 0, 256*4); if (DispCnt & 0x1000) DrawSprites(line, spritebuf); + // TODO: what happens in mode 7? mode 6 on the sub engine? switch (DispCnt & 0x7) { case 0: DrawScanlineBGMode<0>(line, spritebuf, linebuf); break; @@ -958,6 +989,7 @@ void GPU2D::DrawScanline_Mode1(u32 line, u32* dst) case 3: DrawScanlineBGMode<3>(line, spritebuf, linebuf); break; case 4: DrawScanlineBGMode<4>(line, spritebuf, linebuf); break; case 5: DrawScanlineBGMode<5>(line, spritebuf, linebuf); break; + case 6: DrawScanlineBGMode6(line, spritebuf, linebuf); break; } // color special effects diff --git a/src/GPU2D.h b/src/GPU2D.h index 3deb42d..289f1fe 100644 --- a/src/GPU2D.h +++ b/src/GPU2D.h @@ -105,6 +105,7 @@ private: u32 OBJExtPalStatus; template<u32 bgmode> void DrawScanlineBGMode(u32 line, u32* spritebuf, u32* dst); + void DrawScanlineBGMode6(u32 line, u32* spritebuf, u32* dst); void DrawScanline_Mode1(u32 line, u32* dst); void DrawPixel(u32* dst, u16 color, u32 flag); |