src/vga.c
/***
 * increment line, scrolling text if needed
 */
increment line, scrolling text if needed
increment line scrolling text if needed
void vga_newline() {
    int i;
    VGA_STATE.cursor_x = 0;
    if (++VGA_STATE.cursor_y >= VGA_HEIGHT) {
        VGA_STATE.cursor_y = VGA_HEIGHT - 1;
        for (i = 0; i < VGA_HEIGHT; i++) {
            memcpy((void *)(VGA_BUF + i * VGA_WIDTH),
                   (void *)(VGA_BUF + (i + 1) * VGA_WIDTH),
                   (size_t)VGA_WIDTH * sizeof(vga_d_char_t));
        }
    }
    vga_sync_cursor();
}
void vga_newline ( ) { int i ; VGA_STATE . cursor_x = 0 ; if ( ++ VGA_STATE . cursor_y >= VGA_HEIGHT ) { VGA_STATE . cursor_y = VGA_HEIGHT - 1 ; for ( i = 0 ; i < VGA_HEIGHT ; i ++ ) { memcpy ( ( void * ) ( VGA_BUF + i * VGA_WIDTH ) , ( void * ) ( VGA_BUF + ( i + 1 ) * VGA_WIDTH ) , ( size_t ) VGA_WIDTH * sizeof ( vga_d_char_t ) ) ; } } vga_sync_cursor ( ) ; }
increment line, scrolling text if needed
increment line scrolling text if needed
//vga_d_char_t *pos;