From a8aa669ba406a0d6530f48e0c87a358ba614aa95 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 6 Jun 2004 15:17:19 +0000 Subject: generic hardware cursor support git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@903 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/vga_int.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'hw/vga_int.h') diff --git a/hw/vga_int.h b/hw/vga_int.h index 8fb78a0df7..0d0f3edee1 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -72,6 +72,7 @@ #endif /* !CONFIG_BOCHS_VBE */ #define CH_ATTR_SIZE (160 * 100) +#define VGA_MAX_HEIGHT 1024 #define VGA_STATE_COMMON \ uint8_t *vram_ptr; \ @@ -119,6 +120,10 @@ uint32_t cursor_offset; \ unsigned int (*rgb_to_pixel)(unsigned int r, \ unsigned int g, unsigned b); \ + /* hardware mouse cursor support */ \ + uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; \ + void (*cursor_invalidate)(struct VGAState *s); \ + void (*cursor_draw_line)(struct VGAState *s, uint8_t *d, int y); \ /* tell for each page if it has been updated since the last time */ \ uint32_t last_palette[256]; \ uint32_t last_ch_attr[CH_ATTR_SIZE]; /* XXX: make it dynamic */ @@ -128,10 +133,32 @@ typedef struct VGAState { VGA_STATE_COMMON } VGAState; +static inline int c6_to_8(int v) +{ + int b; + v &= 0x3f; + b = v & 1; + return (v << 2) | (b << 1) | b; +} + void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base, unsigned long vga_ram_offset, int vga_ram_size); uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr); void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val); +void vga_invalidate_scanlines(VGAState *s, int y1, int y2); + +void vga_draw_cursor_line_8(uint8_t *d1, const uint8_t *src1, + int poffset, int w, + unsigned int color0, unsigned int color1, + unsigned int color_xor); +void vga_draw_cursor_line_16(uint8_t *d1, const uint8_t *src1, + int poffset, int w, + unsigned int color0, unsigned int color1, + unsigned int color_xor); +void vga_draw_cursor_line_32(uint8_t *d1, const uint8_t *src1, + int poffset, int w, + unsigned int color0, unsigned int color1, + unsigned int color_xor); extern const uint8_t sr_mask[8]; extern const uint8_t gr_mask[16]; -- cgit v1.2.1