Mac Sys Data moved over to the Atari STFM from a Sinclair Spectrum 128K. Having a good knowledge of 6809 and Z80, MSD armed with a copy of K-Seka and a small Motorola 68000 programming pocket reference guide, started to learn the insides of the ST.
For a while MSD struggled with the Atari until he bought a copy of 'the concise Atari ST 68000 reference manual'. This manual held information of all system calls and system variables.
Armed with his new knowledge, MSD started writing simple programs in assembler. First on the list was to write some start-up and shutdown code. Once complete the simple task of displaying a low rez picture and settings the correct palette came about. After this a scroller was needed.
The simplest way to write a scroller is to make a pixel scroller. Most scrollers move from right to left so some way of shifting the data to the left was needed. Luckily the instruction ROXL.W is available on the 68000. The instruction shifts the contents of a data register to the left but puts any bits that 'fall off' the left hand side into the X register.
Any data already in the X register is put into the right hand most bit on the data register.
By storing the font in bit map form, any character could be selected and used as the first piece of data to ROXL. By using further multiple ROXL instructions the character can be scrolled across the screen.
An example of the scroll code is included here, the width of an Atari ST screen in low rez is 160 bytes. The DEPTH variable is the depth in pixel lines of the font. The scroll_number variable is the number of times the scroll routine has been run. Once this has reached zero, it is time to put another character into the scroll buffer.
move.w #DEPTH-1,d0loopy roxl.w 152(a5)roxl.w 144(a5)roxl.w 136(a5)roxl.w 128(a5)roxl.w 120(a5)roxl.w 112(a5)roxl.w 104(a5)roxl.w 96(a5)roxl.w 88(a5)roxl.w 80(a5)roxl.w 72(a5)roxl.w 64(a5)
roxl.w 56(a5)
roxl.w 48(a5)
roxl.w 40(a5)
roxl.w 32(a5)
roxl.w 24(a5)
roxl.w 16(a5)
roxl.w 8(a5)
move.w (a5),d3
and.w #$3fff,d3 ;ensure the text does
roxl.w #1,d3 ;not wrap around to the right of the screen.
move.w d3,(a5)
lea 160(a5),a5
dbf d0,loopy
sub.w #1,scroll_number
The basic single colour (1 plane) scroller was written. POV demo compilation menu one was virtually complete but a tune was needed. By hacking an LSD menu, a tune was removed and inserted into the menu code. POV demo compilation one was born.
It would late far too much time and space to attempt to teach people assembly language on this page so below are some examples of source code, all written by Mac Sys Data. If you wish to assemble them please use Genst 2.08 or higher. The code was originally written using Devpac developer 1.03.
The examples are of source code and so will not generally contain all the files needed to ensure the code will assemble without errors. If you are looking for some free code then e-mail MSD here.
Check out the CD for more source code.