From 2a864eb3668d164b75f9b6005926d53ededa8a55 Mon Sep 17 00:00:00 2001 From: Tom-on64 Date: Fri, 19 Apr 2024 15:45:54 +0200 Subject: [PATCH] Made text 2x bigger so it's readable!\nProbably should find a better way to do this --- include/screen.h | 17 +++++++++++------ src/kernel.c | 2 +- todo.txt | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/screen.h b/include/screen.h index 7364169..99cf6ef 100644 --- a/include/screen.h +++ b/include/screen.h @@ -25,16 +25,21 @@ void setupScreen() { bytesPerScanline = *(uint16_t*)(MODE_INFO_BLOCK + 16); // Bytes per scanline location } +// TODO: Probably make the font bigger in a better way, but this works for now void putcAt(char c, uint32_t x, uint32_t y) { - uint32_t offset = WIDTH * y * 16 + x * 8; + uint32_t offset = (WIDTH * y * 16 + x * 8) * 2; char* bitmap = &font[(c-1) * 16]; - for (uint8_t i = 0; i < 16; i++) { // Rows - char bitmapRow = bitmap[i]; - for (uint8_t j = 0; j < 8; j++) { // Cols + for (uint8_t i = 0; i < 32; i++) { // Rows (16*2 since we draw font 2x larger) + char bitmapRow = bitmap[i/2]; // Idk if this should work, because i'm scared of division + + for (uint8_t j = 0; j < 16; j++) { // Cols (8*2 same as rows) vidmem[offset + j] = (bitmapRow & 0x80) ? FG_COLOR : BG_COLOR; - bitmapRow = bitmapRow << 1; - } + if (j % 2) { + bitmapRow = bitmapRow << 1; + } + } + offset += WIDTH; } } diff --git a/src/kernel.c b/src/kernel.c index a7fcf7e..1bbdd65 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -11,7 +11,7 @@ #define PROMPT "#> " // TODO: Put this at a set address -char filetable[512] = { 0 }; +char filetable[512]; void main() { // Interrupts diff --git a/todo.txt b/todo.txt index 72b1adc..a70c886 100644 --- a/todo.txt +++ b/todo.txt @@ -10,8 +10,8 @@ - [*] Better resolution - [*] Graphics mode - [*] Custom font - - [ ] Larger text size - - [ ] color codes + - [*] Larger text size + - [ ] Variable text size :) - [ ] Filesystem - [ ] Utility for filesystem building (not just an assembly file) - [*] Filetable