more changes
[uccvend-snackrom.git] / ROM2 / helpers.c
index ead76da..74cb40b 100644 (file)
@@ -1,3 +1,4 @@
+#include "display.h"
 #include "vend.h"
 
 #define DELAY_MAGIC 20 /* FIXME: number of loops for ~ 1 millisecond (< 256) */
@@ -9,3 +10,12 @@ void delay(u16 ms) {
        }
 }
 
+void print_amount(u16 amt) {
+       /* take amt and show it on screen with a $ sign */
+       char str[10] = {' ', '$', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
+       u8 pos;
+       for (pos = 7; amt; pos--, amt/=10);
+               str[pos] = amt%10 + '0';
+       }
+       set_msg(str, WRAP_NONE);
+}

UCC git Repository :: git.ucc.asn.au