summaryrefslogtreecommitdiff
path: root/src/kernel/dev/vgatxt.cpp
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-19 09:23:48 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-19 09:23:48 +0200
commit7b466345af0d3a7dc5622617ce443a90c64e34a4 (patch)
treef276b6bf391ccfe8ec3a2cb62a7f70964249621f /src/kernel/dev/vgatxt.cpp
parentac10c1a29c44b0cb29960cd0f792c7361bc430ce (diff)
downloadTCE-7b466345af0d3a7dc5622617ce443a90c64e34a4.tar.gz
TCE-7b466345af0d3a7dc5622617ce443a90c64e34a4.zip
Added ANSI support, minimal readline-like library.
Diffstat (limited to 'src/kernel/dev/vgatxt.cpp')
-rw-r--r--src/kernel/dev/vgatxt.cpp22
1 files changed, 13 insertions, 9 deletions
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
}
}