I'm new to assemblers, so this question might sound dumb, but exactly what type of code should be implemented in a raster interrupt handler?
So I know this handler gets called when the desired raster line is rendered. But this seems to happen only once (if I ack the interrupt). Unless I clear the screen or redraw the relevant part of it, the handler routine won't be called again, right?
So then what's the point of using an interrupt?
If have a main loop like this:
main jsr readKeyboard jsr readJoystick ... jmp main
... then I have an endless loop monitoring everything anyway, so I don't understand what do I use interrupts for?
I mean, I thought interrupts can be used to implement an event system. They eliminate the need for polling and wasting CPU cycles by waiting. But if they happen only once, then this is not possible.
interruptHandler inc $d019 ; acknowledge ... ; do the work jmp $ea81
If I acknowledge like this, the method is called only once. If I don't, it gets called over and over again.
So please help me understand the concept here.
What's the right way to use interrupts? What functionality they are suitable for? When should I use them?
Thx!