kernels,typing-game: clear screen by scanline

* we can leverage memcpy() to speedup
This commit is contained in:
Zihao Yu 2024-01-16 23:55:38 +08:00
parent ade50b257a
commit d41f447c17

View file

@ -114,10 +114,12 @@ void video_init() {
for (int i = 0; i < CHAR_W * CHAR_H; i++) for (int i = 0; i < CHAR_W * CHAR_H; i++)
blank[i] = COL_PURPLE; blank[i] = COL_PURPLE;
for (int x = 0; x < screen_w; x += CHAR_W) uint32_t blank_line[screen_w];
for (int y = 0; y < screen_h; y += CHAR_H) { for (int i = 0; i < screen_w; i++)
io_write(AM_GPU_FBDRAW, x, y, blank, min(CHAR_W, screen_w - x), min(CHAR_H, screen_h - y), false); blank_line[i] = COL_PURPLE;
}
for (int y = 0; y < screen_h; y ++)
io_write(AM_GPU_FBDRAW, 0, y, blank_line, screen_w, 1, false);
for (int ch = 0; ch < 26; ch++) { for (int ch = 0; ch < 26; ch++) {
char *c = &font[CHAR_H * ch]; char *c = &font[CHAR_H * ch];