[vga] a few more vga character writing functions

This commit is contained in:
Kevin Lange 2011-02-10 15:13:33 -06:00
parent fa79d54ce2
commit eb3fa7d499
3 changed files with 40 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ kernel
*.o
bootdisk.img
initrd
*.swp

View File

@ -66,6 +66,43 @@ cls() {
move_csr();
}
/*
* placech
* Put a character in a particular cell with the given attributes.
*/
void
placech(
unsigned char c,
int x,
int y,
int attr
) {
unsigned short *where;
unsigned att = attr << 8;
where = textmemptr + (y * 80 + x);
*where = c | att;
}
/*
* writechf
* Force write the given character.
*/
void
writechf(
unsigned char c
) {
placech(c, csr_x, csr_y, attrib);
csr_x++;
if (csr_x >= 80) {
csr_x = 0;
++csr_y;
}
scroll();
move_csr();
}
/*
* writech
* Write a character to the screen.

View File

@ -48,6 +48,8 @@ extern void puts(char *str);
extern void settextcolor(unsigned char forecolor, unsigned char backcolor);
extern void resettextcolor();
extern void init_video();
extern void placech(unsigned char c, int x, int y, int attr);
extern void writechf(unsigned char c);
extern void writech(unsigned char c);
/* GDT */