diff options
Diffstat (limited to 'boot/framebuffer.zig')
| -rw-r--r-- | boot/framebuffer.zig | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/boot/framebuffer.zig b/boot/framebuffer.zig index b82e5af..e541458 100644 --- a/boot/framebuffer.zig +++ b/boot/framebuffer.zig @@ -9,18 +9,11 @@ pub const Framebuffer = limine.Framebuffer; // idk why this sounds vaguely erotic, like yeah fill me harder lol export var request: limine.FramebufferRequest linksection(".limine_requests") = .{}; -// the response pointer is written by Limine before we run, so read it through a -// volatile pointer or the optimizer assumes it's still null +// the response pointer is written by limine before we run, so read it through a +// volatile pointer or the optimizer assumes its still null pub fn get() ?*Framebuffer { const req: *volatile limine.FramebufferRequest = &request; const resp = req.response orelse return null; if (resp.framebuffer_count == 0) return null; return resp.framebuffers.?[0]; } - -// assumes the usual Limine RGB 32-bpp layout im sure i wont forget about this layout -// later and it wont fuck me over -pub fn putpixel(fb: *Framebuffer, x: usize, y: usize, color: u32) void { - const pixel: *align(1) u32 = @ptrCast(fb.address + y * fb.pitch + x * 4); - pixel.* = color; -} |
