Video: more changes and fixes of the day (June 26th, 2025)

1. Convert the ramdac types into an enumerator.
2. Make sure the 8514/A compatible ramdacs are, if in VGA mode, using VGA compatible ports and/or, in 8514/A mode, the 8514/A ports when needed, fixes color issues in 1280x1024 resolutions on NT 3.1 and various stuff using the Mach32.
3. Add pitch initialization on reset, fixes 8514/A display drivers on various stuff on Mach8/Mach32 cards.
This commit is contained in:
TC1995
2025-06-26 13:11:42 +02:00
parent 08e281cfd5
commit 07af9f12d7
7 changed files with 74 additions and 52 deletions

View File

@@ -67,22 +67,22 @@ typedef struct ati68860_ramdac_t {
} ati68860_ramdac_t;
void
ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga)
ati68860_ramdac_out(uint16_t addr, uint8_t val, int is_8514, void *priv, svga_t *svga)
{
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
switch (addr) {
case 0:
svga_out(0x3c8, val, svga);
svga_out(is_8514 ? 0x2ec : 0x3c8, val, svga);
break;
case 1:
svga_out(0x3c9, val, svga);
svga_out(is_8514 ? 0x2ed : 0x3c9, val, svga);
break;
case 2:
svga_out(0x3c6, val, svga);
svga_out(is_8514 ? 0x2ea : 0x3c6, val, svga);
break;
case 3:
svga_out(0x3c7, val, svga);
svga_out(is_8514 ? 0x2eb : 0x3c7, val, svga);
break;
default:
ramdac->regs[addr & 0xf] = val;
@@ -172,23 +172,23 @@ ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga)
}
uint8_t
ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga)
ati68860_ramdac_in(uint16_t addr, int is_8514, void *priv, svga_t *svga)
{
const ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
uint8_t temp = 0;
switch (addr) {
case 0:
temp = svga_in(0x3c8, svga);
temp = svga_in(is_8514 ? 0x2ec : 0x3c8, svga);
break;
case 1:
temp = svga_in(0x3c9, svga);
temp = svga_in(is_8514 ? 0x2ed : 0x3c9, svga);
break;
case 2:
temp = svga_in(0x3c6, svga);
temp = svga_in(is_8514 ? 0x2ea : 0x3c6, svga);
break;
case 3:
temp = svga_in(0x3c7, svga);
temp = svga_in(is_8514 ? 0x2eb : 0x3c7, svga);
break;
case 4:
case 8:

View File

@@ -38,7 +38,7 @@ typedef struct ati68875_ramdac_t {
} ati68875_ramdac_t;
void
ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga)
ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, int is_8514, void *priv, svga_t *svga)
{
ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) priv;
uint8_t rs = (addr & 0x03);
@@ -48,10 +48,16 @@ ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, sv
switch (rs) {
case 0x00: /* Palette Write Index Register (RS value = 0000) */
svga_out(is_8514 ? 0x2ec : 0x3c8, val, svga);
break;
case 0x01: /* Palette Data Register (RS value = 0001) */
svga_out(is_8514 ? 0x2ed : 0x3c9, val, svga);
break;
case 0x02: /* Pixel Read Mask Register (RS value = 0010) */
case 0x03:
svga_out(addr, val, svga);
svga_out(is_8514 ? 0x2ea : 0x3c6, val, svga);
break;
case 0x03: /* Palette Read Index Register (RS value = 0011) */
svga_out(is_8514 ? 0x2eb : 0x3c7, val, svga);
break;
case 0x08: /* General Control Register (RS value = 1000) */
ramdac->gen_cntl = val;
@@ -83,7 +89,7 @@ ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, sv
}
uint8_t
ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga)
ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, int is_8514, void *priv, svga_t *svga)
{
const ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) priv;
uint8_t rs = (addr & 0x03);
@@ -94,10 +100,16 @@ ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga)
switch (rs) {
case 0x00: /* Palette Write Index Register (RS value = 0000) */
temp = svga_in(is_8514 ? 0x2ec : 0x3c8, svga);
break;
case 0x01: /* Palette Data Register (RS value = 0001) */
temp = svga_in(is_8514 ? 0x2ed : 0x3c9, svga);
break;
case 0x02: /* Pixel Read Mask Register (RS value = 0010) */
case 0x03:
temp = svga_in(addr, svga);
temp = svga_in(is_8514 ? 0x2ea : 0x3c6, svga);
break;
case 0x03: /* Palette Read Index Register (RS value = 0011) */
temp = svga_in(is_8514 ? 0x2eb : 0x3c7, svga);
break;
case 0x08: /* General Control Register (RS value = 1000) */
temp = ramdac->gen_cntl;