X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM2%2Fchime.c;h=37ec78a58d6572d1779be18bd0927d1e983055fa;hb=24f4e50d8f5671b40d2662bbcd50e3859bcd5205;hp=57c4630568e13f94249d0c4250cc383710f0ecd5;hpb=9366107abfbfbe85f00b27449c79284d0e1aa59e;p=uccvend-snackrom.git diff --git a/ROM2/chime.c b/ROM2/chime.c index 57c4630..37ec78a 100644 --- a/ROM2/chime.c +++ b/ROM2/chime.c @@ -1,16 +1,18 @@ #include "vend.h" #include "chime.h" -u8 chime_count; +volatile u8 chime_count; +volatile u8 unchime_count; /* silence counter */ void chime() { /* called from the RTI interrupt, sees if we need to turn the chime on or - * off (chime would be on for N RTI cycles + * off (chime would be on for N RTI cycles) */ if (chime_count) { - bset((void*)&_io_ports[M6811_PORTA], PORTA_CHIME); - --chime_count; + chime_on(); + --chime_count; /* interrupts masked here, so this won't result in badness */ } else - bclr((void*)&_io_ports[M6811_PORTA], PORTA_CHIME); + chime_off(); + if (unchime_count) --unchime_count; }