From 3caf8f1e040c9d186fddc3039e5e4e8dcf5c9d0f Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Fri, 11 Jun 2021 14:41:55 +0200 Subject: Add prototype for CH3 parameter drawing --- src/text/text.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/text') diff --git a/src/text/text.h b/src/text/text.h index 931227c..647a021 100644 --- a/src/text/text.h +++ b/src/text/text.h @@ -136,4 +136,24 @@ txt_draws(char *msg, size_t x, size_t y, size_t spacing, u8 clr) { txt_draws(buf, x, y, s, c); \ } +// Small font is located after the initial ASCII characters, and only supports +// lowercase characters. +// NOTE: Slow, we should do this with a LUT. +#define txt_drawf_small(msg, x, y, s, c, ...) \ + { \ + char buf[256] = {0}; \ + posprintf(buf, msg, ##__VA_ARGS__); \ + for (size_t i = 0; i < 256; i++) { \ + if (buf[i] == 0) { \ + break; \ + } \ + if (buf[i] < 'a') { \ + buf[i] += 16 * 6; \ + } else { \ + buf[i] += 16 * 4; \ + }\ + } \ + txt_draws(buf, x, y, s, c); \ + } + #endif // TEXT_H -- cgit v1.2.1