vertikal:      move.l  spriteadr,a0
               move.l  #spritex,a1
               moveq   #7,d0
vertikal1:     move.l  vpos(a5),d1
               and.l   #$1ff00,d1
               cmp.l   #$1000,d1
               bne     vertikal1
vertikal2:     move.w  2(a1),d1
               lsl.w   #8,d1
               move.w  (a1),d2
               lsr.w   #1,d2
               and.w   #$ffff,d2
               or.w    d2,d1
               move.w  d1,(a0)+
               clr.w   d2
               move.w  2(a1),d1
               add.w   #16,d1
               lsl.w   #8,d1
               bcc     vertikal3
               moveq   #2,d2
vertikal3:     btst    #8,2(a1)
               beq     vertikal4
               or.w    #4,d2
vertikal4:     move.w  (a1),d3
               and.w   #1,d3
               or.w    d3,d2
               or.w    d2,d1
               move.w  d1,(a0)
               add.l   #70,a0
               add.l   #4,a1
               dbra    d0,vertikal2
               rts
loopshow:      clr.w   d2
loopshow1:     move.w  (a2)+,d0
               move.w  (a2)+,d1
               beq     loopshow2
               move.l  a3,a0
               bsr     show
               addq.w  #1,d2
               bra     loopshow1
loopshow2:     rts
show:          move.l  planeadr,a1
               subq    #1,d0
               lsl.b   #1,d0
               adda    d0,a1
               subq    #1,d1
               mulu    #640,d1
               adda    d1,a1
               moveq   #3,d0
show1:         moveq   #15,d1
show2:         move.w  (a0)+,(a1)
               adda    #40,a1
               dbra    d1,show2
               adda    #planesize-40*16,a1
               dbra    d0,show1
               rts
scoreup:       move.w  ganzahl,d1
               subq    #2,d1
               lsl.w   d1,d0
               subq    #1,d0
scoreup1:      move.w  score,d1
               cmpi.b  #9,d1
               beq     scoreup2
               addq    #1,d1
               move.w  d1,score
               bra     scoreup7
scoreup2:      move.w  #0,score
               move.w  score+2,d1
               cmpi.b  #9,d1
               beq     scoreup3
               addq    #1,d1
               move.w  d1,score+2
               bra     scoreup7
scoreup3:      move.w  #0,score+2
               move.w  score+4,d1
               cmpi.b  #9,d1
               beq     scoreup4
               addq    #1,d1
               move.w  d1,score+4
               bra     scoreup7
scoreup4:      move.w  #0,score+4
               move.w  score+6,d1
               cmpi.b  #9,d1
               beq     scoreup5
               addq    #1,d1
               move.w  d1,score+6
               bra     scoreup7
scoreup5:      move.w  #0,score+6
               move.w  score+8,d1
               cmpi.b  #9,d1
               beq     scoreup6
               addq    #1,d1
               move.w  d1,score+8
               bra     scoreup7
scoreup6:      move.w  #0,score+8
scoreup7:      dbra    d0,scoreup1
showscore:     move.w  score,d0
               bsr     showscore1
               moveq   #8,d0
               moveq   #16,d1
               bsr     show
               move.w  score+2,d0
               bsr     showscore1
               moveq   #7,d0
               moveq   #16,d1
               bsr     show
               move.w  score+4,d0
               bsr     showscore1
               moveq   #6,d0
               moveq   #16,d1
               bsr     show
               move.w  score+6,d0
               bsr     showscore1
               moveq   #5,d0
               moveq   #16,d1
               bsr     show
               move.w  score+8,d0
               bsr     showscore1
               moveq   #4,d0
               moveq   #16,d1
               bsr     show
               rts
showscore1:    move.l  #null-(eins-null),a0
showscore2:    add.l   #(eins-null),a0
               dbra    d0,showscore2
               rts
cls:           move.l  planeadr,a0
               moveq   #3,d0
cls1:          move.w  #planesize/4-1,d1
cls2:          move.l  #0,(a0)+
               dbra    d1,cls2
               dbra    d0,cls1
               rts
test:          move.l  planeadr,a0
               sub.w   #40,d1
               move.w  #40,d2
               mulu    d2,d1
               add.l   d1,a0
               sub.w   #128,d0
               lsr.w   #4,d0
