I see that @StephenHorn has written an article on interrupts.
I have a question on how to setup interrupts if your code is placed in a ROM bank (not the same as the Kernal).
I just can't get it to work. Any pointers on how to do this are welcome.
The alternatives I tried:
Placing bridge code in RAM that is pointed to by $0314-0315. The bridge code change ROM bank, and executes my code therein. When done it restores X,Y,A and exits with RTI (without changing the ROM bank).
Storing pointers to my interrupt handler directly in the $FFFE-FFFF in my ROM bank.
Either nothing happens, or the emulator crashes.
EDIT: I've looked a lot at the monitor code, but I do not fully understand it. One thing is that its interrupt handler seems to exit with a rts. How is that possible? Looking at the compiler config file for the monitor, it's apparent that it includes some vectors, amongst other things, from the Kernal. These two memory ranges are defined:
KSUP_VEC2: start = $FEC0, size = $0140, fill=yes, fillval=$AA; => Range $fec0-ffff: May include entry points of Kernal routines, and all interrupt vectors
It all comes down to what happens on an interrupt:
Is the interrupt vector read from FFFE/FFFF in the active ROM bank (and not always ROM bank 0)? I guess that there's no possibility that the processor on interrupt could change the ROM bank before code execution starts.
If so, what parts of the Kernal ROM need to be copied to your own ROM to make this work?
Hi,
I see that @StephenHorn has written an article on interrupts.
I have a question on how to setup interrupts if your code is placed in a ROM bank (not the same as the Kernal).
I just can't get it to work. Any pointers on how to do this are welcome.
The alternatives I tried:
Either nothing happens, or the emulator crashes.
EDIT: I've looked a lot at the monitor code, but I do not fully understand it. One thing is that its interrupt handler seems to exit with a rts. How is that possible? Looking at the compiler config file for the monitor, it's apparent that it includes some vectors, amongst other things, from the Kernal. These two memory ranges are defined:
It all comes down to what happens on an interrupt:
Share this post
Link to post
Share on other sites