	org 105
__START_PROGRAM:
	di
	push ix
	push iy
	exx
	push hl
	exx
	ld hl, 0
	add hl, sp
	ld (__CALL_BACK__), hl
	ei
#line 1
		ld sp, $dff0
#line 2
	jp __LABEL__arrowpatterns4bitend
__LABEL__arrowpatterns4bit:
#line 3
		defb %00000000,%00000000,%11000000,%00000000
		defb %10100000,%01000000,%11110000,%00000000
		defb %10001000,%01110000,%11111100,%00000000
		defb %10000010,%01111100,%11111111,%00000000
		defb %10000010,%01111100,%11111111,%00000000
		defb %10001000,%01110000,%11111100,%00000000
		defb %10100000,%01000000,%11110000,%00000000
		defb %00000000,%00000000,%11000000,%00000000
		defb $81,$81,$81,$7e,$ff,$81,$81,$7e,$3c,$00,$00,$7e,$7e,$42,$42,$3c,$18,$00,$00,$3c,$3c,$24,$24,$18,$00,$00,$00,$18,$18,$18,$18,$00
		defb $00,$03,$00,$03,$05,$0d,$02,$0f,$11,$31,$0e,$3f,$41,$c1,$3e,$ff,$41,$c1,$3e,$ff,$11,$31,$0e,$3f,$05,$0d,$02,$0f,$00,$03,$00,$03
		defb $18,$00,$18,$18,$00,$18,$18,$18,$3c,$18,$3c,$3c,$18,$3c,$3c,$3c,$7e,$3c,$7e,$7e,$3c,$7e,$7e,$7e,$ff,$7e,$ff,$ff,$81,$7e,$ff,$ff
		defb %10011001,%11111111,%01010101,%00000000
		defb %10101010,%00000000,%01100110,%00010001
		defb %01100110,%11111111,%01010101,%00000000
		defb %10101010,%00000000,%10011001,%01000100
		defb %10011001,%11111111,%01010101,%00000000
		defb %10101010,%00000000,%01100110,%00010001
		defb %01100110,%11111111,%01010101,%00000000
		defb %10101010,%00000000,%10011001,%01000100
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
		defb %11111111,%00000000,%00000000,%00000000
#line 30
__LABEL__arrowpatterns4bitend:
	jp __LABEL__charmap2bitend
