]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix lores 15/16-bit PCem mode horizontal doubling.
authorToni Wilen <twilen@winuae.net>
Sat, 18 Dec 2021 17:50:52 +0000 (19:50 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 18 Dec 2021 17:50:52 +0000 (19:50 +0200)
pcem/vid_svga_render.cpp

index 1fc0fc1b503eb34f31f3aacaed8ce34d4dbd89cc..a3514c995a63cf91a1382b5c7131741e9194039c 100644 (file)
@@ -325,7 +325,7 @@ void svga_render_2bpp_lowres(svga_t *svga)
                         svga->firstline_draw = svga->displine;
                 svga->lastline_draw = svga->displine;
                        
-                for (x = 0; x <= svga->hdisp << svga->horizontal_linedbl; x += 16)
+                for (x = 0; x <= svga->hdisp << svga->horizontal_linedbl; x += 8)
                 {
                         uint32_t addr = svga->remap_func(svga, svga->ma);
                         uint8_t dat[2];
@@ -399,7 +399,7 @@ void svga_render_4bpp_lowres(svga_t *svga)
                         svga->firstline_draw = svga->displine;
                 svga->lastline_draw = svga->displine;
 
-                for (x = 0; x <= svga->hdisp << svga->horizontal_linedbl; x += 16)
+                for (x = 0; x <= svga->hdisp << svga->horizontal_linedbl; x += 8)
                 {
                         uint8_t edat[4];
                         uint8_t dat;
@@ -590,12 +590,10 @@ void svga_render_15bpp_lowres(svga_t *svga)
                                 uint32_t dat = *(uint32_t *)(&svga->vram[(svga->ma + (x << 1)) & svga->vram_display_mask]);
 
                                 *p++ = video_15to32[dat & 0xffff];
-                                *p++ = video_15to32[dat >> 16];
-
-                                dat = *(uint32_t *)(&svga->vram[(svga->ma + (x << 1) + 4) & svga->vram_display_mask]);
-
                                 *p++ = video_15to32[dat & 0xffff];
                                 *p++ = video_15to32[dat >> 16];
+                                *p++ = video_15to32[dat >> 16];
+
                         }
                         svga->ma += x << 1;
                 }
@@ -607,9 +605,11 @@ void svga_render_15bpp_lowres(svga_t *svga)
                                 uint32_t dat = *(uint32_t *)(&svga->vram[addr & svga->vram_display_mask]);
 
                                 *p++ = video_15to32[dat & 0xffff];
+                                *p++ = video_15to32[dat & 0xffff];
+                                *p++ = video_15to32[dat >> 16];
                                 *p++ = video_15to32[dat >> 16];
 
-                                svga->ma += 4;
+                                svga->ma += 2 << 1;
                         }
                 }
                 svga->ma &= svga->vram_display_mask;
@@ -686,17 +686,15 @@ void svga_render_16bpp_lowres(svga_t *svga)
                
                 if (!svga->remap_required)
                 {
-                        for (x = 0; x <= svga->hdisp << svga->horizontal_linedbl; x += 4)
+                        for (x = 0; x <= svga->hdisp << svga->horizontal_linedbl; x += 2)
                         {
                                 uint32_t dat = *(uint32_t *)(&svga->vram[(svga->ma + (x << 1)) & svga->vram_display_mask]);
 
                                 *p++ = video_16to32[dat & 0xffff];
-                                *p++ = video_16to32[dat >> 16];
-
-                                dat = *(uint32_t *)(&svga->vram[(svga->ma + (x << 1) + 4) & svga->vram_display_mask]);
-
                                 *p++ = video_16to32[dat & 0xffff];
                                 *p++ = video_16to32[dat >> 16];
+                                *p++ = video_16to32[dat >> 16];
+
                         }
                         svga->ma += x << 1;
                 }
@@ -707,10 +705,12 @@ void svga_render_16bpp_lowres(svga_t *svga)
                                 uint32_t addr = svga->remap_func(svga, svga->ma);
                                 uint32_t dat = *(uint32_t *)(&svga->vram[addr & svga->vram_display_mask]);
 
+                                *p++ = video_16to32[dat & 0xffff];
                                 *p++ = video_16to32[dat & 0xffff];
                                 *p++ = video_16to32[dat >> 16];
+                                *p++ = video_16to32[dat >> 16];
 
-                                svga->ma += 4;
+                                svga->ma += 2 << 1;
                         }
                 }
                 svga->ma &= svga->vram_display_mask;