aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Serpell <daniel.serpell@gmail.com>2020-05-03 00:23:04 -0400
committerDaniel Serpell <daniel.serpell@gmail.com>2020-05-03 01:07:14 -0400
commit8dc9acb698adc31ab6411dcbdcd6a7dd1edf9563 (patch)
treeb51a2eee44e6404d671ce48240be25e602d3721a
parente3541120b2978abe01edf8780b1b1c57f5900c88 (diff)
downloademu2-8dc9acb698adc31ab6411dcbdcd6a7dd1edf9563.tar.gz
Fixes color changes to background outside emulated window.
-rw-r--r--src/video.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video.c b/src/video.c
index 0f0b844..df96015 100644
--- a/src/video.c
+++ b/src/video.c
@@ -200,6 +200,9 @@ static void term_goto_xy(unsigned x, unsigned y)
if(term_posy < y)
{
putc('\r', tty_file);
+ // Set background color to black, as some terminals insert lines with
+ // the current background color.
+ set_color(term_color & 0x0F);
// TODO: Draw new line with background color from video screen
for(unsigned i = term_posy; i < y; i++)
putc('\n', tty_file);
@@ -231,8 +234,8 @@ static void term_goto_xy(unsigned x, unsigned y)
// Outputs a character with the given attributes at the given position
static void put_vc_xy(uint8_t vc, uint8_t color, unsigned x, unsigned y)
{
- set_color(color);
term_goto_xy(x, y);
+ set_color(color);
put_vc(vc);
term_posx++;
Un proyecto texto-plano.xyz