diff options
author | Marvin Borner | 2019-10-30 00:03:36 +0100 |
---|---|---|
committer | Marvin Borner | 2019-10-30 00:03:36 +0100 |
commit | fd4f0a11126a20e75d72f8f2e6d418598fd5f37d (patch) | |
tree | 5f7beaab1491dfa2503733896178c940ecc6ffa2 | |
parent | dfcbd48ed43adce2dacd2125f2b031195de48014 (diff) |
Added better font resizing
-rw-r--r-- | src/kernel/graphics/vesa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c index 3759d35..8347c56 100644 --- a/src/kernel/graphics/vesa.c +++ b/src/kernel/graphics/vesa.c @@ -171,7 +171,9 @@ void set_optimal_resolution() { vbe_set_mode(highest); - vesa_set_font(24); + if (vbe_height > 1440) vesa_set_font(32); + else if (vbe_height > 720) vesa_set_font(24); + else vesa_set_font(16); vesa_set_color(default_text_color); vesa_clear(); @@ -212,7 +214,7 @@ void vesa_convert_color(uint32_t *color_array, uint32_t color) { uint8_t blue = color & 255; if ((vbe_bpl << 3) == 8) { - uint32_t new_color = ((red * 7 / 255) << 5) + ((green * 7 / 255) << 2) + (blue * 3 / 256); + uint32_t new_color = ((red * 7 / 255) << 5) + ((green * 7 / 255) << 2) + (blue * 3 / 255); color_array[0] = (new_color >> 16) & 255; color_array[1] = (new_color >> 8) & 255; color_array[2] = new_color & 255; |