From: Toni Wilen Date: Fri, 4 May 2018 18:35:58 +0000 (+0300) Subject: Fix CL horizontal doubling. X-Git-Tag: 4000~79 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8e65c112f9dfd7fb8fbb9edadb14f991a4d9beed;p=francis%2Fwinuae.git Fix CL horizontal doubling. --- diff --git a/qemuvga/cirrus_vga.cpp b/qemuvga/cirrus_vga.cpp index 71bdae36..dcd0e27a 100644 --- a/qemuvga/cirrus_vga.cpp +++ b/qemuvga/cirrus_vga.cpp @@ -1156,7 +1156,7 @@ static void cirrus_get_resolution(VGACommonState *s, int *pwidth, int *pheight) height *= 2; } /* keep aspect if CGX doublescan mode */ - if (s->graphic_mode == 1 && cirrus_get_bpp(s) >= 8 && height * 3 / 4 >= width) { + if (s->graphic_mode == 1 && cirrus_get_bpp(s) >= 8 && height * 9 / 10 >= width) { width *= 2; s->double_scan2 = 1; } else { diff --git a/qemuvga/vga_template.h b/qemuvga/vga_template.h index 2ea2cabe..1942100d 100644 --- a/qemuvga/vga_template.h +++ b/qemuvga/vga_template.h @@ -379,7 +379,7 @@ static void glue(vga_draw_line15x2_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d, int w; uint32_t v, r, g, b; - w = width; + w = width / 2; do { v = lduw_raw((void *)s); r = (v >> 7) & 0xf8; @@ -425,7 +425,7 @@ static void glue(vga_draw_line16x2_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d, int w; uint32_t v, r, g, b; - w = width; + w = width / 2; do { v = lduw_raw((void *)s); r = (v >> 8) & 0xf8; @@ -472,7 +472,7 @@ static void glue(vga_draw_line24x2_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d, int w; uint32_t r, g, b; - w = width; + w = width / 2; do { #if defined(TARGET_WORDS_BIGENDIAN) r = s[0]; @@ -483,7 +483,9 @@ static void glue(vga_draw_line24x2_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d, g = s[1]; r = s[2]; #endif - ((PIXEL_TYPE *)d)[0] = ((PIXEL_TYPE *)d)[1] = glue(rgb_to_pixel, PIXEL_NAME)(r, g, b); + PIXEL_TYPE v = glue(rgb_to_pixel, PIXEL_NAME)(r, g, b); + ((PIXEL_TYPE *)d)[0] = v; + ((PIXEL_TYPE *)(d + BPP))[0] = v; s += 3; d += BPP * 2; } while (--w != 0); @@ -528,7 +530,7 @@ static void glue(vga_draw_line32x2_, PIXEL_NAME)(VGACommonState *s1, uint8_t *d, int w; uint32_t r, g, b; - w = width; + w = width / 2; do { #if defined(TARGET_WORDS_BIGENDIAN) r = s[1];