GPU: Implement mask bit handling in software renderer

Still needs implementation in the hardware renderers.
This commit is contained in:
Connor McLaughlin
2019-11-24 18:47:40 +10:00
parent 6c6bf8714c
commit 9d6d00480c
4 changed files with 55 additions and 16 deletions

View File

@ -326,8 +326,8 @@ protected:
BitField<u32, TextureMode, 7, 2> texture_color_mode;
BitField<u32, bool, 9, 1> dither_enable;
BitField<u32, bool, 10, 1> draw_to_display_area;
BitField<u32, bool, 11, 1> draw_set_mask_bit;
BitField<u32, bool, 12, 1> draw_to_masked_pixels;
BitField<u32, bool, 11, 1> set_mask_while_drawing;
BitField<u32, bool, 12, 1> check_mask_before_draw;
BitField<u32, bool, 13, 1> interlaced_field;
BitField<u32, bool, 14, 1> reverse_flag;
BitField<u32, bool, 15, 1> texture_disable;
@ -346,7 +346,12 @@ protected:
BitField<u32, DMADirection, 29, 2> dma_direction;
BitField<u32, bool, 31, 1> drawing_even_line;
bool In480iMode() const { return vertical_interlace & vertical_resolution; }
bool IsMaskingEnabled() const { return (bits & ((1 << 11) | (1 << 12))) != 0; }
bool In480iMode() const { return (bits & ((1 << 22) | (1 << 19))) != 0; }
// During transfer/render operations, if ((dst_pixel & mask_and) == mask_and) { pixel = src_pixel | mask_or }
u16 GetMaskAND() const { return check_mask_before_draw ? 0x8000 : 0x0000; }
u16 GetMaskOR() const { return set_mask_while_drawing ? 0x8000 : 0x0000; }
} m_GPUSTAT = {};
struct RenderState