 org $7000
start     		;generating Display List
 ldy #126		;writing #$f value for hires mode 
 lda #$f		;to 235 locations for 235 lines
dl__ 			;the rest of the display dist is
 sta $8103,y	;generated at the end of the file
 dey			;with org instructions
 bpl dl__
 ldy #109
dl___
 sta $8185,y
 dey
 bpl dl___
 
 
 lda #%11100111
 sta $d201		;setting up Pokey for sound
 
 ldy #0
interpolate 	;calculating the perspective
 tya			;consisted of concentric lines
 and #7
 tax
 lda color
 and bits,x
mem1 
 ora $4000
mem2
 sta $4000
 
 dec counter	;counter variable holds width
 beq m0			;of the changes of color each line
 dec counter	;the smaller the value the more frequent changes
 bne m3			;of points in the line
m0 
 lda counter2
 sta counter
 lda color
 eor #$ff
 sta color
m3
 iny
 tya
 and #7
 bne m4
 inc mem1+1
 inc mem2+1
 
m4 
 cpy #0
 bne interpolate
 lda mem1+1		;changing the number of current byte to be drawn
 bne m10		;each line is consisted of 32 lines, line by line
 inc mem1+2
 inc mem2+2
m10

 ldy #0
 sty color
 inc counter2
 lda counter2
 sta counter
 bne interpolate	
 
 mva #33 $22f		;setting up screen
 mwa #$8100 $230	;and display list
	
wait0
 lda $d40b			;checking vcount register to start changing
 bne wait0			;colors at the beginning of the screen raster

 inc start_vcount	;starting line of first horizontal change to the colors
 lda start_vcount
 and #127			;if the value is equal 127 then change direction of the movement
 bne m11
 lda for_eor
 eor #127
 sta for_eor
 lda start_color	;number of color value of next lines
 adc #$0f
 sta start_color
 lda #0
m11
eor0
 eor for_eor
 lsr
 adc #4
 sta change_vcount  ;counting next line where to start flipping colors
col1
 lda start_color
 sta color1
 sta $d018			;setting the colors of the line
col2
 lda #$0
 sta $d017
wait
 lda $d40b
 cmp change_vcount  ;waiting for the next perspective line
 bne wait
 lda color1
 clc
 adc #$20
 eor #$f
 sta $d018
 sta color1
 eor #$f
 sta $d017
 lda change_vcount
 asl
 cmp #120
 bcs wait0			; if number of drawn line exceedes 240(120*2) then start again drawing screen
 sta change_vcount
 and #%10101100
 sta $d200  
 bcc wait
bits dta %10000000,%01000000,%00100000,%00010000,%00001000,%00000100,%00000010,%00000001 
pixel_source equ $e0
pixel_dest   equ $e1
color1 equ $b0
color equ $af
counter equ $ae
counter2 equ $ad
change_vcount equ $b3
start_vcount equ $ac 
for_eor      equ $ab
start_color  equ $aa
 
 
 org $aa
 dta $7f,0,1,1,1,0
 
 org $8100
 dta $4f,$00,$40
 org $8182
 dta $4f,$00,$50
 org $81f3
 dta $41,$00,$81
 
 
 org $83cd
 dta $41,$00,$81

 run start