summaryrefslogtreecommitdiff
path: root/src/kernel/dev
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/dev')
-rw-r--r--src/kernel/dev/display.h2
-rw-r--r--src/kernel/dev/vgatxt.cpp22
2 files changed, 15 insertions, 9 deletions
diff --git a/src/kernel/dev/display.h b/src/kernel/dev/display.h
index 6960b7d..ec67e7e 100644
--- a/src/kernel/dev/display.h
+++ b/src/kernel/dev/display.h
@@ -11,6 +11,8 @@
#define TC_PURPLE 5
#define TC_BROWN 6
#define TC_LIGHTGRAY 7
+#define TC_MAKE_LIGHT 8
+#define TC_MAKE_DARK (~8)
#define TC_WHITE 15
class vt;
diff --git a/src/kernel/dev/vgatxt.cpp b/src/kernel/dev/vgatxt.cpp
index 75071fb..eb57eb9 100644
--- a/src/kernel/dev/vgatxt.cpp
+++ b/src/kernel/dev/vgatxt.cpp
@@ -35,16 +35,20 @@ void vgatxt::text_put(int l, int c, int ch, uint8_t fgcolor, uint8_t bgcolor) {
void vgatxt::text_scroll(int n, uint8_t fgcolor, uint8_t bgcolor) {
//TODO: optimize
- for (int i = 0; i < n; i++) {
+ if (n > 0) {
+ for (int i = 0; i < n; i++) {
+
+ uint16_t blank = (((bgcolor << 4) | fgcolor) << 8) | 0x20;
+ int j;
+ for (j = 0; j < 80*24; j++) {
+ video_memory[j] = video_memory[j+80];
+ }
+ for (j = 80*24; j < 80*25; j++) {
+ video_memory[j] = blank;
+ }
- uint16_t blank = (((bgcolor << 4) | fgcolor) << 8) | 0x20;
- int j;
- for (j = 0; j < 80*24; j++) {
- video_memory[j] = video_memory[j+80];
}
- for (j = 80*24; j < 80*25; j++) {
- video_memory[j] = blank;
- }
-
+ } else if (n < 0) {
+ // TODO
}
}