Updated vid_unk_ramdac.c to set color mode per the official Sierra datasheet.

This commit is contained in:
OBattler
2016-07-24 17:25:01 +02:00
parent 1c1982d64a
commit 69685d71e8

View File

@@ -10,6 +10,7 @@
void unk_ramdac_out(uint16_t addr, uint8_t val, unk_ramdac_t *ramdac, svga_t *svga) void unk_ramdac_out(uint16_t addr, uint8_t val, unk_ramdac_t *ramdac, svga_t *svga)
{ {
//pclog("OUT RAMDAC %04X %02X\n",addr,val); //pclog("OUT RAMDAC %04X %02X\n",addr,val);
int oldbpp = 0;
switch (addr) switch (addr)
{ {
case 0x3C6: case 0x3C6:
@@ -17,6 +18,7 @@ void unk_ramdac_out(uint16_t addr, uint8_t val, unk_ramdac_t *ramdac, svga_t *sv
{ {
ramdac->state = 0; ramdac->state = 0;
ramdac->ctrl = val; ramdac->ctrl = val;
#if 0
switch ((val&1)|((val&0xE0)>>4)) switch ((val&1)|((val&0xE0)>>4))
{ {
case 0: case 1: case 2: case 3: case 0: case 1: case 2: case 3:
@@ -35,8 +37,30 @@ void unk_ramdac_out(uint16_t addr, uint8_t val, unk_ramdac_t *ramdac, svga_t *sv
svga->bpp = 16; svga->bpp = 16;
break; break;
} }
#endif
oldbpp = svga->bpp;
switch ((val&1)|((val&0xC0)>>8))
{
case 0:
svga->bpp = 8;
break;
case 2: case 3:
svga->bpp = 24;
break;
case 4: case 5:
svga->bpp = 15;
break;
case 6:
svga->bpp = 16;
break;
case 1: case 7: default:
break;
}
if (oldbpp != svga->bpp)
{
svga_recalctimings(svga); svga_recalctimings(svga);
pclog("unk_ramdac: set to %02X, %i bpp\n", (val&1)|((val&0xE0)>>4), svga->bpp); pclog("unk_ramdac: set to %02X, %i bpp\n", (val&1)|((val&0xE0)>>4), svga->bpp);
}
return; return;
} }
ramdac->state = 0; ramdac->state = 0;