The task is to create 1 pixel wide coloured vertical pinstripes with a sufficient number of pinstripes to span the entire width of the graphics display.



The pinstripes should either follow the system palette sequence,   or a sequence that includes:

black,   red,   green,   blue,   magenta,   cyan,   yellow,   and   white:

   after filling the top quarter, switch to a wider 2 pixel wide vertical pinstripe pattern,
   halfway down the display, switch to 3 pixel wide vertical pinstripe,
   finally to a 4 pixels wide vertical pinstripe for the last quarter of the display.


See also

   display black and white 
   print colour


define color $00
define looptemp $01
 
loop_1wide:
lda color
sta $0200,x
inc color
inx
bne loop_1wide
 
loop_2wide:
lda color
sta $0300,x
inx
sta $0300,x
inc color
inx
bne loop_2wide
 
lda #0
tax
tay
sta color
sta looptemp   ;reset ram
 
loop_3wide:
lda color
sta $0400,x
inc looptemp
inx
 
sta $0400,x
inc looptemp
inx
 
sta $0400,x
inc looptemp
inc color
inx
 
lda looptemp
cmp #$1e
bne loop_3wide
 
lda color    ;loop overhead
sta $0400,x  ;can't fit all of this stripe.
	     ;two columns will have to do.
inx
lda color
sta $0400,x
inx
 
lda #0
sta color
sta looptemp  ;reset color and looptemp
iny
cpy #$08      ;check secondary loop counter
bne loop_3wide
 
lda #0
tax
tay
sta color
sta looptemp   ;reset ram
 
loop_4wide:
lda color
sta $0500,x
inx
inc looptemp
 
sta $0500,x
inx
inc looptemp
 
sta $0500,x
inx
inc looptemp
 
sta $0500,x
inc color
inc looptemp
inx
 
lda looptemp
cmp #$20
bne loop_4wide
lda #0
sta looptemp
sta color
 
iny
cpy #$8
bcc loop_4wide
 
brk        ;program end