Added ATI Korean VGA, based on PCem patch from greatpsycho.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* SVGA renderers.
|
||||
*
|
||||
* Version: @(#)vid_svga_render.c 1.0.5 2018/02/08
|
||||
* Version: @(#)vid_svga_render.c 1.0.6 2018/03/02
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -92,6 +92,9 @@ uint32_t shade[5][256] =
|
||||
}
|
||||
};
|
||||
|
||||
int dbcs_mode_enabled = 0;
|
||||
|
||||
|
||||
void svga_render_blank(svga_t *svga)
|
||||
{
|
||||
int x, xx;
|
||||
@@ -205,7 +208,7 @@ void svga_render_text_80(svga_t *svga)
|
||||
uint32_t *p = &((uint32_t *)buffer32->line[svga->displine + y_add])[32 + x_add];
|
||||
int x, xx;
|
||||
int drawcursor;
|
||||
uint8_t chr, attr, dat;
|
||||
uint8_t chr, attr, dat, nextchr;
|
||||
uint32_t charaddr;
|
||||
int fg, bg;
|
||||
int xinc = (svga->seqregs[1] & 1) ? 8 : 9;
|
||||
@@ -215,6 +218,85 @@ void svga_render_text_80(svga_t *svga)
|
||||
drawcursor = ((svga->ma == svga->ca) && svga->con && svga->cursoron);
|
||||
chr = svga->vram[(svga->ma << 1) & svga->vram_display_mask];
|
||||
attr = svga->vram[((svga->ma << 1) + 1) & svga->vram_display_mask];
|
||||
|
||||
|
||||
if(dbcs_mode_enabled && x + xinc < svga->hdisp && chr & 0x80)
|
||||
{
|
||||
nextchr = svga->vram[((svga->ma + 4) << 1) & svga->vram_display_mask];
|
||||
if(nextchr & 0x80)
|
||||
{
|
||||
if (drawcursor)
|
||||
{
|
||||
bg = svga->pallook[svga->egapal[attr & 15]];
|
||||
fg = svga->pallook[svga->egapal[attr >> 4]];
|
||||
}
|
||||
else
|
||||
{
|
||||
fg = svga->pallook[svga->egapal[attr & 15]];
|
||||
bg = svga->pallook[svga->egapal[attr >> 4]];
|
||||
if (attr & 0x80 && svga->attrregs[0x10] & 8)
|
||||
{
|
||||
bg = svga->pallook[svga->egapal[(attr >> 4) & 7]];
|
||||
if (svga->blink & 16)
|
||||
fg = bg;
|
||||
}
|
||||
}
|
||||
|
||||
dat = fontdatksc5601[((chr & 0x7F) << 7) | (nextchr & 0x7F)][svga->sc];
|
||||
if (svga->seqregs[1] & 1)
|
||||
{
|
||||
for (xx = 0; xx < 8; xx++)
|
||||
p[xx] = (dat & (0x80 >> xx)) ? fg : bg;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (xx = 0; xx < 8; xx++)
|
||||
p[xx] = (dat & (0x80 >> xx)) ? fg : bg;
|
||||
if ((chr & ~0x1F) != 0xC0 || !(svga->attrregs[0x10] & 4))
|
||||
p[8] = bg;
|
||||
else
|
||||
p[8] = (dat & 1) ? fg : bg;
|
||||
}
|
||||
|
||||
attr = svga->vram[(((svga->ma + 4) << 1) + 1) & svga->vram_display_mask];
|
||||
if (drawcursor)
|
||||
{
|
||||
bg = svga->pallook[svga->egapal[attr & 15]];
|
||||
fg = svga->pallook[svga->egapal[attr >> 4]];
|
||||
}
|
||||
else
|
||||
{
|
||||
fg = svga->pallook[svga->egapal[attr & 15]];
|
||||
bg = svga->pallook[svga->egapal[attr >> 4]];
|
||||
if (attr & 0x80 && svga->attrregs[0x10] & 8)
|
||||
{
|
||||
bg = svga->pallook[svga->egapal[(attr >> 4) & 7]];
|
||||
if (svga->blink & 16)
|
||||
fg = bg;
|
||||
}
|
||||
}
|
||||
|
||||
dat = fontdatksc5601[((chr & 0x7F) << 7) | (nextchr & 0x7F)][svga->sc + 16];
|
||||
if (svga->seqregs[1] & 1)
|
||||
{
|
||||
for (xx = 0; xx < 8; xx++)
|
||||
p[xx+8] = (dat & (0x80 >> xx)) ? fg : bg;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (xx = 0; xx < 8; xx++)
|
||||
p[xx+9] = (dat & (0x80 >> xx)) ? fg : bg;
|
||||
if ((chr & ~0x1F) != 0xC0 || !(svga->attrregs[0x10] & 4))
|
||||
p[17] = bg;
|
||||
else
|
||||
p[17] = (dat & 1) ? fg : bg;
|
||||
}
|
||||
svga->ma += 8;
|
||||
p += xinc * 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (attr & 8) charaddr = svga->charsetb + (chr * 128);
|
||||
else charaddr = svga->charseta + (chr * 128);
|
||||
|
||||
@@ -339,16 +421,8 @@ void svga_render_2bpp_highres(svga_t *svga)
|
||||
{
|
||||
uint8_t dat[2];
|
||||
|
||||
if (svga->sc & 1 && !(svga->crtc[0x17] & 1))
|
||||
{
|
||||
dat[0] = svga->vram[(svga->ma << 1) + 0x8000];
|
||||
dat[1] = svga->vram[(svga->ma << 1) + 0x8001];
|
||||
}
|
||||
else
|
||||
{
|
||||
dat[0] = svga->vram[(svga->ma << 1)];
|
||||
dat[1] = svga->vram[(svga->ma << 1) + 1];
|
||||
}
|
||||
dat[0] = svga->vram[(svga->ma << 1) + ((svga->sc & 3) & (~svga->crtc[0x17] & 3)) * 0x8000];
|
||||
dat[1] = svga->vram[(svga->ma << 1) + ((svga->sc & 3) & (~svga->crtc[0x17] & 3)) * 0x8000 + 1];
|
||||
svga->ma += 4;
|
||||
svga->ma &= svga->vram_display_mask;
|
||||
|
||||
@@ -435,10 +509,8 @@ void svga_render_4bpp_highres(svga_t *svga)
|
||||
uint8_t edat[4];
|
||||
uint8_t dat;
|
||||
|
||||
if (svga->sc & 1 && !(svga->crtc[0x17] & 1))
|
||||
*(uint32_t *)(&edat[0]) = *(uint32_t *)(&svga->vram[svga->ma | 0x8000]);
|
||||
else
|
||||
*(uint32_t *)(&edat[0]) = *(uint32_t *)(&svga->vram[svga->ma]);
|
||||
*(uint32_t *)(&edat[0]) = *(uint32_t *)(&svga->vram[svga->ma | ((svga->sc & 3) & (~svga->crtc[0x17] & 3)) * 0x8000]);
|
||||
|
||||
svga->ma += 4;
|
||||
svga->ma &= svga->vram_display_mask;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user