aboutsummaryrefslogtreecommitdiff
path: root/src/GPU2D.h
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-05-25 20:42:27 +0200
committerArisotura <thetotalworm@gmail.com>2019-05-25 20:42:27 +0200
commit94f5ecb64714c3a4026bebe4f81a99ca4dba0362 (patch)
treecfc88ac94ce13bb1332aadde9f15c6eb4e61aee5 /src/GPU2D.h
parent63e42bf90fa9d78c92123dcbc9c2b8ca5bb5e3ba (diff)
parent9ed1dda9ca18e571fc6613885ac944bbb938cd9a (diff)
Merge branch 'blackmagic'
BAHAHAHHAHAHAHAAHAHAHAHHH HARK HARK HARK HARK HA-*~
Diffstat (limited to 'src/GPU2D.h')
-rw-r--r--src/GPU2D.h49
1 files changed, 33 insertions, 16 deletions
diff --git a/src/GPU2D.h b/src/GPU2D.h
index d7c4e3f..21b43f1 100644
--- a/src/GPU2D.h
+++ b/src/GPU2D.h
@@ -31,6 +31,7 @@ public:
void SetEnabled(bool enable) { Enabled = enable; }
void SetFramebuffer(u32* buf);
+ void SetDisplaySettings(bool accel);
u8 Read8(u32 addr);
u16 Read16(u32 addr);
@@ -68,6 +69,14 @@ private:
bool Enabled;
u32* Framebuffer;
+ bool Accelerated;
+
+ u32 BGOBJLine[256*3];
+ u32* _3DLine;
+
+ u8 WindowMask[256];
+ u32 OBJLine[256];
+
u16 DispFIFO[16];
u32 DispFIFOReadPtr;
u32 DispFIFOWritePtr;
@@ -114,27 +123,35 @@ private:
u32 BGExtPalStatus[4];
u32 OBJExtPalStatus;
- template<u32 bgmode> void DrawScanlineBGMode(u32 line, u32 nsprites, u32* spritebuf, u32* dst);
- void DrawScanlineBGMode6(u32 line, u32 nsprites, u32* spritebuf, u32* dst);
- void DrawScanline_Mode1(u32 line, u32* dst);
+ u32 ColorBlend4(u32 val1, u32 val2, u32 eva, u32 evb);
+ u32 ColorBlend5(u32 val1, u32 val2);
+ u32 ColorBrightnessUp(u32 val, u32 factor);
+ u32 ColorBrightnessDown(u32 val, u32 factor);
+ u32 ColorComposite(int i, u32 val1, u32 val2);
+
+ template<u32 bgmode> void DrawScanlineBGMode(u32 line, u32 nsprites);
+ void DrawScanlineBGMode6(u32 line, u32 nsprites);
+ void DrawScanline_BGOBJ(u32 line);
- void DrawPixel(u32* dst, u16 color, u32 flag);
+ static void DrawPixel_Normal(u32* dst, u16 color, u32 flag);
+ static void DrawPixel_Accel(u32* dst, u16 color, u32 flag);
+ void (*DrawPixel)(u32* dst, u16 color, u32 flag);
- void DrawBG_3D(u32 line, u32* dst);
- void DrawBG_Text(u32 line, u32* dst, u32 bgnum);
- void DrawBG_Affine(u32 line, u32* dst, u32 bgnum);
- void DrawBG_Extended(u32 line, u32* dst, u32 bgnum);
- void DrawBG_Large(u32 line, u32* dst);
+ void DrawBG_3D();
+ void DrawBG_Text(u32 line, u32 bgnum);
+ void DrawBG_Affine(u32 line, u32 bgnum);
+ void DrawBG_Extended(u32 line, u32 bgnum);
+ void DrawBG_Large(u32 line);
- void InterleaveSprites(u32* buf, u32 prio, u32* dst);
- u32 DrawSprites(u32 line, u32* dst);
- void DrawSpritesWindow(u32 line, u8* dst);
- template<bool window> void DrawSprite_Rotscale(u16* attrib, u16* rotparams, u32 boundwidth, u32 boundheight, u32 width, u32 height, s32 xpos, s32 ypos, u32* dst);
- template<bool window> void DrawSprite_Normal(u16* attrib, u32 width, s32 xpos, s32 ypos, u32* dst);
+ void InterleaveSprites(u32 prio);
+ u32 DrawSprites(u32 line);
+ void DrawSpritesWindow(u32 line);
+ template<bool window> void DrawSprite_Rotscale(u16* attrib, u16* rotparams, u32 boundwidth, u32 boundheight, u32 width, u32 height, s32 xpos, s32 ypos);
+ template<bool window> void DrawSprite_Normal(u16* attrib, u32 width, s32 xpos, s32 ypos);
- void DoCapture(u32 line, u32 width, u32* src);
+ void DoCapture(u32 line, u32 width);
- void CalculateWindowMask(u32 line, u8* mask);
+ void CalculateWindowMask(u32 line);
};
#endif