__LABEL__charmap2bit:
#line 3
		defb $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
		defb $00,$18,$18,$18,$18,$18,$18,$18,$00,$18,$18,$18,$00,$00,$00,$00
		defb $18,$24,$24,$24,$18,$24,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
		defb $06,$09,$29,$1b,$16,$3f,$26,$34,$ec,$7e,$58,$58,$00,$00,$00,$00
		defb $24,$18,$5f,$7e,$5a,$78,$38,$1e,$be,$5a,$18,$7c,$00,$00,$00,$00
		defb $46,$20,$f4,$16,$1c,$68,$10,$18,$03,$3e,$61,$6e,$00,$00,$00,$00
		defb $00,$1c,$36,$26,$38,$3c,$48,$7a,$c4,$46,$3a,$7e,$00,$00,$00,$00
		defb $08,$30,$18,$38,$00,$30,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00
		defb $00,$0c,$18,$18,$10,$10,$10,$10,$10,$18,$00,$0c,$00,$00,$00,$00
		defb $00,$30,$18,$18,$08,$08,$08,$08,$08,$18,$00,$30,$00,$00,$00,$00
		defb $00,$00,$18,$00,$18,$5a,$5a,$24,$81,$7e,$18,$18,$00,$00,$00,$00
		defb $00,$00,$00,$00,$18,$18,$18,$7e,$18,$7e,$18,$18,$00,$00,$00,$00
		defb $00,$00,$00,$00,$00,$00,$00,$00,$10,$00,$38,$38,$30,$18,$00,$20
		defb $00,$00,$00,$00,$00,$00,$00,$7e,$00,$7e,$00,$00,$00,$00,$00,$00
		defb $00,$00,$00,$00,$00,$00,$00,$00,$08,$30,$10,$38,$00,$00,$00,$00
		defb $04,$02,$04,$06,$0c,$08,$10,$18,$00,$30,$60,$60,$40,$00,$00,$00
		defb $00,$1c,$2c,$26,$66,$66,$66,$66,$24,$66,$1c,$38,$00,$00,$00,$00
		defb $10,$08,$18,$38,$58,$18,$18,$18,$18,$18,$5a,$3c,$00,$00,$00,$00
		defb $40,$3c,$0e,$46,$06,$06,$08,$1c,$40,$30,$7e,$7e,$00,$00,$00,$00
		defb $02,$3c,$02,$46,$07,$1e,$1a,$06,$82,$42,$38,$7c,$00,$00,$00,$00
		defb $00,$0c,$04,$1c,$34,$04,$04,$64,$3f,$7e,$04,$04,$00,$00,$00,$00
		defb $00,$1e,$20,$20,$64,$7e,$07,$02,$83,$42,$24,$7e,$00,$00,$00,$00
		defb $08,$10,$30,$60,$40,$5c,$7a,$46,$e2,$42,$38,$7c,$00,$00,$00,$00
		defb $41,$3e,$02,$42,$04,$04,$08,$04,$08,$08,$10,$18,$00,$00,$00,$00
		defb $30,$0c,$66,$66,$00,$34,$10,$2c,$66,$66,$00,$3c,$00,$00,$00,$00
		defb $12,$2c,$c2,$46,$42,$66,$43,$3a,$04,$06,$54,$38,$00,$00,$00,$00
		defb $00,$00,$00,$00,$10,$38,$08,$30,$08,$30,$10,$38,$00,$00,$00,$00
		defb $00,$00,$00,$00,$20,$10,$10,$38,$10,$00,$38,$38,$30,$18,$00,$20
		defb $00,$00,$00,$00,$0a,$06,$08,$70,$08,$70,$0a,$06,$00,$00,$00,$00
		defb $00,$00,$00,$00,$00,$00,$81,$7e,$81,$7e,$00,$00,$00,$00,$00,$00
		defb $00,$00,$00,$00,$50,$60,$10,$0e,$10,$0e,$50,$60,$00,$00,$00,$00
		defb $00,$3c,$5e,$66,$0c,$06,$00,$18,$00,$10,$10,$10,$00,$00,$00,$00
		defb $00,$00,$60,$1c,$5e,$62,$55,$5c,$cb,$54,$60,$7e,$1e,$00,$00,$00
		defb $18,$00,$2c,$18,$18,$24,$24,$7e,$02,$46,$02,$c7,$00,$00,$00,$00
		defb $40,$b8,$c4,$46,$4c,$46,$68,$56,$43,$42,$44,$fe,$00,$00,$00,$00
		defb $02,$1c,$00,$62,$40,$40,$40,$40,$60,$40,$00,$3e,$00,$00,$00,$00
		defb $40,$b8,$ce,$46,$42,$42,$42,$42,$42,$42,$40,$fc,$00,$00,$00,$00
		defb $62,$1c,$62,$62,$60,$64,$78,$64,$60,$60,$61,$7e,$00,$00,$00,$00
		defb $62,$1c,$62,$62,$60,$64,$78,$64,$60,$60,$60,$60,$00,$00,$00,$00
		defb $02,$1c,$00,$62,$40,$40,$40,$47,$62,$42,$00,$3e,$00,$00,$00,$00
		defb $66,$81,$c3,$42,$42,$42,$66,$5a,$42,$42,$42,$e7,$00,$00,$00,$00
		defb $18,$24,$18,$18,$18,$18,$18,$18,$18,$18,$18,$3c,$00,$00,$00,$00
		defb $18,$24,$18,$18,$18,$18,$18,$18,$18,$18,$18,$18,$10,$18,$00,$60
		defb $64,$82,$c0,$4c,$40,$70,$50,$78,$4a,$5c,$42,$e7,$00,$00,$00,$00
		defb $60,$00,$60,$60,$60,$60,$60,$60,$60,$60,$61,$7e,$00,$00,$00,$00
		defb $43,$80,$c7,$66,$aa,$66,$ca,$32,$d2,$1a,$12,$d7,$00,$00,$00,$00
		defb $00,$83,$c3,$60,$c3,$30,$cb,$18,$c5,$06,$00,$c3,$00,$00,$00,$00
		defb $00,$18,$0e,$66,$42,$42,$42,$42,$62,$42,$00,$3c,$00,$00,$00,$00
		defb $64,$18,$63,$66,$63,$66,$74,$68,$60,$60,$60,$60,$00,$00,$00,$00
		defb $00,$18,$0e,$66,$42,$42,$42,$42,$42,$62,$38,$3c,$34,$4f,$00,$00
		defb $40,$b8,$cc,$46,$44,$46,$58,$78,$4a,$5c,$42,$e7,$00,$00,$00,$00
		defb $22,$1c,$c1,$62,$e0,$70,$24,$1e,$83,$06,$44,$7e,$00,$00,$00,$00
		defb $18,$66,$db,$18,$18,$18,$18,$18,$18,$18,$18,$3c,$00,$00,$00,$00
		defb $61,$82,$c3,$40,$43,$40,$43,$40,$e1,$42,$3c,$7e,$00,$00,$00,$00
		defb $c6,$00,$c0,$66,$28,$64,$04,$28,$10,$18,$10,$10,$00,$00,$00,$00
		defb $5f,$a0,$db,$58,$79,$7a,$7a,$6e,$24,$6c,$24,$24,$00,$00,$00,$00
		defb $e1,$02,$c1,$62,$00,$34,$08,$18,$44,$26,$02,$c7,$00,$00,$00,$00
		defb $e0,$03,$c1,$62,$00,$34,$18,$18,$18,$18,$18,$18,$00,$00,$00,$00
		defb $46,$38,$06,$46,$00,$0c,$08,$18,$10,$30,$21,$7e,$00,$00,$00,$00
		defb $20,$1c,$10,$10,$10,$10,$10,$10,$10,$10,$1c,$1c,$00,$00,$00,$00
		defb $20,$40,$20,$60,$30,$10,$08,$18,$00,$0c,$06,$06,$02,$00,$00,$00
		defb $04,$38,$08,$08,$08,$08,$08,$08,$08,$08,$38,$38,$00,$00,$00,$00
		defb $08,$10,$20,$6c,$42,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
		defb $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$00,$00
