Program of the Month

Atari Split-screen

by Paul Lay

'Split-screen' is a clever utility for a 16k Atari 400/800.

The program allows you to divide the Atari's screen refresh routine between two different displays - one graphic, the other text. The net result is that you can (apparently) display text and graphics at the same time.

The program intercepts the deferred vertical blank interrupt signal, and instructs it to alternate between two totally independent displays. Thus each display is refreshed at 1/25th second intervals instead of 1/50th. Since the human eye has a perception rate of approximately 1/16th second, we are fooled into seeing the two alternating displays as one uninterrupted one.

The beauty of this method is that the text and graphics screens are genuinely independent, so you can have both text and graphics on the same line, scroll text without affecting the graphics, and so on.

The program has been set up with a GRAPHICS 0 text screen and a GRAPHICS 7 graphics screen, but these may be changed if desired.

To use the routine in your own programs, add your code to the listing below. To force graphics to the prepared screen, GOSUB GRAPH just before entering the graphics statements. Similarly with text, GOSUB TEXT and then print to the screen in the usual way. Note that the TEXT subroutine positions the text cursor at 0,0.

Split screen does have one major problem: screen flicker. Although the brain can't see the two displays as separate, it's being asked to cope with a continuously changing image and perceives this as a rapid flickering. In order to minimise the effects of this, the author recommends the following:

(a) Use dark background colours and bright foreground ones.

(b) Don't change the background colour once set.

(c) Don't change graphics mode once set.

Page 6 locations 1536-1562 and 1636-1662 are used by the routine, so these memory locations must not be used by your program. Similarly, free memory above RAMTOP-8192 should be avoided if possible.

Note that you cannot change the text background colour or the value of COLOUR 3.

The screen flicker is irritating. Our referee suggests that it may even cause epileptic and migraine attacks in sufferers of either illness. If anyone can think of some way of eliminating or reducing the flicker, let me know.