+
+uint8_t _daytime_irq(void) {
+ static char *t;
+ static uint8_t x, y;
+ /* We are called 60 times a second. We only want to draw a clock
+ * when we are a) on the mainscreen and b) the seconds changed */
+ if (kasse_menu == MENU_MAIN && CIA1.tod_sec != daytime.sec) {
+ t = get_time();
+ x = wherex();
+ y = wherey();
+ cputsxy(70, 3, t);
+ gotoxy(x, y);
+ }
+ /* always call additional handlers */
+ return (IRQ_NOT_HANDLED);
+}
+
+void install_daytime_irq(void) {
+ SEI();
+ set_irq(&_daytime_irq, daytime_irq_stack, DAYTIME_IRQ_STACK_SIZE);
+ CLI();
+}