holey-bytes/hblang/examples/fb_driver.hb

37 lines
620 B
Plaintext
Raw Normal View History

2024-05-12 04:52:58 -05:00
arm_fb_ptr := fn(): int return 100;
x86_fb_ptr := fn(): int return 100;
2024-05-11 15:21:07 -05:00
2024-05-12 04:52:58 -05:00
check_platform := fn(): int {
2024-05-11 15:21:07 -05:00
return x86_fb_ptr();
}
2024-05-12 04:52:58 -05:00
set_pixel := fn(x: int, y: int, width: int): int {
2024-05-11 15:21:07 -05:00
pix_offset := y * width + x;
return 0;
}
2024-05-12 04:52:58 -05:00
main := fn(): int {
fb_ptr := check_platform();
width := 100;
height := 30;
2024-05-11 15:21:07 -05:00
x:= 0;
y:= 0;
loop {
if x <= height + 1 {
2024-05-12 04:52:58 -05:00
set_pixel(x,y,width);
x = x + 1;
2024-05-11 15:21:07 -05:00
} else {
2024-05-12 04:52:58 -05:00
set_pixel(x,y,width);
x = 0;
2024-05-11 15:21:07 -05:00
y = y + 1;
}
if y == width {
break;
}
}
return 0;
}