[feat] hankaku print

This commit is contained in:
2026-05-10 18:55:48 +08:00
Unverified
parent 4356f88dfb
commit 4433d2ef85
12 changed files with 348 additions and 22 deletions
+10
View File
@@ -0,0 +1,10 @@
#include <graphics/context.h>
gfx_context g_gfx;
void gfx_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP) {
g_gfx.GOP = GOP;
g_gfx.hr = GOP->Mode->Info->HorizontalResolution;
g_gfx.vr = GOP->Mode->Info->VerticalResolution;
g_gfx.base = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) GOP->Mode->FrameBufferBase;
}
+4 -5
View File
@@ -1,11 +1,10 @@
#include <efi.h>
#include <graphics/draw.h>
void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color,
EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP, unsigned int hr, EFI_GRAPHICS_OUTPUT_BLT_PIXEL *base) {
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *p = base + (hr * y) + x;
void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) {
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *p = g_gfx.base + (g_gfx.hr * y) + x;
p->Blue = color.Blue;
p->Green = color.Green;
p->Red = color.Red;
p->Reserved = color.Reserved;
}
}