summaryrefslogtreecommitdiff
path: root/terminal/terminal.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-24 03:32:14 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-24 03:32:14 +0200
commitfbbbc75200008e2b603e5b7df8cd2e1a5d17483b (patch)
treeeb78fa27e182fd840b02f603cef3a1df97a53249 /terminal/terminal.c
parentf5d8d7bee20742a7a101665ebca630ff8e05d77b (diff)
syscalls and terminal functionality for GAMING mode
Diffstat (limited to 'terminal/terminal.c')
-rw-r--r--terminal/terminal.c13
1 files changed, 7 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 //
{