#line 67
__LABEL__charmap2bitend:
	jp __LABEL__palette01end
__LABEL__palette01:
#line 3
		defb $00,$15,$2a,$3f,$10,$20,$30,$01,$02,$03,$05,$0a,$0f,$04,$08,$0c
#line 4
__LABEL__palette01end:
	ld hl, 170
	ld (_seed), hl
__LABEL__start01:
	ld a, 4
	push af
	xor a
	push af
	call _smsvdp
	ld a, 226
	push af
	ld a, 1
	push af
	call _smsvdp
	ld a, 255
	push af
	ld a, 2
	push af
	call _smsvdp
	ld a, 255
	push af
	ld a, 5
	push af
	call _smsvdp
	ld a, 255
	push af
	ld a, 10
	push af
	call _smsvdp
	ld a, 251
	push af
	ld a, 6
	push af
	call _smsvdp
	xor a
	push af
	ld a, 7
	push af
	call _smsvdp
	ld hl, 16384
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _smsfilvrm
	ld hl, 0
	ld (_ee1), hl
	jp __LABEL0
__LABEL3:
	ld de, __LABEL__palette01
	ld hl, (_ee1)
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	ld l, a
	ld h, 0
	ld (_ee2), hl
	ld a, l
	push af
	ld hl, (_ee1)
	ld a, l
	push af
	call _smspalette
	ld de, 255
	ld hl, (_ee2)
	call __BXOR16
	ld a, l
	push af
	ld hl, (_ee1)
	ld de, 16
	add hl, de
	ld a, l
	push af
	call _smspalette
__LABEL4:
	ld hl, (_ee1)
	inc hl
	ld (_ee1), hl
__LABEL0:
	ld hl, 15
	ld de, (_ee1)
	or a
	sbc hl, de
	jp nc, __LABEL3
__LABEL2:
	xor a
	push af
	ld a, 16
	push af
	call _smspalette
	ld a, 51
	push af
	ld a, 17
	push af
	call _smspalette
	ld hl, 0
	ld (_ee1), hl
	jp __LABEL5
__LABEL8:
	ld hl, 0
	ld (_ee2), hl
	jp __LABEL10
__LABEL13:
	ld hl, (_ee1)
	add hl, hl
	ex de, hl
	ld hl, __LABEL__charmap2bit
	add hl, de
	ex de, hl
	ld hl, (_ee2)
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	ld l, a
	ld h, 0
	ld (_ee3), hl
	push hl
	ld hl, (_ee1)
	add hl, hl
	add hl, hl
	ld de, 1024
	add hl, de
	ex de, hl
	ld hl, (_ee2)
	add hl, de
	push hl
	call _smsvpoke
__LABEL14:
	ld hl, (_ee2)
	inc hl
	ld (_ee2), hl
__LABEL10:
	ld hl, 1
	ld de, (_ee2)
	or a
	sbc hl, de
	jp nc, __LABEL13
__LABEL12:
__LABEL9:
	ld hl, (_ee1)
	inc hl
	ld (_ee1), hl
__LABEL5:
	ld hl, 512
	ld de, (_ee1)
	or a
	sbc hl, de
	jp nc, __LABEL8
__LABEL7:
	ld hl, 0
	ld (_ee1), hl
	jp __LABEL15
__LABEL18:
	ld hl, 0
	ld (_ee2), hl
	jp __LABEL20
__LABEL23:
	ld hl, (_ee1)
	add hl, hl
	add hl, hl
	ex de, hl
	ld hl, __LABEL__arrowpatterns4bit
	add hl, de
	ex de, hl
	ld hl, (_ee2)
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	ld l, a
	ld h, 0
	ld (_ee3), hl
	push hl
	ld hl, (_ee1)
	add hl, hl
	add hl, hl
	ld de, 4096
	add hl, de
	ex de, hl
	ld hl, (_ee2)
	add hl, de
	push hl
	call _smsvpoke
