diff options
| author | Michal Idziorek <m.i@gmx.at> | 2015-05-24 03:32:14 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2015-05-24 03:32:14 +0200 |
| commit | fbbbc75200008e2b603e5b7df8cd2e1a5d17483b (patch) | |
| tree | eb78fa27e182fd840b02f603cef3a1df97a53249 /terminal | |
| parent | f5d8d7bee20742a7a101665ebca630ff8e05d77b (diff) | |
syscalls and terminal functionality for GAMING mode
Diffstat (limited to 'terminal')
| -rw-r--r-- | terminal/terminal.c | 13 | ||||
| -rw-r--r-- | terminal/terminal.h | 4 |
2 files changed, 11 insertions, 6 deletions
diff --git a/terminal/terminal.c b/terminal/terminal.c index 7fc6f93..ccea64e 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -8,9 +8,6 @@ #include "kernel/kmalloc.h" #include "driver/screen.h" -#define SET_LFNL true -#define SET_BUFF false -#define SET_ECHO true typedef enum { @@ -238,6 +235,10 @@ terminal_tty terminal_init(term_out *screen,term_in *input) tty.data=kballoc(2); + tty.set_buff=true; + tty.set_lfnl=true; + tty.set_echo=true; + tty.command=kballoc(1); tty.command_l=0; @@ -262,9 +263,9 @@ terminal_tty terminal_init(term_out *screen,term_in *input) void terminal_kb(terminal_tty *tty, uint8_t c) { - if(SET_ECHO)terminal_put(tty,c); + if(tty->set_echo)terminal_put(tty,c); - if(SET_BUFF) + if(tty->set_buff) { tty->command[tty->command_l]=c; (tty->command_l)++; @@ -328,7 +329,7 @@ bool terminal_put(terminal_tty *tty, uint8_t c) set_char(tty,x,tty->y,' ',tty->fg,tty->bg); } tty->y++; - if(SET_LFNL)tty->x=0; + if(tty->set_lfnl)tty->x=0; } else // { diff --git a/terminal/terminal.h b/terminal/terminal.h index e97a413..5e97cc1 100644 --- a/terminal/terminal.h +++ b/terminal/terminal.h @@ -48,6 +48,10 @@ typedef struct terminal_tty_struct uint8_t fg; uint8_t bg; + bool set_buff; + bool set_lfnl; + bool set_echo; + uint32_t width; uint32_t height; uint32_t x; |
