So this is my handler of IRQ timer:
Code: Select all
/* IRQ handler */
if (fds.drive.irq_timer_enabled && fds.drive.irq_timer_counter && !(--fds.drive.irq_timer_counter)) {
fds.drive.irq_timer_enabled = FALSE;
irq.high |= FDS_TIMER_IRQ;
}
What happens is that in the interlude IRQ is used to create some effects (like the billboard that falls from above). The problem is that with this handler, the IRQ generation continues even when it should not (the screen that asks for the exchange of the side of the floppy).
If at the time of generation of the IRQ I reset the internal register of the reload counter (previously set through the registers $4020 and $4021), IRQ will not be generated any more, until a new value is loaded into $4020 and $4021.
Code: Select all
/* IRQ handler */
if (fds.drive.irq_timer_enabled && fds.drive.irq_timer_counter && !(--fds.drive.irq_timer_counter)) {
fds.drive.irq_timer_reload = 0;
fds.drive.irq_timer_enabled = FALSE;
irq.high |= FDS_TIMER_IRQ;
}
In this way everything works properly. I do not know if this is correct or not and unfortunately I have no way to test it on real hardware.