[fix] Remove PF auto-pos
This commit is contained in:
+2
-29
@@ -3,15 +3,6 @@
|
||||
#include <graphics/draw.h>
|
||||
#include <common.h>
|
||||
|
||||
static unsigned int pf_x = 0;
|
||||
static unsigned int pf_y = 1;
|
||||
|
||||
void pf_reset_position(void) {
|
||||
// 其实应该还要清一下屏,后面思考一个安全的做法
|
||||
pf_x = 0;
|
||||
pf_y = 1;
|
||||
}
|
||||
|
||||
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];
|
||||
@@ -31,27 +22,9 @@ void pf_print_char(char c, unsigned int basex, unsigned int basey, EFI_GRAPHICS_
|
||||
}
|
||||
}
|
||||
|
||||
void pf_print(const char* text, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) {
|
||||
void pf_print(const char* text, unsigned int basex, unsigned int basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) {
|
||||
for (unsigned int i = 0; i < strlen(text); i++) {
|
||||
char c = text[i];
|
||||
if (c == '\n') {
|
||||
pf_x = 0;
|
||||
pf_y++;
|
||||
if ((pf_y - 1) * 16 >= g_gfx.vr) {
|
||||
gfx_clear();
|
||||
pf_y = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (pf_x * 9 + 9 > g_gfx.hr) {
|
||||
pf_x = 0;
|
||||
pf_y++;
|
||||
if ((pf_y - 1) * 16 >= g_gfx.vr) {
|
||||
gfx_clear();
|
||||
pf_y = 1;
|
||||
}
|
||||
}
|
||||
pf_print_char(c, pf_x * 9, (pf_y - 1) * 16, color);
|
||||
pf_x++;
|
||||
pf_print_char(c, basex + i * 8, basey, color); // 只要 字数 * 8 + basex 不爆hr就没事
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user