static const char *screen_dump_filename;
static DisplayChangeListener *screen_dump_dcl;
-static void vga_update_memory_access(VGACommonState *s)
+static void vga_update_memory_access(MaruVGACommonState *s)
{
MemoryRegion *region, *old_region = s->chain4_alias;
target_phys_addr_t base, offset, size;
}
}
-static void vga_dumb_update_retrace_info(VGACommonState *s)
+static void vga_dumb_update_retrace_info(MaruVGACommonState *s)
{
(void) s;
}
-static void vga_precise_update_retrace_info(VGACommonState *s)
+static void vga_precise_update_retrace_info(MaruVGACommonState *s)
{
int htotal_chars;
int hretr_start_char;
int clock_sel;
const int clk_hz[] = {25175000, 28322000, 25175000, 25175000};
int64_t chars_per_sec;
- struct vga_precise_retrace *r = &s->retrace_info.precise;
+ struct maru_vga_precise_retrace *r = &s->retrace_info.precise;
htotal_chars = s->cr[0x00] + 5;
hretr_start_char = s->cr[0x04];
#endif
}
-static uint8_t vga_precise_retrace(VGACommonState *s)
+static uint8_t vga_precise_retrace(MaruVGACommonState *s)
{
- struct vga_precise_retrace *r = &s->retrace_info.precise;
+ struct maru_vga_precise_retrace *r = &s->retrace_info.precise;
uint8_t val = s->st01 & ~(ST01_V_RETRACE | ST01_DISP_ENABLE);
if (r->total_chars) {
}
}
-static uint8_t vga_dumb_retrace(VGACommonState *s)
+static uint8_t vga_dumb_retrace(MaruVGACommonState *s)
{
return s->st01 ^ (ST01_V_RETRACE | ST01_DISP_ENABLE);
}
-int maru_vga_ioport_invalid(VGACommonState *s, uint32_t addr)
+int maru_vga_ioport_invalid(MaruVGACommonState *s, uint32_t addr)
{
if (s->msr & MSR_COLOR_EMULATION) {
/* Color */
uint32_t maru_vga_ioport_read(void *opaque, uint32_t addr)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
int val, index;
if (maru_vga_ioport_invalid(s, addr)) {
void maru_vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
int index;
/* check port range access depending on color/monochrome mode */
#ifdef CONFIG_BOCHS_VBE
static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
uint32_t val;
val = s->vbe_index;
return val;
static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *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)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
s->vbe_index = val;
}
static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
if (s->vbe_index <= VBE_DISPI_INDEX_NB) {
#ifdef DEBUG_BOCHS_VBE
#endif
/* called for accesses between 0xa0000 and 0xc0000 */
-uint32_t maru_vga_mem_readb(VGACommonState *s, target_phys_addr_t addr)
+uint32_t maru_vga_mem_readb(MaruVGACommonState *s, target_phys_addr_t addr)
{
int memory_map_mode, plane;
uint32_t ret;
}
/* called for accesses between 0xa0000 and 0xc0000 */
-void maru_vga_mem_writeb(VGACommonState *s, target_phys_addr_t addr, uint32_t val)
+void maru_vga_mem_writeb(MaruVGACommonState *s, target_phys_addr_t addr, uint32_t val)
{
int memory_map_mode, plane, write_mode, b, func_select, mask;
uint32_t write_mask, bit_mask, set_mask;
}
}
-typedef void vga_draw_glyph8_func(uint8_t *d, int linesize,
+typedef void maru_vga_draw_glyph8_func(uint8_t *d, int linesize,
const uint8_t *font_ptr, int h,
uint32_t fgcol, uint32_t bgcol);
-typedef void vga_draw_glyph9_func(uint8_t *d, int linesize,
+typedef void maru_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(VGACommonState *s1, uint8_t *d,
+typedef void maru_vga_draw_line_func(MaruVGACommonState *s1, uint8_t *d,
const uint8_t *s, int width);
#define DEPTH 8
}
/* return true if the palette was modified */
-static int update_palette16(VGACommonState *s)
+static int update_palette16(MaruVGACommonState *s)
{
int full_update, i;
uint32_t v, col, *palette;
else
v = ((s->ar[0x14] & 0xc) << 4) | (v & 0x3f);
v = v * 3;
- col = s->rgb_to_pixel(c6_to_8(s->palette[v]),
- c6_to_8(s->palette[v + 1]),
- c6_to_8(s->palette[v + 2]));
+ col = s->rgb_to_pixel(maru_c6_to_8(s->palette[v]),
+ maru_c6_to_8(s->palette[v + 1]),
+ maru_c6_to_8(s->palette[v + 2]));
if (col != palette[i]) {
full_update = 1;
palette[i] = col;
}
/* return true if the palette was modified */
-static int update_palette256(VGACommonState *s)
+static int update_palette256(MaruVGACommonState *s)
{
int full_update, i;
uint32_t v, col, *palette;
s->palette[v + 1],
s->palette[v + 2]);
} else {
- col = s->rgb_to_pixel(c6_to_8(s->palette[v]),
- c6_to_8(s->palette[v + 1]),
- c6_to_8(s->palette[v + 2]));
+ col = s->rgb_to_pixel(maru_c6_to_8(s->palette[v]),
+ maru_c6_to_8(s->palette[v + 1]),
+ maru_c6_to_8(s->palette[v + 2]));
}
if (col != palette[i]) {
full_update = 1;
return full_update;
}
-static void vga_get_offsets(VGACommonState *s,
+static void vga_get_offsets(MaruVGACommonState *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(VGACommonState *s)
+static int update_basic_params(MaruVGACommonState *s)
{
int full_update;
uint32_t start_addr, line_offset, line_compare;
}
}
-static vga_draw_glyph8_func * const vga_draw_glyph8_table[NB_DEPTHS] = {
- vga_draw_glyph8_8,
- vga_draw_glyph8_16,
- vga_draw_glyph8_16,
- vga_draw_glyph8_32,
- vga_draw_glyph8_32,
- vga_draw_glyph8_16,
- vga_draw_glyph8_16,
+static maru_vga_draw_glyph8_func * const maru_vga_draw_glyph8_table[NB_DEPTHS] = {
+ maru_vga_draw_glyph8_8,
+ maru_vga_draw_glyph8_16,
+ maru_vga_draw_glyph8_16,
+ maru_vga_draw_glyph8_32,
+ maru_vga_draw_glyph8_32,
+ maru_vga_draw_glyph8_16,
+ maru_vga_draw_glyph8_16,
};
-static vga_draw_glyph8_func * const vga_draw_glyph16_table[NB_DEPTHS] = {
- vga_draw_glyph16_8,
- vga_draw_glyph16_16,
- vga_draw_glyph16_16,
- vga_draw_glyph16_32,
- vga_draw_glyph16_32,
- vga_draw_glyph16_16,
- vga_draw_glyph16_16,
+static maru_vga_draw_glyph8_func * const maru_vga_draw_glyph16_table[NB_DEPTHS] = {
+ maru_vga_draw_glyph16_8,
+ maru_vga_draw_glyph16_16,
+ maru_vga_draw_glyph16_16,
+ maru_vga_draw_glyph16_32,
+ maru_vga_draw_glyph16_32,
+ maru_vga_draw_glyph16_16,
+ maru_vga_draw_glyph16_16,
};
-static vga_draw_glyph9_func * const vga_draw_glyph9_table[NB_DEPTHS] = {
- vga_draw_glyph9_8,
- vga_draw_glyph9_16,
- vga_draw_glyph9_16,
- vga_draw_glyph9_32,
- vga_draw_glyph9_32,
- vga_draw_glyph9_16,
- vga_draw_glyph9_16,
+static maru_vga_draw_glyph9_func * const maru_vga_draw_glyph9_table[NB_DEPTHS] = {
+ maru_vga_draw_glyph9_8,
+ maru_vga_draw_glyph9_16,
+ maru_vga_draw_glyph9_16,
+ maru_vga_draw_glyph9_32,
+ maru_vga_draw_glyph9_32,
+ maru_vga_draw_glyph9_16,
+ maru_vga_draw_glyph9_16,
};
static const uint8_t cursor_glyph[32 * 4] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
-static void vga_get_text_resolution(VGACommonState *s, int *pwidth, int *pheight,
+static void vga_get_text_resolution(MaruVGACommonState *s, int *pwidth, int *pheight,
int *pcwidth, int *pcheight)
{
int width, cwidth, height, cheight;
* - underline
* - flashing
*/
-static void vga_draw_text(VGACommonState *s, int full_update)
+static void maru_vga_draw_text(MaruVGACommonState *s, int full_update)
{
int cx, cy, cheight, cw, ch, cattr, height, width, ch_attr;
int cx_min, cx_max, linesize, x_incr, line, line1;
int dup9, line_offset, depth_index;
uint32_t *palette;
uint32_t *ch_attr_ptr;
- vga_draw_glyph8_func *vga_draw_glyph8;
- vga_draw_glyph9_func *vga_draw_glyph9;
+ maru_vga_draw_glyph8_func *maru_vga_draw_glyph8;
+ maru_vga_draw_glyph9_func *maru_vga_draw_glyph9;
/* compute font data address (in plane 2) */
v = s->sr[3];
depth_index = get_depth_index(s->ds);
if (cw == 16)
- vga_draw_glyph8 = vga_draw_glyph16_table[depth_index];
+ maru_vga_draw_glyph8 = maru_vga_draw_glyph16_table[depth_index];
else
- vga_draw_glyph8 = vga_draw_glyph8_table[depth_index];
- vga_draw_glyph9 = vga_draw_glyph9_table[depth_index];
+ maru_vga_draw_glyph8 = maru_vga_draw_glyph8_table[depth_index];
+ maru_vga_draw_glyph9 = maru_vga_draw_glyph9_table[depth_index];
dest = ds_get_data(s->ds);
linesize = ds_get_linesize(s->ds);
bgcol = palette[cattr >> 4];
fgcol = palette[cattr & 0x0f];
if (cw != 9) {
- vga_draw_glyph8(d1, linesize,
+ maru_vga_draw_glyph8(d1, linesize,
font_ptr, cheight, fgcol, bgcol);
} else {
dup9 = 0;
if (ch >= 0xb0 && ch <= 0xdf && (s->ar[0x10] & 0x04))
dup9 = 1;
- vga_draw_glyph9(d1, linesize,
+ maru_vga_draw_glyph9(d1, linesize,
font_ptr, cheight, fgcol, bgcol, dup9);
}
if (src == cursor_ptr &&
h = line_last - line_start + 1;
d = d1 + linesize * line_start;
if (cw != 9) {
- vga_draw_glyph8(d, linesize,
+ maru_vga_draw_glyph8(d, linesize,
cursor_glyph, h, fgcol, bgcol);
} else {
- vga_draw_glyph9(d, linesize,
+ maru_vga_draw_glyph9(d, linesize,
cursor_glyph, h, fgcol, bgcol, 1);
}
}
}
enum {
- VGA_DRAW_LINE2,
- VGA_DRAW_LINE2D2,
- VGA_DRAW_LINE4,
- VGA_DRAW_LINE4D2,
- VGA_DRAW_LINE8D2,
- VGA_DRAW_LINE8,
- VGA_DRAW_LINE15,
- VGA_DRAW_LINE16,
- VGA_DRAW_LINE24,
- VGA_DRAW_LINE32,
- VGA_DRAW_LINE_NB,
+ maru_vga_draw_LINE2,
+ maru_vga_draw_LINE2D2,
+ maru_vga_draw_LINE4,
+ maru_vga_draw_LINE4D2,
+ maru_vga_draw_LINE8D2,
+ maru_vga_draw_LINE8,
+ maru_vga_draw_LINE15,
+ maru_vga_draw_LINE16,
+ maru_vga_draw_LINE24,
+ maru_vga_draw_LINE32,
+ maru_vga_draw_LINE_NB,
};
-static vga_draw_line_func * const vga_draw_line_table[NB_DEPTHS * VGA_DRAW_LINE_NB] = {
- vga_draw_line2_8,
- vga_draw_line2_16,
- vga_draw_line2_16,
- vga_draw_line2_32,
- vga_draw_line2_32,
- vga_draw_line2_16,
- vga_draw_line2_16,
-
- vga_draw_line2d2_8,
- vga_draw_line2d2_16,
- vga_draw_line2d2_16,
- vga_draw_line2d2_32,
- vga_draw_line2d2_32,
- vga_draw_line2d2_16,
- vga_draw_line2d2_16,
-
- vga_draw_line4_8,
- vga_draw_line4_16,
- vga_draw_line4_16,
- vga_draw_line4_32,
- vga_draw_line4_32,
- vga_draw_line4_16,
- vga_draw_line4_16,
-
- vga_draw_line4d2_8,
- vga_draw_line4d2_16,
- vga_draw_line4d2_16,
- vga_draw_line4d2_32,
- vga_draw_line4d2_32,
- vga_draw_line4d2_16,
- vga_draw_line4d2_16,
-
- vga_draw_line8d2_8,
- vga_draw_line8d2_16,
- vga_draw_line8d2_16,
- vga_draw_line8d2_32,
- vga_draw_line8d2_32,
- vga_draw_line8d2_16,
- vga_draw_line8d2_16,
-
- vga_draw_line8_8,
- vga_draw_line8_16,
- vga_draw_line8_16,
- vga_draw_line8_32,
- vga_draw_line8_32,
- vga_draw_line8_16,
- vga_draw_line8_16,
-
- vga_draw_line15_8,
- vga_draw_line15_15,
- vga_draw_line15_16,
- vga_draw_line15_32,
- vga_draw_line15_32bgr,
- vga_draw_line15_15bgr,
- vga_draw_line15_16bgr,
-
- vga_draw_line16_8,
- vga_draw_line16_15,
- vga_draw_line16_16,
- vga_draw_line16_32,
- vga_draw_line16_32bgr,
- vga_draw_line16_15bgr,
- vga_draw_line16_16bgr,
-
- vga_draw_line24_8,
- vga_draw_line24_15,
- vga_draw_line24_16,
- vga_draw_line24_32,
- vga_draw_line24_32bgr,
- vga_draw_line24_15bgr,
- vga_draw_line24_16bgr,
-
- vga_draw_line32_8,
- vga_draw_line32_15,
- vga_draw_line32_16,
- vga_draw_line32_32,
- vga_draw_line32_32bgr,
- vga_draw_line32_15bgr,
- vga_draw_line32_16bgr,
+static maru_vga_draw_line_func * const maru_vga_draw_line_table[NB_DEPTHS * maru_vga_draw_LINE_NB] = {
+ maru_vga_draw_line2_8,
+ maru_vga_draw_line2_16,
+ maru_vga_draw_line2_16,
+ maru_vga_draw_line2_32,
+ maru_vga_draw_line2_32,
+ maru_vga_draw_line2_16,
+ maru_vga_draw_line2_16,
+
+ maru_vga_draw_line2d2_8,
+ maru_vga_draw_line2d2_16,
+ maru_vga_draw_line2d2_16,
+ maru_vga_draw_line2d2_32,
+ maru_vga_draw_line2d2_32,
+ maru_vga_draw_line2d2_16,
+ maru_vga_draw_line2d2_16,
+
+ maru_vga_draw_line4_8,
+ maru_vga_draw_line4_16,
+ maru_vga_draw_line4_16,
+ maru_vga_draw_line4_32,
+ maru_vga_draw_line4_32,
+ maru_vga_draw_line4_16,
+ maru_vga_draw_line4_16,
+
+ maru_vga_draw_line4d2_8,
+ maru_vga_draw_line4d2_16,
+ maru_vga_draw_line4d2_16,
+ maru_vga_draw_line4d2_32,
+ maru_vga_draw_line4d2_32,
+ maru_vga_draw_line4d2_16,
+ maru_vga_draw_line4d2_16,
+
+ maru_vga_draw_line8d2_8,
+ maru_vga_draw_line8d2_16,
+ maru_vga_draw_line8d2_16,
+ maru_vga_draw_line8d2_32,
+ maru_vga_draw_line8d2_32,
+ maru_vga_draw_line8d2_16,
+ maru_vga_draw_line8d2_16,
+
+ maru_vga_draw_line8_8,
+ maru_vga_draw_line8_16,
+ maru_vga_draw_line8_16,
+ maru_vga_draw_line8_32,
+ maru_vga_draw_line8_32,
+ maru_vga_draw_line8_16,
+ maru_vga_draw_line8_16,
+
+ maru_vga_draw_line15_8,
+ maru_vga_draw_line15_15,
+ maru_vga_draw_line15_16,
+ maru_vga_draw_line15_32,
+ maru_vga_draw_line15_32bgr,
+ maru_vga_draw_line15_15bgr,
+ maru_vga_draw_line15_16bgr,
+
+ maru_vga_draw_line16_8,
+ maru_vga_draw_line16_15,
+ maru_vga_draw_line16_16,
+ maru_vga_draw_line16_32,
+ maru_vga_draw_line16_32bgr,
+ maru_vga_draw_line16_15bgr,
+ maru_vga_draw_line16_16bgr,
+
+ maru_vga_draw_line24_8,
+ maru_vga_draw_line24_15,
+ maru_vga_draw_line24_16,
+ maru_vga_draw_line24_32,
+ maru_vga_draw_line24_32bgr,
+ maru_vga_draw_line24_15bgr,
+ maru_vga_draw_line24_16bgr,
+
+ maru_vga_draw_line32_8,
+ maru_vga_draw_line32_15,
+ maru_vga_draw_line32_16,
+ maru_vga_draw_line32_32,
+ maru_vga_draw_line32_32bgr,
+ maru_vga_draw_line32_15bgr,
+ maru_vga_draw_line32_16bgr,
};
-static int vga_get_bpp(VGACommonState *s)
+static int vga_get_bpp(MaruVGACommonState *s)
{
int ret;
#ifdef CONFIG_BOCHS_VBE
return ret;
}
-static void vga_get_resolution(VGACommonState *s, int *pwidth, int *pheight)
+static void vga_get_resolution(MaruVGACommonState *s, int *pwidth, int *pheight)
{
int width, height;
*pheight = height;
}
-void maru_vga_invalidate_scanlines(VGACommonState *s, int y1, int y2)
+void maru_vga_invalidate_scanlines(MaruVGACommonState *s, int y1, int y2)
{
int y;
if (y1 >= VGA_MAX_HEIGHT)
}
}
-static void vga_sync_dirty_bitmap(VGACommonState *s)
+static void vga_sync_dirty_bitmap(MaruVGACommonState *s)
{
memory_region_sync_dirty_bitmap(&s->vram);
}
-void maru_vga_dirty_log_start(VGACommonState *s)
+void maru_vga_dirty_log_start(MaruVGACommonState *s)
{
memory_region_set_log(&s->vram, true, DIRTY_MEMORY_VGA);
}
-void maru_vga_dirty_log_stop(VGACommonState *s)
+void maru_vga_dirty_log_stop(MaruVGACommonState *s)
{
memory_region_set_log(&s->vram, false, DIRTY_MEMORY_VGA);
}
extern uint32_t brightness_level;
extern uint32_t brightness_off;
#endif
-static void vga_draw_graphic(VGACommonState *s, int full_update)
+static void maru_vga_draw_graphic(MaruVGACommonState *s, int full_update)
{
int y1, y, update, linesize, y_start, double_scan, mask, depth;
int width, height, shift_control, line_offset, bwidth, bits;
int disp_width, multi_scan, multi_run;
uint8_t *d;
uint32_t v, addr1, addr;
- vga_draw_line_func *vga_draw_line;
+ maru_vga_draw_line_func *maru_vga_draw_line;
full_update |= update_basic_params(s);
if (shift_control == 0) {
full_update |= update_palette16(s);
if (s->sr[0x01] & 8) {
- v = VGA_DRAW_LINE4D2;
+ v = maru_vga_draw_LINE4D2;
} else {
- v = VGA_DRAW_LINE4;
+ v = maru_vga_draw_LINE4;
}
bits = 4;
} else if (shift_control == 1) {
full_update |= update_palette16(s);
if (s->sr[0x01] & 8) {
- v = VGA_DRAW_LINE2D2;
+ v = maru_vga_draw_LINE2D2;
} else {
- v = VGA_DRAW_LINE2;
+ v = maru_vga_draw_LINE2;
}
bits = 4;
} else {
default:
case 0:
full_update |= update_palette256(s);
- v = VGA_DRAW_LINE8D2;
+ v = maru_vga_draw_LINE8D2;
bits = 4;
break;
case 8:
full_update |= update_palette256(s);
- v = VGA_DRAW_LINE8;
+ v = maru_vga_draw_LINE8;
bits = 8;
break;
case 15:
- v = VGA_DRAW_LINE15;
+ v = maru_vga_draw_LINE15;
bits = 16;
break;
case 16:
- v = VGA_DRAW_LINE16;
+ v = maru_vga_draw_LINE16;
bits = 16;
break;
case 24:
- v = VGA_DRAW_LINE24;
+ v = maru_vga_draw_LINE24;
bits = 24;
break;
case 32:
- v = VGA_DRAW_LINE32;
+ v = maru_vga_draw_LINE32;
bits = 32;
break;
}
}
- vga_draw_line = vga_draw_line_table[v * NB_DEPTHS + get_depth_index(s->ds)];
+ maru_vga_draw_line = maru_vga_draw_line_table[v * NB_DEPTHS + get_depth_index(s->ds)];
if (!is_buffer_shared(s->ds->surface) && s->cursor_invalidate)
s->cursor_invalidate(s);
if (page1 > page_max)
page_max = page1;
if (!(is_buffer_shared(s->ds->surface))) {
- vga_draw_line(s, d, s->vram_ptr + addr, width);
+ maru_vga_draw_line(s, d, s->vram_ptr + addr, width);
if (s->cursor_draw_line)
s->cursor_draw_line(s, d, y);
}
memset(s->invalidated_y_table, 0, ((height + 31) >> 5) * 4);
}
-static void vga_draw_blank(VGACommonState *s, int full_update)
+static void maru_vga_draw_blank(MaruVGACommonState *s, int full_update)
{
int i, w, val;
uint8_t *d;
static void vga_update_display(void *opaque)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
int full_update, graphic_mode;
qemu_flush_coalesced_mmio_buffer();
}
switch(graphic_mode) {
case GMODE_TEXT:
- vga_draw_text(s, full_update);
+ maru_vga_draw_text(s, full_update);
break;
case GMODE_GRAPH:
- vga_draw_graphic(s, full_update);
+ maru_vga_draw_graphic(s, full_update);
break;
case GMODE_BLANK:
default:
- vga_draw_blank(s, full_update);
+ maru_vga_draw_blank(s, full_update);
break;
}
}
/* force a full display refresh */
static void vga_invalidate_display(void *opaque)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
s->last_width = -1;
s->last_height = -1;
}
-void maru_vga_common_reset(VGACommonState *s)
+void maru_vga_common_reset(MaruVGACommonState *s)
{
s->sr_index = 0;
memset(s->sr, '\0', sizeof(s->sr));
static void vga_reset(void *opaque)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
maru_vga_common_reset(s);
}
* instead of doing a full vga_update_display() */
static void vga_update_text(void *opaque, console_ch_t *chardata)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
int graphic_mode, i, cursor_offset, cursor_visible;
int cw, cheight, width, height, size, c_min, c_max;
uint32_t *src;
static uint64_t maru_vga_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
return maru_vga_mem_readb(s, addr);
}
static void maru_vga_mem_write(void *opaque, target_phys_addr_t addr,
uint64_t data, unsigned size)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
return maru_vga_mem_writeb(s, addr, data);
}
static int vga_common_post_load(void *opaque, int version_id)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
/* force refresh */
s->graphic_mode = -1;
.minimum_version_id_old = 2,
.post_load = vga_common_post_load,
.fields = (VMStateField []) {
- VMSTATE_UINT32(latch, VGACommonState),
- VMSTATE_UINT8(sr_index, VGACommonState),
- VMSTATE_PARTIAL_BUFFER(sr, VGACommonState, 8),
- VMSTATE_UINT8(gr_index, VGACommonState),
- VMSTATE_PARTIAL_BUFFER(gr, VGACommonState, 16),
- VMSTATE_UINT8(ar_index, VGACommonState),
- VMSTATE_BUFFER(ar, VGACommonState),
- VMSTATE_INT32(ar_flip_flop, VGACommonState),
- VMSTATE_UINT8(cr_index, VGACommonState),
- VMSTATE_BUFFER(cr, VGACommonState),
- VMSTATE_UINT8(msr, VGACommonState),
- VMSTATE_UINT8(fcr, VGACommonState),
- VMSTATE_UINT8(st00, VGACommonState),
- VMSTATE_UINT8(st01, VGACommonState),
-
- VMSTATE_UINT8(dac_state, VGACommonState),
- VMSTATE_UINT8(dac_sub_index, VGACommonState),
- VMSTATE_UINT8(dac_read_index, VGACommonState),
- VMSTATE_UINT8(dac_write_index, VGACommonState),
- VMSTATE_BUFFER(dac_cache, VGACommonState),
- VMSTATE_BUFFER(palette, VGACommonState),
-
- VMSTATE_INT32(bank_offset, VGACommonState),
- VMSTATE_UINT8_EQUAL(is_vbe_vmstate, VGACommonState),
+ VMSTATE_UINT32(latch, MaruVGACommonState),
+ VMSTATE_UINT8(sr_index, MaruVGACommonState),
+ VMSTATE_PARTIAL_BUFFER(sr, MaruVGACommonState, 8),
+ VMSTATE_UINT8(gr_index, MaruVGACommonState),
+ VMSTATE_PARTIAL_BUFFER(gr, MaruVGACommonState, 16),
+ VMSTATE_UINT8(ar_index, MaruVGACommonState),
+ VMSTATE_BUFFER(ar, MaruVGACommonState),
+ VMSTATE_INT32(ar_flip_flop, MaruVGACommonState),
+ VMSTATE_UINT8(cr_index, MaruVGACommonState),
+ VMSTATE_BUFFER(cr, MaruVGACommonState),
+ VMSTATE_UINT8(msr, MaruVGACommonState),
+ VMSTATE_UINT8(fcr, MaruVGACommonState),
+ VMSTATE_UINT8(st00, MaruVGACommonState),
+ VMSTATE_UINT8(st01, MaruVGACommonState),
+
+ VMSTATE_UINT8(dac_state, MaruVGACommonState),
+ VMSTATE_UINT8(dac_sub_index, MaruVGACommonState),
+ VMSTATE_UINT8(dac_read_index, MaruVGACommonState),
+ VMSTATE_UINT8(dac_write_index, MaruVGACommonState),
+ VMSTATE_BUFFER(dac_cache, MaruVGACommonState),
+ VMSTATE_BUFFER(palette, MaruVGACommonState),
+
+ VMSTATE_INT32(bank_offset, MaruVGACommonState),
+ VMSTATE_UINT8_EQUAL(is_vbe_vmstate, MaruVGACommonState),
#ifdef CONFIG_BOCHS_VBE
- VMSTATE_UINT16(vbe_index, VGACommonState),
- VMSTATE_UINT16_ARRAY(vbe_regs, VGACommonState, VBE_DISPI_INDEX_NB),
- VMSTATE_UINT32(vbe_start_addr, VGACommonState),
- VMSTATE_UINT32(vbe_line_offset, VGACommonState),
- VMSTATE_UINT32(vbe_bank_mask, VGACommonState),
+ VMSTATE_UINT16(vbe_index, MaruVGACommonState),
+ VMSTATE_UINT16_ARRAY(vbe_regs, MaruVGACommonState, VBE_DISPI_INDEX_NB),
+ VMSTATE_UINT32(vbe_start_addr, MaruVGACommonState),
+ VMSTATE_UINT32(vbe_line_offset, MaruVGACommonState),
+ VMSTATE_UINT32(vbe_bank_mask, MaruVGACommonState),
#endif
VMSTATE_END_OF_LIST()
}
};
-void maru_vga_common_init(VGACommonState *s, int vga_ram_size)
+void maru_vga_common_init(MaruVGACommonState *s, int vga_ram_size)
{
int i, j, v, b;
#endif /* CONFIG_BOCHS_VBE */
/* Used by both ISA and PCI */
-MemoryRegion *maru_vga_init_io(VGACommonState *s,
+MemoryRegion *maru_vga_init_io(MaruVGACommonState *s,
const MemoryRegionPortio **vga_ports,
const MemoryRegionPortio **vbe_ports)
{
return vga_mem;
}
-void maru_vga_init(VGACommonState *s, MemoryRegion *address_space,
+void maru_vga_init(MaruVGACommonState *s, MemoryRegion *address_space,
MemoryRegion *address_space_io, bool init_vga_ports)
{
MemoryRegion *vga_io_memory;
}
}
-void maru_vga_init_vbe(VGACommonState *s, MemoryRegion *system_memory)
+void maru_vga_init_vbe(MaruVGACommonState *s, MemoryRegion *system_memory)
{
#ifdef CONFIG_BOCHS_VBE
/* XXX: use optimized standard vga accesses */
available */
static void vga_screen_dump(void *opaque, const char *filename)
{
- VGACommonState *s = opaque;
+ MaruVGACommonState *s = opaque;
if (!screen_dump_dcl)
screen_dump_dcl = vga_screen_dump_init(s->ds);
#if DEPTH != 15 && !defined(BGR_FORMAT)
-static inline void glue(vga_draw_glyph_line_, DEPTH)(uint8_t *d,
+static inline void glue(maru_vga_draw_glyph_line_, DEPTH)(uint8_t *d,
uint32_t font_data,
uint32_t xorcol,
uint32_t bgcol)
#endif
}
-static void glue(vga_draw_glyph8_, DEPTH)(uint8_t *d, int linesize,
+static void glue(maru_vga_draw_glyph8_, DEPTH)(uint8_t *d, int linesize,
const uint8_t *font_ptr, int h,
uint32_t fgcol, uint32_t bgcol)
{
xorcol = bgcol ^ fgcol;
do {
font_data = font_ptr[0];
- glue(vga_draw_glyph_line_, DEPTH)(d, font_data, xorcol, bgcol);
+ glue(maru_vga_draw_glyph_line_, DEPTH)(d, font_data, xorcol, bgcol);
font_ptr += 4;
d += linesize;
} while (--h);
}
-static void glue(vga_draw_glyph16_, DEPTH)(uint8_t *d, int linesize,
+static void glue(maru_vga_draw_glyph16_, DEPTH)(uint8_t *d, int linesize,
const uint8_t *font_ptr, int h,
uint32_t fgcol, uint32_t bgcol)
{
xorcol = bgcol ^ fgcol;
do {
font_data = font_ptr[0];
- glue(vga_draw_glyph_line_, DEPTH)(d,
+ glue(maru_vga_draw_glyph_line_, DEPTH)(d,
expand4to8[font_data >> 4],
xorcol, bgcol);
- glue(vga_draw_glyph_line_, DEPTH)(d + 8 * BPP,
+ glue(maru_vga_draw_glyph_line_, DEPTH)(d + 8 * BPP,
expand4to8[font_data & 0x0f],
xorcol, bgcol);
font_ptr += 4;
} while (--h);
}
-static void glue(vga_draw_glyph9_, DEPTH)(uint8_t *d, int linesize,
+static void glue(maru_vga_draw_glyph9_, DEPTH)(uint8_t *d, int linesize,
const uint8_t *font_ptr, int h,
uint32_t fgcol, uint32_t bgcol, int dup9)
{
/*
* 4 color mode
*/
-static void glue(vga_draw_line2_, DEPTH)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line2_, DEPTH)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line2d2_, DEPTH)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line4_, DEPTH)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line4d2_, DEPTH)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line8d2_, DEPTH)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line8_, DEPTH)(MaruVGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
uint32_t *palette;
/*
* 15 bit color
*/
-static void glue(vga_draw_line15_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line15_, PIXEL_NAME)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line16_, PIXEL_NAME)(MaruVGACommonState *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)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line24_, PIXEL_NAME)(MaruVGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
int w;
/*
* 32 bit color
*/
-static void glue(vga_draw_line32_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d,
+static void glue(maru_vga_draw_line32_, PIXEL_NAME)(MaruVGACommonState *s1, uint8_t *d,
const uint8_t *s, int width)
{
#if DEPTH == 32 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT)