commit 820b923e9d99e71684cc5e079f14cccf783dcebe
parent f22df7b05b163af203ce1ac244eb49245b459a92
Author: Matsuda Kenji <info@mtkn.jp>
Date: Sat, 30 Mar 2024 14:33:23 +0900
draw rising sun
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel.c b/kernel.c
@@ -13,9 +13,15 @@ kernel_main(void *dummy0, void *dummy1, void *dummy2,
uint32_t hrez = gop->Mode->Info->HorizontalResolution;
uint32_t vrez = gop->Mode->Info->VerticalResolution;
uint32_t sl = gop->Mode->Info->PixelsPerScanLine;
+ uint32_t cx = hrez / 2;
+ uint32_t cy = vrez / 2;
for (int i = 0; i < vrez; i++) {
for (int j = 0; j < hrez; j++) {
- fb_base[i * sl + j] = (j % 0xff) << 8;
+ if ((cx-j)*(cx-j) + (cy-i)*(cy-i) < (vrez/3) * (vrez/3)) {
+ fb_base[i * sl + j] = 0xff << 16;
+ } else {
+ fb_base[i * sl + j] = 0xffffff;
+ }
}
}
for(;;);