diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2008-05-20 20:08:11 +0000 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-05-20 20:08:11 +0000 |
commit | d43841defc07cd84b1dde502a65f4f22c8d8374e (patch) | |
tree | aaa017ec09777fe0368a5c14d490d68c471a6a1b /payloads | |
parent | 9d10dc4ffc144bc8d952047c39f7fc1b109193e8 (diff) |
libpayload: Fix curses subwindows
This fixes subwindows in curses so that they draw and refresh correctly.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Acked-by: Myles Watson <mylesgw@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3336 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/curses/tinycurses.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/payloads/libpayload/curses/tinycurses.c b/payloads/libpayload/curses/tinycurses.c index 08b858e3c0..a51efb2974 100644 --- a/payloads/libpayload/curses/tinycurses.c +++ b/payloads/libpayload/curses/tinycurses.c @@ -66,7 +66,7 @@ static WINDOW window_list[MAX_WINDOWS]; static int window_count = 1; // struct ldat foo; -static struct ldat ldat_list[3]; +static struct ldat ldat_list[MAX_WINDOWS][SCREEN_Y]; static int ldat_count = 0; /* One item bigger than SCREEN_X to reverse place for a NUL byte. */ @@ -306,7 +306,7 @@ WINDOW *newwin(int num_lines, int num_columns, int begy, int begx) win->_begx = begx; // win->_yoffset = SP->_topstolen; - win->_line = &ldat_list[ldat_count++]; + win->_line = ldat_list[ldat_count++]; /* FIXME: Is this right? Should the window attributes be normal? */ win->_color = PAIR_NUMBER(0); @@ -523,8 +523,8 @@ int wcolor_set(WINDOW *win, short color_pair_number, void *opts) int werase(WINDOW *win) { int x, y; - for (y = 0; y < win->_maxy; y++) { - for (x = 0; x < win->_maxx; x++) { + for (y = 0; y <= win->_maxy; y++) { + for (x = 0; x <= win->_maxx; x++) { win->_line[y].text[x].chars[0] = ' '; win->_line[y].text[x].attr = WINDOW_ATTRS(win); } @@ -591,8 +591,8 @@ int wnoutrefresh(WINDOW *win) // FIXME. int x, y; - for (y = 0; y < win->_maxy; y++) { - for (x = 0; x < win->_maxx; x++) { + for (y = 0; y <= win->_maxy; y++) { + for (x = 0; x <= win->_maxx; x++) { if (curses_flags & F_ENABLE_SERIAL) serial_putchar(win->_line[y].text[x].chars[0]); @@ -619,7 +619,7 @@ int wnoutrefresh(WINDOW *win) * but this will break wide characters! */ c |= (chtype) (win->_line[y].text[x].chars[0] & 0xff); - video_console_putc(y, x, c); + video_console_putc(win->_begy + y, win->_begx + x, c); } } } |