I try to do a little exercise for myself, but I'm stuck. I want to do a grid (that is ok) where one shot in two, the color changes (like in this picture : http://puu.sh/tfgHm/b07843323d.jpg ). I already have this :
ORG $800
START:
MOVE.w #050,D2
MOVE.w #100,D4
MOVE.w #0,D6
GRIDLOOP:
MOVE.w #0,D5
MOVE.w #050,D1
MOVE.w #100,D3
LINE:
JSR DRAW_FILL_RECT *task 87
ADD.w #050,D1
ADD.w #050,D3
ADD.w #1,D5
CMP.w #6,D5
BNE LINE
ADD.w #50,D2
ADD.w #50,D4
ADD.w #1,D6
CMP.w #6,D6
BNE GRIDLOOP
RTS
INCLUDE 'DIRECTORY.X68'
END START
I tried few things, but well, it didn't work correctly...
Added "fill" colours alternating (and made it compilable in Easy68k without include):
(the grid definition is intentionally 6x8 and not-square, to verify I put the X/Y constants at correct places (with symmetrical values a mistake would go unnoticed)).
Looks like this:
Second version without memory table, as you are alternating between two values, which means XOR is all you need...