From c4613c6a08856355b196b5a8adbae75f9d4fae6c Mon Sep 17 00:00:00 2001 From: Lawrence Kesteloot Date: Fri, 3 Aug 2018 22:12:55 -0700 Subject: [PATCH] Fix HOME while in GR mode. --- runtime.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime.c b/runtime.c index ab4f9d3..ae24252 100644 --- a/runtime.c +++ b/runtime.c @@ -102,8 +102,18 @@ void clear_to_eol(void) { * Clear the screen with non-reversed spaces. */ void home(void) { - memset(TEXT_PAGE1_BASE, CLEAR_CHAR, SCREEN_STRIDE*8); - move_cursor(0, 0); + if (g_gr_mode) { + int i; + + for (i = MIXED_GRAPHICS_HEIGHT; i < SCREEN_HEIGHT; i++) { + memset(screen_pos(0, i), CLEAR_CHAR, SCREEN_WIDTH); + } + + move_cursor(0, MIXED_GRAPHICS_HEIGHT); + } else { + memset(TEXT_PAGE1_BASE, CLEAR_CHAR, SCREEN_STRIDE*8); + move_cursor(0, 0); + } } /**