test1:         add.l   #2,a0
               dbra    d0,test1
               sub.l   #2,a0
               clr.w   d2
               btst    #0,(a0)
               beq     test2
               moveq   #1,d2
test2:         add.l   #planesize,a0
               btst    #0,(a0)
               beq     test3
               or.w    #2,d2
test3:         add.l   #planesize,a0
               btst    #0,(a0)
               beq     test4
               or.w    #4,d2
test4:         add.l   #planesize,a0
               btst    #0,(a0)
               beq     test5
               or.w    #8,d2
test5:         rts
bonusab:       move.w  bonus,d0
               beq     bonusab1
               subq    #1,d0
               move.w  d0,bonus
               move.w  bonus+2,d2
               bra     bonusab2
bonusab1:      move.w  #9,bonus
               move.w  #9,d0
               move.w  bonus+2,d2
               subq    #1,d2
               move.w  d2,bonus+2
bonusab2:      move.l  #null-(eins-null),a0
bonusab3:      add.l   #(eins-null),a0
               dbra    d0,bonusab3
               move.w  #20,d0
               move.w  #16,d1
               bsr     show
               move.l  #null-(eins-null),a0
bonusab4:      add.l   #(eins-null),a0
               dbra    d2,bonusab4
               move.w  #19,d0
               move.w  #16,d1
               bsr     show
               rts
darf:          clr.l   d6
               clr.l   d5
               cmpi.w  #128,d0
               bne     darf0
               moveq   #1,d5
               moveq   #1,d6
               rts
darf0:         cmpi.w  #432,d0
               bne     darf00
               moveq   #1,d5
               moveq   #2,d6
               rts
darf00:        move.w  d0,d3
               move.w  d1,d4
               add.w   #16,d0
               bsr     test
               cmpi.b  #2,d2
               beq     darf1
               addq    #1,d5
               bset    #0,d6
darf1:         move.w  d3,d0
               move.w  d4,d1
               sub.w   #16,d0
               bsr     test
               cmpi.b  #2,d2
               beq     darf2
               addq    #1,d5
               bset    #1,d6
darf2:         move.w  d3,d0
               move.w  d4,d1
               add.w   #16,d1
               bsr     test
               cmpi.b  #2,d2
               beq     darf3
               addq    #1,d5
               bset    #2,d6
darf3:         move.w  d3,d0
               move.w  d4,d1
               sub.w   #16,d1
               bsr     test
               cmpi.b  #2,d2
               beq     darf4
               addq    #1,d5
               bset    #3,d6
darf4:         rts
wohin:         move.w  (a3),d0
               move.w  2(a3),d1
               bsr     darf
               cmpi.b  #1,d5
               bne     wohin1
               move.w  d6,4(a3)
               rts
wohin1:        cmpi.b  #2,d5
               bne     wohin2
               move.w  4(a3),d0
               and.w   d6,d0
               beq     wohin2
               rts
wohin2:        move.w  vhpos(a5),d0
               btst    #0,d0
               beq     wohiny
               move.w  pacx,d0
               cmp.w   (a3),d0
               bge     wohinx1
               btst    #1,d6
               beq     wohinz
               move.w  #2,4(a3)
               rts
wohinx1:       btst    #0,d6
               beq     wohinz
               move.w  #1,4(a3)
               rts
wohiny:        move.w  pacx+2,d0
               cmp.w   2(a3),d0
               bge     wohiny1
               btst    #3,d6
               beq     wohinz
               move.w  #8,4(a3)
               rts
wohiny1:       btst    #2,d6
               beq     wohinz
               move.w  #4,4(a3)
               rts
wohinz:        move.w  vhpos(a5),d0
               and.w   #3,d0
               bne     wohinz1
               btst    #0,d6
               beq     wohinz
               move.w  #1,4(a3)
               rts
wohinz1:       cmpi.b  #1,d0
               bne     wohinz2
               btst    #1,d6
               beq     wohinz
               move.w  #2,4(a3)
               rts
wohinz2:       cmpi.b  #2,d0
               bne     wohinz3
               btst    #2,d6
               beq     wohinz
               move.w  #4,4(a3)
               rts
wohinz3:       btst    #3,d6
               beq     wohinz
               move.w  #8,4(a3)
               rts
