summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-30 22:38:53 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-30 22:38:53 +0000
commita528b80cb09977806129249ea604aaef3830f3ec (patch)
tree51786c2e439718f6a8fa571d003aaff9ef60040e /console.c
parent12bc92ab8acf5e42598b6fa943ceb98ccce6ba71 (diff)
Miscellaneous VNC related fixes from Xen forwarded by Matthew Kent.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3489 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'console.c')
-rw-r--r--console.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/console.c b/console.c
index ff725c2e66..9d3c2f6279 100644
--- a/console.c
+++ b/console.c
@@ -509,7 +509,7 @@ static void text_console_resize(TextConsole *s)
c++;
}
}
- free(s->cells);
+ qemu_free(s->cells);
s->cells = cells;
}
@@ -1167,11 +1167,21 @@ int is_graphic_console(void)
return active_console->console_type == GRAPHIC_CONSOLE;
}
+void console_color_init(DisplayState *ds)
+{
+ int i, j;
+ for (j = 0; j < 2; j++) {
+ for (i = 0; i < 8; i++) {
+ color_table[j][i] = col_expand(ds,
+ vga_get_color(ds, color_table_rgb[j][i]));
+ }
+ }
+}
+
CharDriverState *text_console_init(DisplayState *ds, const char *p)
{
CharDriverState *chr;
TextConsole *s;
- int i,j;
unsigned width;
unsigned height;
static int color_inited;
@@ -1195,12 +1205,7 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p)
if (!color_inited) {
color_inited = 1;
- for(j = 0; j < 2; j++) {
- for(i = 0; i < 8; i++) {
- color_table[j][i] = col_expand(s->ds,
- vga_get_color(s->ds, color_table_rgb[j][i]));
- }
- }
+ console_color_init(s->ds);
}
s->y_displayed = 0;
s->y_base = 0;