qemu-e2k/hw/display
OGAWA Hirofumi 4083733db5 ui/curses: Fix color attribute of monitor for curses
Current text_console_update() writes totally broken color attributes
to console_write_ch(). The format now is writing,

[WRONG]
	bold << 21 | fg << 12 | bg << 8 | char
	fg == 3bits curses color number
	bg == 3bits curses color number

I can't see this format is where come from. Anyway, this doesn't work
at all.

What curses expects is actually (and vga.c is using),

[RIGHT]
	bold << 21 | bg << 11 | fg << 8 | char
	fg == 3bits vga color number
	bg == 3bits vga color number

And curses set COLOR_PAIR() up to match this format, and curses's
chtype. I.e,

	bold | color_pair | char
	color_pair == (bg << 3 | fg)

To fix, this simply uses VGA color number everywhere except curses.c
internal. Then, convert it to above [RIGHT] format to write by
console_write_ch(). And as bonus, this reduces to expose curses define
to other parts (removes COLOR_* from console.c).

[Tested the first line is displayed as white on blue back for monitor
in curses console]

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Message-id: 87r3j95407.fsf@mail.parknet.co.jp
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 12:20:07 +01:00
..
ads7846.c
blizzard_template.h
blizzard.c blizzard: do not depend on VGA internals 2015-01-15 10:44:13 +03:00
cg3.c hw: do not pass NULL to memory_region_init from instance_init 2015-10-09 15:25:56 +02:00
cirrus_vga_rop2.h
cirrus_vga_rop.h cirrus: Fix host CPU blits 2014-07-11 10:17:02 +02:00
cirrus_vga.c cirrus_vga: QOMify 2015-05-19 11:40:01 +02:00
exynos4210_fimd.c maint: avoid useless "if (foo) free(foo)" pattern 2015-09-11 10:21:38 +03:00
framebuffer.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
framebuffer.h framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
g364fb.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
jazz_led.c ui/curses: Fix color attribute of monitor for curses 2016-01-08 12:20:07 +01:00
Makefile.objs virtio-gpu: add 3d mode and virgl rendering support. 2015-10-08 10:31:35 +02:00
milkymist-tmu2.c ui/opengl: Reduce build required libraries for opengl 2015-11-03 10:13:42 +01:00
milkymist-vgafb_template.h
milkymist-vgafb.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
omap_dss.c arm: Use g_new() & friends where that makes obvious sense 2015-09-07 10:39:27 +01:00
omap_lcd_template.h arm: explicitly mark device loads as little-endian 2015-12-17 13:37:13 +00:00
omap_lcdc.c arm: Use g_new() & friends where that makes obvious sense 2015-09-07 10:39:27 +01:00
pl110_template.h
pl110.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
pxa2xx_lcd.c arm: explicitly mark device loads as little-endian 2015-12-17 13:37:13 +00:00
pxa2xx_template.h
qxl-logger.c hw/display/qxl-logger.c: Constify some variable 2015-06-23 20:23:39 +03:00
qxl-render.c typofixes - v4 2015-09-11 10:45:43 +03:00
qxl.c qxl: Use g_new() & friends where that makes obvious sense 2015-11-06 15:42:38 +03:00
qxl.h qxl: allow to specify head limit to qxl driver 2015-07-16 17:31:05 +02:00
sm501_template.h
sm501.c Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
ssd0303.c
ssd0323.c
tc6393xb_template.h
tc6393xb.c Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
tcx.c hw/display/tcx: Remove superfluous OBJECT() typecasts 2015-11-06 15:42:38 +03:00
vga_int.h virtio-vga: add virtio gpu device with vga compatibility 2015-06-12 10:13:23 +02:00
vga-helpers.h vga: Rename vga_template.h to vga-helpers.h 2014-09-30 13:34:09 +02:00
vga-isa-mm.c
vga-isa.c isa: remove isa_mem_base variable 2015-02-13 14:09:28 +00:00
vga-pci.c virtio-vga: add virtio gpu device with vga compatibility 2015-06-12 10:13:23 +02:00
vga.c ui/curses: Fix color attribute of monitor for curses 2016-01-08 12:20:07 +01:00
vga.h
virtio-gpu-3d.c virtio-gpu: add 3d mode and virgl rendering support. 2015-10-08 10:31:35 +02:00
virtio-gpu-pci.c virtio-gpu: change licence from GPLv2 to GPLv2+ 2015-10-08 10:31:35 +02:00
virtio-gpu.c linux-headers: update from kvm/next 2015-12-17 15:24:34 +01:00
virtio-vga.c virtio-gpu: use virtio_instance_init_common, fixup properties 2015-07-07 11:23:18 +02:00
vmware_vga.c vmsvga: more cursor checks 2015-10-20 09:26:36 +02:00
xenfb.c xenfb: avoid reading twice the same fields from the shared page 2015-12-18 15:10:09 +00:00