carlsson wrote:
As an alternative, perhaps one can use raster timing to constantly change background colour for each square, but it sounds very time consuming and sensitive to timing faults.
Hello Carlsson.
The foreground begins at rasterline x.
At rasterline x-1 you can initialize 2 CIA timer.
Timer 1 runs one screen and goes to zero each rasterline x-1 and produces an interrupt.
Timer 2 runs 16 rasterlines (2 chars), which means:
interrupt @ x-1: set auxiliary color 1 (start of squares)
interrupt @ x-1 +(16*1) : set auxiliary color 2
....
interrupt @ x-1 +(16*8) : set auxiliary color n
interrupt @ x-1 +(16*9) : set auxiliary color 0 (no more squares, end of playfield, no more changes)
When Timer 1 goes to zero: initialize timer 2 again
This method wouldn't be very time-consuming, you need a counter for a table which contains the values for the auxiliary-colors you set in the raster-range.
Timing isn't critical, when the next line -1 is reached (IRQ) you can poll the raster-register for better timing.
Using two timers will slow down the speed of the computer of 1/10 because we have more interrupts.
The timer-values and line x depend on either PAL or NTSC-VIC.
@Admin: It would make sense to split the discussion and move this part to a programming-section.
-- Thomas