	org 512
__START_PROGRAM:
	di
	push ix
	push iy
	exx
	push hl
	exx
	ld hl, 0
	add hl, sp
	ld (__CALL_BACK__), hl
	ei
	jp __LABEL__charmap01end
__LABEL__charmap01:
#line 2
		defb $00,$55,$55,$55,$55,$55,$55,$55
		defb $00,$44,$55,$55,$55,$55,$50,$50
		defb $55,$55,$55,$55,$45,$45,$44,$00
		defb $40,$40,$40,$41,$45,$41,$41,$01
		defb $40,$40,$40,$45,$41,$45,$44,$05
		defb $40,$40,$40,$45,$41,$45,$41,$05
		defb $40,$40,$40,$54,$54,$55,$44,$04
		defb $14,$14,$55,$55,$55,$55,$14,$14
		defb $00,$11,$55,$55,$55,$55,$05,$05
		defb $00,$55,$55,$55,$55,$55,$55,$55
		defb $55,$55,$55,$55,$51,$51,$11,$00
		defb $01,$01,$01,$11,$51,$11,$11,$10
		defb $01,$01,$01,$51,$11,$51,$41,$50
		defb $01,$01,$01,$51,$11,$51,$11,$50
		defb $01,$01,$01,$51,$51,$55,$11,$10
		defb $AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA
		defb $AA,$A2,$A2,$A2,$A2,$AA,$A2,$AA
		defb $AA,$88,$88,$AA,$AA,$AA,$AA,$AA
		defb $AA,$88,$A2,$88,$88,$A2,$88,$AA
		defb $AA,$A2,$80,$8A,$80,$A8,$80,$A2
		defb $AA,$88,$A8,$A2,$A2,$8A,$88,$AA
		defb $AA,$80,$88,$A2,$8A,$88,$80,$AA
		defb $AA,$A8,$A2,$AA,$AA,$AA,$AA,$AA
		defb $AA,$A2,$8A,$8A,$8A,$8A,$A2,$AA
		defb $AA,$A2,$A8,$A8,$A8,$A8,$A2,$AA
		defb $AA,$AA,$88,$A2,$80,$A2,$88,$AA
		defb $AA,$AA,$A2,$A2,$80,$A2,$A2,$AA
		defb $AA,$AA,$AA,$AA,$AA,$AA,$A8,$A0
		defb $AA,$AA,$AA,$AA,$80,$AA,$AA,$AA
		defb $AA,$AA,$AA,$AA,$AA,$A2,$A2,$AA
		defb $AA,$A8,$A8,$A2,$A2,$8A,$8A,$AA
		defb $AA,$80,$88,$88,$88,$88,$80,$AA
		defb $AA,$82,$A2,$A2,$A2,$A2,$A2,$AA
		defb $AA,$80,$88,$A8,$80,$8A,$80,$AA
		defb $AA,$80,$88,$A0,$A8,$88,$80,$AA
		defb $AA,$88,$88,$88,$80,$A8,$A8,$AA
		defb $AA,$80,$8A,$80,$A8,$A8,$80,$AA
		defb $AA,$80,$8A,$80,$88,$88,$80,$AA
		defb $AA,$80,$A8,$A8,$80,$8A,$8A,$AA
		defb $AA,$80,$88,$A2,$88,$88,$80,$AA
		defb $AA,$80,$88,$88,$80,$A8,$80,$AA
		defb $AA,$AA,$A2,$A2,$AA,$A2,$A2,$AA
		defb $AA,$AA,$A2,$A2,$AA,$A2,$8A,$AA
		defb $AA,$AA,$A8,$A2,$8A,$A2,$A8,$AA
		defb $AA,$AA,$AA,$80,$AA,$80,$AA,$AA
		defb $AA,$AA,$8A,$A2,$A8,$A2,$8A,$AA
		defb $AA,$A2,$88,$A8,$A2,$AA,$A2,$AA
		defb $AA,$80,$88,$80,$80,$8A,$80,$AA
		defb $AA,$80,$88,$88,$80,$88,$88,$AA
		defb $AA,$80,$88,$82,$88,$88,$80,$AA
		defb $AA,$80,$88,$8A,$8A,$88,$80,$AA
		defb $AA,$82,$88,$88,$88,$88,$82,$AA
		defb $AA,$80,$8A,$80,$8A,$8A,$80,$AA
		defb $AA,$80,$8A,$82,$8A,$8A,$8A,$AA
		defb $AA,$80,$8A,$8A,$88,$88,$80,$AA
		defb $AA,$88,$88,$80,$88,$88,$88,$AA
		defb $AA,$80,$A2,$A2,$A2,$A2,$80,$AA
		defb $AA,$A0,$A8,$A8,$88,$88,$80,$AA
		defb $AA,$88,$88,$82,$88,$88,$88,$AA
		defb $AA,$8A,$8A,$8A,$8A,$8A,$80,$AA
		defb $AA,$88,$80,$80,$80,$88,$88,$AA
		defb $AA,$88,$80,$88,$88,$88,$88,$AA
		defb $AA,$80,$88,$88,$88,$88,$80,$AA
		defb $AA,$80,$88,$88,$80,$8A,$8A,$AA
		defb $AA,$80,$88,$88,$88,$80,$A0,$AA
		defb $AA,$80,$88,$88,$82,$88,$88,$AA
		defb $AA,$80,$8A,$80,$A8,$A8,$80,$AA
		defb $AA,$80,$A2,$A2,$A2,$A2,$A2,$AA
		defb $AA,$88,$88,$88,$88,$88,$80,$AA
		defb $AA,$88,$88,$88,$88,$80,$A2,$AA
		defb $AA,$88,$88,$80,$80,$80,$88,$AA
		defb $AA,$88,$88,$A2,$88,$88,$88,$AA
		defb $AA,$88,$88,$80,$A2,$A2,$A2,$AA
		defb $AA,$80,$A8,$A2,$8A,$8A,$80,$AA
		defb $AA,$82,$8A,$8A,$8A,$8A,$82,$AA
		defb $AA,$8A,$8A,$A2,$A2,$A8,$A8,$AA
		defb $AA,$A0,$A8,$A8,$A8,$A8,$A0,$AA
		defb $AA,$A2,$88,$AA,$AA,$AA,$AA,$AA
		defb $00,$28,$00,$20,$20,$00,$28,$00
		defb $00,$2A,$22,$22,$22,$22,$2A,$00
		defb $00,$28,$08,$08,$08,$08,$08,$00
		defb $00,$2A,$22,$02,$2A,$20,$2A,$00
		defb $00,$2A,$22,$0A,$02,$22,$2A,$00
		defb $00,$22,$22,$22,$2A,$02,$02,$00
		defb $00,$2A,$20,$2A,$02,$02,$2A,$00
		defb $00,$2A,$20,$2A,$22,$22,$2A,$00
		defb $00,$2A,$02,$02,$2A,$20,$20,$00
		defb $00,$2A,$22,$08,$22,$22,$2A,$00
		defb $00,$2A,$22,$22,$2A,$02,$2A,$00
		defb $00,$00,$00,$08,$00,$00,$08,$00
		defb $00,$80,$02,$20,$00,$80,$08,$00
		defb $AA,$BB,$FF,$FF,$FF,$FF,$AF,$AF
		defb $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
		defb $AB,$AB,$AB,$AB,$AB,$AB,$AB,$AB
		defb $FF,$FF,$FF,$FF,$FB,$FB,$BB,$AA
		defb $00,$3F,$33,$33,$33,$33,$3F,$00
		defb $00,$3C,$0C,$0C,$0C,$0C,$0C,$00
		defb $00,$3F,$33,$03,$3F,$30,$3F,$00
		defb $00,$3F,$33,$0F,$03,$33,$3F,$00
		defb $00,$33,$33,$33,$3F,$03,$03,$00
		defb $00,$3F,$30,$3F,$03,$03,$3F,$00
		defb $00,$3F,$30,$3F,$33,$33,$3F,$00
		defb $00,$3F,$03,$03,$3F,$30,$30,$00
		defb $00,$3F,$33,$0C,$33,$33,$3F,$00
		defb $00,$3F,$33,$33,$3F,$03,$3F,$00
		defb $00,$00,$00,$0C,$00,$00,$0C,$00
#line 108
__LABEL__charmap01end:
	ld a, 152
	call _mc1000screen
	ld a, 2
	push af
	call _mc1000cls
	ld hl, 50
	ld (_seed), hl
	ld a, 1
	ld (_debug), a
__LABEL__startup:
	ld a, (_debug)
	or a
	jp z, __LABEL1
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, 34
	push hl
	ld hl, 25
	push hl
	call _mc1000vpokechr
	ld hl, 0
	ld (_eey), hl
	jp __LABEL2
__LABEL5:
	ld hl, 0
	ld (_eex), hl
	jp __LABEL7
__LABEL10:
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (_eey)
	ld de, 16
	call __MUL16_FAST
	ex de, hl
	ld hl, (_eex)
	add hl, de
	push hl
	ld hl, (_eey)
	ld de, 32
	call __MUL16_FAST
	ld de, 239
	add hl, de
	ex de, hl
	ld hl, (_eex)
	add hl, de
	push hl
	call _mc1000vpokechr
	ld hl, (_eex)
	inc hl
	ld (_eex), hl
__LABEL7:
	ld hl, 15
	ld de, (_eex)
	or a
	sbc hl, de
	jp nc, __LABEL10
	ld hl, (_eey)
	inc hl
	ld (_eey), hl
__LABEL2:
	ld hl, 15
	ld de, (_eey)
	or a
	sbc hl, de
	jp nc, __LABEL5
__LABEL1:
__LABEL12:
	call __LABEL__title
	call __LABEL__playstart
	call __LABEL__playloop
	jp __LABEL12
