summaryrefslogtreecommitdiff
path: root/src/cmd/vterm/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/vterm/draw.c')
-rw-r--r--src/cmd/vterm/draw.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cmd/vterm/draw.c b/src/cmd/vterm/draw.c
new file mode 100644
index 0000000..ee36a0f
--- /dev/null
+++ b/src/cmd/vterm/draw.c
@@ -0,0 +1,17 @@
+#include "vterm.h"
+#include <camellia/execbuf.h>
+#include <camellia/syscalls.h>
+#include <string.h>
+
+struct framebuf fb;
+struct rect dirty;
+
+void scroll(void) {
+ size_t row_len = fb.pitch * font.h;
+ memmove(fb.b, fb.b + row_len, fb.len - row_len);
+ memset(fb.b + fb.len - row_len, 0, row_len);
+ cursor.y--;
+
+ dirty.x1 = 0; dirty.y1 = 0;
+ dirty.x2 = ~0; dirty.y2 = ~0;
+}