<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=Fullscreen_programming_on_the_Atari_ST</id>
	<title>Fullscreen programming on the Atari ST - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=Fullscreen_programming_on_the_Atari_ST"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Fullscreen_programming_on_the_Atari_ST&amp;action=history"/>
	<updated>2026-07-26T06:15:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=Fullscreen_programming_on_the_Atari_ST&amp;diff=13420&amp;oldid=prev</id>
		<title>&gt;Wongck at 15:50, 11 October 2011</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Fullscreen_programming_on_the_Atari_ST&amp;diff=13420&amp;oldid=prev"/>
		<updated>2011-10-11T15:50:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:50, 11 October 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l215&quot;&gt;Line 215:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 215:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bye...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bye...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Flix/DF (The Union)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Flix/DF (The Union)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Programming]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>&gt;Wongck</name></author>
	</entry>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=Fullscreen_programming_on_the_Atari_ST&amp;diff=13419&amp;oldid=prev</id>
		<title>&gt;Desty: Adding an article on fullscreen programming by Flix@delta force</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Fullscreen_programming_on_the_Atari_ST&amp;diff=13419&amp;oldid=prev"/>
		<updated>2011-09-06T14:28:13Z</updated>

		<summary type="html">&lt;p&gt;Adding an article on fullscreen programming by Flix@delta force&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;            &amp;quot;Fullscreen&amp;quot;-Programming on the Atari ST&lt;br /&gt;
                     by Flix of Delta Force&lt;br /&gt;