__LABEL__title:
	ld hl, 6144
	push hl
	ld hl, 170
	push hl
	ld hl, 32768
	push hl
	call _aquariusfillram
	ld hl, 1536
	push hl
	ld hl, 0
	push hl
	ld hl, 32768
	push hl
	call _aquariusfillram
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, __LABEL__text04
	push hl
	ld hl, 14
	push hl
	ld hl, 3
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text04) + (2)
	push hl
	ld hl, 15
	push hl
	ld hl, 3
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, __LABEL__text04
	push hl
	ld hl, 13
	push hl
	ld hl, 19
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text04) + (2)
	push hl
	ld hl, 14
	push hl
	ld hl, 19
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, __LABEL__text04
	push hl
	ld hl, 15
	push hl
	ld hl, 27
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text04) + (2)
	push hl
	ld hl, 16
	push hl
	ld hl, 27
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, __LABEL__text04
	push hl
	ld hl, 21
	push hl
	ld hl, 21
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text04) + (2)
	push hl
	ld hl, 22
	push hl
	ld hl, 21
	push hl
	call _mc1000writetext
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (__LABEL__text02) - (__LABEL__text01)
	push hl
	ld hl, __LABEL__text01
	push hl
	ld hl, 18
	push hl
	ld hl, 2
	push hl
	call _mc1000writetext
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (__LABEL__text03) - (__LABEL__text02)
	push hl
	ld hl, __LABEL__text02
	push hl
	ld hl, 19
	push hl
	ld hl, 2
	push hl
	call _mc1000writetext
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (__LABEL__text04) - (__LABEL__text03)
	push hl
	ld hl, __LABEL__text03
	push hl
	ld hl, 20
	push hl
	ld hl, 2
	push hl
	call _mc1000writetext
__LABEL__waitkey01:
	ld a, 1
	call _mc1000keymapinv
	push af
	ld a, 2
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld (_eb0), a
	ld a, 4
	call _mc1000keymapinv
	push af
	ld a, 8
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld hl, (_eb0 - 1)
	or h
	ld (_eb0), a
	ld a, 16
	call _mc1000keymapinv
	push af
	ld a, 32
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld hl, (_eb0 - 1)
	or h
	ld (_eb0), a
	ld a, 64
	call _mc1000keymapinv
	push af
	ld a, 128
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld hl, (_eb0 - 1)
	or h
	ld (_eb0), a
	sub 1
	jp c, __LABEL__waitkey01
	ret
__LABEL__playstart:
	ld a, 083h
	ld de, 00040h
	ld bc, 00000h
	ld hl, _spb
	call __STOREF
	ld a, 5
	ld (_glim), a
	xor a
	ld (_gst), a
	ld a, 083h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _x1
	call __STOREF
	ld a, 084h
	ld de, 00030h
	ld bc, 00000h
	ld hl, _y1
	call __STOREF
	ld a, 084h
	ld de, 00070h
	ld bc, 00000h
	ld hl, _x2
	call __STOREF
	ld a, 085h
	ld de, 00020h
	ld bc, 00000h
	ld hl, _y2
	call __STOREF
	ld a, 084h
	ld de, 00070h
	ld bc, 00000h
	ld hl, _x3
	call __STOREF
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _y3
	call __STOREF
	ld a, 085h
	ld de, 00050h
	ld bc, 00000h
	ld hl, _x4
	call __STOREF
	ld a, 084h
	ld de, 00030h
	ld bc, 00000h
	ld hl, _y4
	call __STOREF
	xor a
	ld (_m1), a
	xor a
	ld (_m2), a
	ld a, 1
	ld (_m3), a
	ld a, 1
	ld (_m4), a
	ld a, 085h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _xbp
	call __STOREF
	ld a, 084h
	ld de, 00040h
	ld bc, 00000h
	ld hl, _ybp
	call __STOREF
	ld a, (_gst)
	ld (_sc1), a
	ld a, (_gst)
	ld (_sc2), a
	ld a, (_gst)
	ld (_sc3), a
	ld a, (_gst)
	ld (_sc4), a
	xor a
	ld (_bown), a
	xor a
	ld (_govr), a
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
	ld hl, 6144
	push hl
	ld hl, 170
	push hl
	ld hl, 32768
	push hl
	call _aquariusfillram
	call _drawsprites
	ret
__LABEL__playloop:
__LABEL__lp01:
	ld a, (_debug)
	or a
	jp z, __LABEL17
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (_eee)
	ld de, 100
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, 325
	push hl
	call _mc1000vpokechr
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (_eee)
	ld de, 10
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, 326
	push hl
	call _mc1000vpokechr
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, (_eee)
	ld de, 10
	call __MODU16
	ld de, 48
	add hl, de
	push hl
	ld hl, 327
	push hl
	call _mc1000vpokechr
	ld hl, (_eee)
	inc hl
	ld (_eee), hl
	ld hl, 1
	ld (_ee5), hl
	ld hl, 0
	ld (_ee4), hl
	jp __LABEL18
__LABEL21:
	ld hl, (_ee5)
	ld a, l
	call _mc1000keymapinv
	ld (_eb0), a
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld a, (_eb0)
	ld h, 100
	call __DIVU8_FAST
	ld l, a
	ld h, 0
	ld e, h
	ld d, h
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, (_ee4)
	inc hl
	ld de, 32
	call __MUL16_FAST
	ld de, 5
	add hl, de
	push hl
	call _mc1000vpokechr
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld a, (_eb0)
	ld h, 10
	call __DIVU8_FAST
	ld l, a
	ld h, 0
	ld e, h
	ld d, h
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, (_ee4)
	inc hl
	ld de, 32
	call __MUL16_FAST
	ld de, 6
	add hl, de
	push hl
	call _mc1000vpokechr
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld a, (_eb0)
	ld h, 10
	call __MODU8_FAST
	add a, 48
	ld l, a
	ld h, 0
	push hl
	ld hl, (_ee4)
	inc hl
	ld de, 32
	call __MUL16_FAST
	ld de, 7
	add hl, de
	push hl
	call _mc1000vpokechr
	ld hl, (_ee5)
	add hl, hl
	ld (_ee5), hl
	ld hl, (_ee4)
	inc hl
	ld (_ee4), hl
__LABEL18:
	ld hl, 7
	ld de, (_ee4)
	or a
	sbc hl, de
	jp nc, __LABEL21
	ld a, 1
	call _mc1000keymapinv
	push af
	ld a, 2
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld (_eb0), a
	ld a, 4
	call _mc1000keymapinv
	push af
	ld a, 8
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld hl, (_eb0 - 1)
	or h
	ld (_eb0), a
	ld a, 16
	call _mc1000keymapinv
	push af
	ld a, 32
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld hl, (_eb0 - 1)
	or h
	ld (_eb0), a
	ld a, 64
	call _mc1000keymapinv
	push af
	ld a, 128
	call _mc1000keymapinv
	ld h, a
	pop af
	or h
	ld hl, (_eb0 - 1)
	or h
	ld (_eb0), a
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld a, (_eb0)
	ld h, 100
	call __DIVU8_FAST
	ld l, a
	ld h, 0
	ld e, h
	ld d, h
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, 389
	push hl
	call _mc1000vpokechr
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld a, (_eb0)
	ld h, 10
	call __DIVU8_FAST
	ld l, a
	ld h, 0
	ld e, h
	ld d, h
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, 390
	push hl
	call _mc1000vpokechr
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld a, (_eb0)
	ld h, 10
	call __MODU8_FAST
	add a, 48
	ld l, a
	ld h, 0
	push hl
	ld hl, 391
	push hl
	call _mc1000vpokechr
__LABEL17:
	ld a, (_xbd)
	ld de, (_xbd + 1)
	ld bc, (_xbd + 3)
	ld hl, _xbp + 4
	call __FP_PUSH_REV
	call __ADDF
	ld hl, _xbp
	call __STOREF
	ld a, (_ybd)
	ld de, (_ybd + 1)
	ld bc, (_ybd + 3)
	ld hl, _ybp + 4
	call __FP_PUSH_REV
	call __ADDF
	ld hl, _ybp
	call __STOREF
	ld a, 128
	call _mc1000keymapinv
	ld h, 4
	and h
	ld h, 4
	call __DIVU8_FAST
	push af
	ld a, 8
	call _mc1000keymapinv
	ld h, 4
	and h
	srl a
	ld h, a
	pop af
	or h
	push af
	ld a, 2
	call _mc1000keymapinv
	ld h, 1
	and h
	add a, a
	add a, a
	ld h, a
	pop af
	or h
	push af
	ld a, 16
	call _mc1000keymapinv
	ld h, 1
	and h
	ld h, 8
	call __MUL8_FAST
	ld h, a
	pop af
	or h
	ld l, a
	ld h, 0
	ld (_sq1), hl
	ld a, 16
	call _mc1000keymapinv
	ld h, 4
	and h
	ld h, 4
	call __DIVU8_FAST
	push af
	ld a, 128
	call _mc1000keymapinv
	ld h, 1
	and h
	add a, a
	ld h, a
	pop af
	or h
	push af
	ld a, 64
	call _mc1000keymapinv
	ld h, 1
	and h
	add a, a
	add a, a
	ld h, a
	pop af
	or h
	push af
	ld a, 1
	call _mc1000keymapinv
	ld h, 2
	and h
	add a, a
	add a, a
	ld h, a
	pop af
	or h
	ld l, a
	ld h, 0
	ld (_sq2), hl
	ld a, 2
	call _mc1000keymapinv
	ld h, 2
	and h
	srl a
	push af
	ld a, 8
	call _mc1000keymapinv
	ld h, 2
	and h
	ld h, a
	pop af
	or h
	push af
	ld a, 4
	call _mc1000keymapinv
	ld h, 2
	and h
	add a, a
	ld h, a
	pop af
	or h
	push af
	ld a, 16
	call _mc1000keymapinv
	ld h, 2
	and h
	add a, a
	add a, a
	ld h, a
	pop af
	or h
	ld l, a
	ld h, 0
	ld (_sq3), hl
	ld hl, 0
	ld (_sq4), hl
	ld de, 0
	ld hl, (_sq1)
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL24
	ld de, 4
	ld hl, (_sq1)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x1 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL26
	ld hl, _x1 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _x1
	call __STOREF
	ld a, 1
	ld (_m1), a
