GPU:
- Clearing to the backdrop color has been changed from a pixel operation to a scanline operation. - Clearing to black when the GPU engine is disabled has been changed from a scanline operation to a framebuffer operation. - Applying the master brightness has been changed from a scanline operation to a framebuffer operation. - Resetting the BGnX and BGnY registers now occurs at the end of line 191 instead of at the start of line 0.
This commit is contained in:
parent
574e6a2640
commit
76ce2107fa
File diff suppressed because it is too large
Load Diff
|
@ -720,9 +720,12 @@ typedef struct
|
||||||
} GPU_IOREG; // 0x04000000, 0x04001000: GPU registers
|
} GPU_IOREG; // 0x04000000, 0x04001000: GPU registers
|
||||||
#include "PACKED_END.h"
|
#include "PACKED_END.h"
|
||||||
|
|
||||||
enum BlendFunc
|
enum ColorEffect
|
||||||
{
|
{
|
||||||
NoBlend, Blend, Increase, Decrease
|
ColorEffect_Disable = 0,
|
||||||
|
ColorEffect_Blend = 1,
|
||||||
|
ColorEffect_IncreaseBrightness = 2,
|
||||||
|
ColorEffect_DecreaseBrightness = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum GPUEngineID
|
enum GPUEngineID
|
||||||
|
@ -1170,8 +1173,8 @@ protected:
|
||||||
template<int WIN_NUM> u8 _WithinRect(const size_t x) const;
|
template<int WIN_NUM> u8 _WithinRect(const size_t x) const;
|
||||||
template <GPULayerID LAYERID> void _RenderLine_CheckWindows(const size_t srcX, bool &draw, bool &effect) const;
|
template <GPULayerID LAYERID> void _RenderLine_CheckWindows(const size_t srcX, bool &draw, bool &effect) const;
|
||||||
|
|
||||||
|
template<bool ISCUSTOMRENDERINGNEEDED> void _RenderLine_Clear(const u16 clearColor, const u16 l, u16 *dstColorLine, const size_t dstLineWidth, const size_t dstLineCount);
|
||||||
template<bool ISCUSTOMRENDERINGNEEDED> void _RenderLine_Layer(const u16 l, u16 *dstColorLine, const size_t dstLineWidth, const size_t dstLineCount);
|
template<bool ISCUSTOMRENDERINGNEEDED> void _RenderLine_Layer(const u16 l, u16 *dstColorLine, const size_t dstLineWidth, const size_t dstLineCount);
|
||||||
template<bool ISFULLINTENSITYHINT, bool ISCUSTOMRENDERINGNEEDED> void _RenderLine_MasterBrightness(u16 *dstColorLine, const size_t dstLineWidth, const size_t dstLineCount);
|
|
||||||
|
|
||||||
template<bool ISCUSTOMRENDERINGNEEDED> void _HandleDisplayModeOff(u16 *dstColorLine, const size_t l, const size_t dstLineWidth, const size_t dstLineCount);
|
template<bool ISCUSTOMRENDERINGNEEDED> void _HandleDisplayModeOff(u16 *dstColorLine, const size_t l, const size_t dstLineWidth, const size_t dstLineCount);
|
||||||
template<bool ISCUSTOMRENDERINGNEEDED> void _HandleDisplayModeNormal(u16 *dstColorLine, const size_t l, const size_t dstLineWidth, const size_t dstLineCount);
|
template<bool ISCUSTOMRENDERINGNEEDED> void _HandleDisplayModeNormal(u16 *dstColorLine, const size_t l, const size_t dstLineWidth, const size_t dstLineCount);
|
||||||
|
@ -1180,16 +1183,16 @@ protected:
|
||||||
template<size_t WIN_NUM> void _SetupWindows();
|
template<size_t WIN_NUM> void _SetupWindows();
|
||||||
template<GPULayerID LAYERID, bool MOSAIC, bool ISCUSTOMRENDERINGNEEDED> void _ModeRender();
|
template<GPULayerID LAYERID, bool MOSAIC, bool ISCUSTOMRENDERINGNEEDED> void _ModeRender();
|
||||||
|
|
||||||
template<GPULayerID LAYERID, bool BACKDROP, BlendFunc FUNC, bool WINDOW>
|
template<GPULayerID LAYERID, ColorEffect EFFECT, bool WINDOW>
|
||||||
FORCEINLINE FASTCALL bool _master_setFinalBGColor(const size_t srcX, const size_t dstX, const u16 *dstColorLine, const u8 *dstLayerIDLine, u16 &outColor);
|
FORCEINLINE FASTCALL bool _master_setFinalBGColor(const size_t srcX, const size_t dstX, const u16 *dstColorLine, const u8 *dstLayerIDLine, u16 &outColor);
|
||||||
|
|
||||||
template<BlendFunc FUNC, bool WINDOW>
|
template<ColorEffect EFFECT, bool WINDOW>
|
||||||
FORCEINLINE FASTCALL void _master_setFinal3dColor(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const FragmentColor src);
|
FORCEINLINE FASTCALL void _master_setFinal3dColor(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const FragmentColor src);
|
||||||
|
|
||||||
template<BlendFunc FUNC, bool WINDOW>
|
template<ColorEffect EFFECT, bool WINDOW>
|
||||||
FORCEINLINE FASTCALL void _master_setFinalOBJColor(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const u16 src, const u8 alpha, const OBJMode objMode);
|
FORCEINLINE FASTCALL void _master_setFinalOBJColor(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const u16 src, const u8 alpha, const OBJMode objMode);
|
||||||
|
|
||||||
template<GPULayerID LAYERID, bool BACKDROP, int FUNCNUM> void _SetFinalColorBG(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, u16 src);
|
template<GPULayerID LAYERID, int FUNCNUM> void _SetFinalColorBG(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, u16 src);
|
||||||
void _SetFinalColor3D(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const FragmentColor src);
|
void _SetFinalColor3D(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const FragmentColor src);
|
||||||
void _SetFinalColorSprite(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const u16 src, const u8 alpha, const OBJMode objMode);
|
void _SetFinalColorSprite(const size_t srcX, const size_t dstX, u16 *dstColorLine, u8 *dstLayerIDLine, const u16 src, const u8 alpha, const OBJMode objMode);
|
||||||
|
|
||||||
|
@ -1205,7 +1208,6 @@ protected:
|
||||||
u32 _SpriteAddressBMP(const OAMAttributes &spriteInfo, const SpriteSize sprSize, const s32 y);
|
u32 _SpriteAddressBMP(const OAMAttributes &spriteInfo, const SpriteSize sprSize, const s32 y);
|
||||||
|
|
||||||
template<SpriteRenderMode MODE> void _SpriteRenderPerform(u16 *dst, u8 *dst_alpha, u8 *typeTab, u8 *prioTab);
|
template<SpriteRenderMode MODE> void _SpriteRenderPerform(u16 *dst, u8 *dst_alpha, u8 *typeTab, u8 *prioTab);
|
||||||
void _RefreshAffineStartRegs();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GPUEngineBase();
|
GPUEngineBase();
|
||||||
|
@ -1214,6 +1216,7 @@ public:
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
void ResortBGLayers();
|
void ResortBGLayers();
|
||||||
void SetupFinalPixelBlitter();
|
void SetupFinalPixelBlitter();
|
||||||
|
void RefreshAffineStartRegs();
|
||||||
|
|
||||||
template<GPUEngineID ENGINEID> void ParseReg_DISPCNT();
|
template<GPUEngineID ENGINEID> void ParseReg_DISPCNT();
|
||||||
template<GPUEngineID ENGINEID, GPULayerID LAYERID> void ParseReg_BGnCNT();
|
template<GPUEngineID ENGINEID, GPULayerID LAYERID> void ParseReg_BGnCNT();
|
||||||
|
@ -1228,7 +1231,8 @@ public:
|
||||||
|
|
||||||
template<GPUEngineID ENGINEID> void ParseAllRegisters();
|
template<GPUEngineID ENGINEID> void ParseAllRegisters();
|
||||||
|
|
||||||
template<bool ISCUSTOMRENDERINGNEEDED> void RenderLine(const u16 l, bool skip);
|
template<bool ISCUSTOMRENDERINGNEEDED> void RenderLine(const u16 l, bool isFrameSkipRequested);
|
||||||
|
void FramebufferPostprocess();
|
||||||
|
|
||||||
u16 BGSize[4][2];
|
u16 BGSize[4][2];
|
||||||
u8 BGExtPalSlot[4];
|
u8 BGExtPalSlot[4];
|
||||||
|
@ -1262,9 +1266,11 @@ public:
|
||||||
bool GetDebugState();
|
bool GetDebugState();
|
||||||
void SetDebugState(bool theState);
|
void SetDebugState(bool theState);
|
||||||
|
|
||||||
template<GPULayerID LAYERID, bool BACKDROP, int FUNCNUM, bool ISCUSTOMRENDERINGNEEDED, bool USECUSTOMVRAM> FORCEINLINE void ____setFinalColorBck(const u16 color, const size_t srcX);
|
template<bool ISFULLINTENSITYHINT> void ApplyMasterBrightness();
|
||||||
template<GPULayerID LAYERID, bool MOSAIC, bool BACKDROP, int FUNCNUM, bool ISCUSTOMRENDERINGNEEDED, bool USECUSTOMVRAM> FORCEINLINE void ___setFinalColorBck(u16 color, const size_t srcX, const bool opaque);
|
|
||||||
template<GPULayerID LAYERID, bool MOSAIC, bool BACKDROP, bool ISCUSTOMRENDERINGNEEDED> FORCEINLINE void __setFinalColorBck(u16 color, const size_t srcX, const bool opaque);
|
template<GPULayerID LAYERID, int FUNCNUM, bool ISCUSTOMRENDERINGNEEDED, bool USECUSTOMVRAM> FORCEINLINE void ____setFinalColorBck(const u16 color, const size_t srcX);
|
||||||
|
template<GPULayerID LAYERID, bool MOSAIC, int FUNCNUM, bool ISCUSTOMRENDERINGNEEDED, bool USECUSTOMVRAM> FORCEINLINE void ___setFinalColorBck(u16 color, const size_t srcX, const bool opaque);
|
||||||
|
template<GPULayerID LAYERID, bool MOSAIC, bool ISCUSTOMRENDERINGNEEDED> FORCEINLINE void __setFinalColorBck(u16 color, const size_t srcX, const bool opaque);
|
||||||
|
|
||||||
void UpdateVRAM3DUsageProperties_BGLayer(const size_t bankIndex, VRAM3DUsageProperties &outProperty);
|
void UpdateVRAM3DUsageProperties_BGLayer(const size_t bankIndex, VRAM3DUsageProperties &outProperty);
|
||||||
void UpdateVRAM3DUsageProperties_OBJLayer(const size_t bankIndex, VRAM3DUsageProperties &outProperty);
|
void UpdateVRAM3DUsageProperties_OBJLayer(const size_t bankIndex, VRAM3DUsageProperties &outProperty);
|
||||||
|
@ -1338,7 +1344,8 @@ public:
|
||||||
u16* Get3DFramebufferRGBA5551() const;
|
u16* Get3DFramebufferRGBA5551() const;
|
||||||
virtual void SetCustomFramebufferSize(size_t w, size_t h);
|
virtual void SetCustomFramebufferSize(size_t w, size_t h);
|
||||||
|
|
||||||
template<bool ISCUSTOMRENDERINGNEEDED> void RenderLine(const u16 l, bool skip);
|
template<bool ISCUSTOMRENDERINGNEEDED> void RenderLine(const u16 l, bool isFrameSkipRequested);
|
||||||
|
void FramebufferPostprocess();
|
||||||
};
|
};
|
||||||
|
|
||||||
class GPUEngineB : public GPUEngineBase
|
class GPUEngineB : public GPUEngineBase
|
||||||
|
@ -1355,7 +1362,7 @@ public:
|
||||||
void FinalizeAndDeallocate();
|
void FinalizeAndDeallocate();
|
||||||
|
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
template<bool ISCUSTOMRENDERINGNEEDED> void RenderLine(const u16 l, bool skip);
|
template<bool ISCUSTOMRENDERINGNEEDED> void RenderLine(const u16 l);
|
||||||
};
|
};
|
||||||
|
|
||||||
class NDSDisplay
|
class NDSDisplay
|
||||||
|
|
Loading…
Reference in New Issue