From 886966eff573923f23032b0ba98a16ac68e16ee5 Mon Sep 17 00:00:00 2001 From: Tom-on64 Date: Fri, 26 Apr 2024 09:51:25 +0200 Subject: [PATCH] Modified font --- include/screen.h | 4 ++-- src/testfont.asm | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/screen.h b/include/screen.h index 3ea5e3e..a3d96a0 100644 --- a/include/screen.h +++ b/include/screen.h @@ -26,10 +26,10 @@ void setupScreen() { } // 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) { +void putcAt(unsigned char c, uint32_t x, uint32_t y) { uint32_t offset = (WIDTH * y * 16 + x * 8) * 2; - char* bitmap = &font[(c-1) * 16]; + char* bitmap = &font[((c % 128) - 1) * 16]; 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 diff --git a/src/testfont.asm b/src/testfont.asm index 6f3574c..f81196d 100644 --- a/src/testfont.asm +++ b/src/testfont.asm @@ -1132,7 +1132,7 @@ db 00000000b,\ ;; 'b' db 00000000b,\ 00000000b,\ - 00000000b,\ + 10000000b,\ 10000000b,\ 10000000b,\ 10111100b,\ @@ -1166,7 +1166,7 @@ db 00000000b,\ ;; 'd' db 00000000b,\ 00000000b,\ - 00000000b,\ + 00000010b,\ 00000010b,\ 00000010b,\ 01111010b,\ @@ -1199,12 +1199,12 @@ db 00000000b,\ 00000000b ;; 'f' db 00000000b,\ - 00000000b,\ 00000000b,\ 00001110b,\ 00010000b,\ 00010000b,\ 00010000b,\ + 00010000b,\ 11111110b,\ 00010000b,\ 00010000b,\ @@ -1234,7 +1234,7 @@ db 00000000b,\ ;; 'h' db 00000000b,\ 00000000b,\ - 00000000b,\ + 10000000b,\ 10000000b,\ 10000000b,\ 10000000b,\ @@ -1285,7 +1285,7 @@ db 00000000b,\ ;; 'k' db 00000000b,\ 00000000b,\ - 00000000b,\ + 10000000b,\ 10000000b,\ 10000100b,\ 10001000b,\ @@ -1301,7 +1301,6 @@ db 00000000b,\ 00000000b ;; 'l' db 00000000b,\ - 00000000b,\ 00000000b,\ 00110000b,\ 00010000b,\ @@ -1312,6 +1311,7 @@ db 00000000b,\ 00010000b,\ 00010000b,\ 00010000b,\ + 00010000b,\ 01111100b,\ 00000000b,\ 00000000b,\ @@ -1608,14 +1608,14 @@ db 00000000b,\ ;; Tilde '~' db 00000000b,\ 00000000b,\ - 01100010b,\ + 00000000b,\ + 00000000b,\ + 00000000b,\ + 00000000b,\ + 01100000b,\ 10010010b,\ - 10001100b,\ - 00000000b,\ - 00000000b,\ - 00000000b,\ - 00000000b,\ - 00000000b,\ + 10010010b,\ + 00001100b,\ 00000000b,\ 00000000b,\ 00000000b,\