__LABEL26:
	ld de, 8
	ld hl, (_sq1)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x1 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00070h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL28
	ld hl, _x1 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _x1
	call __STOREF
	xor a
	ld (_m1), a
__LABEL28:
	ld de, 1
	ld hl, (_sq1)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y1 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL30
	ld hl, _y1 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _y1
	call __STOREF
__LABEL30:
	ld de, 2
	ld hl, (_sq1)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y1 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00030h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL32
	ld hl, _y1 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _y1
	call __STOREF
__LABEL32:
	call _drawsprites
__LABEL24:
	ld de, 0
	ld hl, (_sq2)
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL34
	ld de, 4
	ld hl, (_sq2)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x2 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL36
	ld hl, _x2 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _x2
	call __STOREF
	ld a, 1
	ld (_m2), a
__LABEL36:
	ld de, 8
	ld hl, (_sq2)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x2 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00070h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL38
	ld hl, _x2 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _x2
	call __STOREF
	xor a
	ld (_m2), a
__LABEL38:
	ld de, 1
	ld hl, (_sq2)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y2 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL40
	ld hl, _y2 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _y2
	call __STOREF
__LABEL40:
	ld de, 2
	ld hl, (_sq2)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y2 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00030h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL42
	ld hl, _y2 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _y2
	call __STOREF
__LABEL42:
	call _drawsprites
__LABEL34:
	ld de, 0
	ld hl, (_sq3)
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL44
	ld de, 4
	ld hl, (_sq3)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x3 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL46
	ld hl, _x3 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _x3
	call __STOREF
	ld a, 1
	ld (_m3), a
__LABEL46:
	ld de, 8
	ld hl, (_sq3)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x3 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00070h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL48
	ld hl, _x3 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _x3
	call __STOREF
	xor a
	ld (_m3), a
__LABEL48:
	ld de, 1
	ld hl, (_sq3)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y3 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL50
	ld hl, _y3 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _y3
	call __STOREF
__LABEL50:
	ld de, 2
	ld hl, (_sq3)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y3 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00030h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL52
	ld hl, _y3 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _y3
	call __STOREF
__LABEL52:
	call _drawsprites
__LABEL44:
	ld de, 0
	ld hl, (_sq4)
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL54
	ld de, 4
	ld hl, (_sq4)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x4 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL56
	ld hl, _x4 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _x4
	call __STOREF
	ld a, 1
	ld (_m4), a
__LABEL56:
	ld de, 8
	ld hl, (_sq4)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _x4 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00070h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL58
	ld hl, _x4 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _x4
	call __STOREF
	xor a
	ld (_m4), a
__LABEL58:
	ld de, 1
	ld hl, (_sq4)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y4 + 4
	call __FP_PUSH_REV
	ld a, 000h
	ld de, 00000h
	ld bc, 00000h
	call __GTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL60
	ld hl, _y4 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __SUBF
	ld hl, _y4
	call __STOREF
__LABEL60:
	ld de, 2
	ld hl, (_sq4)
	call __BAND16
	ld de, 0
	or a
	sbc hl, de
	ld a, h
	or l
	push af
	ld hl, _y4 + 4
	call __FP_PUSH_REV
	ld a, 085h
	ld de, 00030h
	ld bc, 00000h
	call __LTF
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL62
	ld hl, _y4 + 4
	call __FP_PUSH_REV
	ld a, 07Fh
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	ld hl, _y4
	call __STOREF
__LABEL62:
	call _drawsprites
__LABEL54:
	ld a, (_bown)
	dec a
	or a
	jp z, __LABEL64
	ld a, (_x1)
	ld de, (_x1 + 1)
	ld bc, (_x1 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_xt), hl
	ld (_xt + 2), de
	ld a, (_y1)
	ld de, (_y1 + 1)
	ld bc, (_y1 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_ybp)
	ld de, (_ybp + 1)
	ld bc, (_ybp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_yt), hl
	ld (_yt + 2), de
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL66
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL68
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
	ld a, 1
	ld (_bown), a
__LABEL68:
__LABEL66:
__LABEL64:
	ld a, (_bown)
	sub 4
	or a
	jp z, __LABEL70
	ld a, (_x4)
	ld de, (_x4 + 1)
	ld bc, (_x4 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_xt), hl
	ld (_xt + 2), de
	ld a, (_y4)
	ld de, (_y4 + 1)
	ld bc, (_y4 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_ybp)
	ld de, (_ybp + 1)
	ld bc, (_ybp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_yt), hl
	ld (_yt + 2), de
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL72
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL74
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	push bc
	push de
	push af
	ld a, 081h
	ld de, 00080h
	ld bc, 00000h
	call __MULF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
	ld a, 4
	ld (_bown), a
__LABEL74:
__LABEL72:
__LABEL70:
	ld a, (_bown)
	sub 2
	or a
	jp z, __LABEL76
	ld a, (_x2)
	ld de, (_x2 + 1)
	ld bc, (_x2 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_xt), hl
	ld (_xt + 2), de
	ld a, (_y2)
	ld de, (_y2 + 1)
	ld bc, (_y2 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_ybp)
	ld de, (_ybp + 1)
	ld bc, (_ybp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_yt), hl
	ld (_yt + 2), de
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL78
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL80
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	push bc
	push de
	push af
	ld a, 081h
	ld de, 00080h
	ld bc, 00000h
	call __MULF
	ld hl, _ybd
	call __STOREF
	ld a, 2
	ld (_bown), a
__LABEL80:
__LABEL78:
__LABEL76:
	ld a, (_bown)
	sub 3
	or a
	jp z, __LABEL82
	ld a, (_x3)
	ld de, (_x3 + 1)
	ld bc, (_x3 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_xt), hl
	ld (_xt + 2), de
	ld a, (_y3)
	ld de, (_y3 + 1)
	ld bc, (_y3 + 3)
	call __FTOU32REG
	push de
	push hl
	ld a, (_ybp)
	ld de, (_ybp + 1)
	ld bc, (_ybp + 3)
	call __FTOU32REG
	call __SUB32
	ld (_yt), hl
	ld (_yt + 2), de
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_xt + 2)
	push hl
	ld hl, (_xt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL84
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 0
	call __EQ32
	push af
	ld hl, (_yt + 2)
	push hl
	ld hl, (_yt)
	push hl
	ld de, 0
	ld hl, 1
	call __EQ32
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL86
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
	ld a, 3
	ld (_bown), a
__LABEL86:
__LABEL84:
__LABEL82:
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __FTOU32REG
	push de
	push hl
	ld de, 0
	ld hl, 0
	call __LTI32
	or a
	jp z, __LABEL88
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, 157
	push hl
	ld hl, _ybp + 4
	call __FP_PUSH_REV
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __ADDF
	call __FTOU32REG
	push hl
	call _mc1000vpokechr
	ld a, (_sc1)
	dec a
	ld (_sc1), a
	ld a, (_bown)
	sub 2
	sub 1
	jp nc, __LABEL90
	ld a, (_sc2)
	inc a
	ld (_sc2), a
__LABEL90:
	ld a, (_bown)
	sub 3
	sub 1
	jp nc, __LABEL92
	ld a, (_sc3)
	inc a
	ld (_sc3), a
__LABEL92:
	ld a, (_bown)
	sub 4
	sub 1
	jp nc, __LABEL94
	ld a, (_sc4)
	inc a
	ld (_sc4), a
__LABEL94:
	xor a
	ld (_bown), a
	ld a, 085h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _xbp
	call __STOREF
	ld a, 084h
	ld de, 00040h
	ld bc, 00000h
	ld hl, _ybp
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
__LABEL88:
	ld a, (_ybp)
	ld de, (_ybp + 1)
	ld bc, (_ybp + 3)
	call __FTOU32REG
	push de
	push hl
	ld de, 0
	ld hl, 23
	call __LEI32
	sub 1
	jp nc, __LABEL96
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, 157
	push hl
	ld hl, _ybp + 4
	call __FP_PUSH_REV
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __ADDF
	call __FTOU32REG
	push hl
	call _mc1000vpokechr
	ld a, (_sc2)
	dec a
	ld (_sc2), a
	ld a, (_bown)
	dec a
	sub 1
	jp nc, __LABEL98
	ld a, (_sc1)
	inc a
	ld (_sc1), a
__LABEL98:
	ld a, (_bown)
	sub 3
	sub 1
	jp nc, __LABEL100
	ld a, (_sc3)
	inc a
	ld (_sc3), a
__LABEL100:
	ld a, (_bown)
	sub 4
	sub 1
	jp nc, __LABEL102
	ld a, (_sc4)
	inc a
	ld (_sc4), a
__LABEL102:
	xor a
	ld (_bown), a
	ld a, 085h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _xbp
	call __STOREF
	ld a, 084h
	ld de, 00040h
	ld bc, 00000h
	ld hl, _ybp
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
__LABEL96:
	ld a, (_ybp)
	ld de, (_ybp + 1)
	ld bc, (_ybp + 3)
	call __FTOU32REG
	push de
	push hl
	ld de, 0
	ld hl, 0
	call __LTI32
	or a
	jp z, __LABEL104
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, 157
	push hl
	ld hl, _ybp + 4
	call __FP_PUSH_REV
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __ADDF
	call __FTOU32REG
	push hl
	call _mc1000vpokechr
	ld a, (_sc3)
	dec a
	ld (_sc3), a
	ld a, (_bown)
	dec a
	sub 1
	jp nc, __LABEL106
	ld a, (_sc1)
	inc a
	ld (_sc1), a
__LABEL106:
	ld a, (_bown)
	sub 2
	sub 1
	jp nc, __LABEL108
	ld a, (_sc2)
	inc a
	ld (_sc2), a
__LABEL108:
	ld a, (_bown)
	sub 4
	sub 1
	jp nc, __LABEL110
	ld a, (_sc4)
	inc a
	ld (_sc4), a
__LABEL110:
	xor a
	ld (_bown), a
	ld a, 085h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _xbp
	call __STOREF
	ld a, 084h
	ld de, 00040h
	ld bc, 00000h
	ld hl, _ybp
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
__LABEL104:
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __FTOU32REG
	push de
	push hl
	ld de, 0
	ld hl, 31
	call __LEI32
	sub 1
	jp nc, __LABEL112
	ld hl, (__LABEL__charmap01) - (136)
	push hl
	ld hl, 157
	push hl
	ld hl, _ybp + 4
	call __FP_PUSH_REV
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_xbp)
	ld de, (_xbp + 1)
	ld bc, (_xbp + 3)
	call __ADDF
	call __FTOU32REG
	push hl
	call _mc1000vpokechr
	ld a, (_sc4)
	dec a
	ld (_sc4), a
	ld a, (_bown)
	dec a
	sub 1
	jp nc, __LABEL114
	ld a, (_sc1)
	inc a
	ld (_sc1), a
