Colourflow

by Ian McLaughlin

 

Issue 11

Sep/Oct 84

Next Article >>

<< Prev Article

 

 

Colourflow is a demonstration of 128 of Atari's colours as a background to the Atari logo but it does not use display list interrupts.

The display is in Graphics 0 with the bottom line changed to Graphics 2. After printing the display in character graphics the program loads the machine code routine into memory. This part of the program includes a Hex to decimal converter, which might be useful for other programs, and checks to see if the typed data is correct

The machine code routine is surprisingly simple with spectacular results. It achieves its effect by locking up the processor in a tight timing loop. The program uses the accumulator to hold the current colour starting at 255 ($FF) and counting down. After each count the program jumps to a delay subroutine which uses the X register to countdown from 14($0 E) to 0. When this is complete, it stores the colour in the background colour register and cycles round again. It is not necessary to test to see if the accumulator is zero and load it with FF as the status of the flags such as carry etc. are not important here. The machine is locked in an endless loop so the only way out is to press SYSTEM RESET. I tried to incorporate code which sensed a keypress but this destroyed the precise timing loop. Maybe other readers can come up with a solution?

AtariLister - requires Java

 

Source code

1000 ;****************************
1010 ;** COLOURFLOW **
1020 ;** ========== **
1030 :** **
1040 ;** Written on 10/12/83 **
1050 ;** by Ian McLaughlin **
1060 ;** **
1070 ;** This program doesn't **
1080 ;** use DLI's, but locks **
1090 ;** up the processor in a **
1100 ;** loop so that the **
1110 ;** timing is constant. **
1120 ;** **
1130 ;****************************
1140 ;
1150 ;
1160 ;
1170 COLPF2=$D018
1190 *=$600 ;Assemble at page 6
1340 LDA #$FF
1350 LOOP STA COLPF2 ;Store colour
1360 JSR DEL ;Wait a bit
1370 SBC #1 ;Next colour
1380 JMP LOOP ;Back again
1390 ;
1400 ;Delay loop here
1410 ;
1420 DEL LDX #$0E
1430 L1 DEX
1440 BNE L1 ;Loop back if not done
1490 RTS ;Done.Back to main program

top