static uint16_t expand2[256];
static uint8_t expand4to8[16];
-typedef VGACommonState VGAState;
-
static void vga_screen_dump(void *opaque, const char *filename);
static char *screen_dump_filename;
static DisplayChangeListener *screen_dump_dcl;
-static void vga_dumb_update_retrace_info(VGAState *s)
+static void vga_dumb_update_retrace_info(VGACommonState *s)
{
(void) s;
}
-static void vga_precise_update_retrace_info(VGAState *s)
+static void vga_precise_update_retrace_info(VGACommonState *s)
{
int htotal_chars;
int hretr_start_char;
#endif
}
-static uint8_t vga_precise_retrace(VGAState *s)
+static uint8_t vga_precise_retrace(VGACommonState *s)
{
struct vga_precise_retrace *r = &s->retrace_info.precise;
uint8_t val = s->st01 & ~(ST01_V_RETRACE | ST01_DISP_ENABLE);
}
}
-static uint8_t vga_dumb_retrace(VGAState *s)
+static uint8_t vga_dumb_retrace(VGACommonState *s)
{
return s->st01 ^ (ST01_V_RETRACE | ST01_DISP_ENABLE);
}
#ifdef CONFIG_BOCHS_VBE
static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
uint32_t val;
val = s->vbe_index;
return val;
static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
uint32_t val;
if (s->vbe_index <= VBE_DISPI_INDEX_NB) {
static void vbe_ioport_write_index(void *opaque, uint32_t addr, uint32_t val)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
s->vbe_index = val;
}
static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
if (s->vbe_index <= VBE_DISPI_INDEX_NB) {
#ifdef DEBUG_BOCHS_VBE
/* called for accesses between 0xa0000 and 0xc0000 */
uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
int memory_map_mode, plane;
uint32_t ret;
/* called for accesses between 0xa0000 and 0xc0000 */
void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
int memory_map_mode, plane, write_mode, b, func_select, mask;
uint32_t write_mask, bit_mask, set_mask;
typedef void vga_draw_glyph9_func(uint8_t *d, int linesize,
const uint8_t *font_ptr, int h,
uint32_t fgcol, uint32_t bgcol, int dup9);
-typedef void vga_draw_line_func(VGAState *s1, uint8_t *d,
+typedef void vga_draw_line_func(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width);
#define DEPTH 8
}
/* return true if the palette was modified */
-static int update_palette16(VGAState *s)
+static int update_palette16(VGACommonState *s)
{
int full_update, i;
uint32_t v, col, *palette;
}
/* return true if the palette was modified */
-static int update_palette256(VGAState *s)
+static int update_palette256(VGACommonState *s)
{
int full_update, i;
uint32_t v, col, *palette;
return full_update;
}
-static void vga_get_offsets(VGAState *s,
+static void vga_get_offsets(VGACommonState *s,
uint32_t *pline_offset,
uint32_t *pstart_addr,
uint32_t *pline_compare)
}
/* update start_addr and line_offset. Return TRUE if modified */
-static int update_basic_params(VGAState *s)
+static int update_basic_params(VGACommonState *s)
{
int full_update;
uint32_t start_addr, line_offset, line_compare;
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
-static void vga_get_text_resolution(VGAState *s, int *pwidth, int *pheight,
+static void vga_get_text_resolution(VGACommonState *s, int *pwidth, int *pheight,
int *pcwidth, int *pcheight)
{
int width, cwidth, height, cheight;
* - underline
* - flashing
*/
-static void vga_draw_text(VGAState *s, int full_update)
+static void vga_draw_text(VGACommonState *s, int full_update)
{
int cx, cy, cheight, cw, ch, cattr, height, width, ch_attr;
int cx_min, cx_max, linesize, x_incr;
vga_draw_line32_16bgr,
};
-static int vga_get_bpp(VGAState *s)
+static int vga_get_bpp(VGACommonState *s)
{
int ret;
#ifdef CONFIG_BOCHS_VBE
return ret;
}
-static void vga_get_resolution(VGAState *s, int *pwidth, int *pheight)
+static void vga_get_resolution(VGACommonState *s, int *pwidth, int *pheight)
{
int width, height;
*pheight = height;
}
-void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
+void vga_invalidate_scanlines(VGACommonState *s, int y1, int y2)
{
int y;
if (y1 >= VGA_MAX_HEIGHT)
}
}
-static void vga_sync_dirty_bitmap(VGAState *s)
+static void vga_sync_dirty_bitmap(VGACommonState *s)
{
if (s->map_addr)
cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_end);
/*
* graphic modes
*/
-static void vga_draw_graphic(VGAState *s, int full_update)
+static void vga_draw_graphic(VGACommonState *s, int full_update)
{
int y1, y, update, linesize, y_start, double_scan, mask, depth;
int width, height, shift_control, line_offset, bwidth, bits;
memset(s->invalidated_y_table, 0, ((height + 31) >> 5) * 4);
}
-static void vga_draw_blank(VGAState *s, int full_update)
+static void vga_draw_blank(VGACommonState *s, int full_update)
{
int i, w, val;
uint8_t *d;
static void vga_update_display(void *opaque)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
int full_update, graphic_mode;
if (ds_get_bits_per_pixel(s->ds) == 0) {
/* force a full display refresh */
static void vga_invalidate_display(void *opaque)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
s->full_update = 1;
}
static void vga_reset(void *opaque)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
vga_common_reset(s);
}
* instead of doing a full vga_update_display() */
static void vga_update_text(void *opaque, console_ch_t *chardata)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
int graphic_mode, i, cursor_offset, cursor_visible;
int cw, cheight, width, height, size, c_min, c_max;
uint32_t *src;
}
/* used by both ISA and PCI */
-void vga_init(VGAState *s)
+void vga_init(VGACommonState *s)
{
int vga_io_memory;
available */
static void vga_screen_dump(void *opaque, const char *filename)
{
- VGAState *s = opaque;
+ VGACommonState *s = opaque;
if (!screen_dump_dcl)
screen_dump_dcl = vga_screen_dump_init(s->ds);
/*
* 4 color mode
*/
-static void glue(vga_draw_line2_, DEPTH)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line2_, DEPTH)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t plane_mask, *palette, data, v;
/*
* 4 color mode, dup2 horizontal
*/
-static void glue(vga_draw_line2d2_, DEPTH)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line2d2_, DEPTH)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t plane_mask, *palette, data, v;
/*
* 16 color mode
*/
-static void glue(vga_draw_line4_, DEPTH)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line4_, DEPTH)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t plane_mask, data, v, *palette;
/*
* 16 color mode, dup2 horizontal
*/
-static void glue(vga_draw_line4d2_, DEPTH)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line4d2_, DEPTH)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t plane_mask, data, v, *palette;
*
* XXX: add plane_mask support (never used in standard VGA modes)
*/
-static void glue(vga_draw_line8d2_, DEPTH)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line8d2_, DEPTH)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t *palette;
*
* XXX: add plane_mask support (never used in standard VGA modes)
*/
-static void glue(vga_draw_line8_, DEPTH)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line8_, DEPTH)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t *palette;
/*
* 15 bit color
*/
-static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line15_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
#if DEPTH == 15 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
/*
* 16 bit color
*/
-static void glue(vga_draw_line16_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line16_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
/*
* 24 bit color
*/
-static void glue(vga_draw_line24_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line24_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
int w;
/*
* 32 bit color
*/
-static void glue(vga_draw_line32_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
+static void glue(vga_draw_line32_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
#if DEPTH == 32 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT)