GDI acceleration type A + chroma test

This commit is contained in:
starfrost013
2025-03-24 01:13:04 +00:00
parent be83a7c69d
commit 57edb25a27
10 changed files with 146 additions and 27 deletions

View File

@@ -132,9 +132,54 @@ typedef enum nv3_pgraph_class_e
#define NV3_IMAGE_IN_MEMORY_TOP_LEFT_OFFSET 0x030C
#define NV3_IMAGE_IN_MEMORY_TOP_LEFT_OFFSET_END 22
#define NV3_W95TXT_COLORA 0x03FC // It's the colour of the text. This is used to submit a dummy object so the notifier can be used to sync in Win2000 DDraw6 drivers.
#define NV3_W95TXT_COLORA_RECT_START 0x0400
#define NV3_W95TXT_COLORA_RECT_END 0x05FF
/* GDI */
/* Type A: Unclipped Rectangle */
#define NV3_W95TXT_A_COLOR 0x03FC // It's the colour of the text. This is used to submit a dummy object so the notifier can be used to sync in Win2000 DDraw6 drivers.
#define NV3_W95TXT_A_RECT_START 0x0400
#define NV3_W95TXT_A_RECT_SIZE 64 // Number of rects
#define NV3_W95TXT_A_RECT_END 0x05FF
/* Type B: Clipped Rectangle */
#define NV3_W95TXT_B_CLIP_TOPLEFT 0x07F4
#define NV3_W95TXT_B_CLIP_BOTTOMRIGHT 0x07F8
#define NV3_W95TXT_B_CLIP_CLIPRECT_START 0x0800
#define NV3_W95TXT_B_CLIP_CLIPRECT_SIZE 128 // Number of rects
#define NV3_W95TXT_B_CLIP_CLIPRECT_END 0x09FF
/* Type C: Unscaled Single-Colour Text (filled in from mono bitmap) */
#define NV3_W95TXT_C_CLIP_TOPLEFT 0x0BEC
#define NV3_W95TXT_C_CLIP_BOTTOMRIGHT 0x0BF0
#define NV3_W95TXT_C_CLIP_COLOR 0x0BF4
#define NV3_W95TXT_C_CLIP_SIZE 0x0BF8
#define NV3_W95TXT_C_CLIP_POSITION 0x0BFC /* TOP LEFT */
#define NV3_W95TXT_C_CLIP_CLIPRECT_START 0x0C00
#define NV3_W95TXT_C_CLIP_CLIPRECT_SIZE 64 // Number of rects
#define NV3_W95TXT_C_CLIP_CLIPRECT_END 0x0DFF
/* Type D: Scaled Single-Colour Text (filled in from mono bitmap) */
#define NV3_W95TXT_D_CLIP_TOPLEFT 0x0FE8
#define NV3_W95TXT_D_CLIP_BOTTOMRIGHT 0x0FEC
#define NV3_W95TXT_D_CLIP_COLOR 0x0FF0
#define NV3_W95TXT_D_CLIP_SIZE_IN 0x0FF4
#define NV3_W95TXT_D_CLIP_SIZE_OUT 0x0FF8
#define NV3_W95TXT_D_CLIP_POSITION 0x0FFC /* TOP LEFT */
#define NV3_W95TXT_D_CLIP_CLIPRECT_START 0x1000
#define NV3_W95TXT_D_CLIP_CLIPRECT_SIZE 128 // Number of rects
#define NV3_W95TXT_D_CLIP_CLIPRECT_END 0x11FF
/* Type E: Scaled Pattern-type Bitmap Text (filled) */
#define NV3_W95TXT_E_CLIP_TOPLEFT 0x13E4
#define NV3_W95TXT_E_CLIP_BOTTOMRIGHT 0x13E8
#define NV3_W95TXT_E_CLIP_COLOR_0 0x13EC
#define NV3_W95TXT_E_CLIP_COLOR_1 0x13F0
#define NV3_W95TXT_E_CLIP_SIZE_IN 0x13F4
#define NV3_W95TXT_E_CLIP_SIZE_OUT 0x13F8
#define NV3_W95TXT_E_CLIP_POSITION 0x13FC /* TOP LEFT */
#define NV3_W95TXT_E_CLIP_CLIPRECT_START 0x1400
#define NV3_W95TXT_E_CLIP_CLIPRECT_SIZE 128 // Number of rects
#define NV3_W95TXT_E_CLIP_CLIPRECT_END 0x15FF
/* Class context switch method */
typedef struct nv3_class_ctx_switch_method_s
@@ -523,12 +568,6 @@ typedef struct nv3_object_class_00B
uint8_t reserved4[0x19FB];
} nv3_triangle_t;
typedef struct nv3_object_class_00C_nclip_s
{
nv3_position_16_t position;
nv3_size_16_t size;
} nv3_object_class_00C_nclip_t;
/*
Object Class 0x0C (real hardware)
0x0C (drivers)
@@ -544,7 +583,8 @@ typedef struct nv3_object_class_00C
uint32_t set_notify; // Set notifier
uint8_t reserved2[0x2F4];
uint32_t color_a; // Color for Clip A
nv3_object_class_00C_nclip_t rect_nclip[64];
nv3_position_16_t rect_a_position[64];
nv3_size_16_t rect_a_size[64];
uint8_t reserved3[0x1F0];
nv3_clip_16_t clip_b;
uint32_t color_b; // Color for Clip B

View File

@@ -27,8 +27,6 @@ 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); // 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);
@@ -36,7 +34,7 @@ uint32_t nv3_render_set_pattern_color(nv3_color_expanded_t pattern_colour, bool
void nv3_render_rect(nv3_position_16_t position, nv3_size_16_t size, uint32_t color, nv3_grobj_t grobj);
/* Chroma */
void nv3_render_chroma_test(nv3_grobj_t grobj);
bool nv3_render_chroma_test(nv3_grobj_t grobj, uint32_t color);
/* Blit */
void nv3_render_blit_screen2screen(nv3_grobj_t grobj);

