hekate/nyx: gfx: add text color defines

And reduce code size when using W/EPRINTF macros
This commit is contained in:
CTCaer
2022-07-01 04:37:57 +03:00
parent eba6b285ec
commit 535ea95086
12 changed files with 169 additions and 113 deletions

View File

@@ -155,9 +155,9 @@ void gfx_con_init()
gfx_con.y = 0;
gfx_con.savedx = 0;
gfx_con.savedy = 0;
gfx_con.fgcol = 0xFFCCCCCC;
gfx_con.fgcol = TXT_CLR_DEFAULT;
gfx_con.fillbg = 1;
gfx_con.bgcol = 0xFF1B1B1B;
gfx_con.bgcol = TXT_CLR_BG;
gfx_con.mute = 0;
gfx_con_init_done = true;
@@ -265,7 +265,7 @@ void gfx_putc(char c)
}
}
void gfx_puts(char *s)
void gfx_puts(const char *s)
{
if (!s || !gfx_con_init_done || gfx_con.mute)
return;
@@ -410,6 +410,17 @@ void gfx_printf(const char *fmt, ...)
va_end(ap);
}
static void _gfx_cputs(u32 color, const char *s)
{
gfx_con.fgcol = color;
gfx_puts(s);
gfx_putc('\n');
gfx_con.fgcol = TXT_CLR_DEFAULT;
}
void gfx_wputs(const char *s) { _gfx_cputs(TXT_CLR_WARNING, s); }
void gfx_eputs(const char *s) { _gfx_cputs(TXT_CLR_ERROR, s); }
void gfx_hexdump(u32 base, const void *buf, u32 len)
{
if (!gfx_con_init_done || gfx_con.mute)