__LABEL114:
	ld a, (_bown)
	sub 2
	sub 1
	jp nc, __LABEL116
	ld a, (_sc2)
	inc a
	ld (_sc2), a
__LABEL116:
	ld a, (_bown)
	sub 3
	sub 1
	jp nc, __LABEL118
	ld a, (_sc3)
	inc a
	ld (_sc3), a
__LABEL118:
	xor a
	ld (_bown), a
	ld a, 085h
	ld de, 00000h
	ld bc, 00000h
	ld hl, _xbp
	call __STOREF
	ld a, 084h
	ld de, 00040h
	ld bc, 00000h
	ld hl, _ybp
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _xbd
	call __STOREF
	ld hl, (_seed)
	push hl
	call _mc1000rnd
	call __FTOU32REG
	ld (_seed), hl
	ld de, 0
	call __U32TOFREG
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __MODF
	push bc
	push de
	push af
	ld a, 082h
	ld de, 00000h
	ld bc, 00000h
	call __MULF
	push bc
	push de
	push af
	ld a, (_spb)
	ld de, (_spb + 1)
	ld bc, (_spb + 3)
	call __SUBF
	push bc
	push de
	push af
	ld a, 086h
	ld de, 00000h
	ld bc, 00000h
	call __DIVF
	ld hl, _ybd
	call __STOREF
__LABEL112:
	ld h, 0
	ld a, (_sc1)
	call __LTI8
	or a
	jp z, __LABEL120
	xor a
	ld (_sc1), a
__LABEL120:
	ld h, 0
	ld a, (_sc2)
	call __LTI8
	or a
	jp z, __LABEL122
	xor a
	ld (_sc2), a
__LABEL122:
	ld h, 0
	ld a, (_sc3)
	call __LTI8
	or a
	jp z, __LABEL124
	xor a
	ld (_sc3), a
__LABEL124:
	ld h, 0
	ld a, (_sc4)
	call __LTI8
	or a
	jp z, __LABEL126
	xor a
	ld (_sc4), a
__LABEL126:
	ld a, (_glim)
	ld hl, (_sc1 - 1)
	call __LEI8
	or a
	jp z, __LABEL128
	ld a, 1
	ld (_govr), a
__LABEL128:
	ld a, (_glim)
	ld hl, (_sc2 - 1)
	call __LEI8
	or a
	jp z, __LABEL130
	ld a, 1
	ld (_govr), a
__LABEL130:
	ld a, (_glim)
	ld hl, (_sc3 - 1)
	call __LEI8
	or a
	jp z, __LABEL132
	ld a, 1
	ld (_govr), a
__LABEL132:
	ld a, (_glim)
	ld hl, (_sc4 - 1)
	call __LEI8
	or a
	jp z, __LABEL134
	ld a, 1
	ld (_govr), a
__LABEL134:
	ld a, (_govr)
	sub 1
	jp c, __LABEL__lp01
	ld a, (_glim)
	ld hl, (_sc1 - 1)
	call __LEI8
	or a
	jp z, __LABEL138
__LABEL138:
	ld a, (_glim)
	ld hl, (_sc2 - 1)
	call __LEI8
	or a
	jp z, __LABEL140
__LABEL140:
	ld a, (_glim)
	ld hl, (_sc3 - 1)
	call __LEI8
	or a
	jp z, __LABEL142
__LABEL142:
	ld a, (_glim)
	ld hl, (_sc4 - 1)
	call __LEI8
	or a
	jp z, __LABEL144
__LABEL144:
	ret
__LABEL145:
	jp __LABEL145
__LABEL__text01:
#line 372
		defb "BACABALL"
#line 373
__LABEL__text02:
#line 376
		defb " PAULO SILVA, '11"
#line 377
__LABEL__text03:
#line 380
		defb "PUSH ANY KEY"
#line 381
__LABEL__text04:
#line 384
		defb "LMNO"
		defb "KMPL"
#line 386
__LABEL__text05:
#line 389
		defb "PLAYERWINS"
#line 390
__LABEL__text06:
#line 393
		defb "MIJAKMEL"
#line 394
__LABEL__text07:
#line 397
		defb "MIJBKMFL"
#line 398
__LABEL__text08:
#line 401
		defb "MIJCKMGL"
#line 402
__LABEL__text09:
#line 405
		defb "MIJDKMHL"
#line 406
__LABEL__text10:
__LABEL147:
	jp __LABEL147
	ld hl, 0
	ld b, h
	ld c, l
__END_PROGRAM:
	di
	ld hl, (__CALL_BACK__)
	ld sp, hl
	exx
	pop hl
	pop iy
	pop ix
	exx
	ei
	ret
__CALL_BACK__:
	DEFW 0
_mc1000screen:
#line 1
		out($80),a
		ld($00F5),a
#line 3
_mc1000screen__leave:
	ret
_mc1000cls:
	push ix
	ld ix, 0
	add ix, sp
	ld hl, 0
	push hl
	push hl
	push hl
	inc sp
	ld (ix-3), 0
	ld (ix-2), 2
	ld (ix-1), 0
	ld a, (245)
	ld h, 248
	and h
	sub 128
	sub 1
	jp nc, __LABEL150
	ld (ix-3), 0
	ld (ix-2), 4
__LABEL150:
	ld a, (245)
	ld h, 252
	and h
	sub 136
	sub 1
	jp nc, __LABEL152
	ld (ix-3), 0
	ld (ix-2), 8
__LABEL152:
	ld a, (245)
	ld h, 252
	and h
	sub 140
	sub 1
	jp nc, __LABEL154
	ld (ix-3), 0
	ld (ix-2), 6
__LABEL154:
	ld a, (245)
	ld h, 248
	and h
	sub 144
	sub 1
	jp nc, __LABEL156
	ld (ix-3), 0
	ld (ix-2), 12
__LABEL156:
	ld a, (245)
	ld h, 248
	and h
	sub 152
	sub 1
	jp nc, __LABEL158
	ld (ix-3), 0
	ld (ix-2), 24
__LABEL158:
	ld a, (245)
	ld h, 132
	and h
	sub 128
	sub 1
	jp nc, __LABEL160
	ld a, (ix+5)
	ld h, 3
	and h
	ld h, 85
	call __MUL8_FAST
	ld (ix-1), a
__LABEL160:
	ld a, (245)
	ld h, 132
	and h
	sub 132
	sub 1
	jp nc, __LABEL162
	ld a, (ix+5)
	ld h, 1
	and h
	ld h, 255
	call __MUL8_FAST
	ld (ix-1), a
__LABEL162:
	ld a, (245)
	ld h, 96
	and h
	sub 96
	sub 1
	jp nc, __LABEL164
	ld (ix-1), 0
	ld a, (ix+5)
	ld h, 7
	and h
	ld h, 4
	cp h
	jp nc, __LABEL166
	ld a, (ix+5)
	ld h, 3
	and h
	ld b, 6
__LABEL185:
	add a, a
	djnz __LABEL185
	ld h, a
	ld a, 63
	or h
	ld (ix-1), a
__LABEL166:
__LABEL164:
	ld a, (245)
	ld h, 96
	and h
	sub 64
	sub 1
	jp nc, __LABEL168
	ld (ix-1), 0
	ld a, (ix+5)
	ld h, 15
	and h
	ld h, 8
	cp h
	jp nc, __LABEL170
	ld a, (ix+5)
	ld h, 7
	and h
	add a, a
	add a, a
	add a, a
	add a, a
	ld h, a
	ld a, 15
	or h
	ld (ix-1), a
__LABEL170:
__LABEL168:
	ld a, (245)
	ld h, 252
	and h
	sub 1
	jp nc, __LABEL172
	ld a, (ix+5)
	ld h, 1
	and h
	ld b, 7
__LABEL186:
	add a, a
	djnz __LABEL186
	ld h, a
	ld a, 32
	or h
	ld (ix-1), a
__LABEL172:
	ld (ix-5), 0
	ld (ix-4), 0
	jp __LABEL173
__LABEL176:
	ld l, (ix-5)
	ld h, (ix-4)
	ld de, 32768
	add hl, de
	push hl
	ld a, (ix-1)
	pop hl
	ld (hl), a
	ld l, (ix-5)
	ld h, (ix-4)
	inc hl
	ld (ix-5), l
	ld (ix-4), h
__LABEL173:
	ld l, (ix-5)
	ld h, (ix-4)
	push hl
	ld l, (ix-3)
	ld h, (ix-2)
	dec hl
	pop de
	or a
	sbc hl, de
	jp nc, __LABEL176
_mc1000cls__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	ex (sp), hl
	exx
	ret
