.JE1	
	LD DE,BALL1
	CP 1
	RET Z
 	LD DE,BALL2
 	CP 2
	RET Z
 	LD DE,BALL3
 	RET

.URBBALL_CallBack
	push AF
	push HL
	inc H
	inc H
	inc H
	inc H
	ld A,(HL)
	or A
	jr z,URBBALL_CallBack_done
	cp #FF	;is module on player
	jr z,URBBALL_CallBack_onPlayer
	cp 32
	jr z,URBALL_CallBack_Erase
	jr nc,URBBALL_CallBack_done
	
	
	push BC
	ld B,1
	call THEM_MakeDamage
	pop BC
	
.URBBALL_CallBack_done
	pop HL
	pop AF
	ret
.URBALL_CallBack_Erase
	pop HL
	pop AF
	xor A
	ret
	
.URBBALL_CallBack_onPlayer
	ld A,(MASTER)	;is main module ?
	cp #F0
	jr nz,URBBALL_CallBack_done
	ld A,1
	ld (MOD_ONSHIP),A
	jr URBBALL_CallBack_done
	
.URBALL


	xor A
	ld (MOD_ONSHIP),A
	ld A,#F0	;player one main module
	ld (MASTER),A
	ld HL,URBBALL_CallBack
	call REND_SprSetCallBack
	
	jp MOD_NewCode
	read "modules_new.asm"

.JEWELS	
	;CALL CLEARCOL
 	;CALL JEWEL1
 	;CALL CLEARCOL
 	;CALL JEWEL2
 	;CALL CLEARCOL
 	;JP URPILL1
	
URPILL1	
	ld A,#F1	;player one pills
	ld (MASTER),A

	LD A,(PILL1)
 	AND A
 	JR Z,URPILL2
	CALL URPILL9
	DEC D
 	DEC D
 	DEC D
 	;DEC D
 	LD (PILL1X),DE
	LD B,8
URPILL1X	
	LD HL,PILL1P
	CALL URPILL6
URPILL1XA	
	LD BC,(PILL1X)
 	CALL USPN
 	;CALL KILL_1
 ;
URPILL2	
	LD A,(PILL2)
 	AND A
 	RET Z
 	CALL URPILL9
	INC D
 	INC D
 	INC D
 	LD (PILL2X),DE
	LD B,8
URPILL2X	
	LD HL,PILL2P
	CALL URPILL6
URPILL2XA	
	LD BC,(PILL2X)
 	CALL USPF
 	;CALL KILL_1
 	RET
 ;
URPILL6	
	LD A,(HL)
	INC A
 	CP 16
 	JR NZ,URPILL6A
	XOR A
 URPILL6A	
	LD (HL),A
 	SRA A
 	ADD 22
	ADD B
 	RET
 ;
URPILL7	
	LD A,(HL)
	INC A
 	CP 8
	JR NZ,URPILL7A
	XOR A
 URPILL7A	
	LD (HL),A
 	LD B,0
	LD C,A
	LD HL,JEWELTYPE
 	ADD HL,BC
 	LD A,(HL)
 	RET
 ;
URPILL8	
	LD B,0
 	LD A,(TILESCROLL)
 	AND A
 	RET NZ
	LD A,(HL)
 	DEC A
 	LD (HL),A
 	CP 254
	RET
 ;
URPILL9	
	LD A,(FRAME)
 	AND 3
 	ADD A
 	LD HL,PILLBUFF
	ADD L
 	LD L,A
	LD DE,(SHIPX)
 	LD (HL),E
 	INC L
 	LD (HL),D
 	INC L
 	LD A,(FRAME)
	AND 3
 	CP 3
	JR NZ,URPILL9A
	LD HL,PILLBUFF
URPILL9A	LD E,(HL)
 	INC L
 	LD D,(HL)
 	INC E
 	RET
	
.JEWELTYPE		DEFB 107,108,109,110,111
				DEFB 110+128,109+128,108+128