More bugfixes & initing
[uccvend-snackrom.git] / ROM2 / coinmech.c
index a6c0e51..c52e146 100644 (file)
@@ -72,7 +72,7 @@ void sci_interrupt() {
                return;
        }
 
-       if (packet_pos != 0 || IS_CTRL(in&0x10)) {
+       if (packet_pos != 0 || IS_CTRL(in)) {
                in &= 0x0f;
                switch (in) {
                        case 0x01: 
@@ -130,3 +130,10 @@ void coin_cost(u16 cost) {
        item_cost = cost;
        while(coin_value); /* wait until coin mech cleared */
 }
+
+void coinmech_init() {
+       _io_ports[M6811_SCCR1] = 0x10;
+       _io_ports[M6811_SCCR2] = 0x2e;
+       _io_ports[M6811_BAUD] = 0x03;
+       send_byte(0xff);
+}

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