[refactor] 整理注释

This commit is contained in:
2026-06-06 10:31:20 +08:00
Unverified
parent a9ba4457c6
commit 30d48d2881
19 changed files with 177 additions and 192 deletions
+2 -8
View File
@@ -8,13 +8,7 @@ void pf_print_char(char c, SUINT32 basex, SUINT32 basey, EFI_GRAPHICS_OUTPUT_BLT
for (SUINT32 y = 0; y < 16; y++) {
SUINT8 data = hankaku_pixels[c][y];
for (SSINT32 x = 7; x >= 0; x--) {
// 解码Hankaku字体
/*
既然都在这了,就讲一下Hankaku字体是如何解码的
比如一个
{0x00, 0x82, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00}
每一个Hex代表一行,比如0x82就是一行,转换成Bin得到10000010,1代表有像素,0代表没像素
*/
// Hankaku 字体解码:每个字节代表一行,低位在右
SUINT32 current = data & 1;
data >>= 1;
if (current)
@@ -26,6 +20,6 @@ void pf_print_char(char c, SUINT32 basex, SUINT32 basey, EFI_GRAPHICS_OUTPUT_BLT
void pf_print(const char* text, SUINT32 basex, SUINT32 basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) {
for (SUINT32 i = 0; i < str_len(text); i++) {
char c = text[i];
pf_print_char(c, basex + i * 8, basey, color); // 只要 字数 * 8 + basex 不爆hr就没事
pf_print_char(c, basex + i * 8, basey, color);
}
}