29 lines
702 B
C++
29 lines
702 B
C++
#include <hilbert/syscall.hpp>
|
|
|
|
using hilbert::syscall::encoded_color;
|
|
using hilbert::syscall::color;
|
|
|
|
encoded_color *fb;
|
|
uint32_t fb_width;
|
|
uint32_t fb_height;
|
|
uint32_t fb_pitch;
|
|
|
|
int main(int, char **) {
|
|
|
|
hilbert::syscall::get_framebuffer(fb, fb_width, fb_height, fb_pitch);
|
|
for (uint32_t y = 0; y < fb_height; ++y)
|
|
for (uint32_t x = 0; x < fb_width; ++x) {
|
|
color c = {
|
|
.r = 0,
|
|
.g = (uint8_t)(y * 255 / fb_height),
|
|
.b = (uint8_t)(x * 255 / fb_width)
|
|
};
|
|
fb[y * fb_pitch + x] = hilbert::syscall::encode_color(c);
|
|
}
|
|
|
|
//*(int *)0x12345678 = 0;
|
|
//fb_width = *(uint32_t *)0xffffffffc0000000;
|
|
//return 100 / (uint8_t)(uint64_t)fb;
|
|
return 0;
|
|
|
|
}
|