&lt;br /&gt;
Welcome  to the first part of a series of articles in  which  the &lt;br /&gt;
Delta  Force will explain how to code  &amp;quot;demos&amp;quot;,  featuring  fully &lt;br /&gt;
working source-codes on the Maggie-disk.  This article will  show &lt;br /&gt;
you  how  to  display screens with a resolution  of  416  by  276 &lt;br /&gt;
pixels, using 16 colours per line.&lt;br /&gt;
The  reader  of  this  course  should  have  basic  knowledge  of &lt;br /&gt;
assembler   and  the  ST's  hardware.   The  first  topics   are: &lt;br /&gt;
Annihilation of the screen borders (by Flix),  Sync-Scrolling (by &lt;br /&gt;
New Mode) and Music programming using the YM-2149 (by Big  Alec). &lt;br /&gt;
&lt;br /&gt;
But now let's talk about the borders:&lt;br /&gt;
Allthough nobody expected it to be possible a long time ago,  the &lt;br /&gt;
ST's  borders  can  be removed  by  pure  software.  Demos,  that &lt;br /&gt;
displayed  graphics  in the borders using nothing  but  software, &lt;br /&gt;
were  the  foundation  for  the  development  of  the  well-known &lt;br /&gt;
&amp;quot;Overscan&amp;quot;-hardware.&lt;br /&gt;
&lt;br /&gt;
At first,  I will write a bit about the history of the  so-called &lt;br /&gt;
&amp;quot;border-programming&amp;quot;.&lt;br /&gt;
The  first human ever to display any graphics in a screen  border &lt;br /&gt;
was  Sven alias &amp;quot;Alyssa&amp;quot; from Mannheim/Germany.  Back in 1987  he &lt;br /&gt;
wrote  an intro,  that showed graphics in the  lower  border.  As &lt;br /&gt;
Sven  vanished  very fast from the  ST-scene,  it  is  completely &lt;br /&gt;
unsettled,  how Sven had the idea to switch the screen  frequency &lt;br /&gt;
to  60 Hz for a short period of time within the last line of  the &lt;br /&gt;
screen.  Without this fundamental idea,  no fullscreens or  sync-&lt;br /&gt;
scrolling  would be possible on the ST.  Unfortunately nobody  in &lt;br /&gt;
the  ST-scene  knows  what &amp;quot;Alyssa&amp;quot;  is  doing  today.  TEX  (The &lt;br /&gt;
Exceptions)  firstly  used graphics in the lower  border  in  the &lt;br /&gt;
famous  &amp;quot;B.I.G.  Demo&amp;quot;.  To  open the lower  border,  the  screen &lt;br /&gt;
frequency  has  to be switched to 60 Hz at the end of  the  199th &lt;br /&gt;
line.  The  ST  then  reads nearly 50 more lines  of  the  screen &lt;br /&gt;
memory!  The Exceptions revealed this secret in the  B.I.G.  Demo &lt;br /&gt;
at the end of the longest scrolltext (42 Kybtes of  text).  After &lt;br /&gt;
The Exceptions took up Alyssa's trick,  the upper border was  the &lt;br /&gt;
next  one  to  be  removed.  This is  achieved  by  toggling  the &lt;br /&gt;
frequency  13  or  29 lines above the &amp;quot;usual&amp;quot;  beginning  of  the &lt;br /&gt;
screen.  You  may wonder,  why the upper border can be 13  or  29 &lt;br /&gt;
lines long.  Unfortunately there are two different  MMU-versions, &lt;br /&gt;
that have a difference of 16 lines.  Due to the place to open the &lt;br /&gt;
upper  border  being  above the screen memory  and  the  Timer  B &lt;br /&gt;
starting  to  count at the beginning of the  screen  memory,  The &lt;br /&gt;
Exceptions  used a quite complicated method.  They set a Timer  B &lt;br /&gt;
Interrupt  in  the last line and waited  until  the  electron-ray &lt;br /&gt;
reached the right position in the upper border.  Doing this, they &lt;br /&gt;
had  to waste a lot of processor-time.  In the &amp;quot;Musical Wonder  - &lt;br /&gt;
1991&amp;quot;  I  used a routine that waited a few  scanlines  after  the &lt;br /&gt;
VBL-Interrupt occured and then toggled the screen-frequency.  But &lt;br /&gt;
there's  still a better method.  Timer B is counting just  &amp;quot;real&amp;quot; &lt;br /&gt;
screen-lines  (200),  but there is another  interrupt,  the  HBL, &lt;br /&gt;
which  counts all scanlines (313).  At the beginning of  the  VBL &lt;br /&gt;
the  HBL  starts counting until the right position  to  open  the &lt;br /&gt;
upper border is reached.  If you now open both, the upper and the &lt;br /&gt;
lower,  border,  you  have  277  lines of  graphics  in  the  low &lt;br /&gt;
resolution.&lt;br /&gt;
&lt;br /&gt;
Soon  the next border was declared to vanish:  The right  border. &lt;br /&gt;
Unfortunately it is not possible to open this border with Timer B &lt;br /&gt;
or HBL interrupts.  The ST displays graphics in the right border, &lt;br /&gt;
if  you  switch the frequency to 60 Hz at a certain  position  in &lt;br /&gt;
every line,  in which the right border is supposed to be  opened. &lt;br /&gt;
This  &amp;quot;certain&amp;quot; position requires a completely new  technique  of &lt;br /&gt;
programming. If you switch colours in an ordinary Timer B, VBL or &lt;br /&gt;
HBL interrupt, you can see, that these interrupts do not occur at &lt;br /&gt;
exactly the same position. The colours shake from the left to the &lt;br /&gt;
right.  In  order to make some commands,  like the colour or  our &lt;br /&gt;
frequency  switchings,  occur at exactly the same  position,  you &lt;br /&gt;
have  to  become synchronized with  the  raster-electron-ray.  An &lt;br /&gt;
ingenious method to achieve this effect is the following one:&lt;br /&gt;
&lt;br /&gt;
WAIT:     MOVE.B    $FF8209.W,D0   ; Low-Byte&lt;br /&gt;
          BEQ.S     WAIT           ; mustn't be 0&lt;br /&gt;
          NOT.B     D0             ; negate D0&lt;br /&gt;
          LSL.B     D0,D0          ; Synchronisation&lt;br /&gt;
