Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int drawChar(size_t pos_x, size_t pos_y, uint8_t character, uint32_t color)
- {
- uint8_t glyph[] = {0x00, 0x00, 0x00, 0x7E, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00};
- uint8_t bit_shift = 1;
- size_t i = 0;
- while (i < 16)
- {
- if (glyph[i] & bit_shift)
- *(uint32_t*)((uintptr_t)framebuffer + fb_info.framebuffer_pitch * pos_y + (fb_info.framebuffer_bpp / 8) * pos_x) = color;
- else
- *(uint32_t*)((uintptr_t)framebuffer + fb_info.framebuffer_pitch * pos_y + (fb_info.framebuffer_bpp / 8) * pos_x) = 0;
- if (bit_shift != 8)
- {
- bit_shift++;
- pos_x++;
- }
- else
- {
- pos_x = 0;
- pos_y++;
- i++;
- bit_shift = 1;
- }
- }
- return 0;
- }
- drawChar(0, 0, 0, 0x008000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement