Commit 8c720d7c authored by root's avatar root

added cprintf()

parent b887cdc1
......@@ -249,3 +249,28 @@ int sprintf(char *dst, char const *format, ...)
}
#define C_DIM 0x80
void m_cprintf(int color, const char *fmt, ...)
{
va_list ap;
mprintf("\033[0%d;3%dm",color & C_DIM ? 2:1, color&0x7f);
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
}
void m_pcprintf(int row, int col, int color, const char *fmt, ...)
{
va_list ap;
mprintf("\033[%d;%df", row, col);
mprintf("\033[0%d;3%dm",color & C_DIM ? 2:1, color&0x7f);
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
}
void m_term_clear()
{
mprintf("\033[2J\033[1;1H");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment