aboutsummaryrefslogtreecommitdiff
path: root/taipan.c
diff options
context:
space:
mode:
Diffstat (limited to 'taipan.c')
-rw-r--r--taipan.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/taipan.c b/taipan.c
index e221fc5..ef10068 100644
--- a/taipan.c
+++ b/taipan.c
@@ -316,7 +316,7 @@ unsigned long __fastcall__ strtonum(const char* nptr);
unsigned char firmpos;
-/* use page 6 for these buffers, for .xex build. Otherwise they'e BSS. */
+/* use page 6 for these buffers, for .xex build. Otherwise they're BSS. */
#ifdef CART_TARGET
char firm[23];
char num_buf[20];
@@ -779,15 +779,17 @@ void new_gun(void) {
return;
}
+/* cprintfancy_centered() does this for 0 to 999999:
+ | 999999 |
+ | 99999 |
+ | 9999 |
+ | 999 |
+ | 99 |
+ | 9 | */
+
+#if 0
void cprintfancy_centered(unsigned long num) {
if(num < 1000000L) {
- /* 0 to 999999:
- | 999999 |
- | 99999 |
- | 9999 |
- | 999 |
- | 99 |
- | 9 | */
cspaces(3);
if(num < 100L) cspace();
if(num < 10000L) cspace();
@@ -799,6 +801,19 @@ void cprintfancy_centered(unsigned long num) {
}
rvs_off();
}
+#else
+// saves 12 bytes:
+void cprintfancy_centered(unsigned long num) {
+ if(num < 1000000L) {
+ cspaces(3);
+ if(num < 100L) cspace();
+ if(num < 10000L) cspace();
+ }
+ rvs_on();
+ cprintfancy(num);
+ rvs_off();
+}
+#endif
/* if BIGNUM, cprintfancy() just converts to bignum and uses
cprintfancy_big() to do the work. A bit slower, but fast