_mc1000vpokechr:
	push ix
	ld ix, 0
	add ix, sp
	ld l, (ix+4)
	ld h, (ix+5)
	ld de, 768
	call __MODU16
	ld (ix+4), l
	ld (ix+5), h
	ld hl, 8
	push hl
	ld l, (ix+8)
	ld h, (ix+9)
	push hl
	ld l, (ix+6)
	ld h, (ix+7)
	add hl, hl
	add hl, hl
	add hl, hl
	ex de, hl
	pop hl
	add hl, de
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	ld h, 0
	ld a, l
	and 31
	ld l, a
	ld de, 32768
	add hl, de
	ld de, 0
	push de
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	ld de, 32
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 256
	call __MUL32
	pop bc
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	call _minivadersldir32b
_mc1000vpokechr__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_mc1000rnd:
	push ix
	ld ix, 0
	add ix, sp
	ld l, (ix+4)
	ld h, (ix+5)
	ld de, 255
	call __BAND16
	ld de, 221
	call __MUL16_FAST
	ld de, 53
	add hl, de
	ld de, 255
	call __BAND16
	ld de, 0
	call __U32TOFREG
_mc1000rnd__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	ex (sp), hl
	exx
	ret
_minivadersldir32b:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld d,(ix+5)
		ld e,(ix+4)
		ld h,(ix+7)
		ld l,(ix+6)
		ld b,(ix+9)
		ld c,(ix+8)
minivadersldir32bloop:
		ld a,(hl)
		ld (de),a
		inc hl
		ex de,hl
		push de
		ld de,32
		add hl,de
		pop de
		ex de,hl
		dec bc
		ld a,b
		or c
		jp nz,minivadersldir32bloop
#line 22
_minivadersldir32b__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_aquariusfillram:
	push ix
	ld ix, 0
	add ix, sp
#line 1
		ld b,(ix+6)
		ld d,(ix+9)
		ld e,(ix+8)
		ld h,(ix+5)
		ld l,(ix+4)
fillbytes:
		ld (hl),b
		inc hl
		dec de
		ld a,d
		or e
		jr nz,fillbytes
#line 13
_aquariusfillram__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_mc1000keymapinv:
#line 1
		di
		xor $FF
		ld b,a
		ld a,$0E
		out($20),a
		ld a,b
		out($60),a
		ld a,$0F
		out($20),a
		in a,($40)
		xor $FF
		ei
#line 13
_mc1000keymapinv__leave:
	ret
_mc1000writetext:
	push ix
	ld ix, 0
	add ix, sp
	ld hl, 0
	push hl
	ld (ix-2), 0
	ld (ix-1), 0
	jp __LABEL178
__LABEL181:
	ld l, (ix+12)
	ld h, (ix+13)
	push hl
	ld l, (ix+8)
	ld h, (ix+9)
	push hl
	ld l, (ix-2)
	ld h, (ix-1)
	ex de, hl
	pop hl
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	ld l, a
	ld h, 0
	push hl
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 32
	call __MUL16_FAST
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	ex de, hl
	pop hl
	add hl, de
	push hl
	ld l, (ix-2)
	ld h, (ix-1)
	ex de, hl
	pop hl
	add hl, de
	push hl
	call _mc1000vpokechr
	ld l, (ix-2)
	ld h, (ix-1)
	inc hl
	ld (ix-2), l
	ld (ix-1), h
__LABEL178:
	ld l, (ix-2)
	ld h, (ix-1)
	push hl
	ld l, (ix+10)
	ld h, (ix+11)
	dec hl
	pop de
	or a
	sbc hl, de
	jp nc, __LABEL181
_mc1000writetext__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_drawsprites:
	push ix
	ld ix, 0
	add ix, sp
	ld a, (_m1)
	sub 1
	jp nc, __LABEL183
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, __LABEL__text06
	push hl
	ld a, (_y1)
	ld de, (_y1 + 1)
	ld bc, (_y1 + 3)
	call __FTOU32REG
	push hl
	ld a, (_x1)
	ld de, (_x1 + 1)
	ld bc, (_x1 + 3)
	call __FTOU32REG
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text06) + (2)
	push hl
	ld hl, _y1 + 4
	call __FP_PUSH_REV
	ld a, 081h
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	call __FTOU32REG
	push hl
	ld a, (_x1)
	ld de, (_x1 + 1)
	ld bc, (_x1 + 3)
	call __FTOU32REG
	push hl
	call _mc1000writetext
	jp __LABEL184
__LABEL183:
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text06) + (4)
	push hl
	ld a, (_y1)
	ld de, (_y1 + 1)
	ld bc, (_y1 + 3)
	call __FTOU32REG
	push hl
	ld a, (_x1)
	ld de, (_x1 + 1)
	ld bc, (_x1 + 3)
	call __FTOU32REG
	push hl
	call _mc1000writetext
	ld hl, ((__LABEL__charmap01) - (136)) + (256)
	push hl
	ld hl, 2
	push hl
	ld hl, (__LABEL__text06) + (6)
	push hl
	ld hl, _y1 + 4
	call __FP_PUSH_REV
	ld a, 081h
	ld de, 00000h
	ld bc, 00000h
	call __ADDF
	call __FTOU32REG
	push hl
	ld a, (_x1)
	ld de, (_x1 + 1)
	ld bc, (_x1 + 3)
	call __FTOU32REG
	push hl
	call _mc1000writetext
__LABEL184:
_drawsprites__leave:
	ld sp, ix
	pop ix
	ret
#line 1 "addf.asm"
#line 1 "stackf.asm"
	; -------------------------------------------------------------
	; Functions to manage FP-Stack of the ZX Spectrum ROM CALC
	; -------------------------------------------------------------
	
	
	__FPSTACK_PUSH EQU 2AB6h	; Stores an FP number into the ROM FP stack (A, ED CB)
	__FPSTACK_POP  EQU 2BF1h	; Pops an FP number out of the ROM FP stack (A, ED CB)
	
__FPSTACK_PUSH2: ; Pushes Current A ED CB registers and top of the stack on (SP + 4)
	                 ; Second argument to push into the stack calculator is popped out of the stack
	                 ; Since the caller routine also receives the parameters into the top of the stack
	                 ; four bytes must be removed from SP before pop them out
	
	    call __FPSTACK_PUSH ; Pushes A ED CB into the FP-STACK
	    exx
	    pop hl       ; Caller-Caller return addr
	    exx
	    pop hl       ; Caller return addr
	
	    pop af
	    pop de
	    pop bc
	
	    push hl      ; Caller return addr
	    exx
	    push hl      ; Caller-Caller return addr
	    exx
	 
	    jp __FPSTACK_PUSH
	
	
__FPSTACK_I16:	; Pushes 16 bits integer in HL into the FP ROM STACK
					; This format is specified in the ZX 48K Manual
					; You can push a 16 bit signed integer as
					; 0 SS LL HH 0, being SS the sign and LL HH the low
					; and High byte respectively
		ld a, h
		rla			; sign to Carry
		sbc	a, a	; 0 if positive, FF if negative
		ld e, a
		ld d, l
		ld c, h
		xor a
		ld b, a
		jp __FPSTACK_PUSH
#line 2 "addf.asm"
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	; All of them uses A EDCB registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order AF DE BC (F not used).
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
__ADDF:	; Addition
		call __FPSTACK_PUSH2
		
		; ------------- ROM ADD
		rst 28h
		defb 0fh	; ADD
		defb 38h;   ; END CALC
	
		jp __FPSTACK_POP
	
#line 3265 "bacaball.bas"
#line 1 "and8.asm"
	; FASTCALL boolean and 8 version.
	; result in Accumulator (0 False, not 0 True)
; __FASTCALL__ version (operands: A, H)
	; Performs 8bit and 8bit and returns the boolean
	
__AND8:
		or a
		ret z
		ld a, h
		ret 
	
#line 3266 "bacaball.bas"
#line 1 "band16.asm"
; vim:ts=4:et:
	; FASTCALL bitwise and16 version.
	; result in hl 
; __FASTCALL__ version (operands: A, H)
	; Performs 16bit or 16bit and returns the boolean
; Input: HL, DE
; Output: HL <- HL AND DE
	
__BAND16:
		ld a, h
		and d
	    ld h, a
	
	    ld a, l
	    and e
	    ld l, a
	
	    ret 
	
#line 3267 "bacaball.bas"
#line 1 "div16.asm"
	; 16 bit division and modulo functions 
	; for both signed and unsigned values
	
#line 1 "neg16.asm"
	; Negates HL value (16 bit)
__ABS16:
		bit 7, h
		ret z
	
__NEGHL:
		ld a, l			; HL = -HL
		cpl
		ld l, a
		ld a, h
		cpl
		ld h, a
		inc hl
		ret
	
#line 5 "div16.asm"
	
__DIVU16:    ; 16 bit unsigned division
	             ; HL = Dividend, Stack Top = Divisor
	
		;   -- OBSOLETE ; Now uses FASTCALL convention
		;   ex de, hl
	    ;	pop hl      ; Return address
	    ;	ex (sp), hl ; CALLEE Convention
	
__DIVU16_FAST:
	    ld a, h
	    ld c, l
	    ld hl, 0
	    ld b, 16
	
__DIV16LOOP:
	    sll c
	    rla
	    adc hl,hl
	    sbc hl,de
	    jr  nc, __DIV16NOADD
	    add hl,de
	    dec c
	
__DIV16NOADD:
	    djnz __DIV16LOOP
	
	    ex de, hl
	    ld h, a
	    ld l, c
	
	    ret     ; HL = quotient, DE = Mudulus
	
	
	
__MODU16:    ; 16 bit modulus
	             ; HL = Dividend, Stack Top = Divisor
	
	    ;ex de, hl
	    ;pop hl
	    ;ex (sp), hl ; CALLEE Convention
	
	    call __DIVU16_FAST
	    ex de, hl	; hl = reminder (modulus)
					; de = quotient
	
	    ret
	
	
