From 4433d2ef850993e52a328247bb88467511c33e68 Mon Sep 17 00:00:00 2001 From: pyao12 Date: Sun, 10 May 2026 18:55:48 +0800 Subject: [PATCH] [feat] hankaku print --- Makefile | 8 +- README.md | 4 +- fonts/README.md | 7 + fonts/pixel_font.cpp | 22 ++++ graphics/context.cpp | 10 ++ graphics/draw.cpp | 9 +- include/common.h | 7 + include/fonts/pixel_font.h | 6 + include/fonts/sylva_sd.h | 261 +++++++++++++++++++++++++++++++++++++ include/graphics/context.h | 14 ++ include/graphics/draw.h | 4 +- kernel/main.cpp | 18 ++- 12 files changed, 348 insertions(+), 22 deletions(-) create mode 100644 fonts/README.md create mode 100644 fonts/pixel_font.cpp create mode 100644 graphics/context.cpp create mode 100644 include/common.h create mode 100644 include/fonts/pixel_font.h create mode 100644 include/fonts/sylva_sd.h create mode 100644 include/graphics/context.h diff --git a/Makefile b/Makefile index b0d65d3..0f7fbdb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CFLAGS = -Iinclude -Ignu-efi/inc -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -std=c11 -CXXFLAGS = -Iinclude -Ignu-efi/inc -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -maccumulate-outgoing-args -std=c++17 +CFLAGS = -Iinclude -Ignu-efi/inc -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -std=c17 -Wwrite-strings +CXXFLAGS = -Iinclude -Ignu-efi/inc -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -maccumulate-outgoing-args -std=c++17 -Wwrite-strings LDFLAGS = -shared -Bsymbolic -Lgnu-efi/x86_64/lib -Lgnu-efi/x86_64/gnuefi -Tgnu-efi/gnuefi/elf_x86_64_efi.lds LDLIBS = -lgnuefi -lefi --no-undefined @@ -8,11 +8,11 @@ SRC_CPP = $(wildcard */*.cpp) OBJ = $(SRC_C:%.c=build/%.o) $(SRC_CPP:%.cpp=build/%.o) _bd: - @mkdir -p build/graphics build/kernel + @mkdir -p build/graphics build/kernel build/fonts all: _bd $(OBJ) @echo "* Linking EFI..." - @ld $(LDFLAGS) gnu-efi/x86_64/gnuefi/crt0-efi-x86_64.o build/boot.o build/graphics/draw.o build/kernel/main.o -o build/boot.so $(LDLIBS) + @ld $(LDFLAGS) gnu-efi/x86_64/gnuefi/crt0-efi-x86_64.o build/boot.o build/graphics/draw.o build/graphics/context.o build/kernel/main.o build/fonts/pixel_font.o -o build/boot.so $(LDLIBS) @objcopy -j .text -j .sdata -j .data -j .rodata -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --output-target efi-app-x86_64 --subsystem=10 build/boot.so build/BOOTX64.EFI build/%.o: %.c diff --git a/README.md b/README.md index 98f4cd0..fd69e3d 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ Sylva源于拉丁语“森林”,就是本操作系统的宗旨:简单、绿色、清新。 -本操作系统在[GPL-3.0](LICENSE)协议下开源,欢迎各位fork二次开发,或是为提交Issues或PR做出贡献。 \ No newline at end of file +本操作系统在[GPL-3.0](LICENSE)协议下开源,欢迎各位fork二次开发,或是为提交Issues或PR做出贡献。 + +你可能还需要看看:[字体使用声明](fonts/resources/README.md) \ No newline at end of file diff --git a/fonts/README.md b/fonts/README.md new file mode 100644 index 0000000..de30350 --- /dev/null +++ b/fonts/README.md @@ -0,0 +1,7 @@ +# 字体使用声明 + +本系统引用了下列字体: + +- Hankaku + +并在相关协议下使用。 \ No newline at end of file diff --git a/fonts/pixel_font.cpp b/fonts/pixel_font.cpp new file mode 100644 index 0000000..1aef619 --- /dev/null +++ b/fonts/pixel_font.cpp @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +void pf_print_char(char c, unsigned int basex, unsigned int basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) { + for (unsigned int y = 0; y < 16; y++) { + unsigned char data = hankaku_pixels[c][y]; + for (int x = 7; x >= 0; x--) { + unsigned int current = data & 1; + data >>= 1; + if (current) + draw_pixel(basex + x, basey + y, color); + } + } +} + +void pf_print(char* text, unsigned int basex, unsigned int basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) { + for (unsigned int i = 0; i < strlen(text); i++) { + pf_print_char(text[i], basex + 9 * i, basey, color); + } +} \ No newline at end of file diff --git a/graphics/context.cpp b/graphics/context.cpp new file mode 100644 index 0000000..0042ab9 --- /dev/null +++ b/graphics/context.cpp @@ -0,0 +1,10 @@ +#include + +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; +} \ No newline at end of file diff --git a/graphics/draw.cpp b/graphics/draw.cpp index fbab475..0fa9a20 100644 --- a/graphics/draw.cpp +++ b/graphics/draw.cpp @@ -1,11 +1,10 @@ -#include +#include -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; -} +} \ No newline at end of file diff --git a/include/common.h b/include/common.h new file mode 100644 index 0000000..d3e1c6f --- /dev/null +++ b/include/common.h @@ -0,0 +1,7 @@ +#pragma once + +unsigned int strlen(char* arr) { + int i = 0; + while (arr[i++] != '\0'); + return i - 1; +} \ No newline at end of file diff --git a/include/fonts/pixel_font.h b/include/fonts/pixel_font.h new file mode 100644 index 0000000..649624b --- /dev/null +++ b/include/fonts/pixel_font.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +void pf_print_char(char c, unsigned int basex, unsigned int basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color = {255, 255, 255, 255}); +void pf_print(char* text, unsigned int basex, unsigned int basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color = {255, 255, 255, 255}); \ No newline at end of file diff --git a/include/fonts/sylva_sd.h b/include/fonts/sylva_sd.h new file mode 100644 index 0000000..44fbbfe --- /dev/null +++ b/include/fonts/sylva_sd.h @@ -0,0 +1,261 @@ +#pragma once + +// Hankaku 字体 +static unsigned char hankaku_pixels[256][16] = { +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x10, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x10, 0x00, 0x00}, +{0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x00, 0x00}, +{0x00, 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x00, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}, +{0x00, 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, 0x80, 0x3e, 0x20, 0x20, 0x3c, 0x20, 0x20, 0x20, 0x00}, +{0x00, 0x70, 0x88, 0x80, 0x80, 0x80, 0x88, 0x70, 0x00, 0x3c, 0x22, 0x22, 0x3c, 0x28, 0x24, 0x22}, +{0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf8, 0x00, 0x3e, 0x20, 0x20, 0x3c, 0x20, 0x20, 0x20}, +{0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x00, 0xfe, 0x00, 0x00, 0x00}, +{0x00, 0x84, 0xc4, 0xa4, 0xa4, 0x94, 0x94, 0x8c, 0x84, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3e}, +{0x00, 0x00, 0x88, 0x88, 0x88, 0x50, 0x50, 0x20, 0x00, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x00, 0x00, 0x02, 0x0c, 0x30, 0xc0, 0x30, 0x0c, 0x02, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x06, 0x18, 0x60, 0x80, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x24, 0x24, 0x24, 0x24, 0x44, 0x84, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x08, 0xfe, 0x10, 0xfe, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x10, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x3c, 0x52, 0x20, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x18, 0x18, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00}, +{0x6c, 0x24, 0x24, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x12, 0x12, 0x12, 0x7f, 0x24, 0x24, 0x24, 0x24, 0x24, 0xfe, 0x48, 0x48, 0x48, 0x48, 0x00}, +{0x10, 0x38, 0x54, 0x92, 0x92, 0x90, 0x50, 0x38, 0x14, 0x12, 0x92, 0x92, 0x54, 0x38, 0x10, 0x10}, +{0x01, 0x61, 0x92, 0x92, 0x94, 0x94, 0x68, 0x08, 0x10, 0x16, 0x29, 0x29, 0x49, 0x49, 0x86, 0x80}, +{0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x10, 0x30, 0x4a, 0x8a, 0x84, 0x84, 0x4a, 0x31, 0x00, 0x00}, +{0x60, 0x20, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x04, 0x02}, +{0x00, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40}, +{0x00, 0x00, 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0x54, 0x92, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x20, 0x40}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00}, +{0x00, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00}, +{0x00, 0x18, 0x24, 0x24, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x24, 0x18, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x30, 0x50, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x18, 0x24, 0x42, 0x42, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x40, 0x40, 0x7e, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x82, 0x82, 0x02, 0x04, 0x38, 0x04, 0x02, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x08, 0x18, 0x18, 0x28, 0x28, 0x48, 0x48, 0x88, 0xfe, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00}, +{0x00, 0x7c, 0x40, 0x40, 0x40, 0xb8, 0xc4, 0x82, 0x02, 0x02, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x40, 0x80, 0x80, 0xb8, 0xc4, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0xfe, 0x02, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00}, +{0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x44, 0x38, 0x44, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x46, 0x3a, 0x02, 0x02, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x10, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x04, 0x08, 0x08, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00}, +{0x00, 0x18, 0x24, 0x42, 0x5a, 0xb5, 0xa5, 0xa5, 0xa5, 0x9a, 0x40, 0x40, 0x22, 0x1c, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x28, 0x28, 0x28, 0x44, 0x44, 0x44, 0x7c, 0x82, 0x82, 0x82, 0x82, 0x00, 0x00}, +{0x00, 0xf0, 0x88, 0x84, 0x84, 0x84, 0x88, 0xf8, 0x84, 0x82, 0x82, 0x82, 0x84, 0xf8, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x42, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x42, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0xf0, 0x88, 0x84, 0x84, 0x82, 0x82, 0x82, 0x82, 0x82, 0x84, 0x84, 0x88, 0xf0, 0x00, 0x00}, +{0x00, 0xfe, 0x80, 0x80, 0x80, 0x80, 0x80, 0xfc, 0x80, 0x80, 0x80, 0x80, 0x80, 0xfe, 0x00, 0x00}, +{0x00, 0xfe, 0x80, 0x80, 0x80, 0x80, 0x80, 0xfc, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00}, +{0x00, 0x18, 0x24, 0x42, 0x40, 0x80, 0x80, 0x8e, 0x82, 0x82, 0x82, 0x42, 0x66, 0x1a, 0x00, 0x00}, +{0x00, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x00, 0x00}, +{0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00}, +{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x24, 0x18, 0x00, 0x00}, +{0x00, 0x42, 0x42, 0x44, 0x44, 0x48, 0x58, 0x68, 0x64, 0x44, 0x42, 0x42, 0x41, 0x41, 0x00, 0x00}, +{0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7e, 0x00, 0x00}, +{0x00, 0x82, 0x82, 0xc6, 0xc6, 0xc6, 0xaa, 0xaa, 0xaa, 0x92, 0x92, 0x92, 0x92, 0x82, 0x00, 0x00}, +{0x00, 0x82, 0xc2, 0xc2, 0xa2, 0xa2, 0x92, 0x92, 0x92, 0x8a, 0x8a, 0x86, 0x86, 0x82, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0xf8, 0x84, 0x82, 0x82, 0x82, 0x84, 0xf8, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xba, 0x44, 0x44, 0x38, 0x08, 0x06}, +{0x00, 0xf8, 0x84, 0x82, 0x82, 0x82, 0x84, 0xf8, 0x88, 0x84, 0x84, 0x84, 0x82, 0x82, 0x00, 0x00}, +{0x00, 0x38, 0x44, 0x82, 0x82, 0x80, 0x60, 0x18, 0x04, 0x02, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x82, 0x82, 0x82, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0xaa, 0xaa, 0x6c, 0x44, 0x44, 0x44, 0x44, 0x00, 0x00}, +{0x00, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x28, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x00, 0x00}, +{0x00, 0x82, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0xfe, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0xfe, 0x00, 0x00}, +{0x1e, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1e}, +{0x00, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x00}, +{0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0}, +{0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00}, +{0x30, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x02, 0x3e, 0x42, 0x82, 0x82, 0x86, 0x7a, 0x00, 0x00}, +{0x00, 0x80, 0x80, 0x80, 0x80, 0xb8, 0xc4, 0x82, 0x82, 0x82, 0x82, 0x82, 0xc4, 0xb8, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x80, 0x80, 0x80, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x02, 0x02, 0x02, 0x02, 0x3a, 0x46, 0x82, 0x82, 0x82, 0x82, 0x82, 0x46, 0x3a, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0xfe, 0x80, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x0c, 0x10, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x44, 0x44, 0x44, 0x38, 0x40, 0x78, 0x84, 0x82, 0x82, 0x7c}, +{0x00, 0x40, 0x40, 0x40, 0x40, 0x5c, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x08, 0x08, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x60}, +{0x00, 0x40, 0x40, 0x40, 0x40, 0x42, 0x44, 0x48, 0x50, 0x68, 0x44, 0x44, 0x42, 0x42, 0x00, 0x00}, +{0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xc4, 0x82, 0x82, 0x82, 0x82, 0xc4, 0xb8, 0x80, 0x80, 0x80}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x46, 0x82, 0x82, 0x82, 0x82, 0x46, 0x3a, 0x02, 0x02, 0x02}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, 0x60, 0x18, 0x06, 0x02, 0x42, 0x3c, 0x00, 0x00}, +{0x00, 0x00, 0x10, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3a, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0xaa, 0xaa, 0x44, 0x44, 0x44, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x44, 0x28, 0x28, 0x10, 0x28, 0x28, 0x44, 0x82, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x18, 0x10, 0x10, 0x20, 0xc0}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0xfe, 0x00, 0x00}, +{0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04}, +{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, +{0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40}, +{0x00, 0x00, 0x00, 0x60, 0x92, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x00}, +{0x00, 0x3e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x7e, 0x02, 0x02, 0x02, 0x7e, 0x04, 0x04, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x24, 0x28, 0x30, 0x20, 0x40, 0x40, 0x80, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x30, 0x50, 0x90, 0x10, 0x10, 0x10, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0xfc, 0x84, 0x84, 0x88, 0x08, 0x10, 0x20, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x10, 0x10, 0x10, 0x10, 0xfe, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xfe, 0x08, 0x18, 0x28, 0x48, 0x88, 0x18, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x3e, 0xe4, 0x28, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x08, 0x08, 0x08, 0xfe, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x04, 0x04, 0x7c, 0x04, 0x04, 0x7c, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x94, 0x54, 0x44, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0x02, 0x12, 0x12, 0x14, 0x18, 0x10, 0x10, 0x20, 0x20, 0x40, 0x80, 0x00, 0x00}, +{0x00, 0x02, 0x02, 0x04, 0x04, 0x08, 0x18, 0x28, 0x48, 0x88, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x10, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x04, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x00, 0x00, 0x00}, +{0x00, 0x08, 0x08, 0x08, 0xfe, 0x08, 0x18, 0x18, 0x28, 0x28, 0x48, 0x88, 0x08, 0x18, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x10, 0xfe, 0x12, 0x12, 0x12, 0x12, 0x22, 0x22, 0x22, 0x42, 0x8c, 0x00, 0x00}, +{0x00, 0x20, 0x20, 0x3c, 0xe0, 0x10, 0x10, 0x1e, 0xf0, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00}, +{0x00, 0x20, 0x20, 0x3e, 0x22, 0x22, 0x42, 0x44, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x40, 0x40, 0x40, 0x7e, 0x48, 0x48, 0x48, 0x88, 0x08, 0x10, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xfe, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0xfe, 0x02, 0x00, 0x00, 0x00}, +{0x00, 0x24, 0x24, 0x24, 0x24, 0xfe, 0x24, 0x24, 0x24, 0x24, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00}, +{0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0xc2, 0x22, 0x04, 0x04, 0x08, 0x10, 0x20, 0xc0, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xfe, 0x04, 0x04, 0x04, 0x08, 0x08, 0x18, 0x14, 0x24, 0x42, 0x82, 0x00, 0x00}, +{0x00, 0x40, 0x40, 0x40, 0x40, 0x4e, 0x72, 0xc4, 0x48, 0x40, 0x40, 0x40, 0x40, 0x3e, 0x00, 0x00}, +{0x00, 0x00, 0x02, 0x82, 0x42, 0x42, 0x42, 0x04, 0x04, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x20, 0x20, 0x3e, 0x22, 0x42, 0x62, 0x54, 0x8c, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x02, 0x0c, 0x78, 0x08, 0x08, 0xff, 0x08, 0x08, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x00, 0x20, 0x22, 0x92, 0x92, 0x42, 0x44, 0x04, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x08, 0x08, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x20, 0x20, 0x20, 0x20, 0x30, 0x28, 0x24, 0x22, 0x22, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00}, +{0x00, 0x08, 0x08, 0x08, 0xfe, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x7e, 0x02, 0x02, 0x24, 0x14, 0x08, 0x0c, 0x14, 0x12, 0x22, 0x40, 0x80, 0x00, 0x00}, +{0x10, 0x10, 0x10, 0xfe, 0x04, 0x04, 0x08, 0x18, 0x34, 0x52, 0x92, 0x10, 0x10, 0x10, 0x00, 0x00}, +{0x00, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x08, 0x08, 0x24, 0x24, 0x24, 0x22, 0x22, 0x22, 0x22, 0x42, 0x42, 0x82, 0x00, 0x00}, +{0x00, 0x40, 0x40, 0x40, 0x42, 0x4c, 0x70, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x3e, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0x02, 0x02, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, +{0x00, 0x00, 0x20, 0x20, 0x50, 0x50, 0x88, 0x88, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x10, 0xfe, 0x10, 0x18, 0x54, 0x54, 0x52, 0x52, 0x92, 0x10, 0x30, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xfe, 0x02, 0x02, 0x04, 0x04, 0xc8, 0x30, 0x10, 0x08, 0x04, 0x04, 0x00, 0x00}, +{0x00, 0x60, 0x18, 0x04, 0x00, 0x00, 0x60, 0x18, 0x04, 0x00, 0xe0, 0x18, 0x04, 0x02, 0x00, 0x00}, +{0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x24, 0x24, 0x22, 0x4e, 0xf2, 0x02, 0x00, 0x00}, +{0x00, 0x04, 0x04, 0x04, 0x04, 0x64, 0x18, 0x08, 0x0c, 0x12, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0x20, 0x20, 0x20, 0xfe, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1e, 0x00, 0x00, 0x00}, +{0x00, 0x20, 0x20, 0x20, 0x17, 0x39, 0xd2, 0x12, 0x0c, 0x08, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x7c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0xff, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0x02, 0x02, 0x02, 0x02, 0x7e, 0x02, 0x02, 0x02, 0x02, 0x02, 0xfe, 0x00, 0x00}, +{0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x02, 0x04, 0x04, 0x08, 0x10, 0x60, 0x00, 0x00}, +{0x00, 0x04, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x04, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00}, +{0x00, 0x08, 0x08, 0x28, 0x28, 0x28, 0x28, 0x29, 0x29, 0x2a, 0x4a, 0x4c, 0x48, 0x80, 0x00, 0x00}, +{0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x42, 0x44, 0x44, 0x48, 0x50, 0x60, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xfe, 0x82, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x02, 0x04, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0xc0, 0x20, 0x02, 0x02, 0x02, 0x04, 0x04, 0x08, 0x10, 0x20, 0xc0, 0x00, 0x00}, +{0x00, 0x90, 0x48, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x60, 0x90, 0x90, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +}; \ No newline at end of file diff --git a/include/graphics/context.h b/include/graphics/context.h new file mode 100644 index 0000000..b872a21 --- /dev/null +++ b/include/graphics/context.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +struct gfx_context { + EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP; + unsigned int hr; + unsigned int vr; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL *base; +}; + +extern gfx_context g_gfx; + +void gfx_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP); \ No newline at end of file diff --git a/include/graphics/draw.h b/include/graphics/draw.h index 784e0a8..db7cbb4 100644 --- a/include/graphics/draw.h +++ b/include/graphics/draw.h @@ -1,6 +1,6 @@ #pragma once #include +#include -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); \ No newline at end of file +void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color); \ No newline at end of file diff --git a/kernel/main.cpp b/kernel/main.cpp index 4c254b8..5eef58b 100644 --- a/kernel/main.cpp +++ b/kernel/main.cpp @@ -1,6 +1,8 @@ #include #include +#include #include +#include extern "C" void kernel_main() { EFI_GUID gop_guid = {0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a}}; @@ -9,18 +11,14 @@ extern "C" void kernel_main() { uefi_call_wrapper((void*)ST->BootServices->SetWatchdogTimer, 4, 0, 0, 0, NULL); uefi_call_wrapper((void*)ST->BootServices->LocateProtocol, 3, &gop_guid, NULL, (void **)&GOP); - unsigned int hr = GOP->Mode->Info->HorizontalResolution; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL *base = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) GOP->Mode->FrameBufferBase; + gfx_init(GOP); uefi_call_wrapper((void*)ST->ConOut->SetCursorPosition, 3, ST->ConOut, 0, 5); uefi_call_wrapper((void*)ST->ConOut->OutputString, 2, ST->ConOut, L"Kernel is running!\n"); - - for (unsigned int i = 1; i <= 100; i++) { - // uefi_call_wrapper((void*)ST->ConOut->SetCursorPosition, 3, ST->ConOut, 0, i + 6); - // uefi_call_wrapper((void*)ST->ConOut->OutputString, 2, ST->ConOut, L"hello!"); - for (unsigned int j = 1; j <= 100; j++) { - draw_pixel(i, j, {255, 255, 255, 255}, GOP, hr, base); - } - } + + uefi_call_wrapper((void*)ST->ConOut->ClearScreen, 1, ST->ConOut); + + // pf_print_char('k', 10, 10); + pf_print("Welcome to Sylva OS!", 10, 10); while (1); } \ No newline at end of file