aboutsummaryrefslogtreecommitdiff
path: root/src/util/status.c
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-12 09:47:04 -0800
committerChristian Cunningham <cc@localhost>2022-03-12 09:47:04 -0800
commit468167fce9d64cb8f08832dd7586dd55f9200fb8 (patch)
tree2470776fdbf8ee4bb34fa36cb1e6010b5260cfc6 /src/util/status.c
parentf1a310b37e482d091a4c4ac6cbbf7a27f4033a7e (diff)
Draw Base-10 Numbers Easier
Diffstat (limited to 'src/util/status.c')
-rw-r--r--src/util/status.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/util/status.c b/src/util/status.c
index 869fb40..f111251 100644
--- a/src/util/status.c
+++ b/src/util/status.c
@@ -73,33 +73,24 @@ void status(void)
// Output the frequency
draw_string(6, 3, "@");
unsigned long frq = read_cntfrq()/1000;
- char* frq_str = u32_to_str(frq);
- unsigned long fs_len = strlen(frq_str)+1;
- draw_string(8, 3, frq_str);
+ unsigned long fs_len = draw_u10(8, 3, frq) + 1;
draw_string(8+fs_len, 3, "kHz");
// Output the value
unsigned long v = read_cntv_tval();
- char* v_str = u32_to_str(v);
- unsigned long vs_len = strlen(v_str) + 1;
- draw_string(8+fs_len+4, 3, v_str);
+ unsigned long vs_len = draw_u10(8+fs_len+4, 3, v)+1;
draw_string(8+fs_len+4 +vs_len, 3, " ");
draw_letter(8+fs_len+4 +vs_len+1, 3, '|');
draw_hex32(8+fs_len+7+vs_len, 3, v);
// Video Status
draw_cstring(0, 4, "VIDEO", 0x00FF00);
- char* gwidth_str;
- gwidth_str = u32_to_str(gwidth);
- unsigned long gs_len = strlen(gwidth_str) + 1;
- draw_string(6, 4, gwidth_str);
- draw_letter(6+gs_len-1, 4, 'x');
- gwidth_str = u32_to_str(gheight);
- unsigned long gs_len1 = strlen(gwidth_str) + 1;
- draw_string(6+gs_len, 4, gwidth_str);
+ unsigned long gw_len = draw_u10(6, 4, gwidth);
+ unsigned long gh_len = draw_u10(6+gw_len+1, 4, gheight) + 1;
+ draw_letter(6+gw_len, 4, 'x');
if(gisrgb)
- draw_string(6+gs_len+gs_len1, 4, "RGB");
+ draw_string(6+gw_len+gh_len + 1, 4, "RGB");
else
- draw_string(6+gs_len+gs_len1, 4, "BGR");
+ draw_string(6+gw_len+gh_len + 1, 4, "BGR");
// Core Stacks
draw_string(0, 5, "SVC IRQ FIQ User/SYS\n");
@@ -132,6 +123,5 @@ void status(void)
draw_hex32(19+14+8+1, 8, coren);
draw_string(19+14+9+8, 8, "|");
draw_string(19+14+18, 8, " ");
- char* t_str = u32_to_str(((unsigned long)tval)/1000000);
- draw_string(19+14+18, 8, t_str);
+ draw_u10(19+14+18, 8, ((unsigned long)tval)/1000000);
}