__LABEL24:
	ld hl, (_ee2)
	inc hl
	ld (_ee2), hl
__LABEL20:
	ld hl, 3
	ld de, (_ee2)
	or a
	sbc hl, de
	jp nc, __LABEL23
__LABEL22:
__LABEL19:
	ld hl, (_ee1)
	inc hl
	ld (_ee1), hl
__LABEL15:
	ld hl, 48
	ld de, (_ee1)
	or a
	sbc hl, de
	jp nc, __LABEL18
__LABEL17:
__LABEL__mainloop01:
	call __LABEL__title01
	call __LABEL__gameplay01
	jp __LABEL__mainloop01
__LABEL__title01:
	ld hl, 17
	ld (_ee1), hl
	jp __LABEL25
__LABEL28:
	ld hl, (_seed)
	ld a, l
	push af
	ld hl, (_ee1)
	ld a, l
	push af
	call _smspalette
__LABEL29:
	ld hl, (_ee1)
	inc hl
	ld (_ee1), hl
__LABEL25:
	ld hl, 31
	ld de, (_ee1)
	or a
	sbc hl, de
	jp nc, __LABEL28
__LABEL27:
	call __LABEL__clsr
	xor a
	push af
	ld hl, __LABEL__text01bend - __LABEL__text01b
	push hl
	ld hl, __LABEL__text01b
	push hl
	ld hl, 19
	push hl
	ld hl, 2
	push hl
	call _smswritetext
	xor a
	push af
	ld hl, __LABEL__text01cend - __LABEL__text01c
	push hl
	ld hl, __LABEL__text01c
	push hl
	ld hl, 21
	push hl
	ld hl, 2
	push hl
	call _smswritetext
	xor a
	push af
	ld hl, __LABEL__text01dend - __LABEL__text01d
	push hl
	ld hl, __LABEL__text01d
	push hl
	ld hl, 22
	push hl
	ld hl, 2
	push hl
	call _smswritetext
	ld hl, 0
	ld (_ee1), hl
	ld hl, 1
	ld (_cntb), hl
__LABEL30:
	ld hl, (_ee1)
	inc hl
	ld (_ee1), hl
	ld hl, 64
	ld de, (_ee1)
	or a
	sbc hl, de
	jp nc, __LABEL33
	ld hl, (_cntb)
	ld h, 0
	ld a, l
	and 7
	ld l, a
	push hl
	ld de, 0
	pop hl
	call __EQ16
	or a
	jp z, __LABEL35
	ld hl, (_seed)
	call _smsrnd
	ld (_seed), hl
__LABEL35:
	ld hl, (_seed)
	ld a, l
	push af
	ld hl, (_cntb)
	ld h, 0
	ld a, l
	and 7
	ld l, a
	ld de, 17
	add hl, de
	ld a, l
	push af
	call _smspalette
	ld hl, (_cntb)
	inc hl
	ld (_cntb), hl
	ld hl, 0
	ld (_ee1), hl
__LABEL33:
	call _smsjoypad1
	push af
	call _smsjoypad2
	ld h, a
	pop af
	or h
	or a
	jp z, __LABEL37
	ret
__LABEL37:
	ld hl, 500
	push hl
	call _smsdelay
	jp __LABEL30
__LABEL31:
	ld hl, 1
	ld (_cnt), hl
	ld hl, (_seed)
	call _smsrnd
	ld (_seed), hl
	ld (_rlc), hl
__LABEL__gameplay01:
	ld hl, 1
	ld (_cnt), hl
__LABEL__gameloop:
__LABEL__computerturn:
	ld hl, 16
	ld (_xcr), hl
	ld hl, 12
	ld (_ycr), hl
	call __LABEL__clsk
	ld hl, 1
	ld (_n), hl
	jp __LABEL38
__LABEL41:
	ld de, (_rlc)
	ld hl, (_n)
	add hl, de
	push hl
	ld de, 255
	pop hl
	call __BAND16
	ex de, hl
	ld hl, __LABEL__urandomdata01
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	push af
	ld h, 3
	pop af
	and h
	ld l, a
	ld h, 0
	ld (_a), hl
	ld de, 0
	ld hl, (_a)
	call __EQ16
	or a
	jp z, __LABEL44
	call __LABEL__500
__LABEL44:
	ld de, 1
	ld hl, (_a)
	call __EQ16
	or a
	jp z, __LABEL46
	call __LABEL__510
__LABEL46:
	ld de, 2
	ld hl, (_a)
	call __EQ16
	or a
	jp z, __LABEL48
	call __LABEL__520
