Thanks for pointing that out BDD!
I’ve ANDed all interrupt lines in the CPLD.
Code:
IRQB <= N_VIA0IRQ and N_VDPIRQ and N_DUARTIRQ and N_SPIIRQ;
I added a second IRQ, in this case from the VDP. It creates an IRQ when scan line 200 has reached. The IS routine scrolls the screen one pixel to the left and one pixel up, each 60th of a second.
So there are two interrupts independently going on. I’m amazed how well this works, SID music is playing without hick-ups, and the screen scrolls completely smooth.
Attachment:
20181220_212118.jpg [ 3.86 MiB | Viewed 767 times ]
Sorry for the blurry picture, but it was uhm, in motion.
At the beginning of the scroll screen routine I changed the background color of the screen to green, at the end of the routine I changed it back to black. As a result you can see how much (little) raster time it takes to scroll the screen. The green raster line is visible at the bottom of the screen underneath the text “Test Screen”.
I did the same thing for the playmusic routine by changing the background color of the screen to red. Because the music isn’t playing in sync with the refresh rate of the screen, the red bars appear randomly on the screen. You can also see that the playmusic routine takes a little more time.
Here is the interrupt routine I'm using:
Code:
interrupt
pha
phx
phy
+vrfs 1 ; Read from vdp status register 1
and #%00000001 ; check if interrupt is caused by vdp scanline
beq sidirq ; no? sid irq
+vwtr 7,$c ; change background color to green
jsr scrollscreen ; scroll screen one pixel up and left
+vwtr 7,$1 ; change background color to black
sidirq
lda isr
and #%00001000 ; check if interrupt is caused by C/T
beq endirq ; no? exit irq
+vwtr 7,$6 ; change background color to red
lda rop12 ; clear counter ready interrupt status bit
jsr playmusic ; play music
+vwtr 7,$1 ; change background color to black
endirq
ply
plx
pla
rti