Change framebuffer terminal font

This commit is contained in:
2022-01-14 00:39:41 +01:00
parent 8b7e9a454b
commit a1add78fa2
4 changed files with 50 additions and 4 deletions

View File

@@ -17,6 +17,9 @@ LDFLAGS := -nostdlib -r
libmittos.a: $(OBJ)
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
graphics/graphics.o: graphics/u_vga16.termfont.inc
graphics/u_vga16.termfont.inc:
${BUILDROOT}/toolchain/build-uni_vga.sh
# Automatic dependency tracking
DEP := $(OBJ:.o=.d)

View File

@@ -5,7 +5,7 @@
#define incptr(p, n) ((void *)(((uintptr_t)(p)) + (n)))
#include "termfont.inc"
#include "u_vga16.termfont.inc"
void putpixel(gfx_context *ctx, uint64_t x, uint64_t y, uint32_t clr)
{
@@ -52,12 +52,12 @@ void draw_rect(gfx_context *ctx, uint64_t x, uint64_t y, uint64_t width, uint64_
putpixel(ctx, x, _y, clr);
putpixel(ctx, x+width, _y, clr);
}
}
void putCharacter(gfx_context *ctx, uint64_t x, uint64_t y, uint32_t clr_fg, uint32_t clr_bg, char c)
{
char *chr = c ? font[(int)c-0x20]: font[0];
unsigned char *chr = c ? font[(int)c-0x20]: font[0];
if(x >= ctx->width || y >= ctx->height) return;
uint64_t loc = \
y * ctx->pitch + \