X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM2%2Fmain_basic.c;h=0f9d3eab01f5bddf7e057d16dc192a0b074fdbcf;hb=HEAD;hp=feb5bee0eb5a87cefb3d42223b6cf5bbecf41601;hpb=c0863797291ed5ab439e0d213cc26a2c62b00376;p=uccvend-snackrom.git diff --git a/ROM2/main_basic.c b/ROM2/main_basic.c index feb5bee..0f9d3ea 100644 --- a/ROM2/main_basic.c +++ b/ROM2/main_basic.c @@ -175,6 +175,20 @@ void send_keypress(u8 key) { send_string(" key." CRLF); } +void send_timer() { + /* send a packet of the form KX with X being the key, or R for reset */ + unsigned int t=get_timer_counter(); + + send_string("013 "); + sci_tx_buf[0] = '0'+(t/10000)%10; + sci_tx_buf[1] = '0'+(t/1000)%10; + sci_tx_buf[2] = '0'+(t/100)%10; + sci_tx_buf[3] = '0'+(t/10)%10; + sci_tx_buf[4] = '0'+t%10; + sci_tx_buf[5] = 0; + send_buffer(1); +} + void send_door_msg(bool open) { if (is_standalone()) return; sci_tx_buf[0] = '4'; @@ -354,15 +368,15 @@ void about() { return; } send_string( - "------------------------------------------------------------" CRLF + CRLF " ROM2 (C) 2004 Bernard Blackham " 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 " Harry McNally" CRLF + " Mark Tearle" CRLF " Michal Gornisiewicz" CRLF + " Nick Bannon" CRLF " and others." CRLF "" CRLF " Another UCC project in action. http://www.ucc.asn.au/" CRLF @@ -405,6 +419,12 @@ void moo() { ); } +void identify() { + send_string( + "086 ROM " VERSION_STRING " " DATEBUILT_STRING CRLF + ); +} + void help() { send_string( "Valid commands are:" CRLF @@ -415,6 +435,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 + " IDENTIFY report ROM version" 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 @@ -457,7 +478,7 @@ void getrom() { s[2] = _rom_src_data[2]; s[3] = '\0'; send_string(s); - send_string(CRLF " Type YES to download rom.tar.bz2 via XMODEM: "); + send_string(CRLF " Type YES to download rom.tar.lz via XMODEM: "); msg_clr(); while (!sci_have_packet); /* spin */ if (!my_strncmp("YES", (char*)sci_rx_buf, 3)) { @@ -612,6 +633,9 @@ int main() { case 'H': help(); break; + case 'I': + identify(); + break; case 'M': moo(); break; @@ -692,6 +716,7 @@ int main() { } } else send_keypress(last_key); + send_timer(); } /*