__LABEL48:
	ld de, 3
	ld hl, (_a)
	call __EQ16
	or a
	jp z, __LABEL50
	call __LABEL__530
__LABEL50:
__LABEL42:
	ld hl, (_n)
	inc hl
	ld (_n), hl
__LABEL38:
	ld hl, (_cnt)
	ld de, (_n)
	or a
	sbc hl, de
	jp nc, __LABEL41
__LABEL40:
	ld hl, 30000
	push hl
	call _smsdelay
__LABEL__playerturn:
	ld hl, 16
	ld (_xcr), hl
	ld hl, 12
	ld (_ycr), hl
	call __LABEL__clsk
	ld hl, 1
	ld (_n), hl
__LABEL__150:
__LABEL__checkjoystick:
	call _smsjoypad1
	push af
	call _smsjoypad2
	ld h, a
	pop af
	or h
	push af
	ld h, 15
	pop af
	and h
	ld l, a
	ld h, 0
	ld (_jacum), hl
	ld de, 0
	ld hl, (_jacum)
	call __EQ16
	or a
	jp z, __LABEL52
	jp __LABEL__checkjoystick
__LABEL52:
	ld de, 8
	ld hl, (_jacum)
	call __BAND16
	push hl
	ld de, 0
	pop hl
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL54
	ld hl, 0
	ld (_c), hl
	call __LABEL__500
__LABEL54:
	ld de, 2
	ld hl, (_jacum)
	call __BAND16
	push hl
	ld de, 0
	pop hl
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL56
	ld hl, 1
	ld (_c), hl
	call __LABEL__510
__LABEL56:
	ld de, 4
	ld hl, (_jacum)
	call __BAND16
	push hl
	ld de, 0
	pop hl
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL58
	ld hl, 2
	ld (_c), hl
	call __LABEL__520
__LABEL58:
	ld de, 1
	ld hl, (_jacum)
	call __BAND16
	push hl
	ld de, 0
	pop hl
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL60
	ld hl, 3
	ld (_c), hl
	call __LABEL__530
__LABEL60:
__LABEL__175:
__LABEL__loop1:
	ld de, 15
	ld hl, (_jacum)
	call __BAND16
	push hl
	ld de, 0
	pop hl
	call __EQ16
	or a
	jp z, __LABEL62
	jp __LABEL__loop1
__LABEL62:
	ld de, (_rlc)
	ld hl, (_n)
	add hl, de
	push hl
	ld de, 255
	pop hl
	call __BAND16
	ex de, hl
	ld hl, __LABEL__urandomdata01
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	push af
	ld h, 3
	pop af
	and h
	ld l, a
	ld h, 0
	ld (_a), hl
	ld de, (_a)
	ld hl, (_c)
	call __EQ16
	push af
	ld de, (_cnt)
	ld hl, (_n)
	or a
	sbc hl, de
	sbc a, a
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL64
	ld hl, (_n)
	inc hl
	ld (_n), hl
	ld de, (_cnt)
	ld hl, (_hisc)
	or a
	sbc hl, de
	jp nc, __LABEL66
	ld hl, (_cnt)
	ld (_hisc), hl
__LABEL66:
	jp __LABEL__checkjoystick
__LABEL64:
	ld de, (_a)
	ld hl, (_c)
	call __EQ16
	push af
	ld de, (_cnt)
	ld hl, (_n)
	or a
	sbc hl, de
	ccf
	sbc a, a
	ld h, a
	pop af
	call __AND8
	or a
	jp z, __LABEL68
	ld hl, (_cnt)
	inc hl
	ld (_cnt), hl
	ld de, (_cnt)
	ld hl, (_hisc)
	or a
	sbc hl, de
	jp nc, __LABEL70
	ld hl, (_cnt)
	ld (_hisc), hl
__LABEL70:
	call __LABEL__400
	ld de, 251
	ld hl, (_cnt)
	call __EQ16
	or a
	jp z, __LABEL72
	jp __LABEL__10
__LABEL72:
	ld de, 251
	ld hl, (_cnt)
	or a
	sbc hl, de
	ld a, h
	or l
	or a
	jp z, __LABEL74
	jp __LABEL__gameloop
__LABEL74:
__LABEL68:
	ld hl, 15000
	push hl
	call _smsdelay
	ld a, 136
	push af
	call _smssoundio
	ld a, 63
	push af
	call _smssoundio
	ld a, 144
	push af
	call _smssoundio
	ld hl, 60000
	push hl
	call _smsdelay
	ld a, 159
	push af
	call _smssoundio
	ld hl, 15000
	push hl
	call _smsdelay
	ret
__LABEL75:
	jp __LABEL75
__LABEL76:
__LABEL__400:
	ret
__LABEL__10:
__LABEL77:
	jp __LABEL77
