Contact me | Login | Search | Sitemap | Site Notice
	LDA	$C054		; show page 1
	INC	ASCR		; toggle new frame for chamP-profiler
	LDX	#0
lpY	LDA 	YLOOKHI,X	; get line base adress HI-byte
        ORA 	#$20		; HIRES page #1
        STA	hb1+2
        STA	hb2+2

	LDA 	YLOOKHI,X
        ORA 	#$40		; HIRES page #2
        STA	hb1_1+2
        STA	hb1_2+2
        STA	noC2+2
        STA	noC3+2
        STA	hb2_1+2
        STA	hb2_2+2
        STA	hb2_3+2
        STA	hb2_4+2
        STA	hb3_1+2
        STA	hb3+2
        
	LDA 	YLOOKLO,X	; get line base adress LO-byte
	STA	hb1+1
        STA	hb1_1+1
        STA	hb1_2+1
        STA	noC2+1
        STA	noC3+1
        STA	hb2+1
        STA	hb2_1+1
        STA	hb2_2+1
        STA	hb2_3+1
        STA	hb2_4+1
        STA	hb3+1
        STA	hb3_1+1

cc1	LDY	#39
hb1	LDA	$2000,Y		; get the first byte of the new line
	LSR
	BCC	noC1
	LSR
	BCC	noC2
hb1_1	STA	$2000,Y			
	LDA	#%01100000
	STA	Temp		; two bits shifted out, save them
	BRA	lpX
noC1	LSR
	BCC	noC3
hb1_2	STA	$2000,Y
	LDA	#%01000000
	STA	Temp
	BRA	lpX
noC2	STA	$2000,Y
	LDA	#%00100000
	STA	Temp
	BRA	lpX
noC3	STA	$2000,Y
	LDA	#0
	STA	Temp
								
lpX	DEY
	BMI	lpXend

hb2	LDA	$2000,Y		; get the bytes 01 to 39 of the line
	LSR
	BCC	noC1a
	LSR
	BCC	noC2a
	ORA	Temp		; put the two shifted bits from the former
hb2_1	STA	$2000,Y		; HIRES-byte into the correct position
	LDA	#%01100000
	STA	Temp		; save MASK for the two shifted out bits
	BRA	lpX
noC1a	LSR
	BCC	noC3a
	ORA	Temp
hb2_2	STA	$2000,Y
	LDA	#%01000000
	STA	Temp
	BRA	lpX
noC2a	ORA	Temp
hb2_3	STA	$2000,Y
	LDA	#%00100000
	STA	Temp
	BRA	lpX
noC3a	ORA	Temp
hb2_4	STA	$2000,Y
	LDA	#0
	STA	Temp
	BRA	lpX
	
lpXend	LDY	#39
hb3	LDA	$2000,Y
	ORA	Temp
hb3_1	STA	$2000,Y			
				
	INX			; repeat for all 192 lines
	CPX	#192
	BEQ	cc1_1
	JMP	lpY
		
cc1_1	RTS