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 /userspace/snake.c | |
| parent | f5d8d7bee20742a7a101665ebca630ff8e05d77b (diff) | |
syscalls and terminal functionality for GAMING mode
Diffstat (limited to 'userspace/snake.c')
| -rw-r--r-- | userspace/snake.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/userspace/snake.c b/userspace/snake.c index aedf191..8352d1b 100644 --- a/userspace/snake.c +++ b/userspace/snake.c @@ -3,11 +3,23 @@ int main() { printf("Hello I am FoolSnake 0.1\n"); - printf("setvbuf returned %i",setvbuf(stdin,NULL,_IONBF,0)); + printf("setvbuf returned %i\n",setvbuf(stdin,NULL,_IONBF,0)); + + fool_tune(1,0,0); // activate gaming mode while(1) { - printf("%c",fgetc(stdin)); + while(!has_data_waiting()) + { + + } + + char c=fgetc(stdin); + printf("[%c]\n",c); + if(c=='q')break; + } + + fool_tune(0,0,0); // de-activate gaming mode } |