__LABEL78:
__LABEL__500:
	ld hl, (_xcr)
	inc hl
	ld (_xcr), hl
	xor a
	push af
	ld a, 32
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld hl, 15000
	push hl
	call _smsdelay
	xor a
	push af
	ld a, 128
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld a, 140
	push af
	call _smssoundio
	ld a, 53
	push af
	call _smssoundio
	ld a, 144
	push af
	call _smssoundio
	ld hl, 30000
	push hl
	call _smsdelay
	ld a, 159
	push af
	call _smssoundio
	ld hl, 15000
	push hl
	call _smsdelay
	ret
__LABEL__510:
	ld hl, (_ycr)
	inc hl
	ld (_ycr), hl
	xor a
	push af
	ld a, 32
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld hl, 15000
	push hl
	call _smsdelay
	xor a
	push af
	ld a, 129
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld a, 142
	push af
	call _smssoundio
	ld a, 47
	push af
	call _smssoundio
	ld a, 144
	push af
	call _smssoundio
	ld hl, 30000
	push hl
	call _smsdelay
	ld a, 159
	push af
	call _smssoundio
	ld hl, 15000
	push hl
	call _smsdelay
	ret
__LABEL__520:
	ld hl, (_xcr)
	dec hl
	ld (_xcr), hl
	xor a
	push af
	ld a, 32
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld hl, 15000
	push hl
	call _smsdelay
	xor a
	push af
	ld a, 130
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld a, 138
	push af
	call _smssoundio
	ld a, 42
	push af
	call _smssoundio
	ld a, 144
	push af
	call _smssoundio
	ld hl, 30000
	push hl
	call _smsdelay
	ld a, 159
	push af
	call _smssoundio
	ld hl, 15000
	push hl
	call _smsdelay
	ret
__LABEL__530:
	ld hl, (_ycr)
	dec hl
	ld (_ycr), hl
	xor a
	push af
	ld a, 32
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld hl, 15000
	push hl
	call _smsdelay
	xor a
	push af
	ld a, 131
	push af
	ld hl, (_ycr)
	push hl
	ld hl, (_xcr)
	push hl
	call _smsputchar
	ld a, 140
	push af
	call _smssoundio
	ld a, 37
	push af
	call _smssoundio
	ld a, 144
	push af
	call _smssoundio
	ld hl, 30000
	push hl
	call _smsdelay
	ld a, 159
	push af
	call _smssoundio
	ld hl, 15000
	push hl
	call _smsdelay
	ret
__LABEL__clsk:
	ld hl, 768
	push hl
	ld hl, 0
	push hl
	ld hl, 32
	push hl
	ld hl, 14336
	push hl
	call _smsfilvrmtx
	ret
__LABEL__clsr:
	ld hl, 768
	push hl
	ld hl, 8
	push hl
	ld hl, 132
	push hl
	ld hl, 14336
	push hl
	call _smsfilvrmtx
	ret
__LABEL79:
	jp __LABEL79
__LABEL80:
__LABEL__text01a:
#line 304
		defb "HELLO WORLD!!!!!"
#line 305
__LABEL__text01aend:
__LABEL__text01b:
#line 309
		defb " SIMON THE SNAKE "
#line 310
__LABEL__text01bend:
__LABEL__text01c:
#line 314
		defb " PAULO SILVA, 2015 "
#line 315
__LABEL__text01cend:
__LABEL__text01d:
#line 319
		defb " PUSH ANY BUTTON "
#line 320
__LABEL__text01dend:
__LABEL__urandomdata01:
#line 325
		defb 3,0,0,1,2,1,0,1,1,2,3,2,3,2,1,1
		defb 0,1,2,2,2,3,0,3,2,2,1,2,3,3,0,0
		defb 0,3,0,3,2,2,1,2,3,3,0,0,0,0,3,2
		defb 2,3,0,0,0,1,1,0,0,3,2,3,0,0,1,1
		defb 1,2,1,0,0,0,3,2,0,3,3,1,0,1,2,1
		defb 2,2,1,0,0,0,3,0,1,1,2,2,2,1,0,1
		defb 2,2,1,2,3,3,0,3,2,3,3,2,1,1,1,2
		defb 2,1,0,0,1,1,2,3,2,2,3,2,1,2,3,2
		defb 1,1,0,1,2,2,3,2,3,0,3,3,2,1,2,3
		defb 3,3,2,3,0,3,0,3,2,2,1,2,3,3,3,0
		defb 1,0,0,3,2,3,0,0,1,0,3,3,2,2,2,2
		defb 1,2,3,3,0,0,0,3,0,1,0,3,3,2,3,0
		defb 0,1,1,0,3,0,1,1,2,2,1,0,0,0,3,0
		defb 1,0,3,3,2,2,3,0,0,0,1,1,1,0,3,0
		defb 1,1,2,1,0,0,3,3,0,1,1,1,0,1,1,0
		defb 1,2,1,0,1,2,1,0,0,3,0,1,1,2,2,2
