For 25 FPS I also use a frame counter that starts from 0, and +1 is added to it in every vertical blank interrupt.

But I have only 1 wait for vbl.

But just before the "wait for vbl" command happens, I have a separate waiting loop which waits for the frame counter to reach 2. And somehow, after the interrupt has updated the value to 2 and program flow switches back to the main code, the main code vbl wait can still "reach" that same vbl that triggered the interrupt.

In Blitz Basic this method works fine, don't know if ASM is different.

If you use a Graphics.library-style blitter interrupt to draw your bobs and so on, you can actually let the blitter blit and use the CPU to run the program at the same time! Just using QBlit to do any unusual blitting such as filling and so on allows you to use Graphics.library itself if you're so inclined. This is to avoid having multiple blitter lists.

Hmm. Really? As far as I understand that wouldn't give you the possibility to finish your update_all, when it takes more than 20ms, because the current VBL is interrupted by the next VBL, which restarts update_all from the beginning.

Hmm. Really? As far as I understand that wouldn't give you the possibility to finish your update_all, when it takes more than 20ms, because the current VBL is interrupted by the next VBL, which restarts update_all from the beginning.

At first I did not remember why I had written this code yesterday, now I remember update_all is a really fast routine only changing bpl and sprite pointers (double buffer swith) so it can not last 20ms but only few video lines!
[sure the name is misleading, it should be something like update_pointers or buffers_switch]

Ok. I see. The _done_flag makes every second interrupt skip the make_screen routine, which continues to run in the previous interrupt context, when the new one returns.

You got it.
The beauty of this approach is that it is a general solution.
No special cases for specific situation and it works for every requested frame rate (actually frame rate below <0.4 fps is not supported )