[comp.sys.atari.st.tech] Vertical Blank routines

chu@acsu.buffalo.edu (john c chu) (06/08/91)

Can someone mail me the dos and don'ts of using routines that run
every vertical blank? If the Abacus ST Internals is accurate in this
case, I think I know how to install a routine. However, I'd like to
know if it is ok to call an XBIOS routine during that time, what the
maximum length a routine should be and so on...

(also, is it correct to add your routine to the VBL queue by altering
the system variables? Their locations do not (and will not) change
between versions of TOS?)

thanks...

					john
				chu@acsu.buffalo.edu

bjoern@drdhh.hanse.de (Bjoern Kriews) (06/12/91)

chu@acsu.buffalo.edu (john c chu) writes:
>Can someone mail me the dos and don'ts of using routines that run
>every vertical blank? If the Abacus ST Internals is accurate in this
>case, I think I know how to install a routine. However, I'd like to
>know if it is ok to call an XBIOS routine during that time, what the
>maximum length a routine should be and so on...

Before calling BIOS or XBIOS routines from interrupts, you should
use BIOS_ON, afterwards BIOS_OFF, which are macros used to manipulate
the bios register stack.

#define	SAVPTR		(*(char **)0x4a2)
#define	BIOS_ON		(SAVPTR += 46)
#define	BIOS_OFF	(SAVPTR -= 46)

>(also, is it correct to add your routine to the VBL queue by altering
>the system variables? Their locations do not (and will not) change
>between versions of TOS?)

Yes, it's ok.



---
bjoern@drdhh.hanse.de = Bjoern Kriews / Stormsweg 6 / 2000 Hamburg 76 / FRG
"gaaga mahwe Bjoern urgl ufzae Turbo-C bnub"     (J. Willamowius)

erik@mcrware.UUCP (Erik Johnson) (06/12/91)

In article <79358@eerie.acsu.Buffalo.EDU> chu@acsu.buffalo.edu (john c chu) writes:
>Can someone mail me the dos and don'ts of using routines that run
>every vertical blank? If the Abacus ST Internals is accurate in this
>case, I think I know how to install a routine. However, I'd like to
>know if it is ok to call an XBIOS routine during that time, what the
>maximum length a routine should be and so on...
>

Down these same lines, does anyone know what the OS entries in the VB queue
are used for (I know there are many different versions of TOS, but their
function may be similar).  If I make my VBI the only entry, then I can get
130,000 cycles of processing time during each VBI.  Of course using this
much processor time during each interrupt means that your main CPU process
is running with very little processor time.  Somewhere during that 130k cycles
the next screen refresh is already taking place, so don't count on the screen
refresh to wait until your VBI is over.

Another question.  From my experimentations, I have found that it is possible
to have very long VBI interrupts (perhaps a 2 second interrupt).  Think of this
as a one time interrupt.  Now during this way-long interrupt, is it true that
no more VBIs are processed until it is over?  Also, is the main process halted
completely while it is running?

If anyone is interested, I have a tiny assembly routine that will install a
VBI, and another to restore the old entries.  If a few people are interested
I will post it (very short, but I don't have it with me at the moment).

Later,

Erik R Johnson