diff options
author | Christian Cunningham <cc@localhost> | 2022-03-12 09:47:04 -0800 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-03-12 09:47:04 -0800 |
commit | 468167fce9d64cb8f08832dd7586dd55f9200fb8 (patch) | |
tree | 2470776fdbf8ee4bb34fa36cb1e6010b5260cfc6 /src/graphics/lfb.c | |
parent | f1a310b37e482d091a4c4ac6cbbf7a27f4033a7e (diff) |
Draw Base-10 Numbers Easier
Diffstat (limited to 'src/graphics/lfb.c')
-rw-r--r-- | src/graphics/lfb.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/graphics/lfb.c b/src/graphics/lfb.c index 8c9c395..7158afa 100644 --- a/src/graphics/lfb.c +++ b/src/graphics/lfb.c @@ -3,6 +3,7 @@ #include <graphics/glyphs.h> #include <graphics/lfb.h> #include <graphics/mbox.h> +#include <lib/strings.h> unsigned char *lfb; /* raw frame buffer address */ @@ -202,3 +203,16 @@ void draw_hex32(unsigned int lx, unsigned int ly, unsigned long val) { draw_chex32(lx, ly, val, 0xFFFFFF); } + +unsigned long draw_cu10(unsigned int lx, unsigned int ly, unsigned long val, unsigned int c) +{ + string_t vals = u32_to_str(val); + unsigned long len = strlen(vals); + draw_cstring(lx, ly, vals, c); + return len; +} + +unsigned long draw_u10(unsigned int lx, unsigned int ly, unsigned long val) +{ + return draw_cu10(lx, ly, val, 0xFFFFFF); +} |