From bce944d1498eaa3b6940ee234c863b3548a66b37 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 24 Jan 2021 12:00:11 -0500 Subject: graphics! --- src/user/highway/main.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src/user/highway/main.c') diff --git a/src/user/highway/main.c b/src/user/highway/main.c index 4599315..60d5a69 100644 --- a/src/user/highway/main.c +++ b/src/user/highway/main.c @@ -1,17 +1,36 @@ -#include +#include +#include + +#include + +#include +#include #include + #include "cmds.h" #include "line.h" +#define FONT_NAME "berry" + void main(const char *arg) { + struct font_info *f = get_font(FONT_NAME); + + if (!f) + return; + + active_term = make_term(f, 50, 18); + if (!active_term) + return; + source(*arg ? arg : "user/default.rc"); + ensure_color(); + + term_add_sz("Portland Highway\nType \"help\" for help.\n"); + paint_term(); + char cmd_buf[128]; - yield_task(); - struct history *cmd_hs = new_history(128); - tell_user_sz("Portland Highway\nType \"help\" for help.\n"); while (1) { - tell_user_sz("\n> "); - ask_user_line_sz_with_history(cmd_buf, 127, cmd_hs); + read_line(cmd_buf, 127, "> "); run_line(cmd_buf); } } \ No newline at end of file -- cgit v1.2.3