Răsfoiți Sursa

Fix font height to 8 not 16 pixel

Johannes Zellner 8 luni în urmă
părinte
comite
af3ef44577
6 a modificat fișierele cu 253 adăugiri și 253 ștergeri
  1. 4 4
      Makefile
  2. 7 7
      fbtext.c
  3. 0 231
      font_8x16.c
  4. 0 11
      font_8x16.h
  5. 231 0
      font_8x8.c
  6. 11 0
      font_8x8.h

+ 4 - 4
Makefile

@@ -26,10 +26,10 @@ kernel.o: kernel.c io.h terminal.h timer.h
 io.o: io.c io.h fbtext.h
 	$(CC) $(CFLAGS) -o $@ $<
 
-font_8x16.o: font_8x16.c font_8x16.h
+font_8x8.o: font_8x8.c font_8x8.h
 	$(CC) $(CFLAGS) -o $@ $<
 
-fbtext.o: fbtext.c fbtext.h font_8x16.h vga.h
+fbtext.o: fbtext.c fbtext.h font_8x8.h vga.h
 	$(CC) $(CFLAGS) -o $@ $<
 
 terminal.o: terminal.c terminal.h io.h fbtext.h rtc.h timer.h disk.h
@@ -71,7 +71,7 @@ boot.elf: boot.o
 timer.o: timer.S
 	$(AS) $(ASFLAGS) -o $@ $<
 
-kernel.elf: kernel.o timer.o io.o rtc.o terminal.o hello.o reboot.o disk.o fat.o ls.o cat.o vga.o font_8x16.o fbtext.o clock.o display.o
+kernel.elf: kernel.o timer.o io.o rtc.o terminal.o hello.o reboot.o disk.o fat.o ls.o cat.o vga.o font_8x8.o fbtext.o clock.o display.o
 	$(LD) $(KERNEL_LDFLAGS) -o $@ $^
 
 boot.bin: boot.elf
@@ -110,4 +110,4 @@ run: image.bin root.img
 	qemu-system-x86_64 -M pc -drive file=image.bin,format=raw,if=floppy -drive file=root.img,format=raw,if=floppy
 
 clean:
-	rm -f boot.o kernel.o timer.o io.o rtc.o terminal.o hello.o reboot.o fat.o ls.o cat.o disk.o vga.o font_8x16.o fbtext.o clock.o display.o boot.elf kernel.elf boot.bin kernel.bin boot.bin.tmp boot.bin.patched image.bin final.bin root.img
+	rm -f boot.o kernel.o timer.o io.o rtc.o terminal.o hello.o reboot.o fat.o ls.o cat.o disk.o vga.o font_8x8.o fbtext.o clock.o display.o boot.elf kernel.elf boot.bin kernel.bin boot.bin.tmp boot.bin.patched image.bin final.bin root.img

+ 7 - 7
fbtext.c

@@ -1,7 +1,7 @@
-/* Framebuffer text: draw 8x16 characters into VESA LFB. */
+/* Framebuffer text: draw 8x8 characters into VESA LFB. */
 
 #include "fbtext.h"
-#include "font_8x16.h"
+#include "font_8x8.h"
 #include "vga.h"
 
 static int fbtext_use_lfb;
@@ -14,7 +14,7 @@ static int fbtext_cursor_visible;
 #define RAINBOW_TOP   18   /* 5px below header text; line at y 18..19 */
 #define CONTENT_TOP   25   /* 5px below rainbow; first content row at y 25..34 */
 