#line 341
	ld hl, 0
	ld b, h
	ld c, l
__END_PROGRAM:
	di
	ld hl, (__CALL_BACK__)
	ld sp, hl
	exx
	pop hl
	exx
	pop iy
	pop ix
	ei
	ret
__CALL_BACK__:
	DEFW 0
_smsvdp:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld a, (ix+7)
		out ($bf),a
		ld a, (ix+5)
		or $80
		out ($bf),a
#line 7
_smsvdp__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_smsfilvrm:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld l, (ix+4)
		ld a,l
		out ($bf),a
		ld h, (ix+5)
		ld a,h
		or $40
		out ($bf),a
		ld b, (ix+9)
		ld c, (ix+8)
smsfilvrmloop:
		ld a, (ix+6)
		out ($be),a
		dec bc
		ld a,b
		or c
		jp nz,smsfilvrmloop
#line 18
_smsfilvrm__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_smsfilvrmtx:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld l, (ix+4)
		ld a,l
		out ($bf),a
		ld h, (ix+5)
		ld a,h
		or $40
		out ($bf),a
		ld b, (ix+11)
		ld c, (ix+10)
smsfilvrmtxloop:
		ld a, (ix+6)
		out ($be),a
		ld a, (ix+8)
		out ($be),a
		dec bc
		ld a,b
		or c
		jp nz,smsfilvrmtxloop
#line 20
_smsfilvrmtx__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_smsldirvm:
	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)
		ld a,e
		out ($bf),a
		ld a,d
		or $40
		out ($bf),a
smsldirvmloop:
		ld a, (hl)
		out ($be),a
		inc hl
		dec bc
		ld a,b
		or c
		jp nz,smsldirvmloop
#line 21
_smsldirvm__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_smsscroll:
	push ix
	ld ix, 0
	add ix, sp
	ld a, (ix+5)
	push af
	ld a, 8
	push af
	call _smsvdp
	ld a, (ix+7)
	push af
	ld a, 9
	push af
	call _smsvdp
_smsscroll__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_smsvpoke:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld l, (ix+4)
		ld a,l
		out ($bf),a
		ld h, (ix+5)
		ld a,h
		or $40
		out ($bf),a
		ld a, (ix+6)
		out ($be),a
#line 11
_smsvpoke__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_smsrnd:
#line 3
		ld  d, h
		ld  e, l
		ld  a, d
		ld  h, e
		ld  l, 253
		or  a
		sbc  hl, de
		sbc  a, 0
		sbc  hl, de
		ld  d, 0
		sbc  a, d
		ld  e, a
		sbc  hl, de
		jr  nc, smsrndloop
		inc  hl
smsrndloop:
		ret
#line 20
_smsrnd__leave:
	ret
_smsjoypad1:
#line 2
		in  a, ($dc)
		cpl
#line 4
_smsjoypad1__leave:
	ret
_smsjoypad2:
#line 9
		in  a, ($dc)
		cpl
		rla
		rla
		rla
		and  $03
		ld  l, a
		in  a, ($dd)
		cpl
		add  a, a
		add  a, a
		or  l
#line 21
_smsjoypad2__leave:
	ret
_smspalette:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld d, (ix+7)
		ld a, (ix+5)
		and 31
		out ($bf),a
		ld a,$c0
		out ($bf),a
		ld a,d
		out ($be),a
#line 10
_smspalette__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_smspalettergb:
	push ix
	ld ix, 0
	add ix, sp
#line 18
		ld e, (ix+7)
		ld d, (ix+6)
		ld a,d
		and %00001100
		rl a
		rl a
		ld b,a
		ld a,e
		and %00001100
		rr a
		rr a
		ld c,a
		ld a,d
		and %11000000
		rr a
		rr a
		rr a
		rr a
		ld h,a
		ld a,b
		or c
		or h
		ld c,a
		ld a, (ix+5)
		and 31
		out ($bf),a
		ld a,$c0
		out ($bf),a
		ld a,c
		out ($be),a
#line 48
_smspalettergb__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_smsdelay:
	push ix
	ld ix, 0
	add ix, sp
#line 2
		ld b, (ix+5)
		ld c, (ix+4)
smsdelayloop:
		dec bc
		ld a,b
		or c
		jp nz,smsdelayloop
#line 9
_smsdelay__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	ex (sp), hl
	exx
	ret
_smssoundio:
	push ix
	ld ix, 0
	add ix, sp
	ld a, (ix+5)
	ld bc, 127
	out (c), a
