From e9c31cf19a30bd2d9960ce8341fea9cbfc973f7a Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 22 Jul 2020 19:57:16 +0200 Subject: Added basic malloc (WARNING: DUMB!) :) --- src/drivers/vesa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/vesa.c b/src/drivers/vesa.c index ca130db..54e7e34 100644 --- a/src/drivers/vesa.c +++ b/src/drivers/vesa.c @@ -1,25 +1,25 @@ #include #include -void vesa_draw_rectangle(int x1, int y1, int x2, int y2, const u32 color[3]) +void vesa_draw_rectangle(int x1, int y1, int x2, int y2, const u8 color[3]) { int vbe_bpl = vbe->bpp >> 3; int vbe_pitch = vbe->pitch; u8 *fb = (u8 *)vbe->framebuffer; int pos1 = x1 * vbe_bpl + y1 * vbe_pitch; - char *draw = (char *)&fb[pos1]; + u8 *draw = &fb[pos1]; for (int i = 0; i <= y2 - y1; i++) { for (int j = 0; j <= x2 - x1; j++) { - draw[vbe_bpl * j] = (char)color[2]; - draw[vbe_bpl * j + 1] = (char)color[1]; - draw[vbe_bpl * j + 2] = (char)color[0]; + draw[vbe_bpl * j] = color[2]; + draw[vbe_bpl * j + 1] = color[1]; + draw[vbe_bpl * j + 2] = color[0]; } draw += vbe_pitch; } } -void vesa_clear(const u32 color[3]) +void vesa_fill(const u8 color[3]) { vesa_draw_rectangle(0, 0, vbe->width - 1, vbe->height - 1, color); } -- cgit v1.2.3