From 513afcf4f8cd67275bad59251d1ee2a845d0ddca Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 28 Aug 2002 17:28:36 +0000 Subject: hurd/ 2002-08-28 Marcus Brinkmann * console.h (struct cons_display): Fix comment on CUR_LINE. console/ 2002-08-28 Marcus Brinkmann * display.c (screen_fill): Take CUR_LINES modulo LINES. (screen_shift_left): Likewise. (screen_shift_right): Likewise. (linefeed): Don't take CUR_LINES modulo LINES here. libcons/ 2002-08-28 Marcus Brinkmann * file-changed.c (cons_S_file_changed): Take NEW_CUR_LINE modulo VCONS->state.screen.lines where appropriate. Adapt calculation of SCROLLING, and limit it to the screen size. Only scroll at all if there is something to scroll. Fix calculation of scrolled-in area. * vcons-refresh.c (cons_vcons_refresh): Take VCONS->state.screen.cur_line modulo VCONS->state.screen.lines. --- console/ChangeLog | 7 +++++++ console/display.c | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'console') diff --git a/console/ChangeLog b/console/ChangeLog index 3522ff99..69830796 100644 --- a/console/ChangeLog +++ b/console/ChangeLog @@ -1,3 +1,10 @@ +2002-08-28 Marcus Brinkmann + + * display.c (screen_fill): Take CUR_LINES modulo LINES. + (screen_shift_left): Likewise. + (screen_shift_right): Likewise. + (linefeed): Don't take CUR_LINES modulo LINES here. + 2002-08-28 Marcus Brinkmann * display.c (display_output_one): Also set USER->cursor.status to diff --git a/console/display.c b/console/display.c index bcdbac1b..908a1d06 100644 --- a/console/display.c +++ b/console/display.c @@ -829,8 +829,10 @@ screen_fill (display_t display, size_t col1, size_t row1, size_t col2, size_t row2, wchar_t chr, conchar_attr_t attr) { struct cons_display *user = display->user; - off_t start = (user->screen.cur_line + row1) * user->screen.width + col1; - off_t end = (user->screen.cur_line + row2) * user->screen.width + col2; + off_t start = ((user->screen.cur_line % user->screen.lines) + row1) + * user->screen.width + col1; + off_t end = ((user->screen.cur_line % user->screen.lines) + row2) + * user->screen.width + col2; off_t size = user->screen.width * user->screen.lines; if (start >= size && end >= size) @@ -857,8 +859,10 @@ screen_shift_left (display_t display, size_t col1, size_t row1, size_t col2, size_t row2, size_t shift, wchar_t chr, conchar_attr_t attr) { struct cons_display *user = display->user; - off_t start = (user->screen.cur_line + row1) * user->screen.width + col1; - off_t end = (user->screen.cur_line + row2) * user->screen.width + col2; + off_t start = ((user->screen.cur_line % user->screen.lines) + row1) + * user->screen.width + col1; + off_t end = ((user->screen.cur_line % user->screen.lines) + row2) + * user->screen.width + col2; off_t size = user->screen.width * user->screen.lines; if (start >= size && end >= size) @@ -894,8 +898,10 @@ screen_shift_right (display_t display, size_t col1, size_t row1, size_t col2, wchar_t chr, conchar_attr_t attr) { struct cons_display *user = display->user; - off_t start = (user->screen.cur_line + row1) * user->screen.width + col1; - off_t end = (user->screen.cur_line + row2) * user->screen.width + col2; + off_t start = ((user->screen.cur_line % user->screen.lines) + row1) + * user->screen.width + col1; + off_t end = ((user->screen.cur_line % user->screen.lines) + row2) + * user->screen.width + col2; off_t size = user->screen.width * user->screen.lines; if (start >= size && end >= size) @@ -1080,7 +1086,6 @@ linefeed (display_t display) else { user->screen.cur_line++; - user->screen.cur_line %= user->screen.lines; screen_fill (display, 0, user->screen.height - 1, user->screen.width - 1, user->screen.height - 1, @@ -1463,7 +1468,7 @@ display_output_one (display_t display, wchar_t chr) else { /* XXX This implements the functionality. - The alternative is to cut off and set x to 0. */ + The alternative is to cut off and set col to 0. */ user->cursor.col = user->screen.width - 1; user->cursor.row--; } -- cgit v1.2.3