Tseng improvements.

This commit is contained in:
OBattler
2024-01-15 18:42:32 +01:00
parent 9143302587
commit 481b8c8b22
2 changed files with 26 additions and 41 deletions

View File

@@ -599,6 +599,9 @@ et4000_recalctimings(svga_t *svga)
const et4000_t *dev = (et4000_t *) svga->priv; const et4000_t *dev = (et4000_t *) svga->priv;
svga->ma_latch |= (svga->crtc[0x33] & 3) << 16; svga->ma_latch |= (svga->crtc[0x33] & 3) << 16;
svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2] + 1;
if (svga->crtc[0x35] & 1) if (svga->crtc[0x35] & 1)
svga->vblankstart += 0x400; svga->vblankstart += 0x400;
if (svga->crtc[0x35] & 2) if (svga->crtc[0x35] & 2)
@@ -613,10 +616,11 @@ et4000_recalctimings(svga_t *svga)
svga->rowoffset = 0x100; svga->rowoffset = 0x100;
if (svga->crtc[0x3f] & 1) if (svga->crtc[0x3f] & 1)
svga->htotal += 256; svga->htotal += 256;
if (svga->attrregs[0x16] & 0x20) if (svga->attrregs[0x16] & 0x20) {
svga->hdisp <<= 1; svga->hdisp <<= 1;
svga->hblankstart <<= 1;
svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2] + 1; svga->hblank_end_val <<= 1;
}
switch (((svga->miscout >> 2) & 3) | ((svga->crtc[0x34] << 1) & 4)) { switch (((svga->miscout >> 2) & 3) | ((svga->crtc[0x34] << 1) & 4)) {
case 0: case 0:
@@ -637,10 +641,14 @@ et4000_recalctimings(svga_t *svga)
case 15: case 15:
case 16: case 16:
svga->hdisp /= 2; svga->hdisp /= 2;
svga->hblankstart /= 2;
svga->hblank_end_val /= 2;
break; break;
case 24: case 24:
svga->hdisp /= 3; svga->hdisp /= 3;
svga->hblankstart /= 3;
svga->hblank_end_val /= 3;
break; break;
default: default:
@@ -689,7 +697,8 @@ et4000_kasan_recalctimings(svga_t *svga)
et4000_recalctimings(svga); et4000_recalctimings(svga);
if (svga->render == svga_render_text_80 && (et4000->kasan_cfg_regs[0] & 8)) { if (svga->render == svga_render_text_80 && (et4000->kasan_cfg_regs[0] & 8)) {
svga->ma_latch -= 3; svga->hdisp += svga->dots_per_clock;
svga->ma_latch -= 5;
svga->ca_adj = (et4000->kasan_cfg_regs[0] >> 6) - 3; svga->ca_adj = (et4000->kasan_cfg_regs[0] >> 6) - 3;
svga->ksc5601_sbyte_mask = (et4000->kasan_cfg_regs[0] & 4) << 5; 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)) if ((et4000->kasan_cfg_regs[0] & 0x23) == 0x20 && (et4000->kasan_cfg_regs[4] & 0x80) && ((svga->crtc[0x37] & 0x0B) == 0x0A))

View File

@@ -431,6 +431,9 @@ et4000w32p_recalctimings(svga_t *svga)
et4000w32p_t *et4000 = (et4000w32p_t *) svga->priv; et4000w32p_t *et4000 = (et4000w32p_t *) svga->priv;
svga->ma_latch |= (svga->crtc[0x33] & 0x7) << 16; svga->ma_latch |= (svga->crtc[0x33] & 0x7) << 16;
svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2] + 1;
if (svga->crtc[0x35] & 0x01) if (svga->crtc[0x35] & 0x01)
svga->vblankstart += 0x400; svga->vblankstart += 0x400;
if (svga->crtc[0x35] & 0x02) if (svga->crtc[0x35] & 0x02)
@@ -445,10 +448,11 @@ et4000w32p_recalctimings(svga_t *svga)
svga->rowoffset += 0x100; svga->rowoffset += 0x100;
if (svga->crtc[0x3F] & 0x01) if (svga->crtc[0x3F] & 0x01)
svga->htotal += 256; svga->htotal += 256;
if (svga->attrregs[0x16] & 0x20) if (svga->attrregs[0x16] & 0x20) {
svga->hdisp <<= 1; svga->hdisp <<= 1;
svga->hblankstart <<= 1;
svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2] + 1; svga->hblank_end_val <<= 1;
}
svga->clock = (cpuclock * (double) (1ULL << 32)) / svga->getclock((svga->miscout >> 2) & 3, svga->clock_gen); svga->clock = (cpuclock * (double) (1ULL << 32)) / svga->getclock((svga->miscout >> 2) & 3, svga->clock_gen);
@@ -474,32 +478,6 @@ et4000w32p_recalctimings(svga_t *svga)
} }
} }
#if 0
if (svga->adv_flags & FLAG_NOSKEW) {
/* On the Cardex ET4000/W32p-based cards, adjust text mode clocks by 1. */
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /* Text mode */
svga->ma_latch--;
if (svga->seqregs[1] & 8) /*40 column*/
svga->hdisp += (svga->seqregs[1] & 1) ? 16 : 18;
else
svga->hdisp += (svga->seqregs[1] & 1) ? 8 : 9;
} 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->bpp == 24))
svga->hdisp += (svga->seqregs[1] & 1) ? 16 : 18;
else
svga->hdisp += (svga->seqregs[1] & 1) ? 8 : 9;
} else if ((svga->gdcreg[5] & 0x40) == 0) {
svga->hdisp += (svga->seqregs[1] & 1) ? 8 : 9;
if (svga->hdisp == 648 || svga->hdisp == 808 || svga->hdisp == 1032)
svga->hdisp -= 8;
}
}
}
#endif
if (et4000->type == ET4000W32) { if (et4000->type == ET4000W32) {
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) { if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
if (svga->gdcreg[5] & 0x40) { if (svga->gdcreg[5] & 0x40) {
@@ -522,8 +500,11 @@ et4000w32p_recalctimings(svga_t *svga)
switch (svga->bpp) { switch (svga->bpp) {
case 15: case 15:
case 16: case 16:
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
svga->hdisp >>= 1; svga->hdisp >>= 1;
svga->hblankstart >>= 1;
svga->hblank_end_val >>= 1;
}
if (et4000->type <= ET4000W32P_REVC) { if (et4000->type <= ET4000W32P_REVC) {
if (et4000->type == ET4000W32P_REVC) { if (et4000->type == ET4000W32P_REVC) {
if (svga->hdisp != 1024) if (svga->hdisp != 1024)
@@ -534,6 +515,8 @@ et4000w32p_recalctimings(svga_t *svga)
break; break;
case 24: case 24:
svga->hdisp /= 3; svga->hdisp /= 3;
svga->hblankstart /= 3;
svga->hblank_end_val /= 3;
if (et4000->type <= ET4000W32P_REVC) if (et4000->type <= ET4000W32P_REVC)
et4000->adjust_cursor = 2; et4000->adjust_cursor = 2;
if ((et4000->type == ET4000W32P_DIAMOND) && ((svga->hdisp == (640 / 2)) || (svga->hdisp == 1232))) { if ((et4000->type == ET4000W32P_DIAMOND) && ((svga->hdisp == (640 / 2)) || (svga->hdisp == 1232))) {
@@ -553,10 +536,6 @@ et4000w32p_recalctimings(svga_t *svga)
else else
svga->render = svga_render_text_80; svga->render = svga_render_text_80;
} else { } else {
if (svga->adv_flags & FLAG_NOSKEW) {
svga->ma_latch--;
}
switch (svga->gdcreg[5] & 0x60) { switch (svga->gdcreg[5] & 0x60) {
case 0x00: case 0x00:
if (et4000->rev == 5) if (et4000->rev == 5)
@@ -2809,7 +2788,6 @@ et4000w32p_init(const device_t *info)
et4000->svga.ramdac = device_add(&stg_ramdac_device); et4000->svga.ramdac = device_add(&stg_ramdac_device);
et4000->svga.clock_gen = et4000->svga.ramdac; et4000->svga.clock_gen = et4000->svga.ramdac;
et4000->svga.getclock = stg_getclock; et4000->svga.getclock = stg_getclock;
et4000->svga.adv_flags |= FLAG_NOSKEW;
break; break;
case ET4000W32P_REVC: case ET4000W32P_REVC:
@@ -2834,7 +2812,6 @@ et4000w32p_init(const device_t *info)
et4000->svga.ramdac = device_add(&stg_ramdac_device); et4000->svga.ramdac = device_add(&stg_ramdac_device);
et4000->svga.clock_gen = et4000->svga.ramdac; et4000->svga.clock_gen = et4000->svga.ramdac;
et4000->svga.getclock = stg_getclock; et4000->svga.getclock = stg_getclock;
et4000->svga.adv_flags |= FLAG_NOSKEW;
break; break;
case ET4000W32P_CARDEX: case ET4000W32P_CARDEX:
@@ -2847,7 +2824,6 @@ et4000w32p_init(const device_t *info)
et4000->svga.ramdac = device_add(&stg_ramdac_device); et4000->svga.ramdac = device_add(&stg_ramdac_device);
et4000->svga.clock_gen = et4000->svga.ramdac; et4000->svga.clock_gen = et4000->svga.ramdac;
et4000->svga.getclock = stg_getclock; et4000->svga.getclock = stg_getclock;
et4000->svga.adv_flags |= FLAG_NOSKEW;
break; break;
case ET4000W32P_DIAMOND: case ET4000W32P_DIAMOND: