From ebefc855669d743c0ede5b69c259c598c820cce2 Mon Sep 17 00:00:00 2001 From: able Date: Sat, 11 May 2024 15:21:07 -0500 Subject: [PATCH] :3 Breaky --- hblang/examples/fb_driver.hb | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 hblang/examples/fb_driver.hb diff --git a/hblang/examples/fb_driver.hb b/hblang/examples/fb_driver.hb new file mode 100644 index 00000000..ce3cdaf1 --- /dev/null +++ b/hblang/examples/fb_driver.hb @@ -0,0 +1,38 @@ +arm_fb_ptr := ||:int return 100; +x86_fb_ptr := ||:int return 100; + + +check_platform:= ||: int { + + return x86_fb_ptr(); +} + +set_pixel := |x: int, y: int, r: u8, g: u8, b: u8|: int := { + pix_offset := y * width + x; + + return 0; +} + +main := ||: int { + fb_ptr := check_platform(); + + width := 1024; + height := 768; + x:= 0; + y:= 0; + + loop { + if x <= height + 1 { + set_pixel(x,y,100,100,100); + x= x + 1; + } else { + set_pixel(x,y,100,100,100); + x := 0; + y = y + 1; + } + if y == width { + break; + } + } + return 0; +}