From fc0a94bd8480fddd66cfbc5f96dc85d932d8c77c Mon Sep 17 00:00:00 2001 From: Selver-gba Date: Sun, 6 May 2018 10:02:18 -0700 Subject: [PATCH] BUG: gfx_putc() was attempting to print from two characters (126, 127) not in font table FIX: Do not print non-printable char 127 FIX: Add tilde character to font table --- ipl/gfx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipl/gfx.c b/ipl/gfx.c index 4d7d0b2..cf6fb74 100755 --- a/ipl/gfx.c +++ b/ipl/gfx.c @@ -65,6 +65,7 @@ static const u8 _gfx_font[] = { 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x66, 0x66, 0x7C, 0x60, 0x3C, 0x00, 0x00, 0x00, 0x7E, 0x30, 0x18, 0x0C, 0x7E, 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x04, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x0C, 0x08, 0x08, 0x10, 0x08, 0x08, + 0x00, 0x00, 0x00, 0x4c, 0x32, 0x00, 0x00, 0x00 }; void gfx_init_ctxt(gfx_ctxt_t *ctxt, u32 *fb, u32 width, u32 height, u32 stride) @@ -112,7 +113,7 @@ void gfx_con_setpos(gfx_con_t *con, u32 x, u32 y) void gfx_putc(gfx_con_t *con, char c) { - if (c >= 32 && c < 128) + if (c >= 32 && c <= 126) { u8 *cbuf = (u8 *)&_gfx_font[8 * (c - 32)]; u32 *fb = con->gfx_ctxt->fb + con->x + con->y * con->gfx_ctxt->stride;