Skip to main content

by Erik and Gunter of the Exceptions (TEX)

Unfortunately, this is the last episode in this remarkable quest
through the land of programming tricks and things that were
earlier thought to be impossible. We have seen smooth horizontal
scrolling, techniques on how to use raster interrupts, a
brilliant sound synthesizer by the best music programmer on the
ST, neat graphics effects and now....the explanation of how one
can use the lower and upper border for graphics!
Now this series meets its end, the ST NEWS editorial staff would
once again like to thank Tarik Ahmia ("ST Magazin/68000'er") for
his kind permission to have us use these articles as well, and of
course to our good friends The Exceptions who have co-operated
very well - and even more!

Well, so this is the last episode. Yeah, this is now truly the
last part we write in the "Wizards" series. Never again I (Erik)
have to write these weird prefaces. Finally, your machine's
hardware is left untortured - but this will not happen until we
have torn some more effects from it!
I am not sure if the ST's designers knew what can be fetched
from its meagre video electronics. You will now surely think we
will finally tell you how the lower border can be removed: You're
right - cause that's what we told you all the time after all. And
we have not only decided to explain to you how to remove the
lower border, but also the upper border!
I am convinced that you will wonder how one would get the crazy
idea in one's deranged mind to go and display graphics in any of
the borders. And that even while the Shifter chip really doesn't
have that much facilities to achieve this! Hereby I should say
that it wasn't us that came to this idea, but someone from
Mannheim, about 2 year ago, calling himself Alyssa (Hi Sven -
still alive?). He spread a rumour that he had succeeded in
displaying graphics in the lower border and of course we did the
only sensible thing: We declared him insane. But a short while
later we had to swallow our words: He sent us a sample and we had
to admit: There was definitely something down there! We looked
at the source with shaking hands and examined the method that he
used. The specific explanation of the trick will follow in just a
We were stunned, but didn't falter to start and enhance Sven's
method, so that we can now even put graphics in the left-and
right border and even EVERYWHERE. But we want to keep a few of
our secrets, so Gunter will now tell your everything about the
control of the electron beam and NOT everything about the border

Hi, dear readers, this is Gunter behind the keyboard!
Our last episode wasn't really staggering insofar as that it
wasn't really technical. But we're featuring three listings here!
This time, we're talking about the upper and lower border -
better put: Not the borders, but means to get rid of them.

Let's start right away with the lower border. I hope you still
have the article about raster programming (ST NEWS Volume 3 Issue
6) in mind, since we're going to use that here again.
To remove the lower border, you must switch to 60 Hz in the
lowest screen line (number 199). Shortly afterwards, in the left
border, you must again switch back to 50 Hz. It is very important
that this happens at the right time! When the switch point is
somewhere in the screen, the graphics will be damaged. So dig out
the rasters and turn them loose.
Those of you that don't know the article about 'raster
interrupts' should know that 'hblon' activates the rasters. The
program is now adjusted in such a way that an interrupt is
cleared every time the right border is found of line 198. Then,
the program jumps into the 'newtb' routine: This is where it gets
to be interesting.
Then we wait for the right border of line 199 (last 'official'
scan line). That's why the interrupt has to be cleared one line
earlier. After the waiting loop, we switch to 60 Hz. After a
short pause we go back to 50 Hz. That's all. The lower border
should now be gone.
Screen memory continues as usual - i.e. $7D00 bytes after the
start of screen memory, memory for the lower border starts. You
can for example build in the scrolling routine of ST NEWS Volume
3 Issue 5, and now you have a nice border scroller. In the
sample program (LOWERBOR.S, located in the PROGRAMS folder), the
lower border is just removed and filled with a pattern.

