From: [NTU] Date: Mon, 6 Aug 2018 14:00:02 +0000 (+0800) Subject: add credit, add 013 debug timer message on keypress X-Git-Url: https://git.ucc.asn.au/?p=uccvend-snackrom.git;a=commitdiff_plain;h=HEAD add credit, add 013 debug timer message on keypress --- diff --git a/ROM2/main_basic.c b/ROM2/main_basic.c index 8414357..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'; @@ -359,9 +373,10 @@ void about() { " 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 @@ -701,6 +716,7 @@ int main() { } } else send_keypress(last_key); + send_timer(); } /* diff --git a/ROM2/src2asm.pl b/ROM2/src2asm.pl index 2d108b2..7b73f53 100644 --- a/ROM2/src2asm.pl +++ b/ROM2/src2asm.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # keep the format of this next line the same to match regex in check-romsrc.pl -$origin = 0x9d00; +$origin = 0x9d80; $hole_start = 0xb600; $hole_size = 0x0200;