Bigger runes?

This commit is contained in:
xamidev
2024-08-19 13:18:03 +02:00
parent 6ce5264b43
commit 1ebed970c8
2 changed files with 12 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
#include "../libc/stdint.h" #include "../libc/stdint.h"
#include "framebuffer.h" #include "framebuffer.h"
#include "serial.h"
//extern uint32_t *g_framebuffer; //extern uint32_t *g_framebuffer;
@@ -14,8 +15,9 @@ void putpixel(uint32_t* fb, int pitch, int bpp, int x, int y, uint32_t color) //
void draw_char(uint32_t* fb, int pitch, int bpp, int x, int y, char c, uint32_t fg_color, uint32_t bg_color) void draw_char(uint32_t* fb, int pitch, int bpp, int x, int y, char c, uint32_t fg_color, uint32_t bg_color)
{ {
const unsigned char* glyph = font[(unsigned char)c]; const unsigned char* glyph = font[(unsigned char)c];
int glyph_width = 8; //serial_printf(3, "glyph= %c\r\n", glyph);
int glyph_height = 16; int glyph_width = 16;
int glyph_height = 32;
for (int py=0; py < glyph_height; py++) for (int py=0; py < glyph_height; py++)
{ {

View File

@@ -39,7 +39,7 @@ unsigned int g_multiboot_info_address;
uint32_t white = 0xFFFFFFFF; uint32_t white = 0xFFFFFFFF;
uint32_t black = 0x00000000; uint32_t black = 0x00000000;
uint32_t red = 0x00FF0000;
void kmain(multiboot2_info *mb_info) void kmain(multiboot2_info *mb_info)
{ {
@@ -75,20 +75,23 @@ serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
uint32_t pitch = fb_info->framebuffer_pitch; uint32_t pitch = fb_info->framebuffer_pitch;
uint32_t bpp = fb_info->framebuffer_bpp; uint32_t bpp = fb_info->framebuffer_bpp;
int y_offset = 0; int y_offset = 0;
for (int c=0; c<512; c++) for (int c=0; c<512; c++)
{ {
draw_char(framebuffer, (int)pitch, (int)bpp, 50+(c-65)*16, 20+y_offset, c, white, black); draw_char(framebuffer, (int)pitch, (int)bpp, 20+(c-65)*16, 110+y_offset, c, white, black);
if (c%100 == 0) y_offset += 30; if (c%100 == 0) y_offset += 30;
} }
/*
for (uint32_t y = 0; y < 100; y++) { for (uint32_t y = 0; y < 100; y++) {
for (uint32_t x = 0; x < 100; x++) { for (uint32_t x = 0; x < 100; x++) {
framebuffer[y * (pitch / 4) + x] = 0xFF0000; // Rouge putpixel(framebuffer, (int)pitch, (int)bpp, x, y, red);
//framebuffer[y * (pitch / 4) + x] = 0xFF0000; // Rouge
} }
} }
*/
log("Drew to framebuffer.\r\n", 3); log("Drew to framebuffer.\r\n", 3);
} }
puts("This should NOT work."); puts("This should NOT work.");