From: Toni Wilen Date: Sat, 6 Jan 2024 19:54:45 +0000 (+0200) Subject: Added missing NCR SVGA word/long IO accesses, RAMDAC color depth setting implemented. X-Git-Tag: 5200~85 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=eccb55490619fd4c0debb9df49ca746c8192890a;p=francis%2Fwinuae.git Added missing NCR SVGA word/long IO accesses, RAMDAC color depth setting implemented. --- diff --git a/gfxboard.cpp b/gfxboard.cpp index ff2353c8..1be50c48 100644 --- a/gfxboard.cpp +++ b/gfxboard.cpp @@ -5553,7 +5553,13 @@ static void special_pcem_put(uaecptr addr, uae_u32 v, int size) return; } addr &= 0xffff; - gfxboard_bput_io_swap_pcem(addr, v); + if (size == 2) { + gfxboard_lput_io_swap_pcem(addr, v); + } else if (size == 1) { + gfxboard_wput_io_swap_pcem(addr, v); + } else { + gfxboard_bput_io_swap_pcem(addr, v); + } } else if (boardnum == GFXBOARD_ID_RETINA_Z2) { @@ -5908,7 +5914,13 @@ static uae_u32 special_pcem_get(uaecptr addr, int size) return v; } addr &= 0xffff; - v = gfxboard_bget_io_swap_pcem(addr); + if (size == 2) { + v = gfxboard_lget_io_swap_pcem(addr); + } else if (size == 1) { + v = gfxboard_wget_io_swap_pcem(addr); + } else { + v = gfxboard_bget_io_swap_pcem(addr); + } } else if (boardnum == GFXBOARD_ID_RETINA_Z2) { diff --git a/pcem/vid_ncr.cpp b/pcem/vid_ncr.cpp index 61d569a4..180c15b7 100644 --- a/pcem/vid_ncr.cpp +++ b/pcem/vid_ncr.cpp @@ -141,6 +141,9 @@ void ncr_hwcursor_draw(svga_t *svga, int displine) svga->hwcursor_latch.addr += (svga->hwcursor.xsize / 8); int xdbl = 1 << svga->hwcursor.h_acc; + if (svga->bpp == 16 && svga->hwcursor.h_acc > 0) { + xdbl = 1 << (svga->hwcursor.h_acc - 1); + } for (x = 0; x < svga->hwcursor.xsize; x += 8) { svga->hwcursor_latch.addr--; @@ -152,7 +155,7 @@ void ncr_hwcursor_draw(svga_t *svga, int displine) { if (offset >= svga->hwcursor_latch.x) { - for (int i = 0; i line[displine])[offset * xdbl + i + 32] = c[(dat[1] & 0x80) ? 0 : 1]; else if (dat[1] & 0x80) @@ -184,6 +187,9 @@ void ncr_out(uint16_t addr, uint8_t val, void *p) switch (addr) { + case 0x3c6: + ncr->ramdacbpp = val; + break; case 0x3c4: svga->seqaddr = val & 0x3f; break; @@ -415,6 +421,10 @@ void ncr_recalctimings(svga_t *svga) { if (ncr->chip < NCR_TYPE_32BLT) { svga->bpp = ncr->ramdacbpp; + } else { + if (ncr->ramdacbpp & 0x40) { + svga->bpp = (ncr->ramdacbpp & 0x20) ? 16 : 24; + } } } switch (svga->bpp)