-void lcd_init_console(void *address, int rows, int cols)
-{
- console_curr_col = 0;
- console_curr_row = 0;
- console_cols = cols;
- console_rows = rows;
- lcd_console_address = address;
-}
-
-void lcd_set_col(short col)
-{
- console_curr_col = col;
-}
-
-void lcd_set_row(short row)
-{
- console_curr_row = row;
-}
-
-/*----------------------------------------------------------------------*/
-
-static void console_scrollup(void)
-{
- const int rows = CONFIG_CONSOLE_SCROLL_LINES;
- int bg_color = lcd_getbgcolor();
-
- /* Copy up rows ignoring those that will be overwritten */
- memcpy(CONSOLE_ROW_FIRST,
- lcd_console_address + CONSOLE_ROW_SIZE * rows,
- CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
-
- /* Clear the last rows */
-#if (LCD_BPP != LCD_COLOR32)
- memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
- bg_color, CONSOLE_ROW_SIZE * rows);
-#else
- u32 *ppix = lcd_console_address +
- CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
- u32 i;
- for (i = 0;
- i < (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
- i++) {
- *ppix++ = bg_color;
- }
-#endif
- lcd_sync();
- console_curr_row -= rows;
-}
-
-/*----------------------------------------------------------------------*/
-
-static inline void console_back(void)
-{
- if (--console_curr_col < 0) {
- console_curr_col = console_cols - 1;
- if (--console_curr_row < 0)
- console_curr_row = 0;
- }
-
- lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
- console_curr_row * VIDEO_FONT_HEIGHT, ' ');
-}
-
-/*----------------------------------------------------------------------*/
-
-static inline void console_newline(void)
-{
- console_curr_col = 0;
-
- /* Check if we need to scroll the terminal */
- if (++console_curr_row >= console_rows)
- console_scrollup();
- else
- lcd_sync();
-}
-
-/*----------------------------------------------------------------------*/
-