mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2024-12-26 08:31:04 +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("\r(HOURS ) "); apple1_input_line_prompt(KEYBUF, 2);
|
||||
_hours = (byte) atoi(KEYBUF);
|
||||
woz_puts("\r(MINUTES) "); apple1_input_line_prompt(KEYBUF, 2);
|
||||
_minutes = (byte) atoi(KEYBUF);
|
||||
do {
|
||||
woz_puts("\r(HOURS ) ");
|
||||
apple1_input_line_prompt(KEYBUF, 2);
|
||||
_hours = (byte) atoi(KEYBUF);
|
||||
} while(_hours > 23);
|
||||
|
||||
do {
|
||||
woz_puts("\r(MINUTES) ");
|
||||
apple1_input_line_prompt(KEYBUF, 2);
|
||||
_minutes = (byte) atoi(KEYBUF);
|
||||
} while(_minutes > 59);
|
||||
|
||||
_seconds = 0;
|
||||
|
||||
enable_timer_interrupt();
|
||||
|
@ -35,7 +35,7 @@ EXPORT __interrupt(hardware_all) void time_interrupt_handler() {
|
||||
_seconds = 0;
|
||||
if(++_minutes == 60) {
|
||||
_minutes = 0;
|
||||
_hours++;
|
||||
if(++_hours == 24) _hours = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user