Example #1
0
// Print a string on the next line after the cursor position
uint kputs(const char *buf){
	uint i;
	uint16_t* pos;
	
//	if (start => VGA_SIZE) {
//		_scroll();
//		start =- VGA_WIDTH;
//	}
	pos = VGA_BUF+cursor.pos;
	
	for(i=0; buf[i] != '\0'; i++){
		if (buf[i] == '\n') {
			cursor.pos = (cursor.pos/VGA_WIDTH)*VGA_WIDTH + VGA_WIDTH;
			pos = VGA_BUF + cursor.pos;
		}
		else if (buf[i] == '\t'){
			cursor.pos = (cursor.pos/TAB_WIDTH)*TAB_WIDTH + TAB_WIDTH;
			pos = VGA_BUF + cursor.pos;
		}
		else{
			*pos = _mk_vgacell(buf[i]);
			pos++;
			cursor.pos++;
		}
	}
	
	_set_cursor(cursor.pos);
	
	return i;
}
Example #2
0
// Print a character at the cursor position
void kputc(char c){
	uint16_t* pos;
	
	pos = VGA_BUF+cursor.pos;
	
	*pos = _mk_vgacell(c);
	_set_cursor(cursor.pos+1);
}
Example #3
0
void set_cursor(int x,int y)
{
	_set_cursor(x,y);
	uint16_t pos = (y*80)+x;
	outb(0x3d4, 0x0e);
	outb(0x3d5, (uint8_t)((pos>>8)&0xff));
	outb(0x3d4, 0x0f);
	outb(0x3d5, (uint8_t)(pos&0xff));
}
Example #4
0
// Clear the screen
void clear_vga(){
	uint16_t  cell;
	uint16_t* pos;
	
	set_color(BLACK, WHITE);
	cell = _mk_vgacell(' ');
	
	for(pos=VGA_BUF; pos < VGA_BUF+VGA_SIZE; pos++){
		*pos = cell;
	}
	
	_set_cursor(0);
}
void bb_litehtml_document_container::set_cursor( const litehtml::tchar_t *cursor ){
	_set_cursor( cursor );
}