protected final void advance(char c) {
        cursorState = true;
        cursorTimer.restart();
        switch (c) {
            case '\n': cursorX = 0;  if (++cursorY >= rows) scrollByOneRow();  break;
            case '\r': break;
            default:
                if (++cursorX >= logicalColumns) {
                    cursorX = 0;
                    if (++cursorY >= rows)
                        scrollByOneRow();
                }
        }
        repaintChar(cursorX, cursorY);
    }