mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2025-01-14 11:29:48 +00:00
fix 24 hours wrap bug
This commit is contained in:
parent
d9863f02f5
commit
5bc71a3cfe
@ -133,10 +133,18 @@ void main() {
|
|||||||
|
|
||||||
woz_puts("\rWHAT TIME IS IT ?\r");
|
woz_puts("\rWHAT TIME IS IT ?\r");
|
||||||
|
|
||||||
woz_puts("\r(HOURS ) "); apple1_input_line_prompt(KEYBUF, 2);
|
do {
|
||||||
|
woz_puts("\r(HOURS ) ");
|
||||||
|
apple1_input_line_prompt(KEYBUF, 2);
|
||||||
_hours = (byte) atoi(KEYBUF);
|
_hours = (byte) atoi(KEYBUF);
|
||||||
woz_puts("\r(MINUTES) "); apple1_input_line_prompt(KEYBUF, 2);
|
} while(_hours > 23);
|
||||||
|
|
||||||
|
do {
|
||||||
|
woz_puts("\r(MINUTES) ");
|
||||||
|
apple1_input_line_prompt(KEYBUF, 2);
|
||||||
_minutes = (byte) atoi(KEYBUF);
|
_minutes = (byte) atoi(KEYBUF);
|
||||||
|
} while(_minutes > 59);
|
||||||
|
|
||||||
_seconds = 0;
|
_seconds = 0;
|
||||||
|
|
||||||
enable_timer_interrupt();
|
enable_timer_interrupt();
|
||||||
|
@ -35,7 +35,7 @@ EXPORT __interrupt(hardware_all) void time_interrupt_handler() {
|
|||||||
_seconds = 0;
|
_seconds = 0;
|
||||||
if(++_minutes == 60) {
|
if(++_minutes == 60) {
|
||||||
_minutes = 0;
|
_minutes = 0;
|
||||||
_hours++;
|
if(++_hours == 24) _hours = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user