
	.thumb
	.text
	
	
	.global	_k_jumplist
	
_k_jumplist
	
	
	.word	_k_+1
	.word	_k_U+1	
	.word	_k_R+1
	.word	_k_UR+1		
	.word	_k_O+1
	.word	_k_OU+1
	.word	_k_OR+1
	.word	_k_OUR+1
	.word	_k_L+1
	.word	_k_UL+1
	.word	_k_LR+1
	.word	_k_ULR+1
	.word	_k_OL+1
	.word	_k_OUL+1
	.word	_k_OLR+1
	.word	_k_OULR+1
	
;0000
;0001 U		
;0010 R		 	
;0011 UR
;0100 O
;0101 OU
;0110 OR
;0111 OUR
;1000 L
;1001 UL
;1010 LR
;1011 URL 
;1100 OL
;1101 OUL
;1110 ORL
;1111 UORL

;O U R L		      |	O U R L	
;-----------------------------+----------------------	                
;			      | 
;0 0 0 0             0000  0  |	1 0 0 0	 ¯  0001 1          
;0 0 0 1	[    1000  8  |	1 0 0 1	[¯  1001 9
;0 0 1 0	  ]  0100  4  |	1 0 1 0	 ¯] 0101 5
;0 0 1 1 	[ ]  1100  12 |	1 0 1 1	[¯] 1101 13
;0 1 0 0	 _   0010  2  |	1 1 0 0	 =  0011 3
;0 1 0 1	[_   1010  10 |	1 1 0 1	[=  1011 11
;0 1 1 0	 _]  0110  6  |	1 1 1 0	 =] 0111 7
;0 1 1 1	[_]  1110  14 |	1 1 1 1	[=] 1111 15	 

;r0/r1 x,y
;r2/r3 xo,yo

;r0/r1
	
_k_		bx	lr
	
_k_L		
_k_R	
_k_LR		sub	r5,r0,r2
		lsl	r5,r5,#1
		sub	r0,r0,r5
		bx	lr

_k_O
_k_U		
_k_OU		sub	r5,r1,r3
		lsl	r5,r5,#1
		sub	r1,r1,r5
		bx	lr
				
_k_UL		b	_k_undef
_k_UR		b	_k_undef
_k_ULR		b	_k_undef
		b	_k_undef
_k_OL		b	_k_undef
_k_OR		b	_k_undef
_k_OLR		b	_k_undef
_k_OUL		b	_k_undef
_k_OUR		b	_k_undef
_k_OULR		b	_k_undef

_k_undef	b	_k_undef



;**** reclalc coll
;*
;* r4 = mapcode 
;* r5 = carbgmode
;*
;* return r8 = neuer koll
;*
	.align  4
	.global	recalc_koll
	

recalc_koll
	push	{r0-r7}
	mov	r6,r8
	
	;**** 10 test (schreibe immer Oben/Unten Wert (ändern! auf OURL))
	
	cmp	r4,#$10
	bne	block_ou_aus
	cmp	r5,#0
	bne	block_ou_aus
	mov	r6,#%101
	lsl	r6,r6,#8
	
block_ou_aus	

	;**** 20 test (schreibe immer Links/Rechts Wert (ändern! auf OURL))
	
	cmp	r4,#$20
	bne	block_lr_aus
	cmp	r5,#3
	bne	block_lr_aus
	mov	r6,#%1010
	lsl	r6,r6,#8
	
block_lr_aus	

	mov	r8,r6
	pop	{r0-r7}
	bx	lr