;
; File generated by cc65 v 2.10.1
;
	.fopt		compiler,"cc65 v 2.10.1"
	.setcpu		"6502"
	.smart		on
	.autoimport	on
	.case		on
	.debuginfo	off
	.importzp	sp, sreg, regsave, regbank, tmp1, ptr1, ptr2
	.macpack	longbranch
	.import		_rand
	.import		_asmentry
	.export		_main

.segment	"DATA"

_sprite:
	.byte	$00
	.byte	$00
	.byte	$00
	.byte	$00
	.byte	$5A
	.byte	$00
	.byte	$01
	.byte	$5B
	.byte	$C0
	.byte	$05
	.byte	$6F
	.byte	$F0
	.byte	$05
	.byte	$6F
	.byte	$F0
	.byte	$15
	.byte	$AF
	.byte	$FC
	.byte	$15
	.byte	$AF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$BF
	.byte	$FC
	.byte	$15
	.byte	$AF
	.byte	$FC
	.byte	$15
	.byte	$AF
	.byte	$FC
	.byte	$05
	.byte	$6F
	.byte	$F0
	.byte	$05
	.byte	$6B
	.byte	$F0
	.byte	$01
	.byte	$5B
	.byte	$C0
	.byte	$00
	.byte	$5A
	.byte	$00
	.byte	$00
	.byte	$00
	.byte	$00

; ---------------------------------------------------------------
; int __near__ main (void)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_main: near

.segment	"CODE"

	jsr     decsp6
	ldx     #$07
	lda     #$00
	sta     sreg
	lda     #$00
	sta     sreg+1
	lda     #$F8
	ldy     #$02
	jsr     steaxysp
L0045:	ldy     #$05
	jsr     ldeaxysp
	jsr     pusheax
	ldx     #$08
	lda     #$00
	sta     sreg
	sta     sreg+1
	jsr     toslteax
	jne     L0048
	jmp     L0046
L0048:	ldy     #$03
	jsr     ldaxysp
	jsr     pushax
	ldx     #$00
	lda     #$0D
	ldy     #$00
	jsr     staspidx
	ldx     #$00
	stx     sreg
	stx     sreg+1
	lda     #$01
	ldy     #$02
	jsr     laddeqysp
	jmp     L0045
L0046:	ldx     #$00
	stx     sreg
	stx     sreg+1
	lda     #$00
	ldy     #$02
	jsr     steaxysp
L0052:	ldy     #$05
	jsr     ldeaxysp
	cmp     #$3F
	txa
	sbc     #$00
	lda     sreg
	sbc     #$00
	lda     sreg+1
	sbc     #$00
	jsr     boolult
	jne     L0055
	jmp     L0053
L0055:	ldy     #$05
	jsr     ldeaxysp
	jsr     pusheax
	ldx     #$03
	lda     #$00
	sta     sreg
	lda     #$00
	sta     sreg+1
	lda     #$40
	jsr     tosaddeax
	jsr     pushax
	lda     #<(_sprite)
	ldx     #>(_sprite)
	ldy     #$04
	clc
	adc     (sp),y
	pha
	txa
	iny
	adc     (sp),y
	tax
	pla
	ldy     #$00
	jsr     ldauidx
	ldy     #$00
	jsr     staspidx
	ldx     #$00
	stx     sreg
	stx     sreg+1
	lda     #$01
	ldy     #$02
	jsr     laddeqysp
	jmp     L0052
L0053:	ldx     #$00
	lda     #$FF
	sta     $D015
	ldx     #$00
	lda     #$00
	sta     $D010
	ldx     #$00
	lda     #$FF
	sta     $D01C
	ldx     #$00
	lda     #$0F
	sta     $D027
	ldx     #$00
	lda     #$0F
	sta     $D028
	ldx     #$00
	lda     #$0F
	sta     $D029
	ldx     #$00
	lda     #$0F
	sta     $D02A
	ldx     #$00
	lda     #$0F
	sta     $D02B
	ldx     #$00
	lda     #$0F
	sta     $D02C
	ldx     #$00
	lda     #$0F
	sta     $D02D
	ldx     #$00
	lda     #$0F
	sta     $D02E
	ldx     #$00
	lda     #$01
	sta     $D025
	ldx     #$00
	lda     #$00
	sta     $D026
	ldx     #$00
	stx     sreg
	stx     sreg+1
	lda     #$00
	ldy     #$02
	jsr     steaxysp
L0087:	ldy     #$05
	jsr     ldeaxysp
	jsr     pusheax
	ldx     #$00
	stx     sreg
	stx     sreg+1
	lda     #$08
	jsr     toslteax
	jne     L008A
	jmp     L0088
L008A:	jsr     _rand
	jsr     pushax
	lda     #$FF
	jsr     tosmoda0
	ldy     #$14
	jsr     incaxy
	ldy     #$00
	jsr     staxysp
	ldy     #$05
	jsr     ldeaxysp
	jsr     asleax1
	jsr     pusheax
	ldx     #$D0
	lda     #$00
	sta     sreg
	sta     sreg+1
	jsr     tosaddeax
	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	ldx     #$00
	ldy     #$00
	jsr     staspidx
	ldy     #$01
	jsr     ldaxysp
	jsr     pushax
	ldx     #$01
	lda     #$00
	jsr     tosgeax
	jeq     L0098
	ldx     #$00
	lda     $D010
	jsr     pushax
	ldx     #$00
	lda     #$01
	jsr     pushax
	ldy     #$09
	jsr     ldeaxysp
	jsr     toslong
	jsr     tosasleax
	jsr     tosulong
	jsr     tosoreax
	sta     $D010
L0098:	ldy     #$05
	jsr     ldeaxysp
	jsr     asleax1
	jsr     pusheax
	ldx     #$D0
	lda     #$00
	sta     sreg
	lda     #$00
	sta     sreg+1
	lda     #$01
	jsr     tosaddeax
	jsr     pushax
	jsr     _rand
	jsr     pushax
	lda     #$FF
	jsr     tosmoda0
	ldy     #$00
	jsr     staspidx
	ldx     #$00
	stx     sreg
	stx     sreg+1
	lda     #$01
	ldy     #$02
	jsr     laddeqysp
	jmp     L0087
L0088:	ldx     #$00
	lda     #$0F
	sta     $D01D
	ldx     #$00
	lda     #$0F
	sta     $D017
	ldx     #$00
	lda     #$F0
	sta     $D01B
	jsr     _asmentry
	ldx     #$00
	lda     #$00
	jmp     L0044
L0044:	jsr     incsp6
	rts

.endproc

