/* output string on the current console */ void vbeputs(char *str) { struct cons *cons; // uint16_t *ptr; int col; int row; int w; int h; uint8_t ch; // uint8_t atr; cons = &constab[conscur]; col = cons->col; row = cons->row; w = cons->ncol; h = cons->nrow; // atr = cons->chatr; while (*str) { // ptr = cons->buf + row * w + col; ch = *str; if (ch == '\n') { if (row == h) { row = 0; } else { row++; } col = 0; } else { if (col == w) { col = 0; if (row == h) { row = 0; } else { row++; } } #if (NEWFONT) vbedrawchar(ch, col * vgafontw, row * vgafonth, cons->fg, cons->bg); #else vbedrawchar(ch, col << 3, row << 3, cons->fg, cons->bg); #endif col++; } str++; cons->col = col; cons->row = row; } return; }
/* output string on a given console */ void vbeputs2(struct cons *cons, char *str) { // uint16_t *ptr; int x; int row; int w; int h; uint8_t ch; // uint8_t atr; x = cons->col; row = cons->row; w = cons->ncol; h = cons->nrow; // atr = cons->chatr; while (*str) { // ptr = cons->buf + row * w + x; ch = *str; if (ch == '\n') { if (++row == h) { row = 0; } x = 0; } else { #if (NEWFONT) #if (PLASMA) vbedrawcharbg(ch, x * vbefontw, row * vbefonth, cons->fg, cons->bg); #else vbedrawchar(ch, x * vbefontw, row * vbefonth, cons->fg); #endif #else vbedrawchar(ch, x << 3, row << 3, cons->fg); #endif if (++x == w) { x = 0; if (++row == h) { row = 0; } } } str++; cons->col = x; cons->row = row; } return; }
void vbeputchar(int ch) { struct cons *cons; // uint16_t *ptr; cons = &constab[conscur]; vbedrawchar(ch, (cons->col << 3), (cons->row << 3), cons->fg, cons->bg); return; }
void vbeputchar(int ch) { struct cons *cons; long row; long col; // uint16_t *ptr; cons = &constab[conscur]; row = cons->row; col = cons->col; #if (NEWFONT) #if (PLASMA) vbedrawcharbg(ch, col * vbefontw, row * vbefonth, cons->fg, cons->bg); #else vbedrawchar(ch, col * vbefontw, row * vbefonth, cons->fg); #endif #else vbedrawchar(ch, col << 3, row << 3, cons->fg); #endif return; }
/* output string on a given console */ void vbeputs2(struct cons *cons, char *str) { // uint16_t *ptr; int x; int row; int w; int h; uint8_t ch; // uint8_t atr; x = cons->col; row = cons->row; w = cons->ncol; h = cons->nrow; // atr = cons->chatr; while (*str) { // ptr = cons->buf + row * w + x; ch = *str; if (ch == '\n') { if (++row == h) { row = 0; } x = 0; } else { if (++x == w) { x = 0; if (++row == h) { row = 0; } } vbedrawchar(ch, x << 3, row << 3, cons->fg, cons->bg); } str++; cons->col = x; cons->row = row; } return; }