From 1e10963841bf61abeb1d701255b30db0d8cfc325 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Wed, 13 May 2020 17:08:19 +0200 Subject: [PATCH] Ported patch of a patch for the Kasan 16 VGA card. --- src/video/vid_et4000.c | 13 ++++++++----- src/video/vid_svga.c | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 819dfa544..e5aaac302 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -417,6 +417,9 @@ et4000_kasan_in(uint16_t addr, void *priv) } } else if (addr >= et4000->kasan_access_addr && addr < et4000->kasan_access_addr + 8) { switch (addr - ((et4000->kasan_cfg_regs[2] << 8) | (et4000->kasan_cfg_regs[1]))) { + case 2: + val = 0; + break; case 5: if (((et4000->get_korean_font_base >> 7) & 0x7F) == (et4000->svga.ksc5601_udc_area_msb[0] & 0x7F) && (et4000->svga.ksc5601_udc_area_msb[0] & 0x80)) val = fontdatksc5601_user[(et4000->get_korean_font_base & 0x7F) - 0x20].chr[et4000->get_korean_font_index]; @@ -424,6 +427,7 @@ et4000_kasan_in(uint16_t addr, void *priv) val = fontdatksc5601_user[96 + (et4000->get_korean_font_base & 0x7F) - 0x20].chr[et4000->get_korean_font_index]; else val = fontdatksc5601[et4000->get_korean_font_base].chr[et4000->get_korean_font_index]; + break; default: break; } @@ -447,7 +451,6 @@ et4000_kasan_out(uint16_t addr, uint8_t val, void *priv) if (et4000->kasan_cfg_regs[4] & 8) val = (val & 0xFC) | (et4000->kasan_cfg_regs[0] & 3); et4000->kasan_cfg_regs[0] = val; - et4000->svga.ksc5601_sbyte_mask = (val & 4) << 5; svga_recalctimings(&et4000->svga); break; case 1: @@ -636,10 +639,10 @@ et4000_kasan_recalctimings(svga_t *svga) et4000_recalctimings(svga); if (svga->render == svga_render_text_80 && (et4000->kasan_cfg_regs[0] & 8)) { - svga->ma_latch -= 3 - (et4000->kasan_cfg_regs[3] >> 1); - svga->ca_adj = -(3 - (et4000->kasan_cfg_regs[0] >> 6)); - svga->hdisp -= (et4000->kasan_cfg_regs[3] >> 1) * ((svga->seqregs[1] & 1) ? 8 : 9); - if ((et4000->kasan_cfg_regs[0] & 3) == 0 && (et4000->kasan_cfg_regs[4] & 0x80) && ((svga->crtc[0x37] & 0x0B) == 0x0A)) + svga->ma_latch -= 3; + svga->ca_adj = (et4000->kasan_cfg_regs[0] >> 6) - 3; + svga->ksc5601_sbyte_mask = (et4000->kasan_cfg_regs[0] & 4) << 5; + if((et4000->kasan_cfg_regs[0] & 0x23) == 0x20 && (et4000->kasan_cfg_regs[4] & 0x80) && ((svga->crtc[0x37] & 0x0B) == 0x0A)) svga->render = svga_render_text_80_ksc5601; } } diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index a74161de7..2140f7d7e 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -431,7 +431,7 @@ svga_recalctimings(svga_t *svga) svga->vblankstart |= 0x200; svga->vblankstart++; - svga->hdisp = svga->crtc[1]; + svga->hdisp = svga->crtc[1] - ((svga->crtc[5] & 0x60) >> 5); svga->hdisp++; svga->htotal = svga->crtc[0]; @@ -806,10 +806,10 @@ svga_poll(void *p) changeframecount = svga->interlace ? 3 : 2; svga->vslines = 0; - if (svga->interlace && svga->oddeven) - svga->ma = svga->maback = svga->ma_latch + (svga->rowoffset << 1); + if (svga->interlace && svga->oddeven) + svga->ma = svga->maback = svga->ma_latch + (svga->rowoffset << 1) + ((svga->crtc[5] & 0x60) >> 5); else - svga->ma = svga->maback = svga->ma_latch; + svga->ma = svga->maback = svga->ma_latch + ((svga->crtc[5] & 0x60) >> 5); svga->ca = ((svga->crtc[0xe] << 8) | svga->crtc[0xf]) + ((svga->crtc[0xb] & 0x60) >> 5) + svga->ca_adj; svga->ma = (svga->ma << 2) + (skip << 2);