Moj Mikro magazine article listings are available as zipped file in download section. It contains ATR disk image file with Atari DOS system for using with disk based, real Atari machine or any Atari 8-bit emulator. To load Atari BASIC programs properly, Atari must be powered with Atari BASIC enabled, or you can try them with any compatible BASIC.

You can try, use and modify the programs and routines for whatever purpose you want.
Description
The routine is used to fill any area with any 8-byte pattern with no slowdown. It is written in machine language for fast execution. Unfortunately, author of the routine didn't put assembly language source code for the routine, only the Atari BASIC listing in the form of DATA lines. You can check algorithm used for the routine in the last example of this article, written in pure Atari BASIC.
The routine works in graphics mode 8 and is called from BASIC like this:
M=USR(27400,X,Y,ADDRESS)
27400 is the starting memory address of machine language fill pattern routine. Parameters X and Y are coordinates of any chosen pixel in the area to be filled. Last parameter is starting address of the pattern, which will be used to fill the area. Pattern is set of 8 bytes. So, for example, you can use internal character set or any other memory address as basis for displaying interesting area patterns with your favourite characters. The routine takes only 491 bytes and uses 4K as stack for saving all unfilled pixels. For your programs in BASIC there is still 25K of free RAM memory remaining.
Fast fill pattern routine example 1
Magazine: Moj Mikro, 1989/11
Author : Milonja Bjelic
Page : 39
Atari BASIC listing on disk (tokenized): M8911391.BAS
Atari BASIC listing (listed): M8911391.LST

The original listing didn't include any demonstration code, so I modified it.
Fast fill pattern routine example 2
Next example is similar, with another demonstration. Every time you press any key, new random character patterns are shown.
Magazine: Moj Mikro, 1989/11
Author : Milonja Bjelic
Modification: Bostjan Gorisek
Page : 39
Atari BASIC listing on disk (tokenized): M8911393.BAS
Atari BASIC listing (listed): M8911393.LST

Fill pattern algorithm in Atari BASIC
And here is the last example, written in pure Atari BASIC, to show you algorithm used in main machine language routine. You may experiment with it and follow the inner workings of the mentioned routine.
Magazine: Moj Mikro, 1989/11
Author : Milonja Bjelic
Page : 39
Atari BASIC listing on disk (tokenized): M8911392.BAS
Atari BASIC listing (listed): M8911392.LST

Have fun!
Gury
Attached Files
Edited by Gury, Tue Jun 1, 2010 5:56 PM.















