Skip to content

Commit

Permalink
Added a helper function for colour inversion
Browse files Browse the repository at this point in the history
  • Loading branch information
enkiv2 committed Jul 14, 2011
1 parent 6a37499 commit 2d8e856
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/vga.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void write(char c);
void putch(char c);
void puts(char* c);
void scroll(int numlines);
void invertattr();
void setattr(char attr);
void cls();
#endif
Expand Down
Binary file modified src/fd.img
Binary file not shown.
2 changes: 1 addition & 1 deletion src/ix_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void kmain(unsigned long magic, unsigned long addr) {
locate(5, 9);
puts("PRESS ANY KEY TO CONTINUE");
while(kb_buf=='\0') {
setattr(color<<4 | color>>4);
invertattr();
locate(5, 9);
puts("PRESS ANY KEY TO CONTINUE");
timer_wait(9);
Expand Down
4 changes: 4 additions & 0 deletions src/vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ void scroll(int numlines) { //@
}
}

void invertattr() { //@ inverts the current colour scheme
setattr(color<<4|color>>4);
}

void setattr(char attr) { //@ attr is in vga color mode format
color = attr;
}
Expand Down

0 comments on commit 2d8e856

Please sign in to comment.