A.D.A. Amiga Demoscene Archive

  Welcome guest! Please register a new account or log in

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Various subroutines calls during VBL interrupt : how to ?

 

Author Message
HM Kaiser
Member
#1 - Posted: 20 Mar 2012 10:20
Reply Quote
Hi !
I have a question about VBL interrupt, and demo effects subroutines. Let's explain that:

Let's say the VBL interrupt handles, for instance, a starfield and a scrolltext, which are permanent.
In the intro, the first effect does not need VBL for timing.

But for another effect, I need to do more things during the VBL interrupt. And when this effect is finished, these things of course don't need to run any longer.
-> how do I call this additionnal stuff ? I thought about a "flag" tested in the VBL interrupt routine, and jump (or not) to the additionnal stuff given the result of this flag ?
-> or should I do another VBL interrupt, with additional code / jumps to sub routines ?

What are the good practices ?
bstrr
Member
#2 - Posted: 20 Mar 2012 12:35
Reply Quote
put the addresses of the subroutines in a list and update the contents of the list based on where you are in the demo mayhaps? then you just jump to any subroutine sequentially through the list until you reach the end of the list (use a zero or similar for termination).
HM Kaiser
Member
#3 - Posted: 20 Mar 2012 21:38
Reply Quote
Implemented this technique in my code. I like this way to do, thanks :-)
noname
Member
#4 - Posted: 21 Mar 2012 17:10
Reply Quote
I second bstrr. It also proofed handy to have some macro to register a function for execution in the next VBL, i.e. fill the list.

 

  Please register a new account or log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0