Bare metal VGA: implement "reverse video" (\e[7m) escape code

This commit is contained in:
tkchia 2022-09-10 06:46:57 +00:00
parent 26712247ad
commit fa82b57103

View file

@ -270,7 +270,11 @@ static void TtySetCodepage(struct Tty *tty, char id) {
*/ */
static uint8_t TtyGetVgaAttr(struct Tty *tty) static uint8_t TtyGetVgaAttr(struct Tty *tty)
{ {
uint8_t attr = tty->fg | tty->bg << 4; uint8_t attr;
if ((tty->pr & kTtyFlip) == 0)
attr = tty->fg | tty->bg << 4;
else
attr = tty->bg | tty->fg << 4;
#ifdef VGA_USE_BLINK #ifdef VGA_USE_BLINK
/* /*
* If blinking is enabled, we can only have the 8 dark background color * If blinking is enabled, we can only have the 8 dark background color