summaryrefslogtreecommitdiff
path: root/src/c/tty.c
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2022-06-01 17:02:08 +0200
committerAleksa Vučković <aleksav013@gmail.com>2022-06-01 17:02:08 +0200
commitdd038cfb10cae6dba5afabc786a129224da5ef8c (patch)
treee9d94f187db87f880a52be2c4e7c8e276477c9ab /src/c/tty.c
parent602037ec658da6ab2f04f1c806bfccdcd8125f27 (diff)
simple snake game
Diffstat (limited to 'src/c/tty.c')
-rw-r--r--src/c/tty.c53
1 files changed, 10 insertions, 43 deletions
diff --git a/src/c/tty.c b/src/c/tty.c
index 344c720..0ec1408 100644
--- a/src/c/tty.c
+++ b/src/c/tty.c
@@ -3,9 +3,9 @@
#include<source/string.h>
#include<source/stdio.h>
#include<source/vga.h>
-
-
-extern uint32_t time;
+#include<source/shell/uptime.h>
+#include<source/shell/neofetch.h>
+#include<source/shell/game.h>
size_t pieces(char pieces[][CMD_LENGTH],char *buffer)
{
@@ -63,10 +63,6 @@ void number(size_t numberof,char parts[][CMD_LENGTH])
}
}
-void uptime(void)
-{
- printf("System uptime is: %d seconds\n",time);
-}
void prompt(void)
{
@@ -85,47 +81,15 @@ void prompt(void)
printf("$ ");
}
-void neofetch(void)
-{
- set_color(VGA_COLOR_WHITE,VGA_COLOR_BLACK);
- printf(" . "); printf("Dobrodosli u moj \n");
- printf(" J:L (\"\"\") "); printf("operativni sistem :) \n");
- printf(" |:| III "); printf("Uzivajte! \n");
- printf(" |:| III "); printf(" \n");
- printf(" |:| III "); printf("Welcome to my \n");
- printf(" |:| __III__ "); printf("operating system :) \n");
- printf(" |:| /:-.___,-:\\ "); printf("Enjoy your stay! \n");
- printf(" |:| \\] |:| [/ "); printf(" \n");
- printf(" |:| |:| "); printf(" \n");
- printf(" |:| |:| "); printf(" \n");
- printf(" |:| |:| "); printf(" \n");
- printf(" /] |:| [\\ |:| "); printf(" \n");
- printf(" \\:-'\"\"\"`-:/ |:| "); printf(" \n");
- printf(" \"\"III\"\" |:| "); printf(" \n");
- printf(" III |:| "); printf(" \n");
- printf(" III |:| "); printf(" \n");
- printf(" III |:| "); printf("napravio/made by: \n");
- printf(" (___) J:F "); printf("Aleksa Vuckovic \n");
- printf(" \" "); printf(" \n");
-
- for(size_t i=0;i<16;i++)
- {
- set_color(0,i);
- printf(" ",i);
- }
- printf("\n");
-
-
- set_color(VGA_COLOR_LIGHT_GREY,VGA_COLOR_BLACK);
- uptime();
-}
-
void help(void)
{
printf("Currently available commands:\n");
- printf("clear echo merge ls number uptime neofetch help\n");
+ printf("clear echo game merge ls number uptime neofetch help\n");
}
+extern uint8_t process_id;
+extern uint16_t* terminal_buffer;
+
void tty(char *buffer)
{
char parts[CMD_LENGTH][CMD_LENGTH];
@@ -139,5 +103,8 @@ void tty(char *buffer)
else if(stringcmp(parts[0],"uptime")) uptime();
else if(stringcmp(parts[0],"neofetch")) neofetch();
else if(stringcmp(parts[0],"help")) help();
+ else if(stringcmp(parts[0],"game")) game_init();
else printf("command not found: %s\n",parts[0]);
+
+ if (!stringcmp(parts[0],"game")) prompt();
}