}
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);
}
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;
}
};
// Mode flags
+#define MF_LEGACY 0x0001
#define MF_GRAYSUM 0x0002
#define MF_NOPALETTE 0x0008
#define MF_CUSTOMCRTC 0x0800