mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 21:43:16 -07:00
Clean up stupid colour structs and implement patterns (class 0x06). Now, you can select taskbar items and some lines draw. Replace some multiplications with shifts.
This commit is contained in:
@@ -77,15 +77,34 @@ typedef enum nv3_pgraph_class_e
|
||||
#define NV3_SET_NOTIFY_CONTEXT_FOR_DMA 0x0100 // Set object ctx for dma...see nv3_dma_context_t structure
|
||||
#define NV3_SET_NOTIFY 0x0104
|
||||
|
||||
// Render OPeration
|
||||
#define NV3_ROP_SET_ROP 0x0300 // Set GDI standard rop
|
||||
|
||||
// Beta Factor
|
||||
#define NV3_BETA_FACTOR 0x0300
|
||||
|
||||
// Chroma Key
|
||||
#define NV3_CHROMA_KEY 0x0304
|
||||
|
||||
// Clip
|
||||
#define NV3_CLIP_POSITION 0x0300 // S16:S16, 0=topleft
|
||||
#define NV3_CLIP_SIZE 0x0304 // U16:U16
|
||||
|
||||
// Blit Pattern
|
||||
#define NV3_PATTERN_FORMAT 0x0304
|
||||
#define NV3_PATTERN_SHAPE 0x0308
|
||||
#define NV3_PATTERN_SHAPE_8X8 0
|
||||
#define NV3_PATTERN_SHAPE_64X1 1
|
||||
#define NV3_PATTERN_SHAPE_1X64 2
|
||||
#define NV3_PATTERN_SHAPE_LAST_VALID NV3_PATTERN_SHAPE_1X64
|
||||
|
||||
#define NV3_PATTERN_COLOR0 0x0310
|
||||
#define NV3_PATTERN_COLOR1 0x0314
|
||||
#define NV3_PATTERN_BITMAP_HIGH 0x0318
|
||||
#define NV3_PATTERN_BITMAP_LOW 0x031C
|
||||
|
||||
// Rect
|
||||
|
||||
#define NV3_RECTANGLE_COLOR 0x0304
|
||||
|
||||
// 16 possible rectangles. 8 byte structure, first 4 bytes = position, second 2 = size.
|
||||
@@ -173,44 +192,6 @@ typedef struct nv3_color_argb_s
|
||||
uint8_t b;
|
||||
} nv3_color_argb_t;
|
||||
|
||||
/* 30-bit colour format for internal PGRAPH use */
|
||||
typedef struct nv3_color_x2a10g10b10_s
|
||||
{
|
||||
uint8_t reserved : 1;
|
||||
bool a : 1; // 1-bit ALPHA if chroma key, OTHERWISE USELESS and IGNORE
|
||||
uint16_t r : 10;
|
||||
uint16_t g : 10;
|
||||
uint16_t b : 10;
|
||||
} nv3_color_x2a10g10b10_t;
|
||||
|
||||
/* 16-bit A4R4G4B4 colour format */
|
||||
typedef struct nv3_color_16_a4r4g4b4_s
|
||||
{
|
||||
uint8_t a : 4;
|
||||
uint8_t r : 4;
|
||||
uint8_t g : 4;
|
||||
uint8_t b : 4;
|
||||
} nv3_color_16_a4r4g4b4_t;
|
||||
|
||||
/* A1R5G5B5 format
|
||||
Can also be used for R5G5B5
|
||||
*/
|
||||
typedef struct nv3_color_16_a1r5g5b5_s
|
||||
{
|
||||
uint8_t a : 1;
|
||||
uint8_t r : 5;
|
||||
uint8_t g : 5;
|
||||
uint8_t b : 5;
|
||||
} nv3_color_16_a1r5g5b5_t;
|
||||
|
||||
/* 565 format - NV3Tweak */
|
||||
typedef struct nv3_color_16_r5g6b5_s
|
||||
{
|
||||
uint8_t r : 5;
|
||||
uint8_t g : 6;
|
||||
uint8_t b : 5;
|
||||
} nv3_color_16_r5g6b5_t;
|
||||
|
||||
/* Generic 16-bit position*/
|
||||
typedef struct nv3_position_16_s
|
||||
{
|
||||
@@ -384,8 +365,8 @@ typedef struct nv3_object_class_006
|
||||
uint8_t reserved2[0x200];
|
||||
uint32_t shape; // 0 = 8x8, 1 = 64x1, 2 = 1x64
|
||||
uint32_t color0; // Some 32-bit format (argb?)
|
||||
uint32_t color1; // argb?
|
||||
uint32_t pattern[2]; // argb?
|
||||
uint32_t color1; // bit0=color0, bit1=color1
|
||||
uint32_t pattern[2]; // bit0=color0, bit1=color1
|
||||
uint8_t reserved3[0x1CDF]; // needs to be 0x2000 bytes
|
||||
} nv3_pattern_t;
|
||||
|
||||
|
||||
@@ -20,7 +20,11 @@
|
||||
/* Core */
|
||||
void nv3_render_pixel(nv3_position_16_t position, uint32_t color, nv3_grobj_t grobj);
|
||||
uint32_t nv3_render_to_chroma(nv3_color_expanded_t expanded);
|
||||
nv3_color_expanded_t nv3_render_expand_color(nv3_grobj_t grobj, uint32_t color);
|
||||
nv3_color_expanded_t nv3_render_expand_color(nv3_grobj_t grobj, uint32_t color); // Convert a colour to full RGB10 format from the current working format.
|
||||
uint32_t nv3_render_downconvert_color(nv3_grobj_t grobj, nv3_color_expanded_t color); // Convert a colour from the current working format to RGB10 format.
|
||||
|
||||
/* Pattern */
|
||||
uint32_t nv3_render_set_pattern_color(nv3_color_expanded_t pattern_colour, bool use_color1);
|
||||
|
||||
/* Primitives */
|
||||
void nv3_render_rect(nv3_position_16_t position, nv3_size_16_t size, uint32_t color, nv3_grobj_t grobj);
|
||||
|
||||
@@ -569,10 +569,10 @@ extern const device_config_t nv3_config[];
|
||||
#define NV3_PGRAPH_SRC_CANVAS_MAX 0x400554 // Maximum Source Canvas for Blit, Y=30:16, X=10:0
|
||||
#define NV3_PGRAPH_DST_CANVAS_MIN 0x400558 // Minimum Destination Canvas for Blit, Y=30:16, X=10:0
|
||||
#define NV3_PGRAPH_DST_CANVAS_MAX 0x40055C // Maximum Destination Canvas for Blit, Y=30:16, X=10:0
|
||||
#define NV3_PGRAPH_PATTERN_COLOR_0_0 0x400600
|
||||
#define NV3_PGRAPH_PATTERN_COLOR_0_1 0x400604
|
||||
#define NV3_PGRAPH_PATTERN_COLOR_1_0 0x400608
|
||||
#define NV3_PGRAPH_PATTERN_COLOR_1_1 0x40060C // pattern color
|
||||
#define NV3_PGRAPH_pattern_color_0_rgb 0x400600
|
||||
#define NV3_PGRAPH_pattern_color_0_alpha 0x400604
|
||||
#define NV3_PGRAPH_pattern_color_1_rgb 0x400608
|
||||
#define NV3_PGRAPH_pattern_color_1_alpha 0x40060C // pattern color
|
||||
#define NV3_PGRAPH_PATTERN_BITMAP_HIGH 0x400610 // pattern bitmap [31:0]
|
||||
#define NV3_PGRAPH_PATTERN_BITMAP_LOW 0x400614 // pattern bitmap [63:32]
|
||||
#define NV3_PGRAPH_PATTERN_SHAPE 0x400618
|
||||
@@ -1176,15 +1176,14 @@ typedef struct nv3_pgraph_s
|
||||
nv3_position_16_bigy_t dst_canvas_min;
|
||||
nv3_position_16_bigy_t dst_canvas_max;
|
||||
// Pattern stuff
|
||||
nv3_color_x2a10g10b10_t pattern_color_0_0;
|
||||
uint32_t pattern_color_0_1; // only 7:0 relevant
|
||||
nv3_color_x2a10g10b10_t pattern_color_1_0;
|
||||
uint32_t pattern_color_1_1; // only 7:0 relevant
|
||||
uint32_t pattern_bitmap_high; // high part of pattern bitmap for blit
|
||||
uint32_t pattern_bitmap_low;
|
||||
nv3_color_expanded_t pattern_color_0_rgb; // ignore alpha
|
||||
uint32_t pattern_color_0_alpha; // only 7:0 relevant
|
||||
nv3_color_expanded_t pattern_color_1_rgb; // ignore alpha
|
||||
uint32_t pattern_color_1_alpha; // only 7:0 relevant
|
||||
uint64_t pattern_bitmap; // pattern bitmap for blit. it's alwaus 64 bits to simplify pixel rendering code
|
||||
uint32_t pattern_shape; // may need to be an enum - 0=8x8, 1=64x1, 2=1x64
|
||||
uint32_t plane_mask; // only 7:0 relevant
|
||||
nv3_color_x2a10g10b10_t chroma_key; // color key
|
||||
uint32_t chroma_key; // color key
|
||||
uint32_t beta_factor;
|
||||
nv3_pgraph_dma_settings_t dma_settings;
|
||||
uint8_t rop; // Current GDI Ternary Render Operation
|
||||
|
||||
Reference in New Issue
Block a user