Vol 3 Issue 3

 


The secret of the fish
by Udo of TEX

 

On our visit to Holland (see the article in the ST NEWS Volume 3 Issue 2) Richard urged me to write an article about the "fish". If you don't know anything about the "fish" get your hands on our "B.I.G. Demo" and view our second Psych-O-Screen:


Hi! Now it's my turn to explain how to kick the shifter of the ST not to make a lower border. Just a word before: Have you already seen the Psycho-2-Screen? If you haven't, just have a look at it now. The scrolling message will stop during the Psycho Screen. Do you wonder about the fish in the right half of the lower border? We also wonder about it! When we took the photo of the board gliding in front of the colours there was no fish - but after developing the photo the fish appeared (how I can write about fishes just to fill the last three kilobytes); but let's come to the point now! If you carefully examine the Psycho-2-Screen you'll discover a faint line over the whole screen crossing the rightmost air bubble - and if you remember our Super-Neo-Demo-Show you might have noticed a mistake in the pictures in the bottommost line (at the right border, 16 pixels are missing...). These are effects of switching off the border.

Attention!!! I'm now explaining the principles of switching off the border: In the middle of the last line of the normal screen (no. 199 counted from 0) you must change the syncronization frequency from 50 Hz to 60 Hz. This will cause the shifter to start the right border 16 pixels earlier than usual. Then wait till the electron beam is in the left border of the next line. There you must switch back from 60 Hz to 50 Hz and there will be no lower border again. The greatest problem is the exact timing of the synchronization switching! Your routine will be disturbed by keyboard and timer c interrupts. If you don't succeed in timing the program exactly there might be two different effects: In the easier case you'll see the border again for a moment, in the other case you'll see curious things happen on your screen (flickering bitplanes and so on). Another result of switching off the border is a confused video shifter which is starting the right border 16 pixels too soon as he doesn't want to show the last two bytes of the video memory. Therefore the first address displayed in the first line of the border is 31998 bytes behind the first address of the screen (!), so you must move your graphics two bytes to the left for not getting "funny" pictures!

Puh! Writing this text used much less time than making the lousy Psycho-2-Screen for which I needed 48 hours of hard programming and I don't know how long ES needed to paint the graphics with Neochrome, the best painting program on the ST!

Abridged version taken from the B.I.G. Demo scrolltext


 

Perhaps you will see a fish in the bottom right corner of the screen where usually the border appears. If you can't see any fish you are one of the few poor guys who have an ATARI SC1224 monitor. But at least you must see some "air bubbles". The fish was painted to explain the presence of the air bubbles, and the air bubbles were only painted to hide a useful error of the video chip. And now we have reached the theme of this article: Fooling the video chip not to make the lower border.

How to switch off the lower border:

To irritate the video shifter you must switch the video frequency from 50 to 60 Hz in the last line of the screen. This will irritate the video chip so it forgets to draw the last 2 bytes of the screen memory (this causes the right border to start 16 pixels earlier and to hide this malfunction the air bubbles were painted in the screen). After displaying 200 lines the MMU is checking if 32000 bytes have been displayed. But due to the 2 bytes error there are still some left. If switched back to 50 Hz in the left border of the next line, the MMU will continue sending memory data to the shifter without stopping. It depends on the monitor and the ST's video transistor but in the best case you will see 64 more lines of video data till the monitor starts his blank gap. I will now explain a routine doing this, which is my modified RIP (raster interrupt program) from ST NEWS Volume 2 Issue 6.

First we need a level 4 routine which is called at every VBL (that means 50 times per second):

new4:    
clr.b $fffffa1b.w ;stop timer
move.b #199,$fffffa21.w ;set data register
move.b #8,$fffffa1b.w ;start timer
new4b:    
jmp $000000  

This rout sets the Timer C data register to 199 so our main program will be interrupted to handle the border removing properly. Now the Timer C handler:

newtb:    
clr.b $fffffa1b.w ;timer stop
movem.l d0/d3-d7/a0-a6,-(sp)  
move.w #$fa21,a4    
move.b #180,(a4) ;set counter
move.b #8,-6(a4)  

This will install a new Timer C data so we are no longer disturbed by the Timer C, but it is still running.

moveq #0,d0 ;wait till middle of line
mulu d0,d0  
mulu d0,d0  
move.b #0,$ffff820a.w ;on to 60 Hz

We now spent a lot of time multiplying nonsense to let the electron beam run in the middle of the screen and then switched to 60 Hz.

move.b (a4),d0 ;wait for right border
wait:    
cmp.b (a4),d0  
beq wait  

As the Timer C is still running, we use this loop to wait for the right border.

moveq #0,d0 ;wait on left border
mulu d0,d0  
mulu d0,d0  
move.b #2,$ffff820a.w ;back to 50 Hz

With this commands we spent some time waiting for the HBL then we switched back to 50 Hz.

movem.l (sp)+,d0/d3-d7/a0-a6  
bclr #0,$fffffa0f.w ;end of interrupt
rte    

Now we have ended the Interruptrout. This was my explanation of the border removing for those who had no time or no patience to read it in the scroller of the "B.I.G. Demo". The only disadvantage of the program is that in the worst case you can see only 8 lines of the border graphic (on a very bad SC1224 monitor). But I hope you can use this program efficiently.

If you have any questions or suggestions write to:

TEX
P.O. Box 1322
D-6702 Bad Dürkheim
West Germany


Source + PRG


This text was published in the Atari ST diskmag "ST News" and is used by kind permission of Richard Karsmakers. Source for this article: http://www.st-news.com