From fbbbc75200008e2b603e5b7df8cd2e1a5d17483b Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Sun, 24 May 2015 03:32:14 +0200 Subject: syscalls and terminal functionality for GAMING mode --- userspace/snake.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'userspace/snake.c') 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 } -- cgit v1.2.3