From 4ea5261f32ec8acd4cdad7c364f57e6ebc86866a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sat, 12 Jul 2025 16:13:16 +0200 Subject: checkpoint --- graphics.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 graphics.c (limited to 'graphics.c') diff --git a/graphics.c b/graphics.c new file mode 100644 index 0000000..66a00bc --- /dev/null +++ b/graphics.c @@ -0,0 +1,32 @@ +typedef unsigned int u32; +typedef unsigned char u8; + +#define WIDTH 600 +#define HEIGHT 600 +u32 BUFFER[WIDTH * HEIGHT]; + +extern u8 __heap_base; +u32 BumpPointer = (u32)&__heap_base; + +void* Malloc(u32 Size) +{ + u32 Result = BumpPointer; + Result += Size; + return (void *)Result; +} + +void Free(u32 Size) +{ + BumpPointer -= Size; +} + +void go(u32 *Pixels, int Width, int Height) { + for(int Y = 0; Y < Height; Y++) + { + for(int X = 0; X < Width; X++) + { + u32 Color = 0xFFFF0000; + Pixels[Y*Width + X] = Color; + } + } +} -- cgit v1.2.3-70-g09d2