s->state |= REDRAW_SEGMENTS | REDRAW_BACKGROUND;
}
-static void jazz_led_text_update(void *opaque, console_ch_t *chardata)
+static void jazz_led_text_update(void *opaque, uint32_t *chardata)
{
LedState *s = opaque;
char buf[3];
/* TODO: draw the segments */
snprintf(buf, 3, "%02hhx", s->segments);
- console_write_ch(chardata++, ATTR2CHTYPE(buf[0], QEMU_COLOR_BLUE,
- QEMU_COLOR_BLACK, 1));
- console_write_ch(chardata++, ATTR2CHTYPE(buf[1], QEMU_COLOR_BLUE,
- QEMU_COLOR_BLACK, 1));
+ *chardata++ = ATTR2CHTYPE(buf[0], QEMU_COLOR_BLUE,
+ QEMU_COLOR_BLACK, 1);
+ *chardata++ = ATTR2CHTYPE(buf[1], QEMU_COLOR_BLUE,
+ QEMU_COLOR_BLACK, 1);
dpy_text_update(s->con, 0, 0, 2, 1);
}
((v & 0x00000800) << 10) | ((v & 0x00007000) >> 1))
/* relay text rendering to the display driver
* instead of doing a full vga_update_display() */
-static void vga_update_text(void *opaque, console_ch_t *chardata)
+static void vga_update_text(void *opaque, uint32_t *chardata)
{
VGACommonState *s = opaque;
int graphic_mode, i, cursor_offset, cursor_visible;
int cw, cheight, width, height, size, c_min, c_max;
uint32_t *src;
- console_ch_t *dst, val;
+ uint32_t *dst, val;
char msg_buffer[80];
int full_update = 0;
if (full_update) {
for (i = 0; i < size; src ++, dst ++, i ++)
- console_write_ch(dst, VMEM2CHTYPE(le32_to_cpu(*src)));
+ *dst = VMEM2CHTYPE(le32_to_cpu(*src));
dpy_text_update(s->con, 0, 0, width, height);
} else {
c_max = 0;
for (i = 0; i < size; src ++, dst ++, i ++) {
- console_write_ch(&val, VMEM2CHTYPE(le32_to_cpu(*src)));
+ val = VMEM2CHTYPE(le32_to_cpu(*src));
if (*dst != val) {
*dst = val;
c_max = i;
}
c_min = i;
for (; i < size; src ++, dst ++, i ++) {
- console_write_ch(&val, VMEM2CHTYPE(le32_to_cpu(*src)));
+ val = VMEM2CHTYPE(le32_to_cpu(*src));
if (*dst != val) {
*dst = val;
c_max = i;
dpy_text_resize(s->con, s->last_width, height);
for (dst = chardata, i = 0; i < s->last_width * height; i ++)
- console_write_ch(dst ++, ' ');
+ *dst++ = ' ';
size = strlen(msg_buffer);
width = (s->last_width - size) / 2;
dst = chardata + s->last_width + width;
for (i = 0; i < size; i ++)
- console_write_ch(dst ++, ATTR2CHTYPE(msg_buffer[i], QEMU_COLOR_BLUE,
- QEMU_COLOR_BLACK, 1));
+ *dst++ = ATTR2CHTYPE(msg_buffer[i], QEMU_COLOR_BLUE,
+ QEMU_COLOR_BLACK, 1);
dpy_text_update(s->con, 0, 0, s->last_width, height);
}
return true;
}
-static void virtio_gpu_text_update(void *opaque, console_ch_t *chardata)
+static void virtio_gpu_text_update(void *opaque, uint32_t *chardata)
{
}
}
}
-static void virtio_vga_base_text_update(void *opaque, console_ch_t *chardata)
+static void virtio_vga_base_text_update(void *opaque, uint32_t *chardata)
{
VirtIOVGABase *vvga = opaque;
VirtIOGPUBase *g = vvga->vgpu;
s->invalidated = 1;
}
-static void vmsvga_text_update(void *opaque, console_ch_t *chardata)
+static void vmsvga_text_update(void *opaque, uint32_t *chardata)
{
struct vmsvga_state_s *s = opaque;
bool console_has_gl(QemuConsole *con);
-typedef uint32_t console_ch_t;
-
-static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
-{
- *dest = ch;
-}
-
enum {
GRAPHIC_FLAGS_NONE = 0,
/* require a console/display with GL callbacks */
void graphic_hw_update(QemuConsole *con);
void graphic_hw_update_done(QemuConsole *con);
void graphic_hw_invalidate(QemuConsole *con);
-void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
+void graphic_hw_text_update(QemuConsole *con, uint32_t *chardata);
void graphic_hw_gl_block(QemuConsole *con, bool block);
void qemu_console_early_init(void);
vt100_keysym(&s->vt, keysym);
}
-static void text_console_update(void *opaque, console_ch_t *chardata)
+static void text_console_update(void *opaque, uint32_t *chardata)
{
QemuTextConsole *s = QEMU_TEXT_CONSOLE(opaque);
int i, j, src;
chardata += s->vt.text_y[0] * s->vt.width;
for (i = s->vt.text_y[0]; i <= s->vt.text_y[1]; i ++)
for (j = 0; j < s->vt.width; j++, src++) {
- console_write_ch(chardata ++,
- ATTR2CHTYPE(s->vt.cells[src].ch,
- s->vt.cells[src].t_attrib.fgcol,
- s->vt.cells[src].t_attrib.bgcol,
- s->vt.cells[src].t_attrib.bold));
+ *chardata++ = ATTR2CHTYPE(s->vt.cells[src].ch,
+ s->vt.cells[src].t_attrib.fgcol,
+ s->vt.cells[src].t_attrib.bgcol,
+ s->vt.cells[src].t_attrib.bold);
}
dpy_text_update(QEMU_CONSOLE(s), s->vt.text_x[0], s->vt.text_y[0],
s->vt.text_x[1] - s->vt.text_x[0], i - s->vt.text_y[0]);
}
}
-void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata)
+void graphic_hw_text_update(QemuConsole *con, uint32_t *chardata)
{
if (con && con->hw_ops->text_update) {
con->hw_ops->text_update(con->hw, chardata);
};
static DisplayChangeListener *dcl;
-static console_ch_t *screen;
+static uint32_t *screen;
static WINDOW *screenpad = NULL;
static int width, height, gwidth, gheight, invalidate;
static int px, py, sminx, sminy, smaxx, smaxy;
static void curses_update(DisplayChangeListener *dcl,
int x, int y, int w, int h)
{
- console_ch_t *line;
+ uint32_t *line;
g_autofree cchar_t *curses_line = g_new(cchar_t, width);
wchar_t wch[CCHARW_MAX];
attr_t attrs;
if (opts->u.curses.charset) {
font_charset = opts->u.curses.charset;
}
- screen = g_new0(console_ch_t, 160 * 100);
+ screen = g_new0(uint32_t, 160 * 100);
vga_to_curses = g_new0(cchar_t, 256);
curses_setup();
curses_keyboard_setup();