aboutsummaryrefslogtreecommitdiffstats
path: root/src/text
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-11 14:41:55 +0200
committerBad Diode <bd@badd10de.dev>2021-06-11 14:41:55 +0200
commit3caf8f1e040c9d186fddc3039e5e4e8dcf5c9d0f (patch)
treef60582f5d95ac905596a9f2850e1238aac1828a4 /src/text
parent662058f10989f4a0cee6bfdbcf61786f2bb6a687 (diff)
downloadstepper-3caf8f1e040c9d186fddc3039e5e4e8dcf5c9d0f.tar.gz
stepper-3caf8f1e040c9d186fddc3039e5e4e8dcf5c9d0f.zip
Add prototype for CH3 parameter drawing
Diffstat (limited to 'src/text')
-rw-r--r--src/text/text.h20
1 files changed, 20 insertions, 0 deletions
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) {
136 txt_draws(buf, x, y, s, c); \ 136 txt_draws(buf, x, y, s, c); \
137 } 137 }
138 138
139// Small font is located after the initial ASCII characters, and only supports
140// lowercase characters.
141// NOTE: Slow, we should do this with a LUT.
142#define txt_drawf_small(msg, x, y, s, c, ...) \
143 { \
144 char buf[256] = {0}; \
145 posprintf(buf, msg, ##__VA_ARGS__); \
146 for (size_t i = 0; i < 256; i++) { \
147 if (buf[i] == 0) { \
148 break; \
149 } \
150 if (buf[i] < 'a') { \
151 buf[i] += 16 * 6; \
152 } else { \
153 buf[i] += 16 * 4; \
154 }\
155 } \
156 txt_draws(buf, x, y, s, c); \
157 }
158
139#endif // TEXT_H 159#endif // TEXT_H