Have period clock count at the right time

This commit is contained in:
Neale Pickett 2013-04-03 21:52:46 -06:00
parent 5ac5333879
commit 9400090f1b
1 changed files with 15 additions and 12 deletions

27
main.c
View File

@ -110,15 +110,6 @@ draw()
//XXX testing //XXX testing
if ((state == TIMEOUT) && (jam_clock % 8 == 0)) {
for (clk = 0; clk < 4; clk += 1) {
write(0);
}
} else {
clk = (abs(period_clock / 10) / 60) * 100;
clk += abs(period_clock / 10) % 60;
write_num(clk, 4);
}
write_num(score_b, 2); write_num(score_b, 2);
@ -135,6 +126,18 @@ draw()
write_num(score_a, 2); write_num(score_a, 2);
if ((state == TIMEOUT) && (jam_clock % 8 == 0)) {
// Blank it out
for (clk = 0; clk < 4; clk += 1) {
write(0);
}
} else {
clk = (abs(period_clock / 10) / 60) * 100;
clk += abs(period_clock / 10) % 60;
write_num(clk, 4);
}
latch(); latch();
pulse(); pulse();
} }
@ -249,13 +252,13 @@ loop()
switch (state) { switch (state) {
case SETUP: case SETUP:
break; break;
case TIMEOUT: case JAM:
case LINEUP:
if (period_clock) { if (period_clock) {
period_clock += 1; period_clock += 1;
} }
// fall through // fall through
case JAM: case TIMEOUT:
case LINEUP:
if (jam_clock) { if (jam_clock) {
jam_clock += 1; jam_clock += 1;
} }