From 280c9c083229b41255eef221078a26ed6c3f480d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Sun, 14 Oct 2007 13:12:19 +0000 Subject: [PATCH] add textmode character underline feature (see sf patch #1805880) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3016 --- src/hardware/vga_draw.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hardware/vga_draw.cpp b/src/hardware/vga_draw.cpp index 779461fe..842ec49a 100644 --- a/src/hardware/vga_draw.cpp +++ b/src/hardware/vga_draw.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: vga_draw.cpp,v 1.86 2007-10-13 16:34:06 c2woody Exp $ */ +/* $Id: vga_draw.cpp,v 1.87 2007-10-14 13:12:19 c2woody Exp $ */ #include #include @@ -412,12 +412,14 @@ skip_cursor: static Bit8u * VGA_TEXT_Draw_Line_9(Bitu vidstart, Bitu line) { Bits font_addr; Bit8u * draw=(Bit8u *)TempLine; + bool underline=(vga.crtc.underline_location&0x1f)==line; Bit8u pel_pan=vga.config.pel_panning; if ((vga.attr.mode_control&0x20) && (vga.draw.lines_done>=vga.draw.split_line)) pel_pan=0; const Bit8u *vidmem = &vga.tandy.draw_base[vidstart]; Bit8u chr=vidmem[0]; Bit8u col=vidmem[1]; Bit8u font=(vga.draw.font_tables[(col >> 3)&1][chr*32+line])<>4]&0xff); Bitu draw_blocks=vga.draw.blocks; @@ -426,13 +428,15 @@ static Bit8u * VGA_TEXT_Draw_Line_9(Bitu vidstart, Bitu line) { if (pel_pan) { chr=vidmem[cx*2]; col=vidmem[cx*2+1]; - font|=vga.draw.font_tables[(col >> 3)&1][chr*32+line]>>(8-pel_pan); + if (underline && ((col&0x07) == 0x01)) font|=0xff>>(8-pel_pan); + else font|=vga.draw.font_tables[(col >> 3)&1][chr*32+line]>>(8-pel_pan); fg=col&0xf; bg=(Bit8u)(TXT_BG_Table[col>>4]&0xff); } else { chr=vidmem[(cx-1)*2]; col=vidmem[(cx-1)*2+1]; - font=vga.draw.font_tables[(col >> 3)&1][chr*32+line]; + if (underline && ((col&0x07) == 0x01)) font=0xff; + else font=vga.draw.font_tables[(col >> 3)&1][chr*32+line]; fg=col&0xf; bg=(Bit8u)(TXT_BG_Table[col>>4]&0xff); } @@ -444,8 +448,10 @@ static Bit8u * VGA_TEXT_Draw_Line_9(Bitu vidstart, Bitu line) { Bit8u last=(font&0x01)?fg:bg; *draw++=last; *draw++=((chr<0xc0) || (chr>0xdf)) ? bg : last; - if (pel_pan) - font=(vga.draw.font_tables[(col >> 3)&1][chr*32+line])<> 3)&1][chr*32+line])<> 1;