Atari 2600 programming

Harry Dodgson dodgson at cs.wmich.edu
Sat Jan 28 03:14:04 AEST 1989



;	Color Demo
;	Taken from the Magicard Manual
;	shows almost all the colors on the left side
;	of the screen and cycles slowly on the right
;
Start	LDA	$81 ;	get contents of memory
	STA	$0F ;	save into a pattern control register
	LDA	#$03
	STA	$0A ;	set background control register
	LDA	#$55
	STA	$07 ;	set right side color
	LDY	#$00
	DEY
	STA	$02 ;	wait for horizontal sync
	STA	$01 ;	start vertical blanking
	STA	$00 ;	start vertical retrace
	LDA	#$2A
	STA	$0295 ;	set timer for appropriate length
Loop1	LDY	$0284
	BNE	Loop1 ;	waste time
	STY	$02 ;	wait for horizontal sync
	STY	$00 ;	end vertical retrace period
	LDA	#$24
	STA	$0296 ;	set timer for next wait
	LDA	$0282
	AND	#$01 ;	check for reset switch
	BNE	NReset
	BRK ;		only interrupt available - must have vector set
NReset	INC	$80 ;	increment right side color cycle counter
	BNE	Loop2
	LDA	#$E0
	STA	$80 ;	reset counter
	INC	$81
	LDA	$81 ;	increment right side color
	STA	$06 ;	store it in color register
Loop2	LDY	$0284
	BNE	Loop2 ;	waste time
	STY	$02 ;	wait for horizontal sync
	STY	$01 ;	end vertical blanking
	LDX	#$E4 ;	number of line to draw on screen
Loop3	STY	$02 ;	wait for horizontal sync
	STX	$0E ;	change a background pattern with each line
	STX	$07 ;	change right side color with each line
	DEX
	BNE	loop3
	JMP	Start ; do next screen (every 1/60th second)
	.END

-- 
Harry Dodgson Jr.               Internet:  dodgson at cs.wmich.edu
Western Michigan University
Computer Science Department        Voice:     (616) 387-5803
Kalamazoo, MI  49008



More information about the Alt.sources mailing list