-#define ROW_HEIGHT    10   /* drawn height per line (top 10 rows of 8x16 font); avoids clearing rainbow */
+#define ROW_HEIGHT    10   /* drawn height per line (8x8 glyph + 2 line spacing); avoids clearing rainbow */
 
 static inline unsigned int row_to_y0(unsigned int row)
 {
@@ -102,9 +102,9 @@ static void draw_glyph(unsigned int col, unsigned int row, unsigned char c, unsi
 	attr_to_rgb(attr, 1, &r_fg, &g_fg, &b_fg);
 	attr_to_rgb(attr, 0, &r_bg, &g_bg, &b_bg);
 
-	glyph = &font_8x16[(unsigned int)c * FONT_8X16_ROWS];
+	glyph = &font_8x8[(unsigned int)c * FONT_8X8_ROWS];
 	for (y = 0; y < ROW_HEIGHT; y++) {
-		unsigned char row_bits = glyph[y];
+		unsigned char row_bits = (y < FONT_8X8_ROWS) ? glyph[y] : 0;
 		for (x = 0; x < 8; x++) {
 			unsigned int px = x0 + x;
 			unsigned int py = y0 + y;
@@ -190,9 +190,9 @@ static void draw_glyph_cursor_region(unsigned int col, unsigned int row, unsigne
 	attr_to_rgb(attr, 1, &r_fg, &g_fg, &b_fg);
 	attr_to_rgb(attr, 0, &r_bg, &g_bg, &b_bg);
 
-	glyph = &font_8x16[(unsigned int)c * FONT_8X16_ROWS];
+	glyph = &font_8x8[(unsigned int)c * FONT_8X8_ROWS];
 	for (y = 0; y < ROW_HEIGHT && y < CURSOR_H; y++) {
-		unsigned char row_bits = glyph[y];
+		unsigned char row_bits = (y < FONT_8X8_ROWS) ? glyph[y] : 0;
 		for (x = 0; x < CURSOR_W; x++) {
 			unsigned int px = x0 + x;
 			unsigned int py = y0 + y;

+ 0 - 231
font_8x16.c

@@ -1,231 +0,0 @@
-/* 8x16 bitmap font: 256 chars, 16 bytes each. Minimal VGA-style glyphs. */
-
-#include "font_8x16.h"
-
-/* One byte per row, MSB = left pixel. 256 * 16 = 4096 bytes. */
-const unsigned char font_8x16[FONT_8X16_CHARS * FONT_8X16_ROWS] = {
-	/* 0-31: control chars, blank */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 32 space */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 33 ! */
-	0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 34 " */
-	0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 35 # */
-	0x36,0x36,0x7f,0x36,0x36,0x36,0x7f,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 36 $ */
-	0x0c,0x3f,0x68,0x68,0x3e,0x0b,0x0b,0x7e,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 37 % */
-	0x60,0x66,0x6c,0x18,0x30,0x66,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 38 & */
-	0x38,0x6c,0x38,0x76,0xdc,0xcc,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 39 ' */
-	0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 40 ( */
-	0x0c,0x18,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 41 ) */
-	0x30,0x18,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 42 * */
-	0x00,0x18,0x7e,0x3c,0x3c,0x7e,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 43 + */
-	0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 44 , */
-	0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 45 - */
-	0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 46 . */
-	0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 47 / */
-	0x03,0x06,0x0c,0x18,0x30,0x60,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 48 0 */
-	0x3c,0x66,0x6e,0x76,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 49 1 */
-	0x18,0x38,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 50 2 */
-	0x3c,0x66,0x06,0x0c,0x30,0x60,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 51 3 */
-	0x3c,0x66,0x06,0x1c,0x06,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 52 4 */
-	0x0c,0x1c,0x3c,0x6c,0x7e,0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 53 5 */
-	0x7e,0x60,0x7c,0x06,0x06,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 54 6 */
-	0x3c,0x60,0x7c,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 55 7 */
-	0x7e,0x06,0x0c,0x18,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 56 8 */
-	0x3c,0x66,0x66,0x3c,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 57 9 */
-	0x3c,0x66,0x66,0x66,0x3e,0x06,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 58 : */
-	0x00,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 59 ; */
-	0x00,0x18,0x18,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 60 < */
-	0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 61 = */
-	0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 62 > */
-	0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 63 ? */
-	0x3c,0x66,0x06,0x0c,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 64 @ */
-	0x3c,0x66,0x6e,0x6a,0x6e,0x60,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 65 A */
-	0x18,0x3c,0x66,0x66,0x7e,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 66 B */
-	0x7c,0x66,0x66,0x7c,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 67 C */
-	0x3c,0x66,0x60,0x60,0x60,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 68 D */
-	0x7c,0x66,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 69 E */
-	0x7e,0x60,0x60,0x7c,0x60,0x60,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 70 F */
-	0x7e,0x60,0x60,0x7c,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 71 G */
-	0x3c,0x66,0x60,0x6e,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 72 H */
-	0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 73 I */
-	0x3c,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 74 J */
-	0x1e,0x0c,0x0c,0x0c,0x0c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 75 K */
-	0x66,0x6c,0x78,0x70,0x78,0x6c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 76 L */
-	0x60,0x60,0x60,0x60,0x60,0x60,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 77 M */
-	0x63,0x77,0x7f,0x6b,0x63,0x63,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 78 N */
-	0x66,0x76,0x7e,0x6e,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 79 O */
-	0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 80 P */
-	0x7c,0x66,0x66,0x7c,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 81 Q */
-	0x3c,0x66,0x66,0x66,0x6a,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 82 R */
-	0x7c,0x66,0x66,0x7c,0x6c,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 83 S */
-	0x3c,0x66,0x60,0x3c,0x06,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 84 T */
-	0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 85 U */
-	0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 86 V */
-	0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 87 W */
-	0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 88 X */
-	0x66,0x66,0x3c,0x18,0x3c,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 89 Y */
-	0x66,0x66,0x66,0x3c,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 90 Z */
-	0x7e,0x06,0x0c,0x18,0x30,0x60,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 91 [ */
-	0x3c,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 92 \ */
-	0xc0,0x60,0x30,0x18,0x0c,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 93 ] */
-	0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 94 ^ */
-	0x18,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 95 _ */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 96 ` */
-	0x30,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 97 a */
-	0x00,0x00,0x38,0x0c,0x3c,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 98 b */
-	0x60,0x60,0x7c,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 99 c */
-	0x00,0x00,0x3c,0x60,0x60,0x60,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 100 d */
-	0x06,0x06,0x3e,0x66,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 101 e */
-	0x00,0x00,0x3c,0x66,0x7e,0x60,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 102 f */
-	0x1c,0x30,0x30,0x7c,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 103 g */
-	0x00,0x00,0x36,0x66,0x66,0x3e,0x06,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 104 h */
-	0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 105 i */
-	0x18,0x00,0x18,0x18,0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 106 j */
-	0x0c,0x00,0x0c,0x0c,0x0c,0x0c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 107 k */
-	0x60,0x60,0x66,0x6c,0x78,0x6c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 108 l */
-	0x18,0x18,0x18,0x18,0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 109 m */
-	0x00,0x00,0x76,0x7f,0x6b,0x63,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 110 n */
-	0x00,0x00,0x7c,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 111 o */
-	0x00,0x00,0x3c,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 112 p */
-	0x00,0x00,0x7c,0x66,0x66,0x7c,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 113 q */
-	0x00,0x00,0x3e,0x66,0x66,0x3e,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 114 r */
-	0x00,0x00,0x7c,0x66,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 115 s */
-	0x00,0x00,0x3e,0x60,0x3c,0x06,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 116 t */
-	0x30,0x30,0x7c,0x30,0x30,0x30,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 117 u */
-	0x00,0x00,0x66,0x66,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 118 v */
-	0x00,0x00,0x66,0x66,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 119 w */
-	0x00,0x00,0x63,0x6b,0x7f,0x77,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 120 x */
-	0x00,0x00,0x66,0x3c,0x18,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 121 y */
-	0x00,0x00,0x66,0x66,0x66,0x3e,0x06,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 122 z */
-	0x00,0x00,0x7e,0x0c,0x18,0x30,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 123 { */
-	0x0c,0x18,0x18,0x70,0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 124 | */
-	0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 125 } */
-	0x30,0x18,0x18,0x0e,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 126 ~ */
-	0x31,0x6b,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-	/* 127-255: zero (C zero-initializes remaining elements) */
-};

+ 0 - 11
font_8x16.h

@@ -1,11 +0,0 @@
-/* 8x16 bitmap font: 256 chars, 16 bytes each (one byte per row, MSB left).
-   Minimal VGA-style glyphs for ASCII 32-126. */
-#ifndef FONT_8X16_H
-#define FONT_8X16_H
-
-#define FONT_8X16_CHARS  256
-#define FONT_8X16_ROWS   16
-
-extern const unsigned char font_8x16[FONT_8X16_CHARS * FONT_8X16_ROWS];
-
-#endif

+ 231 - 0
font_8x8.c

@@ -0,0 +1,231 @@
+/* 8x8 bitmap font: 256 chars, 8 bytes each (one byte per row, MSB left). */
+
+#include "font_8x8.h"
+
+/* One byte per row, MSB = left pixel. 256 * 8 = 2048 bytes. */
+const unsigned char font_8x8[FONT_8X8_CHARS * FONT_8X8_ROWS] = {
+	/* 0-31: control chars, blank */
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	/* 32 space */
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	/* 33 ! */
+	0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x18,
+	/* 34 " */
+	0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,
+	/* 35 # */
+	0x36,0x36,0x7f,0x36,0x36,0x36,0x7f,0x36,
+	/* 36 $ */
+	0x0c,0x3f,0x68,0x68,0x3e,0x0b,0x0b,0x7e,
+	/* 37 % */
+	0x60,0x66,0x6c,0x18,0x30,0x66,0xc6,0x00,
+	/* 38 & */
+	0x38,0x6c,0x38,0x76,0xdc,0xcc,0x76,0x00,
+	/* 39 ' */
+	0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
+	/* 40 ( */
+	0x0c,0x18,0x30,0x30,0x30,0x18,0x0c,0x00,
+	/* 41 ) */
+	0x30,0x18,0x0c,0x0c,0x0c,0x18,0x30,0x00,
+	/* 42 * */
+	0x00,0x18,0x7e,0x3c,0x3c,0x7e,0x18,0x00,
+	/* 43 + */
+	0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,
+	/* 44 , */
+	0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30,
+	/* 45 - */
+	0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,
+	/* 46 . */
+	0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,
+	/* 47 / */
+	0x03,0x06,0x0c,0x18,0x30,0x60,0xc0,0x00,
+	/* 48 0 */
+	0x3c,0x66,0x6e,0x76,0x66,0x66,0x3c,0x00,
+	/* 49 1 */
+	0x18,0x38,0x18,0x18,0x18,0x18,0x7e,0x00,
+	/* 50 2 */
+	0x3c,0x66,0x06,0x0c,0x30,0x60,0x7e,0x00,
+	/* 51 3 */
+	0x3c,0x66,0x06,0x1c,0x06,0x66,0x3c,0x00,
+	/* 52 4 */
+	0x0c,0x1c,0x3c,0x6c,0x7e,0x0c,0x0c,0x00,
+	/* 53 5 */
+	0x7e,0x60,0x7c,0x06,0x06,0x66,0x3c,0x00,
+	/* 54 6 */
+	0x3c,0x60,0x7c,0x66,0x66,0x66,0x3c,0x00,
+	/* 55 7 */
+	0x7e,0x06,0x0c,0x18,0x30,0x30,0x30,0x00,
+	/* 56 8 */
+	0x3c,0x66,0x66,0x3c,0x66,0x66,0x3c,0x00,
+	/* 57 9 */
+	0x3c,0x66,0x66,0x66,0x3e,0x06,0x3c,0x00,
+	/* 58 : */
+	0x00,0x18,0x18,0x00,0x18,0x18,0x00,0x00,
+	/* 59 ; */
+	0x00,0x18,0x18,0x00,0x18,0x18,0x30,0x00,
+	/* 60 < */
+	0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,
+	/* 61 = */
+	0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00,
+	/* 62 > */
+	0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,
+	/* 63 ? */
+	0x3c,0x66,0x06,0x0c,0x18,0x00,0x18,0x00,
+	/* 64 @ */
+	0x3c,0x66,0x6e,0x6a,0x6e,0x60,0x3c,0x00,
+	/* 65 A */
+	0x18,0x3c,0x66,0x66,0x7e,0x66,0x66,0x00,
+	/* 66 B */
+	0x7c,0x66,0x66,0x7c,0x66,0x66,0x7c,0x00,
+	/* 67 C */
+	0x3c,0x66,0x60,0x60,0x60,0x66,0x3c,0x00,
+	/* 68 D */
+	0x7c,0x66,0x66,0x66,0x66,0x66,0x7c,0x00,
+	/* 69 E */
+	0x7e,0x60,0x60,0x7c,0x60,0x60,0x7e,0x00,
+	/* 70 F */
+	0x7e,0x60,0x60,0x7c,0x60,0x60,0x60,0x00,
+	/* 71 G */
+	0x3c,0x66,0x60,0x6e,0x66,0x66,0x3e,0x00,
+	/* 72 H */
+	0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00,
+	/* 73 I */
+	0x3c,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,
+	/* 74 J */
+	0x1e,0x0c,0x0c,0x0c,0x0c,0x6c,0x38,0x00,
+	/* 75 K */
+	0x66,0x6c,0x78,0x70,0x78,0x6c,0x66,0x00,
+	/* 76 L */
+	0x60,0x60,0x60,0x60,0x60,0x60,0x7e,0x00,
+	/* 77 M */
+	0x63,0x77,0x7f,0x6b,0x63,0x63,0x63,0x00,
+	/* 78 N */
+	0x66,0x76,0x7e,0x6e,0x66,0x66,0x66,0x00,
+	/* 79 O */
+	0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,
+	/* 80 P */
+	0x7c,0x66,0x66,0x7c,0x60,0x60,0x60,0x00,
+	/* 81 Q */
+	0x3c,0x66,0x66,0x66,0x6a,0x6c,0x36,0x00,
+	/* 82 R */
+	0x7c,0x66,0x66,0x7c,0x6c,0x66,0x66,0x00,
+	/* 83 S */
+	0x3c,0x66,0x60,0x3c,0x06,0x66,0x3c,0x00,
+	/* 84 T */
+	0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x00,
+	/* 85 U */
+	0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,
+	/* 86 V */
+	0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,
+	/* 87 W */
+	0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00,
+	/* 88 X */
+	0x66,0x66,0x3c,0x18,0x3c,0x66,0x66,0x00,
+	/* 89 Y */
+	0x66,0x66,0x66,0x3c,0x18,0x18,0x18,0x00,
+	/* 90 Z */
+	0x7e,0x06,0x0c,0x18,0x30,0x60,0x7e,0x00,
+	/* 91 [ */
+	0x3c,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,
+	/* 92 \ */
+	0xc0,0x60,0x30,0x18,0x0c,0x06,0x03,0x00,
+	/* 93 ] */
+	0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,
+	/* 94 ^ */
+	0x18,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,
+	/* 95 _ */
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+	/* 96 ` */
+	0x30,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,
+	/* 97 a */
+	0x00,0x00,0x38,0x0c,0x3c,0x6c,0x36,0x00,
+	/* 98 b */
+	0x60,0x60,0x7c,0x66,0x66,0x66,0x7c,0x00,
+	/* 99 c */
+	0x00,0x00,0x3c,0x60,0x60,0x60,0x3c,0x00,
+	/* 100 d */
+	0x06,0x06,0x3e,0x66,0x66,0x66,0x3e,0x00,
+	/* 101 e */
+	0x00,0x00,0x3c,0x66,0x7e,0x60,0x3c,0x00,
+	/* 102 f */
+	0x1c,0x30,0x30,0x7c,0x30,0x30,0x30,0x00,
+	/* 103 g */
+	0x00,0x00,0x36,0x66,0x66,0x3e,0x06,0x3c,
+	/* 104 h */
+	0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x00,
+	/* 105 i */
+	0x18,0x00,0x18,0x18,0x18,0x18,0x0c,0x00,
+	/* 106 j */
+	0x0c,0x00,0x0c,0x0c,0x0c,0x0c,0x6c,0x38,
+	/* 107 k */
+	0x60,0x60,0x66,0x6c,0x78,0x6c,0x66,0x00,
+	/* 108 l */
+	0x18,0x18,0x18,0x18,0x18,0x18,0x0c,0x00,
+	/* 109 m */
+	0x00,0x00,0x76,0x7f,0x6b,0x63,0x63,0x00,
+	/* 110 n */
+	0x00,0x00,0x7c,0x66,0x66,0x66,0x66,0x00,
+	/* 111 o */
+	0x00,0x00,0x3c,0x66,0x66,0x66,0x3c,0x00,
+	/* 112 p */
+	0x00,0x00,0x7c,0x66,0x66,0x7c,0x60,0x60,
+	/* 113 q */
+	0x00,0x00,0x3e,0x66,0x66,0x3e,0x06,0x06,
+	/* 114 r */
+	0x00,0x00,0x7c,0x66,0x60,0x60,0x60,0x00,
+	/* 115 s */
+	0x00,0x00,0x3e,0x60,0x3c,0x06,0x7c,0x00,
+	/* 116 t */
+	0x30,0x30,0x7c,0x30,0x30,0x30,0x1c,0x00,
+	/* 117 u */
+	0x00,0x00,0x66,0x66,0x66,0x66,0x3e,0x00,
+	/* 118 v */
+	0x00,0x00,0x66,0x66,0x66,0x3c,0x18,0x00,
+	/* 119 w */
+	0x00,0x00,0x63,0x6b,0x7f,0x77,0x63,0x00,
+	/* 120 x */
+	0x00,0x00,0x66,0x3c,0x18,0x3c,0x66,0x00,
+	/* 121 y */
+	0x00,0x00,0x66,0x66,0x66,0x3e,0x06,0x3c,
+	/* 122 z */
+	0x00,0x00,0x7e,0x0c,0x18,0x30,0x7e,0x00,
+	/* 123 { */
+	0x0c,0x18,0x18,0x70,0x18,0x18,0x0c,0x00,
+	/* 124 | */
+	0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,
+	/* 125 } */
+	0x30,0x18,0x18,0x0e,0x18,0x18,0x30,0x00,
+	/* 126 ~ */
+	0x31,0x6b,0x46,0x00,0x00,0x00,0x00,0x00,
+	/* 127-255: zero (C zero-initializes remaining elements) */
+};

+ 11 - 0
font_8x8.h

@@ -0,0 +1,11 @@
+/* 8x8 bitmap font: 256 chars, 8 bytes each (one byte per row, MSB left).
+   Minimal VGA-style glyphs for ASCII 32-126. */
+#ifndef FONT_8X8_H
+#define FONT_8X8_H
+
+#define FONT_8X8_CHARS  256
+#define FONT_8X8_ROWS   8
+
+extern const unsigned char font_8x8[FONT_8X8_CHARS * FONT_8X8_ROWS];
+
+#endif