]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix CL horizontal doubling.
authorToni Wilen <twilen@winuae.net>
Fri, 4 May 2018 18:35:58 +0000 (21:35 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 4 May 2018 18:35:58 +0000 (21:35 +0300)
qemuvga/cirrus_vga.cpp
qemuvga/vga_template.h

index 71bdae366c6577ea31d8affe1d22165dc7842793..dcd0e27a8bae5f9676fcbd7e3cad60881c4d66dc 100644 (file)
@@ -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 {
index 2ea2cabe37677b94bb7fdb1d79269d802d7aa77b..1942100d9da27b0d459df2fc7f40aba0d16621f4 100644 (file)
@@ -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];