diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-10-30 12:09:19 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-11-12 12:17:57 -0500 |
commit | 6fed307251e2590e9a999af64cf29ff739b034f9 (patch) | |
tree | 64662671047950c5a918be236deaddae1cef6fb8 /vgasrc/cbvga.c | |
parent | 09ae7f1b59a18f3b051cc0934efcd09d70fa6171 (diff) | |
download | seabios-6fed307251e2590e9a999af64cf29ff739b034f9.tar.gz |
vgabios: Support emulating text mode attributes while in graphics mode
Add support for simple text mode attribute emulation while in graphics
mode. This improves text highlighting and background color on some
boot-loaders. Enable it only for CBVGA vgabios and only when a text
mode is requested.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/cbvga.c')
-rw-r--r-- | vgasrc/cbvga.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c index a9c6d3a7..3acc8398 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -14,12 +14,15 @@ static int CBmode VAR16; static struct vgamode_s CBmodeinfo VAR16; +static struct vgamode_s CBemulinfo VAR16; static u32 CBlinelength VAR16; struct vgamode_s *cbvga_find_mode(int mode) { if (mode == GET_GLOBAL(CBmode)) return &CBmodeinfo; + if (mode == 0x03) + return &CBemulinfo; return NULL; } @@ -92,6 +95,8 @@ cbvga_save_restore(int cmd, u16 seg, void *data) int cbvga_set_mode(struct vgamode_s *vmode_g, int flags) { + MASK_BDA_EXT(flags, BF_EMULATE_TEXT + , (vmode_g == &CBemulinfo) ? BF_EMULATE_TEXT : 0); if (!(flags & MF_NOCLEARMEM)) { if (GET_GLOBAL(CBmodeinfo.memmodel) == MM_TEXT) { memset16_far(SEG_CTEXT, (void*)0, 0x0720, 80*25*2); @@ -181,9 +186,8 @@ cbvga_setup(void) SET_VGA(CBmodeinfo.depth, bpp); SET_VGA(CBmodeinfo.cwidth, 8); SET_VGA(CBmodeinfo.cheight, 16); - - // Setup BDA and clear screen. - vga_set_mode(GET_GLOBAL(CBmode), 0); + memcpy_far(get_global_seg(), &CBemulinfo + , get_global_seg(), &CBmodeinfo, sizeof(CBemulinfo)); return 0; } |