__DIVI16:	; 16 bit signed division
		;	--- The following is OBSOLETE ---
		;	ex de, hl
		;	pop hl
		;	ex (sp), hl 	; CALLEE Convention
	
__DIVI16_FAST:
		ld a, d
		xor h
		ex af, af'		; BIT 7 of a contains result
	
		bit 7, d		; DE is negative?
		jr z, __DIVI16A	
	
		ld a, e			; DE = -DE
		cpl
		ld e, a
		ld a, d
		cpl
		ld d, a
		inc de
	
__DIVI16A:
		bit 7, h		; HL is negative?
		call nz, __NEGHL
	
__DIVI16B:
		call __DIVU16_FAST
		ex af, af'
	
		or a	
		ret p	; return if positive
	    jp __NEGHL
	
		
__MODI16:    ; 16 bit modulus
	             ; HL = Dividend, Stack Top = Divisor
	
	    ;ex de, hl
	    ;pop hl
	    ;ex (sp), hl ; CALLEE Convention
	
	    call __DIVI16_FAST
	    ex de, hl	; hl = reminder (modulus)
					; de = quotient
	
	    ret
	
#line 3268 "bacaball.bas"
#line 1 "div32.asm"
#line 1 "neg32.asm"
__ABS32:
		bit 7, d
		ret z
	