Let's now get on with the upper border. Here, it is not all that
easy as with the lower border. There is a very simple method,
but it is strongly dependent on your monitor as well as your
computer. To put it differently: The thing fauls up at half of
all STs. The graphics are most of the time damaged, and a routine
that should combine into a removal of the lower border doesn't
function anymore. So if you see a demo (not one of us, for sure)
that has these effects, they surely use the wrong method. Enough
slandering - I will now finally reveal to you how it's done the
right way. With our routine, improved by Andreas from Level 16,
it is not possible to open the entire upper border. There is a
certain point that is - depending on computer version - 13 or 29
scanlines above the regular screen where you can open the upper
border. Yes, you're right. Unfortunately there are two (I hope
there aren't more) different computer versions. The MMU is really
to blame in this case, because you use the MMU in all this border
stuff, and not the shifter, which often gets all the attention.
The MMU 'decides' in the ST when the shifter should display
graphics and when it should display borders. The shifter itself
is totally dumb. Even in the border the MMU must supply it with a
continuous stream of zeroes. Here the MMU is 'persuaded' not to
give zeroes but graphics memory to the Shifter. for the upper border. One cannot undertake anything
against the individual MMU versions, but one can get the computer
to display the upper border in all cases through a little trick.
So we simply built in the known 50/60 Hz switches on 29 and 13
lines above screen start. The border will then surely be thrown
open. Depending on the computer version you own, you will have 13
or 29 lines extra. The second switch does not interfere, luckily.
But now there's another problem. I talk constantly about
switching before screen start. Unfortunately, you cannot clear an
interrupt there, since Timer B only starts at the screen start.
There's nothing you can do about that, so you'll just have to
'spill' raster time and clear an interrupt in the LAST possible
raster line. Then we simply wait the correct number of lines to
switch off the lower border. This waiting loop is done the best
way when we wait x*512 clock cycles (the time needed to draw one
scan line). Look at the file UPPERBOR.S in the PROGRAMS folder.
But you can also open the lower border to use the waiting time
efficiently. Don't think that you can only open the upper border
in combination with the lower one. It's only opened to save
processor time. A second raster is in fact set 47 scan lines
deeper. This second raster (newtb2:) is located on the last
possible line, that is not reached on all STs. Here, we now have
to start our waiting time loop. If we hadn't opened the lower
border, we would have had to wait another 47 lines.
The first waiting loop ends 29 lines above the screen. Here we
will try to open the upper border just like we opened the lower
one. Then we have to wait another 15 lines, and then we have to
try our luck a second time. Alongside the old level 4 interrupt
is restored, which is only needed when executed the first time.
From now on, both Timer B routines call one another. After the
second trial of opening the upper border, we load the Timer Data
Registers with the value 199+13. We then get back to the precise
location where the lower border starts (13 lines upper border +
199 lines regular screen), and the circle closes itself.

In the listing, some control colors are added where the borders
are switched on and off. Between green and white, the lower
border is opened. The two switch points for the upper border are
located between white and red as well as red and green. Now you
can see which MMU version you have. Depending on the version the
pattern starts after white or after red. We have experienced that
especially old STs have 13 lines more in the upper border, while
the new models can usually achieve 29 lines. Therefore, these
have a smaller lower border.

Hi. Here is Erik again. They told me I should write some final
words of farewell. But why so sentimental? We have had good fun
writing for ST NEWS, and who knows....we might get back in the
future, revealing even more tricks! If you think the articles
were nice, just write to the ST NEWS correspondence address. If
you think they weren't, well....write as well!
We hope you liked our style. Maybe, these articles even helped
in increasing the overall quality of ST software? I don't know
nothing to write now anymore, so I will close down. Maybe, we'll
'see' one another again. Bye!

The text of the articles is identical to the originals like they appeared in old ST NEWS issues. Please take into consideration that the author(s) was (were) a lot younger and less responsible back then. So bad jokes, bad English, youthful arrogance, insults, bravura, over-crediting and tastelessness should be taken with at least a grain of salt. Any contact and/or payment information, as well as deadlines/release dates of any kind should be regarded as outdated. Due to the fact that these pages are not actually contained in an Atari executable here, references to scroll texts, featured demo screens and hidden articles may also be irrelevant.