diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-03-09 13:04:47 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-03-09 13:10:45 -0500 |
commit | b7b92935df0e309149c042d587e4764548f10608 (patch) | |
tree | a8bac68b2d9bc89d8a5d5c07ddc696e396f98855 /vgasrc/clext.c | |
parent | 9cba2b3d22db7da313dfec444eb6030459d239c4 (diff) | |
download | seabios-b7b92935df0e309149c042d587e4764548f10608.tar.gz |
vgabios: Fix cirrus memory clear on mode switch.
The cirrus_clear_vram() code wasn't actually doing anything because of
a u8 overflow. Fix that.
Fill with 0xff when performing a legacy cirrus mode switch (WinXP has
been observed to incorrectly render dialog boxes if the memory is
filled to 0). This was the behavior of the original LGPL vgabios
code. To support this, add mechanism (MF_LEGACY) to allow vga drivers
to detect if the mode switch is from vesa or int10.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/clext.c')
-rw-r--r-- | vgasrc/clext.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vgasrc/clext.c b/vgasrc/clext.c index d02b8802..8eb226af 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -443,14 +443,14 @@ cirrus_enable_16k_granularity(void) } static void -cirrus_clear_vram(void) +cirrus_clear_vram(u16 fill) { cirrus_enable_16k_granularity(); - u8 count = GET_GLOBAL(VBE_total_memory) / (16 * 1024); - u8 i; + int count = GET_GLOBAL(VBE_total_memory) / (16 * 1024); + int i; for (i=0; i<count; i++) { stdvga_grdc_write(0x09, i); - memset16_far(SEG_GRAPH, 0, 0, 16 * 1024); + memset16_far(SEG_GRAPH, 0, fill, 16 * 1024); } stdvga_grdc_write(0x09, 0x00); } @@ -469,7 +469,8 @@ clext_set_mode(struct vgamode_s *vmode_g, int flags) if (!(flags & MF_LINEARFB)) cirrus_enable_16k_granularity(); if (!(flags & MF_NOCLEARMEM)) - cirrus_clear_vram(); + // fill with 0xff to keep win 2K happy + cirrus_clear_vram(flags & MF_LEGACY ? 0xffff : 0x0000); return 0; } |