;---------------------------------------
;"chunky" fli mode displayer. Also known
;as "cwiartki".
;BRUSH/ELYSIUM.
;---------------------------------------

         *= $2000

lin      = $a0
ala      = $a1     ;word
src      = $fc     ;word
tmp      = $fe


mapa     = $7000
dane     = $8000
scr2     = $60ad
scr1     = $64ad

ofs      = $88

         jmp start

;---------------------------------------

int2     sta ala
         stx ala+1
         lsr $d019
         lda #<int3
         sta $fffe
         lda #$80
         sta $d018
         lda $d012
         clc
         adc #$01
         sta $d012
         lda #$3f
         ldx #$ff
         nop
         nop
         cli
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         lda ala
         ldx ala+1
         rti

;---------------------------------------

int3     sta $cf12,x

         sta $d019
         lda #$3b
         sta $d011
         lda #$90
         sta $d018

         lda lin
         clc
         adc #$08
         sta lin
         sta $d012

         cmp #$be
         beq omm
         lda #<int2
         sta $fffe
      ;  lda #>int2
      ;  sta $ffff
         lda ala
         ldx ala+1
         rti

omm      lda #<int
         sta $fffe
         lda #>int
         sta $ffff
         lda #$ff
         sta $d012
         lda ala
         ldx ala+1
         rti


;---------------------------------------

int4     pha

         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop
         nop

         lda $d012
         cmp #$31
         beq *+2

         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea

         lda $d012
         cmp #$32
         beq *+2

         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         nop
         nop
         lda $d012
         cmp #$34
         beq *+2


         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         lda $d012
         cmp #$35
         beq *+2
         nop

         bit $ea
         bit $ea
         nop
         nop


         lda #$80
         sta $d018
         lsr $d019

         bit $ea

         bit $ea
         bit $ea
         bit $ea


         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea
         bit $ea


         lda #$3f
         sta $d011
         lda #$3b
         sta $d011

         lda #$90
         sta $d018

         lda #<int2
         sta $fffe
         lda #>int2
         sta $ffff
         lda lin
         clc
         adc #$08
         sta lin
         sta $d012

         lsr $d019
         pla
         rti

;---------------------------------------

int      pha
         txa
         pha
         tya
         pha
         lsr $d019
;        jsr $1003
         lda #<int4
         sta $fffe
         lda #>int4
         sta $ffff
         lda #$36
         sta lin
         lda #$31
         sta $d012
         pla
         tay
         pla
         tax
         pla
         rti

;---------------------------------------

start    sei
         lda #$35
         sta $01

         lda #$7f
         sta $dc0d
         lda #$01
         sta $d01a
         lda #<int
         sta $fffe
         lda #>int
         sta $ffff
         lda #$ff
         sta $d012
         lda #$3b
         sta $d011
         lda #$96
         sta $dd00
         lda #$d8
         sta $d016
         cli

tutaj    jmp tutaj

;---------------------------------------