View File

@@ -202,6 +202,7 @@ extern const device_config_t nv3_config[];
#define NV3_CIO_START 0x3b0 // Legacy SVGA Emulation Subsystem
#define NV3_CIO_END 0x3df
#define NV3_PBUS_START 0x1000 // Bus Control Subsystem
#define NV3_PBUS_DEBUG_0 0x1084 // Bus Control Debug
#define NV3_PBUS_INTR 0x1100 // Bus Control - Interrupt Status
#define NV3_PBUS_INTR_EN 0x1140 // Bus Control - Interrupt Enable
@@ -375,6 +376,7 @@ extern const device_config_t nv3_config[];
#define NV3_PFB_BOOT_RAM_EXTENSION_8MB 0x1
#define NV3_PFB_DELAY 0x100044
#define NV3_PFB_DEBUG_0 0x100080 // Debug register for pfb
#define NV3_PFB_GREEN_0 0x1000C0
#define NV3_PFB_CONFIG_0 0x100200 // Framebuffer interface config register 0
@@ -569,10 +571,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_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_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
@@ -581,6 +583,7 @@ extern const device_config_t nv3_config[];
#define NV3_PGRAPH_CHROMA_KEY 0x40062C
#define NV3_PGRAPH_BETA 0x400640 // Beta factor (30:23 fractional, 22:0 before fraction)
#define NV3_PGRAPH_DMA 0x400680
#define NV3_PGRAPH_INSTANCE 0x400688 // Current instance (?)
// Current notification object for pgraph
#define NV3_PGRAPH_NOTIFY 0x400684 // Notifier for PGRAPH
@@ -905,6 +908,7 @@ typedef struct nv3_straps_s
typedef struct nv3_pfb_s
{
uint32_t boot;
uint32_t debug_0; // debug stuff
uint32_t config_0; // Framebuffer width, etc.
uint32_t config_1;
uint32_t green;
@@ -960,6 +964,7 @@ typedef struct nv3_pbus_rma_s
// Bus Configuration
typedef struct nv3_pbus_s
{
uint32_t debug_0;
uint32_t interrupt_status; // Interrupt status
uint32_t interrupt_enable; // Interrupt enable
nv3_pbus_rma_t rma;
@@ -1207,6 +1212,7 @@ typedef struct nv3_pgraph_s
nv3_pgraph_status_t status; // Current status of the 3D engine.
uint32_t trapped_address;
uint32_t trapped_data;
uint32_t instance; // no idea what this is but possibly an object context
uint32_t trapped_instance;
/* This area is used for holding universal representations of the U* registers, which are actually mapped into MMIO */