Display "Date Built" in ABOUT
[uccvend-snackrom.git] / ROM2 / main_basic.c
index 3896b3e..feb5bee 100644 (file)
@@ -4,8 +4,7 @@
  * and snacks.
  */
 
-#define VERSION_STRING "V 20040624"
-
+#include "version.h"
 #include "display_basic.h"
 #include "keypad.h"
 #include "chime.h"
@@ -82,10 +81,11 @@ void dispense_something() {
                send_string("102 Vend all motors starting." CRLF);
                for (motor[0] = '0'; motor[0] <= '9'; motor[0]++) {
                        for (motor[1] = '0'; motor[1] <= '9'; motor[1]++) {
+                               if (motor[1] == '5') continue; /* there is now row 5 */
                                send_string("101 Vending ");
                                send_string(motor);
                                send_string(CRLF);
-                               motor_reply(dispense_motor(motor[0]*10+motor[1]));
+                               motor_reply(dispense_motor((motor[0]-'0')*10+(motor[1]-'0')));
                        }
                }
                send_string("102 Vend all motors complete." CRLF);
@@ -235,7 +235,7 @@ void do_silence() {
                send_string("511 Unknown silence duration." CRLF);
                return;
        }
-       send_string("500 Silence started." CRLF);
+       send_string("501 Silence started." CRLF);
        return;
 }
 
@@ -354,11 +354,10 @@ void about() {
                return;
        }
        send_string(
-               "-----------------------------------------------------------------" CRLF
-               "    ROM2 (C) 2004 Bernard Blackham <[email protected]>" CRLF
-               "-----------------------------------------------------------------" CRLF
-               "                                        Revision " VERSION_STRING CRLF
-               "" CRLF
+               "------------------------------------------------------------" CRLF
+               " ROM2 (C) 2004 Bernard Blackham <[email protected]>" CRLF
+               "------------------------------------------------------------" CRLF
+               " Revision: " VERSION_STRING "  Built: " DATEBUILT_STRING CRLF "" CRLF CRLF
                "   This snack machine was brought to you by " CRLF
                "    Bernard Blackham" CRLF
                "    Mark Tearle" CRLF
@@ -366,7 +365,7 @@ void about() {
                "    Michal Gornisiewicz" CRLF
                "    and others." CRLF
                "" CRLF
-               " Another UCC project in action.         http://www.ucc.asn.au/" CRLF
+               " Another UCC project in action.      http://www.ucc.asn.au/" CRLF
        );
 }
 
@@ -416,7 +415,7 @@ void help() {
                " ECHO {ON|OFF} turn echo on or off" CRLF
                " GETROM        download the ROM source code using xmodem" CRLF
                " H[...]        this help screen" CRLF
-               "*JUMPxxxx      jumps to a subroute at location xxxx" CRLF
+               "*JUMPxxxx      jumps to a subroutine at location xxxx" CRLF
                "*PEEKxxxx      returns the value of the byte at location xxxx" CRLF
                "*POKExxxxyy    sets the value of location xxxx to yy" CRLF
                " PING          pongs" CRLF
@@ -424,6 +423,7 @@ void help() {
                "+Vnn           vend an item" CRLF
                "+VALL          vend all items" CRLF
                "*Wxxxxxxxxxxxx set a new password for authenticated vends. xxx=16 chars" CRLF
+               "               password will be converted to uppercase" CRLF
                "" CRLF
                "Very few functions are available when the machine is in standalone " CRLF
                "mode (DIP SW 1 is set)" CRLF
@@ -441,12 +441,16 @@ void getrom() {
                return;
        }
        char s[4];
+       
+       u16 rom_addr;
+       rom_addr = (u16)(&_rom_src_data);
+
        send_string("Writing to serial port (maybe). Size is 0x");
        send_string(u82hex(_rom_src_len >> 8));
        send_string(u82hex(_rom_src_len & 0xff));
        send_string("@0x");
-       send_string(u82hex((u16)(&_rom_src_data) >> 8));
-       send_string(u82hex((u16)(&_rom_src_data) & 0xff));
+       send_string(u82hex(rom_addr >> 8));
+       send_string(u82hex(rom_addr & 0xff));
        send_string(" with signature ");
        s[0] = _rom_src_data[0];
        s[1] = _rom_src_data[1];
@@ -538,8 +542,6 @@ int main() {
 
        send_string("5N4X0RZ R US" CRLF);
 
-       mic_challenge = 0;
-       
        last_standalone = is_standalone();
        if (last_standalone)
                cur_motor[0] = 0xff;
@@ -583,6 +585,7 @@ int main() {
                }
 
                if (sci_have_packet) {
+                       send_string(CRLF);
                        switch (sci_rx_buf[0]) {
                                case '\0':
                                case '#':

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