aboutsummaryrefslogtreecommitdiff
path: root/src/GPU2D_Soft.h
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2021-02-27 22:25:27 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2021-02-27 22:25:42 +0100
commita046eb50384e5f55f7d6ca7e69417e8b013a8c5a (patch)
tree143d83a1f580adb1312f2623955a591dd66e84e3 /src/GPU2D_Soft.h
parentf8692f85a437b4fc82b35fe80622f09e3346c78a (diff)
separate GPU2D registers and renderer
Diffstat (limited to 'src/GPU2D_Soft.h')
-rw-r--r--src/GPU2D_Soft.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/GPU2D_Soft.h b/src/GPU2D_Soft.h
index 754f08a..b209810 100644
--- a/src/GPU2D_Soft.h
+++ b/src/GPU2D_Soft.h
@@ -20,32 +20,32 @@
#include "GPU2D.h"
-class GPU2D_Soft : public GPU2D
+namespace GPU2D
{
-public:
- GPU2D_Soft(u32 num);
- ~GPU2D_Soft() override {}
-
- void DrawScanline(u32 line) override;
- void DrawSprites(u32 line) override;
- void VBlankEnd() override;
-protected:
- void MosaicXSizeChanged() override;
+class SoftRenderer : public Renderer2D
+{
+public:
+ SoftRenderer();
+ ~SoftRenderer() override {}
+ void DrawScanline(u32 line, Unit* unit) override;
+ void DrawSprites(u32 line, Unit* unit) override;
+ void VBlankEnd(Unit* unitA, Unit* unitB) override;
private:
-
alignas(8) u32 BGOBJLine[256*3];
u32* _3DLine;
- alignas(8) u32 OBJLine[256];
- alignas(8) u8 OBJIndex[256];
+ alignas(8) u8 WindowMask[256];
- u32 NumSprites;
+ alignas(8) u32 OBJLine[2][256];
+ alignas(8) u8 OBJIndex[2][256];
+ alignas(8) u8 OBJWindow[2][256];
+
+ u32 NumSprites[2];
- u8 MosaicTable[16][256];
u8* CurBGXMosaicTable;
- u8* CurOBJXMosaicTable;
+ u8 MosaicTable[16][256];
u32 ColorBlend4(u32 val1, u32 val2, u32 eva, u32 evb);
u32 ColorBlend5(u32 val1, u32 val2);
@@ -76,4 +76,6 @@ private:
template<bool window> void DrawSprite_Normal(u32 num, u32 width, u32 height, s32 xpos, s32 ypos);
void DoCapture(u32 line, u32 width);
-}; \ No newline at end of file
+};
+
+} \ No newline at end of file