random changes
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "shitgui.h"
|
||||
|
||||
void console_init(SG_Context *ctx);
|
||||
void console_clear(u32 color);
|
||||
void console_set_color(u32 color);
|
||||
void kprint(const char *str);
|
||||
|
||||
|
||||
+2
-18
@@ -15,27 +15,11 @@ void kmain(Bootinfo* info) {
|
||||
sg_ctx.width = info->width;
|
||||
sg_ctx.pitch = info->pitch;
|
||||
|
||||
SG_Point p = {0};
|
||||
p.x = 0;
|
||||
p.y = 0;
|
||||
|
||||
u32 stripe_h = info->height / 5;
|
||||
|
||||
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0x5BCEFA);
|
||||
p.y += stripe_h;
|
||||
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0xF5A9B8);
|
||||
p.y += stripe_h;
|
||||
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0xFFFFFF);
|
||||
p.y += stripe_h;
|
||||
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0xF5A9B8);
|
||||
p.y += stripe_h;
|
||||
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0x5BCEFA);
|
||||
|
||||
serial_init();
|
||||
console_init(&sg_ctx);
|
||||
console_clear(0xFFFFFF);
|
||||
console_set_color(0x000000);
|
||||
kprint("Hello!!!");
|
||||
for (int i = 0; i < 1000; i++) kprint("!");
|
||||
kprint("Welcome to termOS!!!");
|
||||
|
||||
while (1) { __asm__("hlt"); }
|
||||
}
|
||||
@@ -18,6 +18,16 @@ void console_init(SG_Context *ctx) {
|
||||
s_font.base = (const unsigned char*)font8x8_basic;
|
||||
}
|
||||
|
||||
void console_clear(u32 color) {
|
||||
if (!ctx_ptr) return;
|
||||
|
||||
SG_Point p = {0, 0};
|
||||
sg_draw_rect(ctx_ptr, &p, ctx_ptr->width, ctx_ptr->height, color);
|
||||
|
||||
s_cursor_pos.x = 0;
|
||||
s_cursor_pos.y = 0;
|
||||
}
|
||||
|
||||
static void console_putc(char c) {
|
||||
serial_writec(c);
|
||||
if (!ctx_ptr) return;
|
||||
@@ -35,10 +45,12 @@ static void console_putc(char c) {
|
||||
}
|
||||
}
|
||||
|
||||
void console_set_color(u32 color) {
|
||||
s_color = color;
|
||||
}
|
||||
|
||||
|
||||
void kprint(const char *str) {
|
||||
for (int i = 0; str[i] != '\0'; i++) console_putc(str[i]);
|
||||
}
|
||||
|
||||
void console_set_color(u32 color) {
|
||||
s_color = color;
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
// im really sorry for this code
|
||||
// but its called shitgui after all
|
||||
|
||||
#include "shitgui.h"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user