__NEG32: ; Negates DEHL (Two's complement)
		ld a, l
		cpl
		ld l, a
	
		ld a, h
		cpl
		ld h, a
	
		ld a, e
		cpl
		ld e, a
		
		ld a, d
		cpl
		ld d, a
	
		inc l
		ret nz
	
		inc h
		ret nz
	
		inc de
		ret
	
#line 2 "div32.asm"
	
				 ; ---------------------------------------------------------
__DIVU32:    ; 32 bit unsigned division
	             ; DEHL = Dividend, Stack Top = Divisor
	             ; OPERANDS P = Dividend, Q = Divisor => OPERATION => P / Q
				 ;
				 ; Changes A, BC DE HL B'C' D'E' H'L'
				 ; ---------------------------------------------------------
	        exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
__DIVU32START: ; Performs D'E'H'L' / HLDE
	        ; Now switch to DIVIDEND = B'C'BC / DIVISOR = D'E'DE (A / B)
	        push de ; push Lowpart(Q)
			ex de, hl	; DE = HL
	        ld hl, 0
	        exx
	        ld b, h
	        ld c, l
	        pop hl
	        push de
	        ex de, hl
	        ld hl, 0        ; H'L'HL = 0
	        exx
	        pop bc          ; Pop HightPart(B) => B = B'C'BC
	        exx
	
	        ld a, 32 ; Loop count
	
__DIV32LOOP:
	        sll c  ; B'C'BC << 1 ; Output most left bit to carry
	        rl  b
	        exx
	        rl c
	        rl b
	        exx
	
	        adc hl, hl
	        exx
	        adc hl, hl
	        exx
	
	        sbc hl,de
	        exx
	        sbc hl,de
	        exx
	        jp nc, __DIV32NOADD	; use JP inside a loop for being faster
	
	        add hl, de
	        exx
	        adc hl, de
	        exx
	        dec bc
	
__DIV32NOADD:
	        dec a
	        jp nz, __DIV32LOOP	; use JP inside a loop for being faster
	        ; At this point, quotient is stored in B'C'BC and the reminder in H'L'HL
	
	        push hl
	        exx
	        pop de
	        ex de, hl ; D'E'H'L' = 32 bits modulus
	        push bc
	        exx
	        pop de    ; DE = B'C'
	        ld h, b
	        ld l, c   ; DEHL = quotient D'E'H'L' = Modulus
	
	        ret     ; DEHL = quotient, D'E'H'L' = Modulus
	
	
	
__MODU32:    ; 32 bit modulus for 32bit unsigned division
	             ; DEHL = Dividend, Stack Top = Divisor (DE, HL)
	
	        exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
	        call __DIVU32START	; At return, modulus is at D'E'H'L'
	
__MODU32START:
	
			exx
			push de
			push hl
	
			exx 
			pop hl
			pop de
	
			ret
	
	
__DIVI32:    ; 32 bit signed division
	             ; DEHL = Dividend, Stack Top = Divisor
	             ; A = Dividend, B = Divisor => A / B
	        exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
__DIVI32START:
			exx
			ld a, d	 ; Save sign
			ex af, af'
			bit 7, d ; Negative?
			call nz, __NEG32 ; Negates DEHL
	
			exx		; Now works with H'L'D'E'
			ex af, af'
			xor h
			ex af, af'  ; Stores sign of the result for later
	
			bit 7, h ; Negative?
			ex de, hl ; HLDE = DEHL
			call nz, __NEG32
			ex de, hl 
	
			call __DIVU32START
			ex af, af' ; Recovers sign
			and 128	   ; positive?
			ret z
	
			jp __NEG32 ; Negates DEHL and returns from there
			
			
__MODI32:	; 32bits signed division modulus
			exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
			call __DIVI32START
			jp __MODU32START		
	
#line 3269 "bacaball.bas"
#line 1 "div8.asm"
				; --------------------------------
__DIVU8:	; 8 bit unsigned integer division 
				; Divides (Top of stack, High Byte) / A
		pop hl	; --------------------------------
		ex (sp), hl	; CALLEE
	
__DIVU8_FAST:	; Does A / H
		ld l, h
		ld h, a		; At this point do H / L
	
		ld b, 8
		xor a		; A = 0, Carry Flag = 0
		
__DIV8LOOP:
		sla	h		
		rla			
		cp	l		
		jr	c, __DIV8NOSUB
		sub	l		
		inc	h		
	
__DIV8NOSUB:	
		djnz __DIV8LOOP
	
		ld	l, a		; save remainder
		ld	a, h		; 
		
		ret			; a = Quotient, 
	
	
					; --------------------------------
__DIVI8:		; 8 bit signed integer division Divides (Top of stack) / A
		pop hl		; --------------------------------
		ex (sp), hl
	
__DIVI8_FAST:
		ld e, a		; store operands for later
		ld c, h
	
		or a		; negative?
		jp p, __DIV8A
		neg			; Make it positive
	
__DIV8A:
		ex af, af'
		ld a, h
		or a
		jp p, __DIV8B
		neg
		ld h, a		; make it positive
	
__DIV8B:
		ex af, af'
	
		call __DIVU8_FAST
	
		ld a, c
		xor l		; bit 7 of A = 1 if result is negative
	
		ld a, h		; Quotient
		ret p		; return if positive	
	
		neg
		ret
		
	
__MODU8:		; 8 bit module. REturns A mod (Top of stack) (unsigned operands)
		pop hl
		ex (sp), hl	; CALLEE
	
__MODU8_FAST:	; __FASTCALL__ entry
		call __DIVU8_FAST
		ld a, l		; Remainder
	
		ret		; a = Modulus
	
	
__MODI8:		; 8 bit module. REturns A mod (Top of stack) (For singed operands)
		pop hl
		ex (sp), hl	; CALLEE
	
__MODI8_FAST:	; __FASTCALL__ entry
		call __DIVI8_FAST
		ld a, l		; remainder
	
		ret		; a = Modulus
	
#line 3270 "bacaball.bas"
#line 1 "divf.asm"
	
#line 1 "error.asm"
	; Simple error control routines
; vim:ts=4:et:
	
	ERR_NR    EQU    23610    ; Error code system variable
	
	
	; Error code definitions (as in ZX spectrum manual)
	
; Set error code with:
	;    ld a, ERROR_CODE
	;    ld (ERR_NR), a
	
	
	ERROR_Ok                EQU    -1
	ERROR_SubscriptWrong    EQU     2
	ERROR_OutOfMemory       EQU     3
	ERROR_OutOfScreen       EQU     4
	ERROR_NumberTooBig      EQU     5
	ERROR_InvalidArg        EQU     9
	ERROR_IntOutOfRange     EQU    10
	ERROR_InvalidFileName   EQU    14 
	ERROR_InvalidColour     EQU    19
	ERROR_BreakIntoProgram  EQU    20
	ERROR_TapeLoadingErr    EQU    26
	
	
	; Raises error using RST #8
__ERROR:
	    ld (__ERROR_CODE), a
	    rst 8
__ERROR_CODE:
	    nop
	    ret
	
	; Sets the error system variable, but keeps running.
	; Usually this instruction if followed by the END intermediate instruction.
__STOP:
	    ld (ERR_NR), a
	    ret
#line 3 "divf.asm"
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	
	; All of them uses C EDHL registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order BC DE HL (B not used).
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
__DIVF:	; Division
		PROC
		LOCAL __DIVBYZERO
		LOCAL TMP, ERR_SP
	
	TMP         EQU 23629 ;(DEST)
	ERR_SP      EQU 23613
	
		call __FPSTACK_PUSH2
	
		ld hl, (ERR_SP)
		ld (TMP), hl
		ld hl, __DIVBYZERO
		push hl
		ld hl, 0
		add hl, sp
		ld (ERR_SP), hl
		
		; ------------- ROM DIV
		rst 28h
		defb 01h	; EXCHANGE
		defb 05h	; DIV
		defb 38h;   ; END CALC
	
		pop hl
		ld hl, (TMP)
		ld (ERR_SP), hl
	
		jp __FPSTACK_POP
	
__DIVBYZERO:
		ld hl, (TMP)
		ld (ERR_SP), hl
	
		ld a, ERROR_NumberTooBig
		ld (ERR_NR), a
	
		; Returns 0 on DIV BY ZERO error
		xor a
		ld b, a
		ld c, a
		ld d, a
		ld e, a
		ret
	
		ENDP
	
#line 3271 "bacaball.bas"
#line 1 "eq32.asm"
__EQ32:	; Test if 32bit value HLDE equals top of the stack
		; Returns result in A: 0 = False, FF = True
			exx
			pop bc ; Return address
			exx
	
			or a	; Reset carry flag
			pop bc
			sbc hl, bc ; Low part
			ex de, hl 
			pop bc
			sbc hl, bc ; Hight part
	
			exx
			push bc ; CALLEE
			exx
	
			ld a, h
			or l
			or d
			or e   ; a = 0 only if HLDE = 0
			sub 1  ; sets carry flag only if a = 0
			sbc a, a
			
			ret
	
#line 3272 "bacaball.bas"
#line 1 "ftou32reg.asm"
	
	
__FTOU32REG:	; Converts a Float to (un)signed 32 bit integer (NOTE: It's ALWAYS 32 bit signed)
					; Input FP number in A EDCB (A exponent, EDCB mantissa)
				; Output: DEHL 32 bit number (signed)
		PROC
	
		LOCAL __IS_FLOAT
	
		or a
		jr nz, __IS_FLOAT 
		; Here if it is a ZX ROM Integer
	
		ld h, c
		ld l, d
	ld a, e	 ; Takes sign: FF = -, 0 = +
		ld de, 0
		inc a
		jp z, __NEG32	; Negates if negative
		ret
	
__IS_FLOAT:  ; Jumps here if it is a true floating point number
		ld h, e	
		push hl  ; Stores it for later (Contains Sign in H)
	
		push de
		push bc
	
		exx
		pop de   ; Loads mantissa into C'B' E'D' 
		pop bc	 ; 
	
		set 7, c ; Highest mantissa bit is always 1
		exx
	
		ld hl, 0 ; DEHL = 0
		ld d, h
		ld e, l
	
		;ld a, c  ; Get exponent
		sub 128  ; Exponent -= 128
		jr z, __FTOU32REG_END	; If it was <= 128, we are done (Integers must be > 128)
		jr c, __FTOU32REG_END	; It was decimal (0.xxx). We are done (return 0)
	
		ld b, a  ; Loop counter = exponent - 128
	
__FTOU32REG_LOOP:
		exx 	 ; Shift C'B' E'D' << 1, output bit stays in Carry
		sla d
		rl e
		rl b
		rl c
	
	    exx		 ; Shift DEHL << 1, inserting the carry on the right
		rl l
		rl h
		rl e
		rl d
	
		djnz __FTOU32REG_LOOP
	
__FTOU32REG_END:
		pop af   ; Take the sign bit
		or a	 ; Sets SGN bit to 1 if negative
		jp m, __NEG32 ; Negates DEHL
		
		ret
	
		ENDP
	
	
__FTOU8:	; Converts float in C ED LH to Unsigned byte in A
		call __FTOU32REG
		ld a, l
		ret
	
#line 3273 "bacaball.bas"
#line 1 "gtf.asm"
#line 1 "u32tofreg.asm"
	
__I8TOFREG:
		ld l, a
		rlca
		sbc a, a	; A = SGN(A)
		ld h, a
		ld e, a
		ld d, a
	
__I32TOFREG:	; Converts a 32bit signed integer (stored in DEHL)
					; to a Floating Point Number returned in (A ED CB)
	
		ld a, d
		or a		; Test sign
	
		jp p, __U32TOFREG	; It was positive, proceed as 32bit unsigned
	
		call __NEG32		; Convert it to positive
		call __U32TOFREG	; Convert it to Floating point
	
		set 7, e			; Put the sign bit (negative) in the 31bit of mantissa
		ret
	
__U8TOFREG:
					; Converts an unsigned 8 bit (A) to Floating point
		ld l, a
		ld h, 0
		ld e, h
		ld d, h
	
__U32TOFREG:	; Converts an unsigned 32 bit integer (DEHL)
					; to a Floating point number returned in A ED CB
	
	    PROC
	
	    LOCAL __U32TOFREG_END
	
		ld a, d
		or e
		or h
		or l
	    ld b, d
		ld c, e		; Returns 00 0000 0000 if ZERO
		ret z
	
		push de
		push hl
	
		exx
		pop de  ; Loads integer into B'C' D'E' 
		pop bc
		exx
	
		ld l, 128	; Exponent
		ld bc, 0	; DEBC = 0
		ld d, b
		ld e, c
	
__U32TOFREG_LOOP: ; Also an entry point for __F16TOFREG
		exx
		ld a, d 	; B'C'D'E' == 0 ?
		or e
		or b
		or c
		jp z, __U32TOFREG_END	; We are done
	
		srl b ; Shift B'C' D'E' >> 1, output bit stays in Carry
		rr c
		rr d
		rr e
		exx
	
		rr e ; Shift EDCB >> 1, inserting the carry on the left
		rr d
		rr c
		rr b
	
		inc l	; Increment exponent
		jp __U32TOFREG_LOOP
	
	
__U32TOFREG_END:
		exx
	    ld a, l     ; Puts the exponent in a
		res 7, e	; Sets the sign bit to 0 (positive)
	
		ret
	    ENDP
	
#line 2 "gtf.asm"
	
	
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	
	; All of them uses A EDCB registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order A DE BC.
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
__GTF:	; A > B
		call __FPSTACK_PUSH2 ; ENTERS B, A
		
		; ------------- ROM NOS-GRTR
		ld b, 0Dh	; B < A
		rst 28h
		defb 0Dh	; B < A
		defb 38h;   ; END CALC
	
		call __FPSTACK_POP 
		jp __FTOU8; Convert to 8 bits
	
#line 3274 "bacaball.bas"
#line 1 "lei32.asm"
	
#line 1 "lti8.asm"
	
__LTI8: ; Test 8 bit values A < H
        ; Returns result in A: 0 = False, !0 = True
	        sub h
	
__LTI:  ; Signed CMP
	        PROC
	        LOCAL __PE
	
	        ld a, 0  ; Sets default to false
__LTI2:
	        jp pe, __PE
	        ; Overflow flag NOT set
	        ret p
	        dec a ; TRUE
	
__PE:   ; Overflow set
	        ret m
	        dec a ; TRUE
	        ret
	        
	        ENDP
#line 3 "lei32.asm"
#line 1 "sub32.asm"
	; SUB32 
	; TOP of the stack - DEHL
	; Pops operand out of the stack (CALLEE)
	; and returns result in DEHL
	; Operands come reversed => So we swap then using EX (SP), HL
	
__SUB32:
		exx
		pop bc		; Return address
		exx
	
		ex (sp), hl
		pop bc
		or a 
		sbc hl, bc
	
		ex de, hl
		ex (sp), hl
		pop bc
		sbc hl, bc
		ex de, hl
	
		exx
		push bc		; Put return address
		exx
		ret
		
	
	
#line 4 "lei32.asm"
	
__LEI32: ; Test 32 bit values HLDE < Top of the stack
	    exx
	    pop de ; Preserves return address
	    exx
	
	    call __SUB32
	
	    exx
	    push de ; Restores return address
	    exx
	
	    ld a, 0
	    jp nz, __LTI2 ; go for sign it Not Zero
	    ; At this point, DE = 0. So, check HL
	
	    or h
	    or l
	    sub 1   ; If A = 0 => A = 0xFF & Carry
	    sbc a, a; If Carry, A = 0xFF else, 0
	    ret
	
#line 3275 "bacaball.bas"
#line 1 "lei8.asm"
	
	
__LEI8: ; Signed <= comparison for 8bit int
	        ; A <= H (registers)
	        sub h
	        jp nz, __LTI ; not 0, proceed as A < H
	        dec a   ; Sets A to True
	        ret
#line 3276 "bacaball.bas"
#line 1 "ltf.asm"
	
	
	
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	
	; All of them uses A EDCB registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order A HL BC.
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
__LTF:	; A < B
		call __FPSTACK_PUSH2 ; Enters B, A
		
		; ------------- ROM NOS-LESS
		ld b, 0Ch	; A > B (Operands stack-reversed)
		rst 28h
		defb 0Ch;	; A > B
		defb 38h;   ; END CALC
	
		call __FPSTACK_POP 
		jp __FTOU8 ; Convert to 8 bits
	
#line 3277 "bacaball.bas"
#line 1 "lti32.asm"
	
	
	
	
__LTI32: ; Test 32 bit values HLDE < Top of the stack
	    exx
	    pop de ; Preserves return address
	    exx
	
	    call __SUB32
	
	    exx
	    push de ; Restores return address
	    exx
	
	    ld a, 0
	    jp __LTI2 ; go for sign
	
#line 3278 "bacaball.bas"
	
#line 1 "modf.asm"
	
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	
	; All of them uses A EDCB registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order A DE BC.
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
__MODF:	; MODULO
		call __FPSTACK_PUSH2	; Enters B, A
		
		; ------------- ROM DIV
		rst 28h
		defb 01h	; EXCHANGE
		defb 32h	; MOD
		defb 38h;   ; END CALC
	
		jp __FPSTACK_POP
	
#line 3280 "bacaball.bas"
#line 1 "mul16.asm"
__MUL16:	; Mutiplies HL with the last value stored into de stack
				; Works for both signed and unsigned
	
			PROC
	
			LOCAL __MUL16LOOP
	        LOCAL __MUL16NOADD
			
			ex de, hl
			pop hl		; Return address
			ex (sp), hl ; CALLEE caller convention
	
;;__MUL16_FAST:	; __FASTCALL ENTRY: HL = 1st operand, DE = 2nd Operand
	;;		ld c, h
	;;		ld a, l	 ; C,A => 1st Operand
	;;
	;;		ld hl, 0 ; Accumulator
	;;		ld b, 16
	;;
;;__MUL16LOOP:
	;;		sra c	; C,A >> 1  (Arithmetic)
	;;		rra
	;;
	;;		jr nc, __MUL16NOADD
	;;		add hl, de
	;;
;;__MUL16NOADD:
	;;		sla e
	;;		rl d
	;;			
	;;		djnz __MUL16LOOP
	
__MUL16_FAST:
	        ld b, 16
	        ld a, d
	        ld c, e
	        ex de, hl
	        ld hl, 0
	
__MUL16LOOP:
	        add hl, hl  ; hl << 1
	        sla c
	        rla         ; a,c << 1
	        jp nc, __MUL16NOADD
	        add hl, de
	
__MUL16NOADD:
	        djnz __MUL16LOOP
	
			ret	; Result in hl (16 lower bits)
	
			ENDP
	
#line 3281 "bacaball.bas"
#line 1 "mul32.asm"
#line 1 "_mul32.asm"
	
; Ripped from: http://www.andreadrian.de/oldcpu/z80_number_cruncher.html#moztocid784223
	; Used with permission.
	; Multiplies 32x32 bit integer (DEHL x D'E'H'L')
	; 64bit result is returned in H'L'H L B'C'A C
	
	
__MUL32_64START:
			push hl
			exx
			ld b, h
			ld c, l		; BC = Low Part (A)
			pop hl		; HL = Load Part (B)
			ex de, hl	; DE = Low Part (B), HL = HightPart(A) (must be in B'C')
			push hl
	
			exx
			pop bc		; B'C' = HightPart(A)
			exx			; A = B'C'BC , B = D'E'DE
	
				; multiply routine 32 * 32bit = 64bit
				; h'l'hlb'c'ac = b'c'bc * d'e'de
				; needs register a, changes flags
				;
				; this routine was with tiny differences in the
				; sinclair zx81 rom for the mantissa multiply
	
__LMUL:
	        and     a               ; reset carry flag
	        sbc     hl,hl           ; result bits 32..47 = 0
	        exx
	        sbc     hl,hl           ; result bits 48..63 = 0
	        exx
	        ld      a,b             ; mpr is b'c'ac
	        ld      b,33            ; initialize loop counter
	        jp      __LMULSTART  
	
__LMULLOOP:
	        jr      nc,__LMULNOADD  ; JP is 2 cycles faster than JR. Since it's inside a LOOP
	                                ; it can save up to 33 * 2 = 66 cycles
	                                ; But JR if 3 cycles faster if JUMP not taken!
	        add     hl,de           ; result += mpd
	        exx
	        adc     hl,de
	        exx
	
__LMULNOADD:
	        exx
	        rr      h               ; right shift upper
	        rr      l               ; 32bit of result
	        exx
	        rr      h
	        rr      l
	
__LMULSTART:
	        exx
	        rr      b               ; right shift mpr/
	        rr      c               ; lower 32bit of result
	        exx
	        rra                     ; equivalent to rr a
	        rr      c
	        djnz    __LMULLOOP
	
			ret						; result in h'l'hlb'c'ac
	       
#line 2 "mul32.asm"
	
__MUL32:	; multiplies 32 bit un/signed integer.
				; First operand stored in DEHL, and 2nd onto stack
				; Lowest part of 2nd operand on top of the stack
				; returns the result in DE.HL
			exx
			pop hl	; Return ADDRESS
			pop de	; Low part
			ex (sp), hl ; CALLEE -> HL = High part
			ex de, hl
			call __MUL32_64START
	
__TO32BIT:  ; Converts H'L'HLB'C'AC to DEHL (Discards H'L'HL)
			exx
			push bc
			exx
			pop de
			ld h, a
			ld l, c
			ret
	
	
#line 3282 "bacaball.bas"
#line 1 "mul8.asm"
__MUL8:		; Performs 8bit x 8bit multiplication
		PROC
	
		;LOCAL __MUL8A
		LOCAL __MUL8LOOP
		LOCAL __MUL8B
				; 1st operand (byte) in A, 2nd operand into the stack (AF)
		pop hl	; return address
		ex (sp), hl ; CALLE convention
	
;;__MUL8_FAST: ; __FASTCALL__ entry
	;;	ld e, a
	;;	ld d, 0
	;;	ld l, d
	;;	
	;;	sla h	
	;;	jr nc, __MUL8A
	;;	ld l, e
	;;
;;__MUL8A:
	;;
	;;	ld b, 7
;;__MUL8LOOP:
	;;	add hl, hl
	;;	jr nc, __MUL8B
	;;
	;;	add hl, de
	;;
;;__MUL8B:
	;;	djnz __MUL8LOOP
	;;
	;;	ld a, l ; result = A and HL  (Truncate to lower 8 bits)
	
__MUL8_FAST: ; __FASTCALL__ entry, a = a * h (8 bit mul) and Carry
	
	    ld b, 8
	    ld l, a
	    xor a
	
__MUL8LOOP:
	    add a, a ; a *= 2
	    sla l
	    jp nc, __MUL8B
	    add a, h
	
__MUL8B:
	    djnz __MUL8LOOP
		
		ret		; result = HL
		ENDP
	
#line 3283 "bacaball.bas"
#line 1 "mulf.asm"
	
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	; All of them uses A EDCB registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order A DE BC.
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
__MULF:	; Multiplication
		call __FPSTACK_PUSH2
		
		; ------------- ROM MUL
		rst 28h
		defb 04h	; 
		defb 38h;   ; END CALC
	
		jp __FPSTACK_POP
	
#line 3284 "bacaball.bas"
#line 1 "pushf.asm"
	
	; Routine to push Float pointed by HL 
	; Into the stack. Notice that the hl points to the last
	; byte of the FP number.
	; Uses H'L' B'C' and D'E' to preserve ABCDEHL registers
	
__FP_PUSH_REV:
	    push hl
	    exx
	    pop hl
	    pop bc ; Return Address
	    ld d, (hl)
	    dec hl
	    ld e, (hl)
	    dec hl
	    push de
	    ld d, (hl)
	    dec hl
	    ld e, (hl)
	    dec hl
	    push de
	    ld d, (hl)
	    push de
	    push bc ; Return Address
	    exx
	    ret
	
	
#line 3285 "bacaball.bas"
#line 1 "storef.asm"
__PISTOREF:	; Indect Stores a float (A, E, D, C, B) at location stored in memory, pointed by (IX + HL)
			push de
			ex de, hl	; DE <- HL
			push ix
			pop hl		; HL <- IX
			add hl, de  ; HL <- IX + HL
			pop de
	
__ISTOREF:  ; Load address at hl, and stores A,E,D,C,B registers at that address. Modifies A' register
	        ex af, af'
			ld a, (hl)
			inc hl
			ld h, (hl)
			ld l, a     ; HL = (HL)
	        ex af, af'
	
__STOREF:	; Stores the given FP number in A EDCB at address HL
			ld (hl), a
			inc hl
			ld (hl), e
			inc hl
			ld (hl), d
			inc hl
			ld (hl), c
			inc hl
			ld (hl), b
			ret
			
#line 3286 "bacaball.bas"
	
#line 1 "subf.asm"
	
	
	; -------------------------------------------------------------
	; Floating point library using the FP ROM Calculator (ZX 48K)
	
	; All of them uses A EDCB registers as 1st paramter.
	; For binary operators, the 2n operator must be pushed into the
	; stack, in the order A DE BC.
	;
	; Uses CALLEE convention
	; -------------------------------------------------------------
	
	
__SUBF:	; Subtraction
		call __FPSTACK_PUSH2	; ENTERS B, A
		
		; ------------- ROM SUB
		rst 28h
		defb 01h	; EXCHANGE
		defb 03h	; SUB
		defb 38h;   ; END CALC
	
		jp __FPSTACK_POP
	
#line 3288 "bacaball.bas"
#line 1 "swap32.asm"
	; Exchanges current DE HL with the
	; ones in the stack
	
__SWAP32:
		pop bc ; Return address
	
		exx
		pop hl	; exx'
		pop de
	
		exx
		push de ; exx
		push hl
	
		exx		; exx '
		push de
		push hl
		
		exx		; exx
		pop hl
		pop de
	
		push bc
	
		ret
	
#line 3289 "bacaball.bas"
	
	
ZXBASIC_USER_DATA:
_tadrv2:
	DEFB 00, 00
_seed:
	DEFB 00, 00
_ee4:
	DEFB 00, 00
_ee5:
	DEFB 00, 00
_eee:
	DEFB 00, 00
_eex:
	DEFB 00, 00
_eey:
	DEFB 00, 00
_eb0:
	DEFB 00
_debug:
	DEFB 00
_sq1:
	DEFB 00, 00
_sq2:
	DEFB 00, 00
_sq3:
	DEFB 00, 00
_sq4:
	DEFB 00, 00
_x1:
	DEFB 00, 00, 00, 00, 00
_y1:
	DEFB 00, 00, 00, 00, 00
_x2:
	DEFB 00, 00, 00, 00, 00
_y2:
	DEFB 00, 00, 00, 00, 00
_x3:
	DEFB 00, 00, 00, 00, 00
_y3:
	DEFB 00, 00, 00, 00, 00
_x4:
	DEFB 00, 00, 00, 00, 00
_y4:
	DEFB 00, 00, 00, 00, 00
_xbp:
	DEFB 00, 00, 00, 00, 00
_ybp:
	DEFB 00, 00, 00, 00, 00
_xbd:
	DEFB 00, 00, 00, 00, 00
_ybd:
	DEFB 00, 00, 00, 00, 00
_spb:
	DEFB 00, 00, 00, 00, 00
_m1:
	DEFB 00
_m2:
	DEFB 00
_m3:
	DEFB 00
_m4:
	DEFB 00
_sc1:
	DEFB 00
_sc2:
	DEFB 00
_sc3:
	DEFB 00
_sc4:
	DEFB 00
_bown:
	DEFB 00
_govr:
	DEFB 00
_glim:
	DEFB 00
_gst:
	DEFB 00
_xt:
	DEFB 00, 00, 00, 00
_yt:
	DEFB 00, 00, 00, 00
	; Defines DATA END --> HEAP size is 0
ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP
	; Defines USER DATA Length in bytes
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
	END
