(S)VGA: Bring back specific pel panning behavior for some ATi and Tseng graphics cards, closes #6437.

This commit is contained in:
OBattler
2025-11-05 02:54:51 +01:00
parent 98bb4950f8
commit daf34f3dcd
3 changed files with 74 additions and 25 deletions

View File

@@ -5027,6 +5027,7 @@ mach64vt_init(const device_t *info)
mem_mapping_disable(&mach64->bios_rom.mapping);
svga->vblank_start = mach64_vblank_start;
svga->adv_flags |= FLAG_PANNING_ATI;
return mach64;
}
@@ -5058,6 +5059,7 @@ mach64vt2_init(const device_t *info)
mem_mapping_disable(&mach64->bios_rom.mapping);
svga->vblank_start = mach64_vblank_start;
svga->adv_flags |= FLAG_PANNING_ATI;
return mach64;
}

View File

@@ -2966,6 +2966,7 @@ et4000w32p_init(const device_t *info)
et4000->pci_regs[0x33] = 0xf0;
et4000->svga.packed_chain4 = 1;
et4000->svga.adv_flags |= FLAG_PANNING_ATI;
return et4000;
}

View File

@@ -1421,6 +1421,41 @@ svga_poll(void *priv)
} else {
timer_advance_u64(&svga->timer, svga->dispontime);
if (svga->adv_flags & FLAG_PANNING_ATI) {
if (svga->panning_blank) {
svga->scrollcache = 0;
svga->half_pixel = 0;
svga->x_add = svga->left_overscan;
} else {
svga->scrollcache = (svga->attrregs[0x13] & 0x0f);
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /*Text mode*/
if (svga->seqregs[1] & 1)
svga->scrollcache &= 0x07;
else {
svga->scrollcache++;
if (svga->scrollcache > 8)
svga->scrollcache = 0;
}
svga->half_pixel = 0;
} else if ((svga->render == svga_render_2bpp_lowres) || (svga->render == svga_render_2bpp_highres) ||
(svga->render == svga_render_4bpp_lowres) || (svga->render == svga_render_4bpp_highres)) {
svga->half_pixel = 0;
svga->scrollcache &= 0x07;
} else {
if (svga->scrollcache > 7)
svga->scrollcache = 7;
svga->half_pixel = svga->scrollcache & 0x01;
svga->scrollcache = (svga->scrollcache & 0x06) >> 1;
}
if ((svga->seqregs[1] & 8) || (svga->render == svga_render_8bpp_lowres))
svga->scrollcache <<= 1;
svga->x_add = svga->left_overscan - svga->scrollcache;
}
}
if (svga->dispon)
svga->cgastat &= ~1;
svga->hdisp_on = 0;
@@ -1477,9 +1512,13 @@ svga_poll(void *priv)
svga->scanline = 0;
if (svga->attrregs[0x10] & 0x20) {
svga->scrollcache = 0;
svga->half_pixel = 0;
svga->x_add = svga->left_overscan;
if (svga->adv_flags & FLAG_PANNING_ATI)
svga->panning_blank = 1;
else {
svga->scrollcache = 0;
svga->half_pixel = 0;
svga->x_add = svga->left_overscan;
}
}
}
}
@@ -1570,32 +1609,39 @@ svga_poll(void *priv)
svga->dispon = 1;
svga->displine = (svga->interlace && svga->oddeven) ? 1 : 0;
svga->scrollcache = (svga->attrregs[0x13] & 0x0f);
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /*Text mode*/
if (svga->seqregs[1] & 1)
svga->scrollcache &= 0x07;
else {
svga->scrollcache++;
if (svga->scrollcache > 8)
svga->scrollcache = 0;
}
if ((svga->adv_flags & FLAG_PANNING_ATI) && svga->panning_blank) {
svga->scrollcache = 0;
svga->half_pixel = 0;
} else if ((svga->render == svga_render_2bpp_lowres) || (svga->render == svga_render_2bpp_highres) ||
(svga->render == svga_render_4bpp_lowres) || (svga->render == svga_render_4bpp_highres)) {
svga->half_pixel = 0;
svga->scrollcache &= 0x07;
svga->x_add = svga->left_overscan;
} else {
if (svga->scrollcache > 7)
svga->scrollcache = 7;
svga->half_pixel = svga->scrollcache & 0x01;
svga->scrollcache = (svga->scrollcache & 0x06) >> 1;
svga->scrollcache = (svga->attrregs[0x13] & 0x0f);
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /*Text mode*/
if (svga->seqregs[1] & 1)
svga->scrollcache &= 0x07;
else {
svga->scrollcache++;
if (svga->scrollcache > 8)
svga->scrollcache = 0;
}
svga->half_pixel = 0;
} else if ((svga->render == svga_render_2bpp_lowres) || (svga->render == svga_render_2bpp_highres) ||
(svga->render == svga_render_4bpp_lowres) || (svga->render == svga_render_4bpp_highres)) {
svga->half_pixel = 0;
svga->scrollcache &= 0x07;
} else {
if (svga->scrollcache > 7)
svga->scrollcache = 7;
svga->half_pixel = svga->scrollcache & 0x01;
svga->scrollcache = (svga->scrollcache & 0x06) >> 1;
}
if ((svga->seqregs[1] & 8) || (svga->render == svga_render_8bpp_lowres))
svga->scrollcache <<= 1;
svga->x_add = svga->left_overscan - svga->scrollcache;
}
if ((svga->seqregs[1] & 8) || (svga->render == svga_render_8bpp_lowres))
svga->scrollcache <<= 1;
svga->x_add = svga->left_overscan - svga->scrollcache;
svga->linecountff = 0;
svga->hwcursor_on = 0;