
	org	hcoreStartPc

	nop
	nop
	nop
	nop	;preload
	nop

	gssr	r127,0		;get core number
	cmpeq	last,0
	br.tc	notCoreZero
	nop			;delay slot
	nop			;delay slot
	nop			;delay slot
	nop			;delay slot
	nop
		
	move	hold,$0b4a
	moveh	hold,last,$d000
	or	r0,last,0	;offset
	
	;
	
	move	hold,720	;2 lines offset
	fead	last,r127	;*core
	nop
	mul	hold
	add	r40,last,r0	;
	
	;
	
	move	hold,color
	moveh	hold,last,>>color
	or	r7,last,0	;r7 = color address
	move	r2,$fff
	nop
	
loop	
	
	or	r0,r40,r40
	move	r101,8000
	
drw	

	;rqld	r7,0		;get color
	ldw	r10,r7,0
	ldw	r11,r7,2
	ldw	r12,r7,4
	ldw	r13,r7,6
	ldw	r14,r7,8
	ldw	r15,r7,10
	ldw	r16,r7,12
	ldw	r17,r7,14

	stw	r10,r0,0	;store
	stw	r11,r0,1	;store
	stw	r12,r0,2	;store
	stw	r13,r0,3	;store
	stw	r14,r0,4	;store
	stw	r15,r0,5	;store
	
	cmpeq	r101,0
	br.tc	drw
	stw	r16,r0,6	;store
	stw	r17,r0,7	;store
	add	r0,r0,8
	sub	r101,r101,1
	
	;
	
	br	loop
	nop
	nop
	nop
	nop
	nop
	
notCoreZero	br	notCoreZero
	nop
	nop
	nop
	nop
	nop
	

color		
	word	$00000111
	word	$02220333
	word	$04440555
	word	$06660777
	word	$08880999
	word	$0aaa0bbb
	word	$0ccc0ddd
	word	$0eee0fff
	
	
	
	
	
	
	
	
	
	
	
	