On 5/27/2022 at 10:55 PM, svenvandevelde said:
Ed, may I ask, does the technique to process the VBLANK in the main loop (outside of the interrupt) help with the frame rate? I mean, I notice that during my IRQ processing, that if the CPU time goes beyond the available time to process one frame, then the logic "stutters" and is noticable. When processing the frames in the main loop, this might help, isn't it? because the main loop can just take it's time to paint, while the interrupt will handle the coordinates of the objects to be painted ... hmmm... might consider.
Well, I have a couple of routines that take a really long time. The subroutine that redraws the asteroid if you move or rotate your view takes about 2 million cycles. When it's in the middle of doing its thing it's using both VERA channels and bouncing around in various RAM banks.
I have that subroutine broken up into 22 parts, though I could break it up further if necessary. Each time it's starting a new part of the asteroid to draw, it sets the VERA channels. So, in between each of these 22 (or 44, or whatever I eventually decide) parts, it checks the flag bits set by the IRQ and does whatever (very short) subroutines it needs before returning to the next part of the Draw routine.
My IRQ just alerts the rest of the program that an event needs to take place, and regular checks of those flags in the rest of the program allows those VERA channels to be switched to different addresses without affecting other subroutines, and without the dance of addresses required if doing things within the interrupt subroutine.