Showing with 23 additions and 3 deletions.
  1. +6 −1 CHANGELOG.md
  2. +17 −2 src/sercon.c
7 changes: 6 additions & 1 deletion CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@ Fourth digit in release number means PC Engines patch.

## [Unreleased]

## [rel-1.11.0.2] - 2017-12-22
### Fixed
- bug with serial console printing

## [rel-1.11.0.1] - 2017-11-30
### Changed
- rebased to 1.11.0 stable mainline
Expand Down Expand Up @@ -46,7 +50,8 @@ Fourth digit in release number means PC Engines patch.
### Fixed
- prevented from printing character multiple times

[Unreleased]: https://github.com/pcengines/seabios/compare/rel-1.11.0.1...apu_support
[Unreleased]: https://github.com/pcengines/seabios/compare/rel-1.11.0.2...apu_support
[rel-1.11.0.2]: https://github.com/pcengines/seabios/compare/rel-1.11.0.2...rel-1.11.0.1
[rel-1.11.0.1]: https://github.com/pcengines/seabios/compare/rel-1.11.0.1...rel-1.10.2.1
[rel-1.10.2.1]: https://github.com/pcengines/seabios/compare/rel-1.10.2.1...rel-1.10.0.1
[rel-1.10.0.1]: https://github.com/pcengines/seabios/compare/rel-1.9.2.4...rel-1.10.0.1
Expand Down
19 changes: 17 additions & 2 deletions src/sercon.c
Expand Up @@ -99,6 +99,13 @@ static void sercon_putchar(u8 chr)
}
}

/* Reset terminal to initial state */
static void sercon_term_reset(void)
{
sercon_putchar('\x1b');
sercon_putchar('c');
}

static void sercon_term_clear_screen(void)
{
sercon_putchar('\x1b');
Expand Down Expand Up @@ -302,7 +309,7 @@ static void sercon_lazy_putchar(u8 chr, u8 attr, u8 teletype)
/* Set video mode */
static void sercon_1000(struct bregs *regs)
{

u8 clearscreen = !(regs->al & 0x80);
u8 mode = regs->al & 0x7f;
u8 rows, cols;

Expand All @@ -326,7 +333,7 @@ static void sercon_1000(struct bregs *regs)
regs->al = 0x30;
break;
}

cursor_pos_set(0, 0);
SET_BDA(video_mode, mode);
SET_BDA(video_cols, cols);
SET_BDA(video_rows, rows-1);
Expand All @@ -336,8 +343,16 @@ static void sercon_1000(struct bregs *regs)
}

SET_LOW(sercon_enable, mode <= 0x07);
SET_LOW(sercon_col_last, 0);
SET_LOW(sercon_row_last, 0);
SET_LOW(sercon_attr_last, 0);

sercon_term_reset();
sercon_term_no_linewrap();

if (clearscreen) {
sercon_term_clear_screen();
}
}

/* Set text-mode cursor shape */
Expand Down