mirror of https://github.com/E-Almqvist/eOS
parent
e58ec4a2ef
commit
e429ac6102
@ -1,9 +1,14 @@ |
||||
#include "../drivers/vga.h" |
||||
#include "../lib/strf.h" |
||||
|
||||
void main() { |
||||
vga_init(); // Initialize the screen first
|
||||
// i.e. clear the screen et cetera.
|
||||
|
||||
int test = 1234; |
||||
char* teststr = int_to_str(test); |
||||
println(teststr, 0xf0); |
||||
|
||||
set_cursor_pos(28, 2); |
||||
print("eOS Version 0.1 2021", 0xf0); |
||||
} |
||||
|
@ -1,9 +1,15 @@ |
||||
#include "lib/strf.h" |
||||
#include "strf.h" |
||||
|
||||
#define int_offset 48 |
||||
// 0:48 - 9:57
|
||||
|
||||
char* int_to_str(int i) { |
||||
char* strbuf; |
||||
double num = (double)i; |
||||
char* strbuf = "XXXXXX"; |
||||
|
||||
while( i > 0 ) { |
||||
*(strbuf + 1) = (i % 10) + int_offset; |
||||
i /= 10; |
||||
} |
||||
|
||||
return strbuf; |
||||
} |
||||
|
Loading…
Reference in new issue