Fix attribute mode control register not always saving value
Add blinking text support Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1617
This commit is contained in:
parent
5640023e40
commit
66aa286476
2 changed files with 18 additions and 3 deletions
|
@ -57,12 +57,16 @@ void write_p3c0(Bit32u port,Bit8u val) {
|
|||
break;
|
||||
case 0x10: /* Mode Control Register */
|
||||
if ((attr(mode_control) ^ val) & 0x80) {
|
||||
attr(mode_control)=val;
|
||||
attr(mode_control)^=0x80;
|
||||
for (Bitu i=0;i<0x10;i++) {
|
||||
VGA_ATTR_SetPalette(i,vga.attr.palette[i]);
|
||||
}
|
||||
}
|
||||
attr(mode_control)=val;
|
||||
if ((attr(mode_control) ^ val) & 0x08) {
|
||||
/* Fill up background text mode color lookup table */
|
||||
Bit32u b=(val & 8) ^ 0x8;
|
||||
for (Bitu i=0;i<8;i++) TXT_BG_Table[i+8]=(b+i) | ((b+i) << 8)| ((b+i) <<16) | ((b+i) << 24);
|
||||
}
|
||||
/*
|
||||
Special hacks for games programming registers themselves,
|
||||
Doesn't work if they program EGA16 themselves,
|
||||
|
@ -73,6 +77,7 @@ void write_p3c0(Bit32u port,Bit8u val) {
|
|||
} else {
|
||||
if (vga.mode==M_VGA) VGA_SetMode(M_EGA16);
|
||||
}
|
||||
attr(mode_control)=val;
|
||||
//TODO Monochrome mode
|
||||
//TODO 9 bit characters
|
||||
//TODO line wrapping split screen shit see bit 5
|
||||
|
|
|
@ -100,6 +100,8 @@ static Bit8u * VGA_VGA_Draw_Line(Bitu vidstart,Bitu panning,Bitu line) {
|
|||
return &vga.mem.linear[vidstart*4+panning/2];
|
||||
}
|
||||
|
||||
|
||||
static Bit32u FontMask[2]={0xffffffff,0x0};
|
||||
static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart,Bitu panning,Bitu line) {
|
||||
Bit8u * draw=VGA_DrawBuffer;
|
||||
Bit8u * vidmem=&vga.mem.linear[vidstart];
|
||||
|
@ -111,6 +113,7 @@ static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart,Bitu panning,Bitu line) {
|
|||
Bitu col=vidmem[cx*2+1];
|
||||
Bit32u fg=TXT_FG_Table[col&0xf];
|
||||
Bit32u bg=TXT_BG_Table[col>>4];
|
||||
mask1&=FontMask[col >> 7];mask2&=FontMask[col >> 7];
|
||||
*(Bit32u*)draw=fg&mask1 | bg&~mask1;
|
||||
draw+=4;
|
||||
*(Bit32u*)draw=fg&mask2 | bg&~mask2;
|
||||
|
@ -199,7 +202,6 @@ static void VGA_DrawPart(void) {
|
|||
|
||||
static void VGA_VerticalTimer(void) {
|
||||
vga.config.retrace=false;
|
||||
vga.draw.cursor.count++;vga.draw.cursor.count&=0xf;
|
||||
PIC_AddEvent(VGA_VerticalTimer,vga.draw.micro.vtotal);
|
||||
PIC_AddEvent(VGA_VerticalDisplayEnd,vga.draw.micro.vend);
|
||||
vga.draw.parts_left=4;
|
||||
|
@ -208,6 +210,14 @@ static void VGA_VerticalTimer(void) {
|
|||
vga.draw.address_line=vga.config.hlines_skip;
|
||||
vga.draw.split_line=vga.draw.lines_total-(vga.config.line_compare/vga.draw.lines_scaled);
|
||||
vga.draw.panning=vga.config.pel_panning;
|
||||
switch (vga.mode) {
|
||||
case M_TEXT2:case M_TEXT16:
|
||||
vga.draw.cursor.count++;
|
||||
/* check for blinking and blinking change delay */
|
||||
FontMask[1]=(vga.attr.mode_control & (vga.draw.cursor.count >> 1) & 0x8) ?
|
||||
0 : 0xffffffff;
|
||||
break;
|
||||
}
|
||||
if (RENDER_StartUpdate()) {
|
||||
VGA_DrawPart();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue