FreeBASIC  0.91.0
io_cls.c
Go to the documentation of this file.
1 /* console CLS statement */
2 
3 #include "../fb.h"
4 #include "fb_private_console.h"
5 #include <pc.h>
6 
7 void fb_ConsoleClear( int mode )
8 {
9  int toprow, botrow;
10 
11  if( mode==1 )
12  return;
13 
14  if( (mode == 2) || (mode == 0xFFFF0000) ) { /* same as gfxlib's DEFAULT_COLOR */
15  fb_ConsoleGetView( &toprow, &botrow );
16  --toprow;
17  --botrow;
18  } else {
19  toprow = 0;
20  botrow = ScreenRows() - 1;
21  }
22 
23  fb_ConsoleScroll_BIOS( 0, toprow, ScreenCols()-1, botrow, 0 );
24  fb_ConsoleLocate_BIOS( toprow, 0, -1 );
25 }