_smssoundio__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	ex (sp), hl
	exx
	ret
_smsputchar:
	push ix
	ld ix, 0
	add ix, sp
	ld a, (ix+9)
	ld l, a
	ld h, 0
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	add hl, hl
	ld de, 14336
	add hl, de
	push hl
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 64
	call __MUL16_FAST
	ex de, hl
	pop hl
	add hl, de
	push hl
	call _smsvpoke
	ld a, (ix+11)
	ld l, a
	ld h, 0
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	add hl, hl
	ld de, 14337
	add hl, de
	push hl
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 64
	call __MUL16_FAST
	ex de, hl
	pop hl
	add hl, de
	push hl
	call _smsvpoke
_smsputchar__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_smswritetext:
	push ix
	ld ix, 0
	add ix, sp
	ld hl, 0
	ld (_smswritetext_tq2), hl
	jp __LABEL81
__LABEL84:
	ld a, (ix+13)
	push af
	ld l, (ix+8)
	ld h, (ix+9)
	ex de, hl
	ld hl, (_smswritetext_tq2)
	add hl, de
	ld b, h
	ld c, l
	ld a, (bc)
	push af
	ld l, (ix+6)
	ld h, (ix+7)
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	ex de, hl
	ld hl, (_smswritetext_tq2)
	add hl, de
	push hl
	call _smsputchar
__LABEL85:
	ld hl, (_smswritetext_tq2)
	inc hl
	ld (_smswritetext_tq2), hl
__LABEL81:
	ld l, (ix+10)
	ld h, (ix+11)
	dec hl
	ld de, (_smswritetext_tq2)
	or a
	sbc hl, de
	jp nc, __LABEL84
__LABEL83:
_smswritetext__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_smswritedec:
	push ix
	ld ix, 0
	add ix, sp
	ld hl, 1
	ld (_smswritedec_tylp), hl
	ld l, (ix+10)
	ld h, (ix+11)
	ld (_smswritedec_txlp), hl
	jp __LABEL86
__LABEL89:
	ld a, (ix+13)
	push af
	ld l, (ix+8)
	ld h, (ix+9)
	ld de, (_smswritedec_tylp)
	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
	push bc
	pop bc
	add hl, bc
	ex de, hl
	pop bc
	adc hl, bc
	ex de, hl
	ld a, l
	push af
	ld l, (ix+6)
	ld h, (ix+7)
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	ex de, hl
	ld hl, (_smswritedec_txlp)
	add hl, de
	dec hl
	push hl
	call _smsputchar
	ld hl, (_smswritedec_tylp)
	ld de, 10
	call __MUL16_FAST
	ld (_smswritedec_tylp), hl
__LABEL90:
	ld hl, (_smswritedec_txlp)
	dec hl
	ld (_smswritedec_txlp), hl
__LABEL86:
	ld de, 1
	ld hl, (_smswritedec_txlp)
	or a
	sbc hl, de
	jp nc, __LABEL89
__LABEL88:
_smswritedec__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
#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 1510 "simonthesnake.bas"
#line 1 "bxor16.asm"
; vim:ts=4:et:
	; FASTCALL bitwise xor 16 version.
	; result in Accumulator (0 False, not 0 True)
; __FASTCALL__ version (operands: A, H)
	; Performs 16bit xor 16bit and returns the boolean
; Input: HL, DE
; Output: HL <- HL XOR DE
	
__BXOR16:
		ld a, h
		xor d
	    ld h, a
	
	    ld a, l
	    xor e
	    ld l, a
	
	    ret 
	
#line 1511 "simonthesnake.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 1512 "simonthesnake.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 1513 "simonthesnake.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 1514 "simonthesnake.bas"
#line 1 "eq16.asm"
__EQ16:	; Test if 16bit values HL == DE
		; Returns result in A: 0 = False, FF = True
			or a	; Reset carry flag
			sbc hl, de 
	
			ld a, h
			or l
			sub 1  ; sets carry flag only if a = 0
			sbc a, a
			
			ret
	
#line 1515 "simonthesnake.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 1516 "simonthesnake.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 1517 "simonthesnake.bas"
	
ZXBASIC_USER_DATA:
	_ee1 EQU 49168
	_ee2 EQU 49170
	_ee3 EQU 49172
	_seed EQU 49174
	_shfc EQU 49176
	_hisc EQU 49178
	_xcr EQU 49180
	_ycr EQU 49182
	_cnt EQU 49184
	_rlc EQU 49186
	_jacum EQU 49188
	_n EQU 49190
	_c EQU 49192
	_a EQU 49194
	_i EQU 49196
	_cntb EQU 49198
	_smswritetext_tq2 EQU 49152
	_smswritedec_txlp EQU 49152
	_smswritedec_tylp EQU 49154
	; 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
