diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-19 09:23:48 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-19 09:23:48 +0200 |
commit | 7b466345af0d3a7dc5622617ce443a90c64e34a4 (patch) | |
tree | f276b6bf391ccfe8ec3a2cb62a7f70964249621f /src/kernel/dev/vgatxt.cpp | |
parent | ac10c1a29c44b0cb29960cd0f792c7361bc430ce (diff) | |
download | TCE-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.cpp | 22 |
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 } } |