static void videoPutChar( char ch ) { switch ( ch ) { case '\b': { if ( column ) column--; /* Move cursor on the previous location */ wr_cursor( row, column ); return; } case '\t': { int i; i = TAB_SPACE - ( column & ( TAB_SPACE - 1 ) ); while ( i-- ) { video_drawchars( row, column, ' ' ); column += 1; if ( column >= maxCol ) { doCRNL( 1, 1 ); return; } } wr_cursor( row, column ); return; } case '\n': { doCRNL( 0, 1 ); return; } case 7: { /* Bell code must be inserted here */ return; } case '\r': { doCRNL( 1, 0 ); return; } case BLANK: { video_drawchars( row, column, ' ' ); wr_cursor( row, column ); return; } default: { // *pt_bitmap = (unsigned char)ch | attribute; video_drawchars( row, column, ch ); advanceCursor(); return; } } }
static void videoPutChar(char car) { unsigned short *pt_bitmap = bitMapBaseAddr + row * maxCol + column; switch (car) { case '\b': { if (column) column--; /* Move cursor on the previous location */ wr_cursor(row * maxCol + column, ioCrtBaseAddr); return; } case '\t': { int i; i = TAB_SPACE - (column & (TAB_SPACE - 1)); column += i; if (column >= maxCol) { doCRNL(1,1); return; } while (i--) *pt_bitmap++ = ' ' | attribute; wr_cursor(row * maxCol + column, ioCrtBaseAddr); return; } case '\n': { doCRNL(0,1); return; } case 7: { /* Bell code must be inserted here */ return; } case '\r' : { doCRNL(1,0); return; } case BLANK: { *pt_bitmap = ' ' | attribute; /* DONT move the cursor... */ return; } default: { *pt_bitmap = (unsigned char)car | attribute; advanceCursor(); return; } } }
static void advanceCursor( void ) { if ( ++column == maxCol ) doCRNL( 1, 1 ); else wr_cursor( row, column ); }
static void gotorc(int r, int c) { column = c; row = r; wr_cursor(row * maxCol + column, ioCrtBaseAddr); }
static void advanceCursor(void) { if (++column == maxCol) doCRNL(1,1); else wr_cursor(row * maxCol + column, ioCrtBaseAddr); }
static void gotorc( int r, int c ) { column = c; row = r; wr_cursor( row, column ); }
static void doCRNL(int cr, int nl) { if (nl) { if (++row == maxRow) { scroll(); /* Scroll the screen now */ row = maxRow - 1; } nLines++; } if (cr) column = 0; /* Move cursor on the next location */ if (cr || nl) wr_cursor(row * maxCol + column, ioCrtBaseAddr); }