diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/musicpal.c | 2 | ||||
-rw-r--r-- | hw/nseries.c | 2 | ||||
-rw-r--r-- | hw/palm.c | 2 | ||||
-rw-r--r-- | hw/sm501.c | 5 | ||||
-rw-r--r-- | hw/tcx.c | 13 | ||||
-rw-r--r-- | hw/vga.c | 11 |
6 files changed, 24 insertions, 11 deletions
diff --git a/hw/musicpal.c b/hw/musicpal.c index 03f40d3ea..abd3afa9e 100644 --- a/hw/musicpal.c +++ b/hw/musicpal.c @@ -831,7 +831,7 @@ static void lcd_refresh(void *opaque) break; LCD_REFRESH(8, rgb_to_pixel8) LCD_REFRESH(16, rgb_to_pixel16) - LCD_REFRESH(32, rgb_to_pixel32) + LCD_REFRESH(32, (is_surface_bgr(s->ds) ? rgb_to_pixel32bgr : rgb_to_pixel32)) default: cpu_abort(cpu_single_env, "unsupported colour depth %i\n", ds_get_bits_per_pixel(s->ds)); diff --git a/hw/nseries.c b/hw/nseries.c index 32aaead27..0c7da77f8 100644 --- a/hw/nseries.c +++ b/hw/nseries.c @@ -1362,7 +1362,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device, will set the size once configured, so this just sets an initial size until the guest activates the display. */ ds = get_displaystate(); - ds->surface = qemu_resize_displaysurface(ds->surface, 800, 480, 32, 4 * 800); + ds->surface = qemu_resize_displaysurface(ds, 800, 480); dpy_resize(ds); } @@ -278,7 +278,7 @@ static void palmte_init(ram_addr_t ram_size, int vga_ram_size, /* FIXME: We shouldn't really be doing this here. The LCD controller will set the size once configured, so this just sets an initial size until the guest activates the display. */ - ds->surface = qemu_resize_displaysurface(ds->surface, 320, 320, 32, 4 * 320); + ds->surface = qemu_resize_displaysurface(ds, 320, 320); dpy_resize(ds); } diff --git a/hw/sm501.c b/hw/sm501.c index ca9528b60..f94fa0e16 100644 --- a/hw/sm501.c +++ b/hw/sm501.c @@ -948,7 +948,10 @@ static inline int get_depth_index(DisplayState *s) case 16: return 2; case 32: - return 3; + if (is_surface_bgr(s->surface)) + return 4; + else + return 3; } } @@ -66,7 +66,10 @@ static void update_palette_entries(TCXState *s, int start, int end) s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]); break; case 32: - s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]); + if (is_surface_bgr(s->ds->surface)) + s->palette[i] = rgb_to_pixel32bgr(s->r[i], s->g[i], s->b[i]); + else + s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]); break; } } @@ -124,11 +127,12 @@ static inline void tcx24_draw_line32(TCXState *s1, uint8_t *d, const uint32_t *cplane, const uint32_t *s24) { - int x, r, g, b; + int x, bgr, r, g, b; uint8_t val, *p8; uint32_t *p = (uint32_t *)d; uint32_t dval; + bgr = is_surface_bgr(s1->ds->surface); for(x = 0; x < width; x++, s++, s24++) { if ((be32_to_cpu(*cplane++) & 0xff000000) == 0x03000000) { // 24-bit direct, BGR order @@ -137,7 +141,10 @@ static inline void tcx24_draw_line32(TCXState *s1, uint8_t *d, b = *p8++; g = *p8++; r = *p8++; - dval = rgb_to_pixel32(r, g, b); + if (bgr) + dval = rgb_to_pixel32bgr(r, g, b); + else + dval = rgb_to_pixel32(r, g, b); } else { val = *s; dval = s1->palette[val]; @@ -1161,7 +1161,10 @@ static inline int get_depth_index(DisplayState *s) case 16: return 2; case 32: - return 3; + if (is_surface_bgr(s->surface)) + return 4; + else + return 3; } } @@ -1627,7 +1630,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) if (depth == 32) { #endif if (is_graphic_console()) { - qemu_free_displaysurface(s->ds->surface); + qemu_free_displaysurface(s->ds); s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, s->line_offset, s->vram_ptr + (s->start_addr * 4)); @@ -2619,7 +2622,7 @@ static void vga_screen_dump_common(VGAState *s, const char *filename, dcl.dpy_resize = vga_save_dpy_resize; dcl.dpy_refresh = vga_save_dpy_refresh; register_displaychangelistener(ds, &dcl); - ds->surface = qemu_create_displaysurface(w, h, 32, 4 * w); + ds->surface = qemu_create_displaysurface(ds, w, h); s->ds = ds; s->graphic_mode = -1; @@ -2627,7 +2630,7 @@ static void vga_screen_dump_common(VGAState *s, const char *filename, ppm_save(filename, ds->surface); - qemu_free_displaysurface(ds->surface); + qemu_free_displaysurface(ds); s->ds = saved_ds; } |