View Single Post
Old 24 September 2019, 17:39   #1
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Interrupts, doing it low level, but properly.

I'm trying to set up some interrupt handlers, starting with some borrowed code. What I have works, but is limited to Vertical Blank interrupts only. How do I detect and process different kinds of (same level) interrupts, namely Blitter Finished?

So far, I have an interrupt handler:

Code:
static __attribute__((interrupt)) void InterruptHandler(void) {
	custom->intreq = (1 << INTB_VERTB); custom->intreq = (1 << INTB_VERTB); // reset vbl req. twice for A4000 bug

    display->updateDisplay(display);
}
Which I've set using the following:

Code:
void SetInterruptHandler(APTR interrupt) {
    * (volatile APTR *) (((UBYTE *) VBR) + 0x6c) = interrupt;
}
I've then enabled only vertical blank interrupts:

Code:
	custom->intena = (1 << INTB_SETCLR) | (1 << INTB_INTEN) | (1 << INTB_VERTB);
	custom->intreq = 1 << INTB_VERTB; // reset vbl req
While I get what each individual bit of code does, I don't fully get how they work as a whole. For instance, what's that last line, custom->intreq = 1 << INTB_VERTB, about?

And is this code "complete" enough, or is there more that I need to do inside the interrupt handler, for instance?
deimos is offline  
 
Page generated in 0.05125 seconds with 11 queries