From 37def45e0eed0758fdc8db1e47f7ab4492f92643 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Thu, 25 Mar 2021 21:46:39 +0100 Subject: [PATCH] More skew changes, fixed the missing pixels in hdisp in 24bpp mode as well as properly organized hdisp in other bpp modes. Clear bit 7 of attr reg 0x10 in the v7 code otherwise it would scramble the colors in 8-bit graphics mode if issued. --- src/video/vid_et4000w32.c | 6 +++--- src/video/vid_ht216.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 5d1771494..070e9aa68 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -396,10 +396,10 @@ et4000w32p_recalctimings(svga_t *svga) } else { /* Also adjust the graphics mode clocks in some cases. */ if ((svga->gdcreg[5] & 0x40) && (svga->bpp != 32)) { - if ((svga->bpp == 15) || (svga->bpp == 16)) - svga->hdisp += 16; + if ((svga->bpp == 15) || (svga->bpp == 16) || (svga->bpp == 24)) + svga->hdisp += (svga->seqregs[1] & 1) ? 16 : 18; else - svga->hdisp += 8; + svga->hdisp += (svga->seqregs[1] & 1) ? 8 : 9; } } } diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 7f26650e7..e9048c06b 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -628,6 +628,9 @@ ht216_recalctimings(svga_t *svga) ht216_t *ht216 = (ht216_t *)svga->p; int high_res_256 = 0; + if (svga->attrregs[0x10] & 0x80) + svga->attrregs[0x10] &= ~0x80; /*Otherwise 8-bit color in graphics mode is a bit busted*/ + switch (ht216->clk_sel) { case 5: svga->clock = (cpuclock * (double)(1ull << 32)) / 65000000.0; break; case 6: svga->clock = (cpuclock * (double)(1ull << 32)) / 40000000.0; break;