Video 7 fixes, fixes RAMDAC 6-bit/8-bit switching on the Radius SVGA MultiView.

This commit is contained in:
OBattler
2021-10-06 18:12:22 +02:00
parent 46807540ed
commit b7f5d4a773
4 changed files with 108 additions and 82 deletions

View File

@@ -24,6 +24,7 @@
#define FLAG_LATCH8 8
#define FLAG_NOSKEW 16
#define FLAG_ADDR_BY16 32
#define FLAG_RAMDAC_SHIFT 64
typedef struct {

View File

@@ -59,7 +59,7 @@ typedef struct ht216_t
uint8_t bg_plane_sel, fg_plane_sel;
uint8_t ht_regs[256];
uint8_t extensions;
uint8_t extensions, reg_3cb;
uint8_t pos_regs[8];
} ht216_t;
@@ -300,6 +300,12 @@ ht216_out(uint16_t addr, uint8_t val, void *p)
svga->hwcursor.ena = !!(val & 0x80);
break;
case 0xc0:
break;
case 0xc1:
break;
case 0xc8:
if ((old ^ val) & HT_REG_C8_E256) {
svga->fullchange = changeframecount;
@@ -313,6 +319,10 @@ ht216_out(uint16_t addr, uint8_t val, void *p)
break;
case 0xe0:
svga->adv_flags &= ~FLAG_RAMDAC_SHIFT;
if (val & 0x04)
svga->adv_flags |= FLAG_RAMDAC_SHIFT;
/* FALLTHROUGH */
/*Bank registers*/
case 0xe8: case 0xe9:
ht216_log("HT216 reg 0x%02x write = %02x, mode = 1, chain4 = %x\n", svga->seqaddr & 0xff, val, svga->chain4);
@@ -384,6 +394,13 @@ ht216_out(uint16_t addr, uint8_t val, void *p)
svga_out(addr, val, svga);
return;
case 0x3cb:
if (ht216->id == 0x7152) {
ht216->reg_3cb = val;
svga_set_ramdac_type(svga, (val & 0x20) ? RAMDAC_6BIT : RAMDAC_8BIT);
}
break;
case 0x3cf:
if (svga->gdcaddr == 5) {
svga->chain2_read = val & 0x10;
@@ -414,8 +431,7 @@ ht216_out(uint16_t addr, uint8_t val, void *p)
svga->crtc[svga->crtcreg] = val;
if (old != val) {
if (svga->crtcreg < 0xe || svga->crtcreg > 0x10)
{
if (svga->crtcreg < 0xe || svga->crtcreg > 0x10) {
if ((svga->crtcreg == 0xc) || (svga->crtcreg == 0xd)) {
svga->fullchange = 3;
svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5);
@@ -523,6 +539,11 @@ ht216_in(uint16_t addr, void *p)
return sc1148x_ramdac_in(addr, 0, svga->ramdac, svga);
return svga_in(addr, svga);
case 0x3cb:
if (ht216->id == 0x7152)
return ht216->reg_3cb;
break;
case 0x3cc:
return svga->miscout;
@@ -1488,6 +1509,9 @@ void
if (ht216->id == 0x7861)
ht216->ht_regs[0xb4] = 0x08; /*32-bit DRAM bus*/
if (ht216->id == 0x7152)
ht216->reg_3cb = 0x20;
/* Initialize the cursor pointer towards the end of its segment, needed for ht256sf.drv to work correctly
when Windows 3.1 is started after boot. */
ht216->ht_regs[0x94] = 0xff;

View File

@@ -55,17 +55,15 @@ sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
svga->bpp = 16;
else
svga->bpp = 15;
} else {
} else
svga->bpp = 8;
}
svga_recalctimings(svga);
return;
}
ramdac->state = 0;
break;
case 0x3c7:
case 0x3c8:
case 0x3c7: case 0x3c8:
case 0x3c9:
ramdac->state = 0;
svga_out(addr, val, svga);
@@ -78,7 +76,7 @@ uint8_t
sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga)
{
sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p;
uint8_t temp = 0xff;
uint8_t ret = 0xff;
uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2);
@@ -86,27 +84,26 @@ sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga)
case 0x3c6:
if (ramdac->state == 4) {
ramdac->state = 0;
temp = ramdac->ctrl;
ret = ramdac->ctrl;
if (ramdac->type == 1) {
if (((ramdac->ctrl >> 5) == 1) || ((ramdac->ctrl >> 5) == 3))
temp |= 1;
ret |= 1;
else
temp &= ~1;
ret &= ~1;
}
return temp;
return ret;
}
ramdac->state++;
break;
case 0x3c7:
case 0x3c8:
case 0x3c7: case 0x3c8:
case 0x3c9:
temp = svga_in(addr, svga);
ret = svga_in(addr, svga);
ramdac->state = 0;
break;
}
return temp;
return ret;
}

View File

@@ -192,6 +192,8 @@ svga_out(uint16_t addr, uint8_t val, void *p)
svga->dac_addr = (val + (addr & 0x01)) & 255;
break;
case 0x3c9:
if (svga->adv_flags & FLAG_RAMDAC_SHIFT)
val <<= 2;
svga->fullchange = changeframecount;
switch (svga->dac_pos) {
case 0:
@@ -330,6 +332,8 @@ svga_in(uint16_t addr, void *p)
ret = svga->vgapal[index].b & 0x3f;
break;
}
if (svga->adv_flags & FLAG_RAMDAC_SHIFT)
ret >>= 2;
break;
case 0x3cc:
ret = svga->miscout;