From ca1e725b0dc9b10997897dd2ac6d44028601d9bb Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 19 Apr 2021 19:06:28 +0200 Subject: Init sources --- src/libc/stdio.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/libc/stdio.c (limited to 'src/libc/stdio.c') diff --git a/src/libc/stdio.c b/src/libc/stdio.c new file mode 100644 index 0000000..6e0063b --- /dev/null +++ b/src/libc/stdio.c @@ -0,0 +1,25 @@ +#include "stdio.h" +#include "string.h" + +extern VIDEO_STATE VS; + +void print(char *str){ + int i=0; + while(str[i]!='\0'){ + putchar(str[i]); + i++; + } +} + +void printc(char* str,VIDEO_COLORS c){ + VIDEO_COLORS backup=VS.fg; + VS.fg=c; + print(str); + VS.fg=backup; +} + +void printi(int i){ + char str[12]; + itoa(i,str); + print(str); +} \ No newline at end of file -- cgit v1.2.3