aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/sys')
-rw-r--r--com32/lib/sys/vesa/initvesa.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c
index 35084449..bcdcc09d 100644
--- a/com32/lib/sys/vesa/initvesa.c
+++ b/com32/lib/sys/vesa/initvesa.c
@@ -116,9 +116,13 @@ static int vesacon_set_mode(void)
return 1; /* Function call failed */
if ( gi->signature != VESA_MAGIC )
return 2; /* No magic */
+#if 1
+ /* Linear frame buffer is a VBE 2.0 feature. In theory this
+ test is redundant given that we check the bitmasks. */
if ( gi->version < 0x0200 ) {
return 3; /* VESA 2.0 not supported */
}
+#endif
/* Copy general info */
memcpy(&__vesa_info.gi, gi, sizeof *gi);
@@ -145,8 +149,16 @@ static int vesacon_set_mode(void)
mi->mode_attr, mi->h_res, mi->v_res, mi->bpp, mi->memory_layout,
mi->rpos, mi->gpos, mi->bpos);
- /* Must be an LFB color graphics mode supported by the hardware */
- if ( (mi->mode_attr & 0x0099) != 0x0099 )
+ /* Must be an LFB color graphics mode supported by the hardware.
+
+ The bits tested are:
+ 7 - linear frame buffer available
+ 4 - graphics mode
+ 3 - color mode
+ 1 - mode information available (mandatory in VBE 1.2+)
+ 0 - mode supported by hardware
+ */
+ if ( (mi->mode_attr & 0x009b) != 0x009b )
continue;
/* Must be 640x480, 32 bpp */