aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-13 14:46:15 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-13 14:46:53 +0100
commit243e6d72928d1fc4cf20366eab9007980b945458 (patch)
treeb4b2a22d4ef4cbb33c8c17f904f82cde73093ea6 /src/lib
parentfb5efb630ab93893f8bb3036acbb591591a03032 (diff)
downloadkogata-243e6d72928d1fc4cf20366eab9007980b945458.tar.gz
kogata-243e6d72928d1fc4cf20366eab9007980b945458.zip
Begin implement terminal
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/include/draw.h2
-rw-r--r--src/lib/include/keyboard.h3
-rw-r--r--src/lib/libkogata/draw.c8
-rw-r--r--src/lib/libkogata/gip.c2
4 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/include/draw.h b/src/lib/include/draw.h
index 893c5a3..5296b92 100644
--- a/src/lib/include/draw.h
+++ b/src/lib/include/draw.h
@@ -48,6 +48,8 @@ void g_fillcircle(fb_t *fb, int cx, int cy, int r, color_t c);
void g_blit(fb_t *dst, int x, int y, fb_t *src);
void g_blit_region(fb_t *dst, int x, int y, fb_t *src, fb_region_t reg);
+void g_scroll_up(fb_t *fb, int l);
+
// ---- Text manipulation
font_t *g_load_font(const char* fontname);
diff --git a/src/lib/include/keyboard.h b/src/lib/include/keyboard.h
index 2842936..0d5a97a 100644
--- a/src/lib/include/keyboard.h
+++ b/src/lib/include/keyboard.h
@@ -1,7 +1,8 @@
#pragma once
-#include <proto/keymap_file.h>
+#include <proto/keyboard.h>
+#include <proto/keymap_file.h>
#define KBD_CHAR 0x01
#define KBD_ALT 0x02
diff --git a/src/lib/libkogata/draw.c b/src/lib/libkogata/draw.c
index b9ef9bc..0536c03 100644
--- a/src/lib/libkogata/draw.c
+++ b/src/lib/libkogata/draw.c
@@ -208,6 +208,14 @@ void g_blit_region(fb_t *dst, int x, int y, fb_t *src, fb_region_t reg) {
}
}
+void g_scroll_up(fb_t *dst, int l) {
+ for (unsigned y = 0; y < dst->geom.height - l; y++) {
+ memcpy(dst->data + y * dst->geom.pitch,
+ dst->data + (y + l) * dst->geom.pitch,
+ dst->geom.pitch);
+ }
+}
+
// ---- Text manipulation
#define FONT_ASCII_BITMAP 1
diff --git a/src/lib/libkogata/gip.c b/src/lib/libkogata/gip.c
index 852cc05..cdfeb71 100644
--- a/src/lib/libkogata/gip.c
+++ b/src/lib/libkogata/gip.c
@@ -137,7 +137,7 @@ void giph_msg_header(mainloop_fd_t *fd) {
ASSERT(fd == &h->mainloop_item);
int code = h->msg_buf.code;
- dbg_printf("Got GIP header, code %d\n", code);
+ /*dbg_printf("Got GIP header, code %d\n", code);*/
noarg_gip_callback_t use_cb = 0;
if (code == GIPC_RESET) {