weg:           move.w  (a3),d0
               move.w  2(a3),d1
               bsr     darf
               cmpi.b  #1,d5
               bne     weg1
               move.w  d6,4(a3)
               rts
weg1:          cmpi.b  #2,d5
               bne     weg2
               move.w  4(a3),d0
               and.w   d6,d0
               beq     weg2
               rts
weg2:          move.w  vhpos(a5),d0
               btst    #0,d0
               beq     wegy
               move.w  pacx,d0
               cmp.w   (a3),d0
               blt     wegx1
               btst    #1,d6
               beq     wegz
               move.w  #2,4(a3)
               rts
wegx1:         btst    #0,d6
               beq     wegz
               move.w  #1,4(a3)
               rts
wegy:          move.w  pacx+2,d0
               cmp.w   2(a3),d0
               blt     wegy1
               btst    #3,d6
               beq     wegz
               move.w  #8,4(a3)
               rts
wegy1:         btst    #2,d6
               beq     wegz
               move.w  #4,4(a3)
               rts
wegz:          move.w  vhpos(a5),d0
               and.w   #3,d0
               bne     wegz1
               btst    #0,d6
               beq     wegz
               move.w  #1,4(a3)
               rts
wegz1:         cmpi.b  #1,d0
               bne     wegz2
               btst    #1,d6
               beq     wegz
               move.w  #2,4(a3)
               rts
wegz2:         cmpi.b  #2,d0
               bne     wegz3
               btst    #2,d6
               beq     wegz
               move.w  #4,4(a3)
               rts
wegz3:         btst    #3,d6
               beq     wegz
               move.w  #8,4(a3)
               rts
buchstabe:     move.w  #2,dmacon(a5)
               move.l  sound4adr,aud1lch(a5)
               move.w  #(sound5-sound4)/2,aud1len(a5)
               move.w  #$8000+2,dmacon(a5)
               moveq   #3,d0
               bsr     scoreup
               move.l  spriteadr,a0
               add.l   #68,a0
               move.l  a0,aud1lch(a5)
               move.w  #2,aud1len(a5)
               lea     buchx,a0
               move.w  6(a0),d0
               addq    #1,d0
               cmpi.b  #6,d0
               beq     buchstabe3
               move.w  d0,6(a0)
               move.l  #bb-(o-bb),a1
               subq    #1,d0
buchstabe1:    add.l   #(o-bb),a1
               dbra    d0,buchstabe1
               move.l  spriteadr,a2
               add.l   #76,a2
               moveq   #15,d0
buchstabe2:    move.l  (a1)+,(a2)+
               dbra    d0,buchstabe2
               move.w  #0,4(a0)
               cmpi.w  #32+8*16,pacx+2
               bge     buchstabe21
               move.l  buchxu,(a0)
               rts
buchstabe21:   move.l  buchxo,(a0)
               rts
buchstabe3:    move.l  #0,(a0)+
               move.l  #0,(a0)
               move.w  #$ff0,color15(a5)
               rts
fruchta:        move.w  fruchtz,d0
               bne     fruchtl
               move.w  #1,fruchtz
               move.w  vhpos(a5),d0
               and.w   %1111000,d0
               move.w  d0,fruchtzahl
               move.w  fruchtx,d0
               move.w  fruchtx+2,d1
               lea     frucht,a0
               bsr     show
               rts
fruchtl:       move.w  #0,fruchtz
               move.w  vhpos(a5),d0
               and.w   %11111000,d0
               move.w  d0,fruchtzahl
               move.w  fruchtx,d0
               move.w  fruchtx+2,d1
               lea     leer,a0
               bsr     show
               rts
farbsprite:    lea     farbtab1,a0
               move.l  #$dff1a8,a1
               moveq   #11,d0
farbsprite1:   move.w  (a0)+,(a1)+
               dbra    d0,farbsprite1
               rts
grausprite:    move.l  #$dff1a8,a0
               moveq   #2,d0
grausprite1:   move.w  #$0,(a0)+
               move.w  #$0999,(a0)+
               move.w  #$0ddd,(a0)+
               move.w  #$0555,(a0)+
               dbra    d0,grausprite1
               rts
verzoegerung:  move.b  #0,timer
verzoegerung1: cmp.b   timer,d6
               bne     verzoegerung1
               rts
               end
