Handle clock interrupt and cleaning code
This commit is contained in:
parent
958e2dae04
commit
8fee35522d
8 changed files with 79 additions and 17 deletions
|
@ -20,6 +20,17 @@ VIDEO_STATE VS={
|
|||
};
|
||||
|
||||
void putchar(char c){
|
||||
// Handle newline here
|
||||
if(c=='\n'){
|
||||
VS.col=0;
|
||||
VS.line+=1;
|
||||
if(VS.line>=MAX_LINE){
|
||||
VS.line=MAX_LINE-1;
|
||||
scrollup();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Print char
|
||||
VS.mem[VS.col*2+MAX_COL*VS.line*2]=c;
|
||||
VS.mem[VS.col*2+MAX_COL*VS.line*2+1]=VS.fg|VS.bg<<4;
|
||||
|
@ -44,6 +55,13 @@ void print(char *str){
|
|||
}
|
||||
}
|
||||
|
||||
void printc(char* str,VIDEO_COLORS c){
|
||||
VIDEO_COLORS backup=VS.fg;
|
||||
VS.fg=c;
|
||||
print(str);
|
||||
VS.fg=backup;
|
||||
}
|
||||
|
||||
void clear(){
|
||||
for(char i=0;i<MAX_LINE;i++){
|
||||
scrollup();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue