diff options
| author | Michal Idziorek <m.i@gmx.at> | 2015-05-24 04:00:01 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2015-05-24 04:00:01 +0200 |
| commit | 1b64f1e69bfbffc0e70ba3a1baff00ed3fd8cb51 (patch) | |
| tree | ff2a2deeb3e4184756d6883d3ac3c08cc42aa795 | |
| parent | fbbbc75200008e2b603e5b7df8cd2e1a5d17483b (diff) | |
experimenting with brand new gaming mode
| -rw-r--r-- | terminal/terminal.c | 2 | ||||
| -rw-r--r-- | userspace/snake.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/terminal/terminal.c b/terminal/terminal.c index ccea64e..add207a 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -309,7 +309,7 @@ bool terminal_put(terminal_tty *tty, uint8_t c) if(c==0x08) //BACKSPACE { - if(tty->x>0&&tty->command_l>0) + if(tty->x>0&&tty->command_l>0||!tty->set_echo) { set_char(tty,tty->x-1,tty->y,' ',tty->fg,tty->bg); tty->x--; diff --git a/userspace/snake.c b/userspace/snake.c index 8352d1b..7deaa6c 100644 --- a/userspace/snake.c +++ b/userspace/snake.c @@ -9,10 +9,18 @@ int main() while(1) { + uint8_t x=0; + while(!has_data_waiting()) { + x++; + putc('\b',stdout); + if(x%4==0)putc('/',stdout); + if(x%4==1)putc('-',stdout); + if(x%4==2)putc('\\',stdout); + if(x%4==3)putc('|',stdout); } char c=fgetc(stdin); |
