void rpi_fb_outch( char c ) { static int escaped = 0; if ( !( escaped = handleEscape( escaped, c ) ) ) { if ( '\n' == c ) videoPutChar( '\r' ); videoPutChar( c ); } }
// prints the contents of the given string onto the backbuffer void AnsiWidget::print(const char *str) { int len = strlen(str); if (len) { _back->drawInto(); int lineHeight = textHeight(); const char *p = (char *)str; while (*p) { switch (*p) { case '\a': // beep dev_beep(); break; case '\t': _back->calcTab(); break; case '\003': // end of text flush(true); break; case '\xC': clearScreen(); break; case '\033': // ESC ctrl chars handleEscape(p, lineHeight); break; case '\034': // file separator break; case '\n': // new line _back->newLine(lineHeight); break; case '\r': // return _back->_curX = INITXY; // erasing the line will clear any previous text break; default: p += _back->print(p, lineHeight) - 1; // allow for p++ break; }; if (*p == '\0') { break; } p++; } // cleanup flush(false); } }