&lt;br /&gt;
If  you execute this routine every VBL,  all  following  commands &lt;br /&gt;
will be executed at the same position every VBL,  that means that &lt;br /&gt;
the colour- or frequency-switches are stable.  But what does this &lt;br /&gt;
little routine do?  At first,  the low-byte of the screen-address &lt;br /&gt;
is  loaded  into D0.  This byte exactly determines  the  position &lt;br /&gt;
within  the line.  It is negated and the LSL-command is  executed &lt;br /&gt;
(LSR,  ASL  or  ASR  work as well).  As you  can  read  in  every &lt;br /&gt;
processor-book  the LSL-command takes  8+2*n  clock-cycles.  That &lt;br /&gt;
means  that  the command needs more clock-cycles the  bigger  the &lt;br /&gt;
value in D0 is. That is exactly the shifting that we need! I hope &lt;br /&gt;
that you understood this part,  because all fullscreens and sync-&lt;br /&gt;
scrolling-routines  are based upon this effect.  You should  know &lt;br /&gt;
that  one  VBL  (50  Hz) consists  of  160000  clock-cycles  (one &lt;br /&gt;
scanline  consists of 512 clock-cycles).  Now you have to  switch &lt;br /&gt;
the  frequency  at a certain position and the  border  opens.  Of &lt;br /&gt;
course  this takes a lot more processor time than the opening  of &lt;br /&gt;
the  upper  or lower border,  because you've to open  the  border &lt;br /&gt;
every  line.  Your  ST now displays 204 bytes per  line!  A  line &lt;br /&gt;
consists  of 25.5 instead of 20 words without the  right  border, &lt;br /&gt;
but should use only 23 of these 25.5 words,  because the  picture &lt;br /&gt;
is  distorted on some STs (We made this mistake in  the  &amp;quot;Musical &lt;br /&gt;
Wonder  - 1991&amp;quot;) if you use too much  words.  Anyway,  there  are &lt;br /&gt;
hardly  any monitors that have such a huge visible right  border. &lt;br /&gt;
A  demo-screen  without  the  lower  and  the  right  border  was &lt;br /&gt;
included in the &amp;quot;Amiga-Demo&amp;quot; by TEX.&lt;br /&gt;
For  a  long time it was considered impossible to open  the  left &lt;br /&gt;
border,  because the trick with the 60-hertz-switch did not  work &lt;br /&gt;
in the left border (I was sure about that as well). But than came &lt;br /&gt;
the  &amp;quot;Death  Of The Left Border&amp;quot;-Demo by  the  TNT-Crew.  Finally &lt;br /&gt;
there  was a screen in the legendary Union-Demo that  firstly  in &lt;br /&gt;
ST-history  displayed  no borders at  all:  The  first  so-called &lt;br /&gt;
&amp;quot;Fullscreen&amp;quot;!  The demo-coders made the impossible possible.  But &lt;br /&gt;
how  does  this  trick  work?  It's  pretty  simple:  Instead  of &lt;br /&gt;
switching  to  60  Hz you switch to 71 Hz!  If  you  disable  the &lt;br /&gt;
interrupt  that  resets  at 71 Hz,  you can switch to  71  Hz  in &lt;br /&gt;
coulour mode.  You should do this only for short periods of  time &lt;br /&gt;
(a few clock-cycles).  Being in 71 Hz for a long time can  damage &lt;br /&gt;
your  monitor (allthough I've never seen such damages).  It  goes &lt;br /&gt;
without  saying  that neither Maggie nor the &amp;quot;Delta  Force&amp;quot;  take &lt;br /&gt;
responsibility for damages caused by this technique.  If you  now &lt;br /&gt;
open the right border additionally,  the ST displays 230  instead &lt;br /&gt;
of  160  bytes  per line!  In order to make the  opening  of  the &lt;br /&gt;
&amp;quot;side-borders&amp;quot;  run  on  all STs,  you've  to  install  so-called &lt;br /&gt;
&amp;quot;Stabilisation&amp;quot;-switches  at  the  end  of  each  line  (This  is &lt;br /&gt;
sometimes  called &amp;quot;Closing of the right border&amp;quot; which it  isn't). &lt;br /&gt;
You  can  switch  to  71 Hz (like in the  source)  or  to  medium &lt;br /&gt;
resolution (like ULM (Unlimited Matricks) does it).  I prefer the &lt;br /&gt;
71  Hz  method,  because  I heard that the  other  method  causes &lt;br /&gt;
problems  on few STs.  The &amp;quot;Stabilisation&amp;quot; is needed because  the &lt;br /&gt;
shifter  waits for the last word at the end of the  right  border &lt;br /&gt;
(115  words are displayed in fullscreen) to fill the last  plane. &lt;br /&gt;
This  word  never  arrives and to avoid total  confusion  of  the &lt;br /&gt;
shifter the 71-Hz-switch does something like a shifter-reset.&lt;br /&gt;
If you now open all borders, you've a screen memory that consists &lt;br /&gt;
of  160+230*276  (=63640) bytes.  The first line  is  needed  for &lt;br /&gt;
synchronisation, therefore it has 160 bytes. The screen memory is &lt;br /&gt;
almost twice as big as in the &amp;quot;usual&amp;quot; low resolution!&lt;br /&gt;
Two registers of the shifter are needed to switch the frequency:&lt;br /&gt;
&lt;br /&gt;
     $FFFF820A:     0: 60 Hertz         2: 50 Hertz     &lt;br /&gt;
     $FFFF8260:     0: Low resolution   2: High Res. (71 Hertz)&lt;br /&gt;
&lt;br /&gt;
There  are various methods to cause the  frequency-switches.  ULM &lt;br /&gt;
uses the &amp;quot;Immediate&amp;quot;-Adressation, that means a 60-Hz-switch would &lt;br /&gt;
look like this:&lt;br /&gt;
&lt;br /&gt;
          MOVE.B    #0,$FF820A.W   ; 60 Hz (16 clock-cycles)&lt;br /&gt;
          MOVE.B    #2,$FF820A.W   ; 50 Hz (16 clock-cycles)&lt;br /&gt;
&lt;br /&gt;
Besides  that this method takes a lot of processor  time,  it  is &lt;br /&gt;
said  that it does not run on all STs.  Another method is to  use &lt;br /&gt;
registers.  This  is faster,  but takes some Data-  and  Address-&lt;br /&gt;
registers.  A  60-Hz-switch  would look like  that  (D0=0,  D1=2, &lt;br /&gt;
A0=$FF820A.W):&lt;br /&gt;
&lt;br /&gt;
          MOVE.B    D0,(A0)        ; 60 Hz (8 clock-cycles)&lt;br /&gt;
          MOVE.B    D1,(A0)        ; 50 Hz (8 clock-cycles)&lt;br /&gt;
&lt;br /&gt;
In the source-code on the this Maggie-disk only D0, A0 and A1 are &lt;br /&gt;
used for all frequency switches.  How is this possible? Usually a &lt;br /&gt;
data-register is needed for synchronisation,  but you can use the &lt;br /&gt;
fact that D0 should always contain zero:&lt;br /&gt;
&lt;br /&gt;
WAIT:     MOVE.B    $FF8209.W,D0   ; Low-Byte&lt;br /&gt;
          BEQ.S     WAIT           ; mustn't be 0 &lt;br /&gt;
          NOT.B     D0             ; negate D0&lt;br /&gt;
          LSR.B     D0,D0          ; Synchronisation&lt;br /&gt;
&lt;br /&gt;
After  the LSR-command is executed,  D0 contains zero  for  sure. &lt;br /&gt;
This  zero  can than be used for the  border-routine.  The  other &lt;br /&gt;
data-register  D1 must contain 2.  This register is  superfluous, &lt;br /&gt;
because   you   can  get  the  2  from  somewhere   else   (D0=0, &lt;br /&gt;
A0=$FF820A.W):&lt;br /&gt;
        &lt;br /&gt;
          MOVE.B    D0,(A0)        ; 60 Hz&lt;br /&gt;
          MOVE.W    A0,(A0)        ; 50 Hz&lt;br /&gt;
&lt;br /&gt;
This  step  is not very easy to understand.  The  second  command &lt;br /&gt;
writes the word $820A to $FF820A.  The second byte of the word is &lt;br /&gt;
meaningless,  because  the address $FF820B of the shifter is  not &lt;br /&gt;
used.  The  shifter  only reads the lower two bits of  the  first &lt;br /&gt;
byte ($82), that means that the byte is handled like $02!&lt;br /&gt;
The  source-code  on the disk includes a  subroutine  that  tests &lt;br /&gt;
which MMU is present,  that means how many lines the MMU displays &lt;br /&gt;
with an opened upper border (229 or 213).  The program should run &lt;br /&gt;
on every ST,  STe,  Mega ST and Mega STe (not on TTs). It took me &lt;br /&gt;
more  than a month to test the routine on all  possible  ST-chip-&lt;br /&gt;
configurations (Thanx to Alien/ST-CNX).  There are more than  two &lt;br /&gt;
dozens  ST-versions.  Atari  changed the Glue,  the MMU  and  the &lt;br /&gt;
Shifter quite often.&lt;br /&gt;
It  is  possible to open two more lines of the  lower  border  by &lt;br /&gt;
switching  to 60 Hz for a second time at the end of the  &amp;quot;normal&amp;quot; &lt;br /&gt;
lower border.  Unfortunately this does not work on the new  Atari &lt;br /&gt;
colour  monitors  (Thanx to Aeon/Aura for telling  me!).  For  my &lt;br /&gt;
&amp;quot;Punish Your Machine&amp;quot;-screen I had the idea to code a  fullscreen &lt;br /&gt;
in medium resolution.  It worked fine on my ST very soon,  but on &lt;br /&gt;
the ICC #2 I discovered that the screen only worked on my ST! New &lt;br /&gt;
Mode  made  it work on all STs two months  later,  allthough  all &lt;br /&gt;
&amp;quot;border-experts&amp;quot; on the ICC #2 said that it's impossible to  code &lt;br /&gt;
a fullscreen in medium resolution.&lt;br /&gt;
The most difficult thing writing a fullscreen is that the  entire &lt;br /&gt;
code  has  to  fit  synchronous  in  the  waiting  gaps  of   the &lt;br /&gt;
fullscreen-routine.&lt;br /&gt;
A  few  days  after  the ICC #2 I  developed  a  new  fullscreen-&lt;br /&gt;
routine.  With this routine the main program does not have to  be &lt;br /&gt;
synchronous  with  the electron-ray.  The  disadvantage  of  this &lt;br /&gt;
method  is that the border annihilation takes up to 50  per  cent &lt;br /&gt;
of the processor time.  Therefore you can use  keyboard-requests, &lt;br /&gt;
multiplications,   divisions  and  interrupts.  The  routine  is, &lt;br /&gt;
allthough  it's awfully old,  top secret and cannot be  published &lt;br /&gt;
in Maggie (yet).&lt;br /&gt;
Ok,  I  hope  you  understood  how you make  your  ST  display  a &lt;br /&gt;
resolution  of  416*276 pixels.  In the next part New  Mode  will &lt;br /&gt;
explain  how you can scroll the whole screen in 4 planes using  7 &lt;br /&gt;
scanlines of processor-time.&lt;br /&gt;
&lt;br /&gt;
Bye...&lt;br /&gt;
Flix/DF (The Union)&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>&gt;Desty</name></author>
	</entry>
</feed>