mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 19:00:27 +00:00
Bare metal VGA: filter out non-framebuffer graphics modes
from VESA video mode list
This commit is contained in:
parent
8ed7d4df55
commit
d5eb6c32f2
1 changed files with 7 additions and 7 deletions
|
@ -159,17 +159,17 @@ _rlinit_vesa:
|
|||
mov %al,%cl
|
||||
and $0b00001011,%al # also skip if mode is unusable, or
|
||||
cmp $0b00001011,%al # extra information unavailable, or
|
||||
jnz .fail3 # is monochrome
|
||||
jnz .fail3 # is monochrome, or is graphics w/o
|
||||
mov %cl,%al # linear frame buffer
|
||||
and $0b10010000,%al
|
||||
cmp $0b00010000,%al
|
||||
jz .fail3
|
||||
call .putsp # echo mode information
|
||||
call .putsp
|
||||
test $0b00010000,%cl # first, echo mode attributes
|
||||
setnz %al
|
||||
imul $'g'-'t',%ax,%ax # - 'g': graphics; 't': text mode
|
||||
add $'t',%al
|
||||
shl %cl # - turn 'g' into 'G' if linear
|
||||
sbb %cl,%cl # frame buffer supported
|
||||
and $'G'-'g',%cl
|
||||
add %cl,%al
|
||||
imul $'G'-'T',%ax,%ax # - 'G': graphics; 'T': text mode
|
||||
add $'T',%al
|
||||
call .putc
|
||||
call .putsp
|
||||
xchg %ax,%si # then output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue