Commit 87ee166914e2d886b982a8d9e55c16b09a09a180
1 parent
33d9cc8a
Don't try to use "vt" output in nographic mode.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2966 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
28 additions
and
24 deletions
hw/mips_malta.c
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | #define ENVP_NB_ENTRIES 16 |
43 | 43 | #define ENVP_ENTRY_SIZE 256 |
44 | 44 | |
45 | - | |
45 | +extern int nographic; | |
46 | 46 | extern FILE *logfile; |
47 | 47 | |
48 | 48 | typedef struct { |
... | ... | @@ -67,16 +67,18 @@ static void malta_fpga_update_display(void *opaque) |
67 | 67 | int i; |
68 | 68 | MaltaFPGAState *s = opaque; |
69 | 69 | |
70 | - for (i = 7 ; i >= 0 ; i--) { | |
71 | - if (s->leds & (1 << i)) | |
72 | - leds_text[i] = '#'; | |
73 | - else | |
74 | - leds_text[i] = ' '; | |
75 | - } | |
76 | - leds_text[8] = '\0'; | |
70 | + if (!nographic) { | |
71 | + for (i = 7 ; i >= 0 ; i--) { | |
72 | + if (s->leds & (1 << i)) | |
73 | + leds_text[i] = '#'; | |
74 | + else | |
75 | + leds_text[i] = ' '; | |
76 | + } | |
77 | + leds_text[8] = '\0'; | |
77 | 78 | |
78 | - qemu_chr_printf(s->display, "\e[H\n\n|\e[32m%-8.8s\e[00m|\r\n", leds_text); | |
79 | - qemu_chr_printf(s->display, "\n\n\n\n|\e[31m%-8.8s\e[00m|", s->display_text); | |
79 | + qemu_chr_printf(s->display, "\e[H\n\n|\e[32m%-8.8s\e[00m|\r\n", leds_text); | |
80 | + qemu_chr_printf(s->display, "\n\n\n\n|\e[31m%-8.8s\e[00m|", s->display_text); | |
81 | + } | |
80 | 82 | } |
81 | 83 | |
82 | 84 | /* |
... | ... | @@ -413,20 +415,22 @@ MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, CPUState *env) |
413 | 415 | cpu_register_physical_memory(base, 0x900, malta); |
414 | 416 | cpu_register_physical_memory(base + 0xa00, 0x100000 - 0xa00, malta); |
415 | 417 | |
416 | - s->display = qemu_chr_open("vc"); | |
417 | - qemu_chr_printf(s->display, "\e[HMalta LEDBAR\r\n"); | |
418 | - qemu_chr_printf(s->display, "+--------+\r\n"); | |
419 | - qemu_chr_printf(s->display, "+ +\r\n"); | |
420 | - qemu_chr_printf(s->display, "+--------+\r\n"); | |
421 | - qemu_chr_printf(s->display, "\n"); | |
422 | - qemu_chr_printf(s->display, "Malta ASCII\r\n"); | |
423 | - qemu_chr_printf(s->display, "+--------+\r\n"); | |
424 | - qemu_chr_printf(s->display, "+ +\r\n"); | |
425 | - qemu_chr_printf(s->display, "+--------+\r\n"); | |
426 | - | |
427 | - uart_chr = qemu_chr_open("vc"); | |
428 | - qemu_chr_printf(uart_chr, "CBUS UART\r\n"); | |
429 | - s->uart = serial_mm_init(base + 0x900, 3, env->irq[2], uart_chr, 1); | |
418 | + if (!nographic) { | |
419 | + s->display = qemu_chr_open("vc"); | |
420 | + qemu_chr_printf(s->display, "\e[HMalta LEDBAR\r\n"); | |
421 | + qemu_chr_printf(s->display, "+--------+\r\n"); | |
422 | + qemu_chr_printf(s->display, "+ +\r\n"); | |
423 | + qemu_chr_printf(s->display, "+--------+\r\n"); | |
424 | + qemu_chr_printf(s->display, "\n"); | |
425 | + qemu_chr_printf(s->display, "Malta ASCII\r\n"); | |
426 | + qemu_chr_printf(s->display, "+--------+\r\n"); | |
427 | + qemu_chr_printf(s->display, "+ +\r\n"); | |
428 | + qemu_chr_printf(s->display, "+--------+\r\n"); | |
429 | + | |
430 | + uart_chr = qemu_chr_open("vc"); | |
431 | + qemu_chr_printf(uart_chr, "CBUS UART\r\n"); | |
432 | + s->uart = serial_mm_init(base + 0x900, 3, env->irq[2], uart_chr, 1); | |
433 | + } | |
430 | 434 | |
431 | 435 | malta_fpga_reset(s); |
432 | 436 | qemu_register_reset(malta_fpga_reset, s); | ... | ... |