home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / GAMES / SHAREWAR.E / MATCH_IT.ARJ / match_it / MATCH_IT.S < prev    next >
Text File  |  1991-11-23  |  153KB  |  4,269 lines

  1. *********************************************************************
  2. ***                                                               ***
  3. ***                       M A T C H  -  I T !                     ***
  4. ***                      ~~~~~~~~~~~~~~~~~~~~~                    ***
  5. ***                                                               ***
  6. ***                 (C) by New Mode of Delta Force                ***
  7. ***                                                               ***
  8. ***---------------------------------------------------------------***
  9. ***            Programmerstellung begann am: 29.10.89             ***
  10. ***            Aktuelles Datum             : 28.11.90             ***
  11. ***---------------------------------------------------------------***
  12. *********************************************************************
  13.  
  14. ystartline      EQU 24          ; ab dort beginnen Tiles
  15. eisrand         EQU 8           ; ab dort auf Eisplatte sind die Tiles
  16.  
  17.  
  18.                 TEXT
  19.  
  20.                 pea     start(PC)
  21.                 move.w  #38,-(A7)
  22.                 trap    #14
  23.                 addq.l  #6,A7
  24.                 clr.w   -(A7)
  25.                 trap    #1
  26.  
  27. start:         move.w    #2,-(a7)
  28.         trap    #14
  29.         addq.l    #2,a7
  30.         move.l    d0,oldscreen
  31.         
  32.         move.b    $ffff8260.w,oldres
  33.  
  34.                 move.l  A7,oldstack
  35.                 lea     stack,A7
  36.  
  37.         clr.w    highscoremade
  38.  
  39.                 bsr     loadhighscores
  40.  
  41.                 bsr     initscroller
  42.  
  43.                 lea     leerfeld,A0
  44.                 moveq   #7,D0
  45. clrleerfeld:    clr.l   (A0)+
  46.                 dbra    D0,clrleerfeld
  47.  
  48.                 lea     scrollsavebuff,A0    ; Scrollbuff löschen
  49.                 move.w  #(15*40)-1,D0
  50. clrscrollbuff:  clr.l   (A0)+
  51.                 dbra    D0,clrscrollbuff
  52.  
  53.                 movem.l leerfeld,D0-D7
  54.                 movem.l D0-D7,hilfspalette1
  55.  
  56.                 lea     font,A0
  57.                 move.l  #7200,D0
  58.                 bsr     backform
  59.  
  60.                 lea     eisplatte,A0
  61.                 move.l  #28960,D0
  62.                 bsr     backform
  63.  
  64.                 bsr     preferences          ; Raster an, usw.
  65.  
  66.         bsr    do_budgie
  67.  
  68.         move.l    #vblquit,$70.w
  69.  
  70.                 bsr     make_leveltab        ; zufallsmäßige Verteilung der Levels
  71.  
  72.                 move.w  #1,scrollready       ; nicht Zeichnen
  73.  
  74.                 clr.l   cheatmode            ; Pos.
  75.                 move.l  #cheatmode,cheatpoint
  76.                 move.w  #1,musicflag         ; Music an
  77.  
  78. menu:           move.l  #mauszeiger2,mousepointer
  79.                 clr.l   rettbuff             ; Maus nicht restaurieren
  80.                 move.w  #100,mousex
  81.                 move.w  #100,mousey          ; Maus positionieren
  82.  
  83.                 move.w  #1,scrollready
  84.  
  85.                 movem.l leerfeld,D0-D7
  86.                 movem.l D0-D7,hilfspalette1
  87.  
  88.                 move.l  #vblmenu,$70.w
  89.  
  90.                 movea.l screen1(PC),A0
  91.                 bsr     cls
  92.  
  93.                 lea     menuplatte,A0
  94.                 movea.l screen1(PC),A1
  95.                 lea     37*160(A1),A1
  96.                 lea     37*160(A1),A2        ; Platten reinkopieren
  97.                 lea     37*160(A2),A3
  98.                 lea     37*160(A3),A4
  99.                 move.w  #(16*40)-1,D0
  100. copymenu:       move.l  (A0),(A1)+
  101.                 move.l  (A0),(A2)+
  102.                 move.l  (A0),(A3)+
  103.                 move.l  (A0)+,(A4)+
  104.                 dbra    D0,copymenu
  105.  
  106.                 lea     menutext0,A0
  107.                 movea.l screen1(PC),A1
  108.                 moveq   #40,D0
  109.                 moveq   #5,D1
  110.                 moveq   #5,D2
  111.                 bsr     textaus2
  112.  
  113.                 lea     menutext1,A0
  114.                 movea.l screen1(PC),A1
  115.                 moveq   #40,D0
  116.                 moveq   #5,D1
  117.                 move.w  #38,D2
  118.                 bsr     textaus
  119.                 lea     menutext2,A0
  120.                 movea.l screen1(PC),A1
  121.                 moveq   #40,D0
  122.                 moveq   #3,D1
  123.                 move.w  #75,D2
  124.                 bsr     textaus
  125.                 lea     menutext3,A0
  126.                 movea.l screen1(PC),A1
  127.                 moveq   #40,D0
  128.                 moveq   #4,D1
  129.                 move.w  #112,D2
  130.                 bsr     textaus
  131.                 lea     menutext4,A0
  132.                 movea.l screen1(PC),A1
  133.                 moveq   #40,D0
  134.                 moveq   #8,D1
  135.                 move.w  #149,D2
  136.                 bsr     textaus
  137.  
  138.                 bsr     vsync
  139.                 lea     scrollsavebuff,A0
  140.                 movea.l screen1(PC),A1
  141.                 lea     184*160(A1),A1
  142.                 move.w  #(15*40)-1,D0
  143. copyscrollbuff: move.l  (A0)+,(A1)+
  144.                 dbra    D0,copyscrollbuff
  145.  
  146.                 clr.w   scrollready          ; Scroller an
  147.  
  148.                 bsr     fadeup3
  149.  
  150.                 tst.w   musicflag
  151.                 bne.s   nixanschalten        ; falls Musik aus war, -> anmachen
  152.                 bsr     musiconoff
  153. nixanschalten:
  154.  
  155.                 clr.w   mousek
  156.                 clr.b   keybuffer
  157.  
  158. waitforkey:     cmpi.b  #1,keybuffer         ; Escape?
  159.                 beq     ende
  160.                 move.b  mousek,D0            ; Maustaste holen
  161.                 btst    #1,D0                ; linke Maustaste gedrückt?
  162.                 beq.s   waitforkey
  163.                 moveq   #0,D0
  164.                 move.w  mousey,D0
  165.                 sub.w   #37,D0
  166.                 divu    #37,D0               ; damit Werte von 0-3
  167.                 swap    D0
  168.                 cmp.w   #16,D0               ; Rest>16?
  169.                 bgt.s   waitforkey
  170.                 swap    D0
  171.                 tst.w   D0
  172.                 bne.s   notstartgame
  173.                 bsr     rettscrollbuff
  174.                 bsr     fadedown3
  175.                 bsr     gamestart            ; Spiel beginnen!
  176.                 bra     menu
  177. notstartgame:   cmp.w   #1,D0                ; Highscores?
  178.                 bne.s   nothighs
  179.                 bsr     rettscrollbuff
  180.                 bsr     fadedown3
  181.                 bsr     highscoreout         ; Highscores zeigen!
  182.                 bra     menu
  183. nothighs:       cmp.w   #2,D0
  184.                 bne.s   notinstr
  185.                 bsr     rettscrollbuff
  186.                 bsr     fadedown3
  187.                 bsr     instructions         ; Highscores zeigen!
  188.                 bra     menu
  189. notinstr:       cmp.w   #3,D0
  190.                 beq     ende                 ; Programm beenden
  191.                 bra.s   waitforkey
  192.  
  193. rettscrollbuff:
  194.                 move.w  #1,scrollready       ; Scroller aus
  195.                 bsr     vsync
  196.                 lea     scrollsavebuff,A1
  197.                 movea.l screen1(PC),A0
  198.                 lea     184*160(A0),A0
  199.                 move.w  #(15*40)-1,D0
  200. copyscrollbuff2:move.l  (A0)+,(A1)+
  201.                 dbra    D0,copyscrollbuff2
  202.                 rts
  203.  
  204.  
  205. gamestart:      clr.w   score                ; Score=0
  206.                 move.w  #1,stage             ; Level 1
  207.                 move.w  #2,helpcount         ; 3 Helps
  208.                 move.w  #70,timeverzoegerung
  209.                 move.l  #mauszeiger,mousepointer
  210.  
  211. levelloop:      bsr     initgame
  212.  
  213. gameloop:       bsr     oneplayermouse       ; jeweilige Joyroutine
  214.                 tst.w   endeflag             ; falls Zu Ende-> Main
  215.                 bpl     nixgameover          ; Ende des Spiels (Zeit aus!)
  216.                 bsr     gameover
  217.                 rts
  218. nixgameover:    cmpi.w  #2,endeflag
  219.                 beq     endegame             ; zurück ins Menü
  220.                 cmpi.w  #1,endeflag          ; nächster Level?
  221.                 bne.s   gameloop
  222.  
  223. nextlevel:      move.w  #1,timestop          ; Zeit sofort anhalten
  224.                 move.l  #vblpause,$70.w
  225.                 bsr     initpalpointers
  226.                 bsr     fadeup2              ; auf weiß hochblenden
  227.                 lea     hilfspalette1,A0
  228.                 moveq   #15,D0
  229. fillpalweiss:   move.w  #$0777,(A0)+
  230.                 dbra    D0,fillpalweiss
  231.                 move.l  #vblgame2,$70.w
  232.                 bsr     vsync
  233.  
  234.                 bsr     exitpalpointers
  235.  
  236.  
  237.                 movea.l screen1(PC),A0
  238.                 bsr     cls
  239.  
  240.                 lea     welldonetext,A0
  241.                 movea.l screen1(PC),A1
  242.                 moveq   #40,D0
  243.                 moveq   #5,D1
  244.                 moveq   #2,D2
  245.                 bsr     textaus
  246.  
  247.                 lea     clearedstagetext,A0
  248.                 movea.l screen1(PC),A1
  249.                 moveq   #40,D0
  250.                 moveq   #0,D1
  251.                 moveq   #40,D2
  252.                 bsr     textaus
  253.  
  254.                 move.w  stage,D0
  255.                 bsr     hexdez
  256.                 lea     hexdezbuff+4,A0
  257.                 moveq   #2,D0
  258.                 bsr     nullfix
  259.                 movea.l screen1(PC),A1
  260.                 moveq   #18,D1
  261.                 moveq   #40,D2
  262.                 bsr     textaus
  263.  
  264.                 moveq   #0,D0
  265.                 move.w  helpcount,D0
  266.                 mulu    #100,D0
  267.                 move.w  D0,helpbonus
  268.  
  269.                 cmpi.w  #5,helpcount         ; hat schon 5  Helps
  270.                 beq.s   nixaddhelp
  271.                 tst.w   helpverbraucht       ; hat Help benutzt!
  272.                 bne.s   nixaddhelp           ; bekommt kein Help dazu!
  273.                 addq.w  #1,helpcount         ; pro Level 1 Help dazu!
  274. nixaddhelp:
  275.  
  276.                 lea     scoretext,A0
  277.                 moveq   #40,D0
  278.                 moveq   #2,D1
  279.                 moveq   #70,D2
  280.                 movea.l screen1(PC),A1
  281.                 bsr     textaus
  282.  
  283.                 lea     timebonustext,A0
  284.                 moveq   #40,D0
  285.                 moveq   #2,D1
  286.                 move.w  #90,D2
  287.                 movea.l screen1(PC),A1
  288.                 bsr     textaus
  289.  
  290.                 lea     helpbonustext,A0
  291.                 moveq   #40,D0
  292.                 moveq   #2,D1
  293.                 move.w  #110,D2
  294.                 movea.l screen1(PC),A1
  295.                 bsr     textaus
  296.  
  297.                 bsr     outputhelpbonus
  298.                 bsr     outputscore
  299.                 bsr     outputtime
  300.  
  301.                 bsr     fadedown2
  302.  
  303.                 moveq   #20,D7
  304. waitabithere:   bsr     vsync
  305.                 dbra    D7,waitabithere
  306.  
  307.                 move.w  time,D7
  308.                 subq.w  #1,D7
  309.                 bmi.s   nixaddtimetoscore
  310. addtimetoscore: bsr     vsync
  311.                 subq.w  #1,time              ; Zeit -1
  312.                 addq.w  #1,score             ; Score +1
  313.                 bsr     outputscore
  314.                 bsr     outputtime
  315.                 dbra    D7,addtimetoscore
  316.  
  317. nixaddtimetoscore:
  318.                 moveq   #20,D7
  319. waitabithere2:  bsr     vsync
  320.                 dbra    D7,waitabithere2
  321.  
  322.                 moveq   #0,D7
  323.                 move.w  helpbonus,D7
  324.                 divu    #100,D7
  325.                 subq.w  #1,D7
  326.                 bmi.s   nixaddhelptoscore
  327. addhelptoscore: moveq   #9,D1
  328. verz:           bsr     vsync
  329.                 dbra    D1,verz
  330.                 subi.w  #100,helpbonus
  331.                 addi.w  #100,score
  332.                 bsr     outputscore
  333.                 bsr     outputhelpbonus
  334.                 dbra    D7,addhelptoscore
  335.  
  336. nixaddhelptoscore:
  337.                 addq.w  #1,stage             ; Level erhöhen
  338.                 cmpi.w  #65,stage            ; Spiel geschafft?
  339.                 bne     notlaststage         ; Spiel zu Ende!
  340.  
  341.                 move.w  #-3,endeflag
  342.  
  343.                 lea     stage64text,A0
  344.                 moveq   #40,D0
  345.                 moveq   #0,D1
  346.                 move.w  #130,D2
  347.                 movea.l screen1(PC),A1
  348.                 bsr     textaus2
  349.  
  350.                 lea     bonus64text,A0
  351.                 moveq   #40,D0
  352.                 moveq   #0,D1
  353.                 move.w  #150,D2
  354.                 movea.l screen1(PC),A1
  355.                 bsr     textaus2
  356.  
  357.                 addi.w  #5000,score
  358.                 bsr     outputscore
  359.  
  360.                 bsr     button
  361.                 bra     gameovereins
  362.  
  363.  
  364. notlaststage:   bsr     button
  365.  
  366.                 bsr     fadedown3
  367.  
  368.                 movea.l screen1(PC),A0
  369.                 bsr     cls
  370.  
  371.                 clr.w   endeflag
  372.  
  373.                 cmpi.w  #20,timeverzoegerung ; niedrigestes Niveau
  374.                 beq.s   nixsubstarttime
  375.                 subq.w  #2,timeverzoegerung  ; Zeit -5 Sekunden nächster Level
  376. nixsubstarttime:
  377.  
  378.                 bra     levelloop
  379.  
  380. endegame:       rts
  381.  
  382.  
  383.  
  384. backform:
  385. ; formt Bild aus Spezialformat zurück
  386. ; a0=Adresse
  387. ; d0=Länge
  388.                 lsr.l   #3,D0                ; Length/Bitblocks
  389.                 subq.l  #1,D0
  390.                 movea.l A0,A1                ; Dest. (Atari)
  391. backformloop0:  moveq   #0,D1                ; clear Plane 0-3
  392.                 moveq   #0,D2
  393.                 moveq   #0,D3
  394.                 moveq   #0,D4
  395.                 moveq   #3,D5                ; 4 words
  396. backformloop1:  move.w  (A0)+,D7             ; get word (Special)
  397.                 add.w   D7,D7                ; shift left by 1
  398.                 addx.w  D1,D1                ; Plane 0 set
  399.                 add.w   D7,D7                ;
  400.                 addx.w  D2,D2                ;
  401.                 add.w   D7,D7                ;
  402.                 addx.w  D3,D3                ;
  403.                 add.w   D7,D7                ;
  404.                 addx.w  D4,D4                ;
  405.                 add.w   D7,D7                ;
  406.                 addx.w  D1,D1                ;
  407.                 add.w   D7,D7                ;
  408.                 addx.w  D2,D2                ;
  409.                 add.w   D7,D7                ;
  410.                 addx.w  D3,D3                ;
  411.                 add.w   D7,D7                ;
  412.                 addx.w  D4,D4                ;
  413.                 add.w   D7,D7                ;
  414.                 addx.w  D1,D1                ;
  415.                 add.w   D7,D7                ;
  416.                 addx.w  D2,D2                ;
  417.                 add.w   D7,D7                ;
  418.                 addx.w  D3,D3                ;
  419.                 add.w   D7,D7                ;
  420.                 addx.w  D4,D4                ;
  421.                 add.w   D7,D7                ;
  422.                 addx.w  D1,D1                ;
  423.                 add.w   D7,D7                ;
  424.                 addx.w  D2,D2                ;
  425.                 add.w   D7,D7                ;
  426.                 addx.w  D3,D3                ;
  427.                 add.w   D7,D7                ;
  428.                 addx.w  D4,D4                ;
  429.                 dbra    D5,backformloop1
  430.                 move.w  D4,(A1)+             ;
  431.                 move.w  D3,(A1)+
  432.                 move.w  D2,(A1)+
  433.                 move.w  D1,(A1)+
  434.                 dbra    D0,backformloop0
  435.                 rts
  436.  
  437.  
  438.  
  439.  
  440. do_budgie:
  441. ; Kopiert Logo rein und faded es hoch und runter
  442.  
  443.         bsr    fadebudgie
  444.  
  445.                 lea     budgie_pic,A0
  446.                 movea.l screen1(PC),A1
  447.                 move.w  #7999,D0
  448. copy_budgie:    move.l  (A0)+,(A1)+
  449.                 dbra    D0,copy_budgie
  450.  
  451.  
  452.                 moveq   #0,D7
  453. fade_all_white: lea     $ffff8242.w,A0
  454.                 moveq   #14,D0
  455. copy_col:       move.w  D7,(A0)+
  456.                 dbra    D0,copy_col
  457.                 bsr     vsync
  458.                 bsr     vsync
  459.                 add.w   #$0111,D7
  460.                 cmp.w   #$0888,D7
  461.                 bne.s   fade_all_white
  462.  
  463.                 moveq   #9,D7
  464. w1:             bsr     vsync                ; kurz warten
  465.                 dbra    D7,w1
  466.  
  467.                 bsr     fadefromwhitedown
  468.  
  469.                 moveq   #29,D7
  470. w2:             bsr     vsync                ; kurz warten
  471.                 dbra    D7,w2
  472.  
  473.         bsr    fadebudgie
  474.         rts
  475.  
  476.  
  477. fadebudgie:     lea     $ffff8240.w,A0
  478.                 moveq   #15,D2
  479.                 bsr     fade_down
  480.                 bsr     vsync
  481.                 bsr     vsync
  482.                 lea     $ffff8240.w,A0
  483.                 moveq   #15,D0
  484. check:          move.w  (A0)+,D1
  485.                 and.w   #$0777,D1
  486.                 bne.s   fadebudgie
  487.                 dbra    D0,check
  488.         rts
  489.  
  490.  
  491.                 movea.l screen1(PC),A1
  492.                 move.w  #7999,D0
  493. clear_budgie:   clr.l   (A1)+
  494.                 dbra    D0,clear_budgie
  495.  
  496.                 rts
  497.  
  498.  
  499.  
  500. fade_down:
  501. ; faded Paletten runter
  502. ; a0=Zeiger auf Farben
  503. ; d2=Anzahl Farben
  504.  
  505. fdl0a:           move.w  (A0),D0
  506.                 and.w   #%111,D0
  507.                 beq.s   col2a
  508.                 subq.w  #1,D0
  509.                 move.w  (A0),D1
  510.                 and.w   #%1111111111111000,D1
  511.                 or.w    D0,D1
  512.                 move.w  D1,(A0)
  513.                 bra.s   coloka
  514. col2a:           move.w  (A0),D0
  515.                 and.w   #%1110000,D0
  516.                 beq.s   col3a
  517.                 sub.w   #$10,D0
  518.                 move.w  (A0),D1
  519.                 and.w   #%1111111110001111,D1
  520.                 or.w    D0,D1
  521.                 move.w  D1,(A0)
  522.                 bra.s   coloka
  523. col3a:           move.w  (A0),D0
  524.                 and.w   #%11100000000,D0
  525.                 beq.s   coloka
  526.                 sub.w   #$0100,D0
  527.                 move.w  (A0),D1
  528.                 and.w   #%1111100011111111,D1
  529.                 or.w    D0,D1
  530.                 move.w  D1,(A0)
  531. coloka:          lea     2(A0),A0
  532.                 dbra    D2,fdl0a
  533.                 rts
  534.  
  535.  
  536. fadefromwhitedown:
  537. ; faded von Weiß herunter auf Palette
  538.  
  539.                 lea     budgie_pal+2,A0      ; Zielfarben
  540.                 lea     $ffff8242.w,A1
  541.                 moveq   #14,D0               ; 15 Farben
  542. fadeloop:       move.w  (A0),D1              ; Zielfarbe holen
  543.                 move.w  (A1),D2              ; aktuelle Farbe
  544.                 and.w   #7,D2                ; nur Blauwert
  545.                 and.w   #7,D1
  546.                 cmp.w   D1,D2
  547.                 beq.s   blau_ok
  548.                 subq.w  #1,D2                ; Farbe -1
  549. blau_ok:        move.w  D2,D3                ; Merken
  550.                 move.w  (A0),D1              ; Zielfarbe holen
  551.                 move.w  (A1),D2              ; aktuelle Farbe
  552.                 and.w   #%1110000,D2         ; nur Grünwert
  553.                 and.w   #%1110000,D1
  554.                 cmp.w   D1,D2
  555.                 beq.s   gruen_ok
  556.                 sub.w   #$10,D2              ; Farbe -1
  557. gruen_ok:       or.w    D2,D3                ; Merken
  558.                 move.w  (A0)+,D1             ; Zielfarbe holen
  559.                 move.w  (A1),D2              ; aktuelle Farbe
  560.                 and.w   #%11100000000,D2     ; nur Rotwert
  561.                 and.w   #%11100000000,D1
  562.                 cmp.w   D1,D2
  563.                 beq.s   rot_ok
  564.                 sub.w   #$0100,D2            ; Farbe -1
  565. rot_ok:         or.w    D2,D3
  566.                 move.w  D3,(A1)+             ; und abspeichern
  567.                 dbra    D0,fadeloop
  568.                 bsr     vsync
  569.                 bsr     vsync
  570.                 bsr     vsync
  571.                 bsr     vsync
  572.                 lea     $ffff8242.w,A1
  573.                 lea     budgie_pal+2,A0
  574.                 moveq   #14,D0               ; 15 Farben
  575. comparecols:    move.w  (A1)+,D1
  576.                 and.w   #$0777,D1
  577.                 cmp.w   (A0)+,D1
  578.                 bne.s   fadefromwhitedown
  579.                 dbra    D0,comparecols
  580.                 rts
  581.  
  582.  
  583.  
  584. gameovererzeug: cmpi.l  #$136d7c22,cheatmode
  585.                 bne.s   nixxx
  586.                 move.w  #-1,endeflag
  587. nixxx:          rts
  588.  
  589.  
  590. button:         lea     pressbuttontext,A0
  591.                 moveq   #20,D0
  592.                 moveq   #0,D1
  593.                 move.w  #180,D2
  594.                 movea.l screen1(PC),A1
  595.                 bsr     textaus2
  596.  
  597.                 clr.w   mousek
  598. waitforbutt:    move.b  mousek,D0
  599.                 and.b   #3,D0
  600.                 beq.s   waitforbutt
  601.                 rts
  602.  
  603. gameover:
  604. ; Spiel zuende -> Time vorbei
  605.  
  606.                 move.l  #vblpause,$70.w
  607.                 bsr     initpalpointers
  608.                 bsr     fadeup2
  609.                 lea     hilfspalette1,A0
  610.                 moveq   #15,D0
  611. fillpalweiss2:  move.w  #$0777,(A0)+
  612.                 dbra    D0,fillpalweiss2
  613.                 move.l  #vblgame2,$70.w
  614.                 bsr     vsync
  615.  
  616.                 bsr     exitpalpointers
  617.  
  618. gameovereins:   movea.l screen1(PC),A0
  619.                 bsr     cls
  620.  
  621.                 lea     gameovermess,A0
  622.                 moveq   #40,D0
  623.                 moveq   #6,D1
  624.                 move.w  #2,D2
  625.                 movea.l screen1(PC),A1
  626.                 bsr     textaus
  627.  
  628.                 cmpi.w  #-3,endeflag
  629.                 beq.s   gamesolved
  630.  
  631.                 cmpi.w  #-2,endeflag         ; war checkmated?
  632.                 bne.s   nixendcheckmated
  633.  
  634.                 lea     checkmatedmess,A0
  635.                 moveq   #40,D0
  636.                 moveq   #5,D1
  637.                 move.w  #22,D2
  638.                 movea.l screen1(PC),A1
  639.                 bsr     textaus
  640.                 bra.s   nixendtimeout
  641. nixendcheckmated:
  642.                 lea     timeoutmess,A0
  643.                 moveq   #40,D0
  644.                 moveq   #6,D1
  645.                 move.w  #22,D2
  646.                 movea.l screen1(PC),A1
  647.                 bsr     textaus
  648.                 bra.s   nixendtimeout
  649. gamesolved:
  650.                 lea     gamesolvedmess,A0
  651.                 moveq   #40,D0
  652.                 moveq   #5,D1
  653.                 move.w  #22,D2
  654.                 movea.l screen1(PC),A1
  655.                 bsr     textaus
  656.  
  657. nixendtimeout:
  658.  
  659.  
  660.                 moveq   #0,D0
  661.                 move.w  score,D0             ; schauen ob Highscore gemacht
  662.                 lea     highscores,A0
  663.                 moveq   #0,D1                ; 10 Plätze durchschauen
  664. hiscoreschauen: moveq   #0,D2
  665.                 move.w  (A0),D2
  666.                 cmp.l   D2,D0                ; Score größer?
  667.                 bgt.s   highscoregemacht
  668.                 lea     12(A0),A0            ; nächster Platz
  669.                 addq.w  #1,D1
  670.                 cmp.w   #10,D1
  671.                 bne.s   hiscoreschauen
  672.                 bra     nixhighscore
  673. highscoregemacht:move.w #-1,highscoremade    ; Highscores saven am Ende
  674.                 move.w  D1,highscoreplatz
  675.                 lea     highscores+(8*12),A1
  676.                 move.w  #8,D0                ; 9 Plätze maximal kopieren
  677.                 sub.w   D1,D0
  678.                 bmi     nixcopyhighscore
  679. hiscoredowncopy:move.l  (A1),12(A1)          ; einen Platz nach unten schieben
  680.                 move.l  4(A1),16(A1)
  681.                 move.l  8(A1),20(A1)
  682.                 lea     -12(A1),A1
  683.                 dbra    D0,hiscoredowncopy   ; in a0=Platzpointer jetzt
  684. nixcopyhighscore:move.w score,(A0)+
  685.                 move.l  A0,-(A7)
  686.                 move.w  D1,-(A7)
  687.                 lea     madehighscoretext,A0
  688.                 movea.l screen1(PC),A1
  689.                 moveq   #40,D0
  690.                 moveq   #3,D1
  691.                 move.w  #60,D2
  692.                 bsr     textaus
  693.                 lea     onplacetext,A0
  694.                 movea.l screen1(PC),A1
  695.                 moveq   #40,D0
  696.                 moveq   #0,D1
  697.                 move.w  #90,D2
  698.                 bsr     textaus
  699.                 move.w  highscoreplatz,D0
  700.                 addq.w  #1,D0
  701.                 bsr     hexdez
  702.                 lea     hexdezbuff+4,A0
  703.                 moveq   #2,D0
  704.                 bsr     nullfix
  705.                 moveq   #17,D1
  706.                 move.w  #90,D2
  707.                 movea.l screen1(PC),A1
  708.                 bsr     textaus
  709.                 lea     enternametext,A0
  710.                 movea.l screen1(PC),A1
  711.                 moveq   #40,D0
  712.                 moveq   #0,D1
  713.                 move.w  #140,D2
  714.                 bsr     textaus
  715.                 bsr     fadedown2
  716.                 bsr     eingabe
  717.                 move.w  (A7)+,D0
  718.                 movea.l (A7)+,A0             ; Namenspos. im Highscore
  719.                 lea     namebuff,A1
  720.                 tst.b   (A1)                 ; nichts eingegeben
  721.                 bne.s   nixcopydefname
  722.                 lea     defaultname,A1
  723. nixcopydefname: moveq   #9,D0                ; 10 Zeichen
  724. copynameintab:  move.b  (A1)+,(A0)+
  725.                 dbra    D0,copynameintab
  726.  
  727.                 bsr     fadedown3
  728.  
  729.                 movea.l screen1(PC),A0
  730.                 bsr     cls
  731.  
  732.                 bsr     drawhighscores
  733.                 bsr     fadeup3
  734.  
  735.                 bra.s   warten
  736.  
  737. nixhighscore:   bsr     fadedown2
  738.  
  739. warten:         clr.w   mousek
  740.                 moveq   #0,D0
  741. waitmoo:        move.b  mousek,D0
  742.                 and.w   #3,D0
  743.                 beq.s   waitmoo
  744.  
  745. endgameover:    bsr     fadedown3
  746.  
  747.                 movea.l screen1(PC),A0
  748.                 bsr     cls
  749.  
  750.                 rts                          ; zum Menue zurück
  751.  
  752. highscoreout:   movea.l screen1(PC),A0
  753.                 bsr     cls
  754.                 bsr     drawhighscores
  755.                 bsr     waitmouse2
  756.                 rts
  757.  
  758.  
  759. drawhighscores: lea     highscores,A6
  760.                 moveq   #1,D7                ; 10 Plätze
  761.                 moveq   #5,D6                ; Y-Zähler
  762. hiscoreloop:    move.w  D7,D0
  763.                 bsr     hexdez
  764.                 lea     hexdezbuff+4,A0
  765.                 moveq   #2,D0
  766.                 moveq   #0,D1
  767.                 move.w  D6,D2
  768.                 movea.l screen1(PC),A1       ; Nummer ausgeben
  769.                 bsr     textaus2
  770.                 lea     2(A6),A0             ; Name
  771.                 moveq   #10,D0               ; max. 10 Zeichen
  772.                 moveq   #3,D1
  773.                 move.w  D6,D2
  774.                 movea.l screen1(PC),A1
  775.                 bsr     textaus2
  776.                 move.w  (A6),D0
  777.                 bsr     hexdez
  778.                 lea     hexdezbuff+1,A0
  779.                 moveq   #5,D0
  780.                 bsr     nullfix
  781.                 moveq   #15,D1
  782.                 move.w  D6,D2
  783.                 movea.l screen1(PC),A1
  784.                 bsr     textaus2             ; Score ausgeben
  785.                 lea     12(A6),A6
  786.                 add.w   #18,D6
  787.                 addq.w  #1,D7
  788.                 cmp.w   #11,D7
  789.                 bne.s   hiscoreloop
  790.                 rts
  791.  
  792.  
  793.  
  794.  
  795. outputscore:
  796.                 movea.l screen1(PC),A1
  797.                 lea     70*160+13*8(A1),A1
  798.                 bsr     cleartext
  799.                 move.w  score,D0
  800.                 bsr     hexdez
  801.                 lea     hexdezbuff+1,A0
  802.                 moveq   #5,D0
  803.                 bsr     nullfix
  804.                 movea.l screen1(PC),A1
  805.                 moveq   #13,D1
  806.                 moveq   #70,D2
  807.                 bsr     textaus2
  808.                 rts
  809.  
  810. outputtime:
  811.                 movea.l screen1(PC),A1
  812.                 lea     90*160+13*8(A1),A1
  813.                 bsr     cleartext
  814.  
  815.                 move.w  time,D0
  816.                 bsr     hexdez
  817.                 lea     hexdezbuff+3,A0
  818.                 moveq   #3,D0
  819.                 bsr     nullfix
  820.                 movea.l screen1(PC),A1
  821.                 moveq   #13,D1
  822.                 move.w  #90,D2
  823.                 bsr     textaus2
  824.                 rts
  825.  
  826. outputhelpbonus:
  827.                 movea.l screen1(PC),A1
  828.                 lea     110*160+13*8(A1),A1
  829.                 bsr     cleartext
  830.                 move.w  helpbonus,D0
  831.                 bsr     hexdez
  832.                 lea     hexdezbuff+3,A0
  833.                 moveq   #3,D0
  834.                 bsr     nullfix
  835.                 moveq   #13,D1
  836.                 move.w  #110,D2
  837.                 movea.l screen1(PC),A1
  838.                 bsr     textaus2
  839.                 rts
  840.  
  841. cleartext:      moveq   #14,D0               ; 15 Scanlines
  842. cleartextloop:  clr.l   (A1)+
  843.                 clr.l   (A1)+
  844.                 clr.l   (A1)+
  845.                 clr.l   (A1)+
  846.                 clr.l   (A1)+
  847.                 clr.l   (A1)+
  848.                 clr.l   (A1)+
  849.                 clr.l   (A1)+
  850.                 clr.l   (A1)+
  851.                 clr.l   (A1)+
  852.                 lea     120(A1),A1
  853.                 dbra    D0,cleartextloop
  854.                 rts
  855.  
  856. oneplayermouse:
  857. ; diese Routine ist für 1 Spieler mit Maus und Tastaturhilfe
  858.                 bsr     umrechen             ; Maus.Koord umrechnen
  859.                 moveq   #0,D0
  860.                 move.b  keybuffer,D0
  861.                 moveq   #0,D1
  862.                 lea     keytab(PC),A0        ; nur Sonderfunktionen
  863. testkey:        tst.b   (A0)                 ; prüfen ob erlaubt
  864.                 bmi.s   nokeyfound
  865.                 cmp.b   (A0)+,D0
  866.                 beq.s   keyfound
  867.                 addq.w  #4,D1
  868.                 bra.s   testkey
  869. nokeyfound:     move.b  mousek,D0            ; Maustaste
  870.                 btst    #1,D0                ; linke Taste
  871.                 bne     selekttile
  872.                 btst    #0,D0                ; rechter Knopf
  873.                 bne     deselekttile
  874.                 rts
  875.  
  876. keyfound:       lea     keyroutinen(PC),A0   ; je nach Taste
  877.                 movea.l 0(A0,D1.w),A0        ; Routine anspringen
  878.                 jsr     (A0)
  879.                 rts
  880.  
  881. initscroller:   move.l  #scrolltext,textpos
  882.                 move.l  #fontbuff,mempos
  883.                 clr.w   zeichen
  884.                 rts
  885.  
  886. ;------------------------------ Instructions -------------------------
  887.  
  888. instructions:
  889.                 lea     instrtext1,A6
  890.                 bsr     outputinstructions2
  891.  
  892.                 bsr     waitmouse
  893.  
  894.                 lea     instrtext2,A6
  895.                 bsr     outputinstructions2
  896.  
  897.                 bsr     waitmouse
  898.  
  899.  
  900.                 rts
  901.  
  902. waitmouse2:     bsr     fadeup3
  903.                 bra.s   waitmm
  904. waitmouse:      bsr     fadeup4
  905. waitmm:         clr.b   mousek
  906. waitmousek:     moveq   #0,D0
  907.                 move.b  mousek,D0
  908.                 and.w   #3,D0
  909.                 beq.s   waitmousek
  910.                 bsr     fadedown3
  911.                 rts
  912.  
  913.  
  914. loadhighscores:
  915.         clr.w    -(A7)
  916.         pea    filename
  917.         move.w    #$3d,-(a7)
  918.         trap    #1
  919.         addq.l    #8,a7
  920.         tst.w    d0
  921.         bmi.s    error
  922.  
  923.         move.w    d0,d7
  924.  
  925.         pea    highscores
  926.         move.l    #512,-(a7)
  927.         move.w    d0,-(a7)
  928.         move.w    #$3f,-(a7)
  929.         trap    #1
  930.         lea    12(a7),a7
  931.                 
  932.         cmp.l    #512,d0
  933.         bne.s    error
  934.         
  935.         move.w    d0,-(A7)
  936.         move.w    #$3e,-(a7)
  937.         trap    #1
  938.         addq.l    #4,a7                
  939.  
  940.         moveq    #0,d0
  941.                 rts
  942.  
  943. error:        lea    highscores2,a0
  944.         lea    highscores,a1
  945.         move.w    #512-2,d0
  946. copyscores:    move.b    (a0)+,(A1)+
  947.         dbra    d0,copyscores
  948.         move.w    #-1,highscoremade
  949.         rts
  950.  
  951.  
  952.  
  953. writehighscores:
  954.         clr.w    -(A7)
  955.         pea    filename
  956.         move.w    #$3c,-(a7)
  957.         trap    #1
  958.         addq.l    #8,a7
  959.         tst.w    d0
  960.         bmi.s    error2
  961.  
  962.         move.w    d0,d7
  963.  
  964.         pea    highscores
  965.         move.l    #512,-(a7)
  966.         move.w    d0,-(a7)
  967.         move.w    #$40,-(a7)
  968.         trap    #1
  969.         lea    12(a7),a7
  970.                 
  971.         cmp.l    #512,d0
  972.         bne.s    error2
  973.         
  974.         move.w    d0,-(A7)
  975.         move.w    #$3e,-(a7)
  976.         trap    #1
  977.         addq.l    #4,a7                
  978.  
  979.         moveq    #0,d0
  980.                 rts
  981. error2:        moveq    #-1,d0
  982.         rts
  983.  
  984.  
  985.  
  986. outputinstructions:
  987. ; gibt die Instructions zentriert auf dem Screen aus
  988. ; a6=pointer auf Text
  989.  
  990.                 movea.l screen1(PC),A0
  991.                 bsr     cls
  992.  
  993.                 moveq   #0,D2                ; Y-Counter
  994.  
  995. instroutloop:   tst.b   (A6)
  996.                 bmi.s   endoutput            ; -1, dann Ende Ausgabe
  997.  
  998.                 moveq   #0,D3
  999.                 movea.l A6,A0
  1000. counttext:      tst.b   (A0)+
  1001.                 beq.s   textendefound
  1002.                 addq.w  #1,D3                ; Länge erhöhen
  1003.                 bra.s   counttext
  1004. textendefound:  movea.l A0,A5                ; Merken!
  1005.                 moveq   #20,D1
  1006.                 sub.w   D3,D1
  1007.                 lsr.w   #1,D1
  1008.                 movea.l A6,A0
  1009.                 movea.l screen1(PC),A1
  1010.                 moveq   #40,D0
  1011.                 bsr     textaus2
  1012.                 add.w   #16,D2               ; Y erhöhen
  1013.                 movea.l A5,A6
  1014.                 bra.s   instroutloop
  1015.  
  1016.  
  1017. outputinstructions2:
  1018. ; gibt die Instructions zentriert auf dem Screen aus (mit 8er Font)
  1019. ; a6=pointer auf Text
  1020.  
  1021.                 movea.l screen1(PC),A0
  1022.                 bsr     cls
  1023.  
  1024.                 moveq   #0,D2                ; Y-Counter
  1025.  
  1026. instroutloop2:  tst.b   (A6)
  1027.                 bmi.s   endoutput            ; -1, dann Ende Ausgabe
  1028.  
  1029.                 moveq   #0,D3
  1030.                 movea.l A6,A0
  1031. counttext2:     tst.b   (A0)+
  1032.                 beq.s   textendefound2
  1033.                 addq.w  #1,D3                ; Länge erhöhen
  1034.                 bra.s   counttext2
  1035. textendefound2: movea.l A0,A5                ; Merken!
  1036.                 moveq   #40,D1
  1037.                 sub.w   D3,D1
  1038.                 lsr.w   #1,D1
  1039.                 movea.l A6,A0
  1040.                 movea.l screen1(PC),A1
  1041.                 moveq   #80,D0
  1042.                 bsr     textaus3
  1043.                 add.w   #9,D2                ; Y erhöhen
  1044.                 movea.l A5,A6
  1045.                 bra.s   instroutloop2
  1046.  
  1047.  
  1048. endoutput:      rts
  1049.  
  1050.  
  1051.  
  1052. scroller:
  1053. ; Laufschrift am unteren Rand
  1054.  
  1055.                 subq.w  #2,zeichen           ; um 2 Zeichen scrollen
  1056.                 bpl.s   do_it                ; alles gescrollt?
  1057.                 move.w  #14,zeichen
  1058.                 movea.l textpos,A0
  1059.                 tst.b   (A0)
  1060.                 bne.s   gweiter              ; noch nicht Ende von Text
  1061.                 move.l  #scrolltext,textpos
  1062.                 movea.l textpos,A0
  1063. gweiter:        moveq   #0,D0
  1064.                 move.b  (A0),D0              ; Zeichen holen
  1065.                 add.w   D0,D0
  1066.                 lea     fonttabelle,A6
  1067.                 move.w  0(A6,D0.w),D0
  1068.                 lea     fontbuff,A6
  1069.                 adda.w  D0,A6
  1070.                 lea     2(A6),A6             ; Maske überspringen
  1071.                 move.l  A6,mempos
  1072.                 addq.l  #1,textpos
  1073.  
  1074.  
  1075. do_it:          moveq   #2,D7                ; 3 Planes
  1076.                 movea.l mempos,A4
  1077.                 movea.l screen1(PC),A3
  1078.                 lea     184*160+152(A3),A3
  1079. planescroll_loop:
  1080.                 movea.l A4,A2
  1081.                 movea.l A3,A0
  1082.                 move.w  zeichen,D4           ; Anzahl wieviel gescrollt ist
  1083.                 moveq   #14,D5               ; Anzahl der Scrollzeilen-1
  1084. scrollloop:     moveq   #0,D0
  1085.                 move.w  (A2),D0              ; 4 mal 16 Pixel von Zeichen
  1086.                 lsr.w   D4,D0
  1087.                 and.w   #3,D0
  1088.                 REPT 20
  1089.                 moveq   #0,D1
  1090.                 move.w  (A0),D1              ; vom Quellbildschirm
  1091.                 lsl.l   #2,D1                ; um 2 Bits nach links schieben
  1092.                 or.w    D0,D1                ; alten Rest einodern
  1093.                 move.w  D1,(A0)              ; abspeichern auf Zielbildschirm
  1094.                 swap    D1                   ; Hiword <-> Lowword
  1095.                 move.w  D1,D0                ; Herausgeschobenes merken
  1096.                 lea     -8(A0),A0
  1097.                 ENDR
  1098.  
  1099.                 lea     320(A0),A0           ; auf Bitplane1 1 Zeile tiefer
  1100.                 lea     10(A2),A2            ; im Charscreen 1 Zeile tiefer
  1101.  
  1102.                 dbra    D5,scrollloop
  1103.                 lea     2(A3),A3
  1104.                 lea     2(A4),A4
  1105.                 dbra    D7,planescroll_loop
  1106.                 rts
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112. ende:
  1113. ; Spiel ganz verlassen
  1114.  
  1115.                 bsr     fadedown3
  1116.                 move.w  #1,scrollready
  1117.                 movem.l leerfeld,D0-D7
  1118.                 movem.l D0-D7,hilfspalette1
  1119.                 move.l  #vblquit,$70.w
  1120.                 bsr     vsync
  1121.                 moveq   #0,D0
  1122.                 jsr     music                ; Musik abschalten
  1123.  
  1124.                 bsr     hbl_off
  1125.  
  1126.                 movem.l oldpal,D0-D7
  1127.                 movem.l D0-D7,$ffff8240.w    ; alte Palette
  1128.  
  1129.                 move.l  oldscreen,D0
  1130.                 bsr     setscreen
  1131.  
  1132.                 bsr     vsync
  1133.                 move.b  oldres,$ffff8260.w       ; Midres
  1134.                 movea.l oldstack,A7
  1135.  
  1136.         bsr    writehighscores
  1137.                 rts
  1138.  
  1139.  
  1140. no_new_move:    rts
  1141.  
  1142.  
  1143. sendkeyboard:   lea     $fffffc00.w,A0
  1144. waitkeyready:   btst    #1,(A0)
  1145.                 beq.s   waitkeyready
  1146.                 move.b  D0,2(A0)
  1147.                 rts
  1148.  
  1149.  
  1150. cheatlevel:     cmpi.l  #$136d7c22,cheatmode
  1151.                 bne.s   nixcheatlevel
  1152.                 move.w  #1,endeflag          ; Level geschafft (mit Beschiß)
  1153. nixcheatlevel:  rts
  1154.  
  1155. musiconoff:     eori.w  #1,musicflag
  1156.                 moveq   #0,D0
  1157.                 move.w  musicflag,D0         ; 0 oder 1
  1158.                 jsr     music
  1159.                 clr.b   keybuffer
  1160.                 rts
  1161.  
  1162. addscore:       
  1163.                 cmpi.l  #$136d7c22,cheatmode
  1164.                 bne.s   nixaddscore
  1165.                 addi.w  #100,score
  1166.                 movea.l screen1(PC),A1
  1167.                 bsr     draw_score
  1168. nixaddscore:    rts
  1169.  
  1170.  
  1171. umrechen:
  1172. ; rechnet Koordinaten von Maus in Koord. im Feld um
  1173.  
  1174.                 move.w  mousex,D0
  1175.                 addq.w  #6,D0                ; Mittelpunkt
  1176.                 lsr.w   #4,D0                ; X/16
  1177.                 subq.w  #1,D0                ; -2 wegen Startfeld=16
  1178.                 moveq   #0,D1
  1179.                 move.w  mousey,D1
  1180.                 addq.w  #6,D1                ; Mittelpunkt
  1181.                 sub.w   #ystartline,D1       ; Startzeile abziehen
  1182.                 divu    #20,D1               ; / Höhe teilen
  1183.                 move.w  D0,xpos1
  1184.                 move.w  D1,ypos1
  1185.                 rts
  1186.  
  1187. selekttile:
  1188. ; diese Routine selektiert das Tile, auf dem geklickt wurde.
  1189.                 tst.b   tile1selektpos       ; schon selektiert?
  1190.                 bne.s   tile2selekt          ; dann 2. selekt.
  1191.                 moveq   #0,D2                ; umrechnen in Pos.
  1192.                 move.w  xpos1,D0
  1193.                 move.w  ypos1,D1
  1194.                 move.w  D1,D2
  1195.                 mulu    #18,D2               ; * Breite
  1196.                 add.w   D0,D2                ; + X
  1197.                 lea     matchitbuff,A0
  1198.                 tst.b   0(A0,D2.w)           ; dort überhaupt Tile?
  1199.                 beq.s   notileselekt
  1200.                 move.w  #-1,kasten1aktiv
  1201.                 movem.l D0-A6,-(A7)
  1202.                 bsr     vsync
  1203.                 bsr     restmouse            ; Maus restaurieren
  1204.                 clr.l   rettbuff
  1205. joyrest:        movem.l (A7)+,D0-A6
  1206.                 move.w  D0,tile1selektx      ; Koord. speichern
  1207.                 move.w  D1,tile1selekty
  1208.                 move.b  D2,tile1selektpos
  1209.                 bsr     draw_kasten
  1210.                 clr.w   kasten1aktiv
  1211. notileselekt:   rts
  1212.  
  1213. tile2selekt:    tst.b   tile1selektpos
  1214.                 beq     notileselekt2
  1215.                 moveq   #0,D5                ; umrechnen in Pos.
  1216.                 move.w  xpos1,D0
  1217.                 move.w  ypos1,D1
  1218.                 move.w  D1,D5
  1219.                 mulu    #18,D5               ; * Breite
  1220.                 add.w   D0,D5                ; + X
  1221.                 lea     matchitbuff,A0
  1222.                 tst.b   0(A0,D5.w)           ; dort überhaupt Tile?
  1223.                 beq     notileselekt2
  1224.  
  1225.                 cmp.w   tile1selektx,D0      ; = alten Koord.?
  1226.                 bne.s   tile2xntile1x
  1227.                 cmp.w   tile1selekty,D1
  1228.                 beq     notileselekt2
  1229. tile2xntile1x:  move.w  D0,tile2selektx      ; Koord. speichern
  1230.                 move.w  D1,tile2selekty
  1231.                 move.b  D5,tile2selektpos
  1232.                 moveq   #0,D4
  1233.                 move.b  tile1selektpos,D4
  1234.                 move.b  0(A0,D4.w),D2        ; Wert holen
  1235.                 move.b  0(A0,D5.w),D3        ; Wert holen
  1236.                 bsr     tilevergleich        ; Tausch möglich ?
  1237.                 tst.w   D7
  1238.                 bne     notileselekt2        ; Nein-> Nichts
  1239.  
  1240.                 move.w  D0,D2                ; X2
  1241.                 move.w  D1,D3                ; Y2
  1242.                 move.w  tile1selektx,D0      ; X1
  1243.                 move.w  tile1selekty,D1      ; Y1
  1244.                 movem.l D0-A6,-(A7)
  1245.                 move.w  #-1,kasten1aktiv     ; Kasten 1 aus
  1246.                 bsr     vsync
  1247.                 bsr     restmouse
  1248.                 clr.l   rettbuff
  1249. tile2selektrj:  move.w  tile2selektx,D0
  1250.                 move.w  tile2selekty,D1
  1251.                 bsr     draw_kasten
  1252.                 movem.l (A7)+,D0-A6
  1253.  
  1254. helpeinsprung:
  1255.                 clr.w   mousek
  1256.                 bsr     such_weg             ; Verbindungslinie?
  1257.                 tst.w   D0                   ; geklappt?
  1258.                 bne     notawegfound
  1259.  
  1260.                 moveq   #10,D7
  1261. waitahalf:      bsr     vsync
  1262.                 dbra    D7,waitahalf
  1263.  
  1264.                 addq.w  #1,score             ; Score erhöhen
  1265.  
  1266.                 bsr     draw_weg
  1267.  
  1268.                 subq.w  #1,paaranzahl
  1269.                 bne.s   notallpaars
  1270.                 move.w  #1,endeflag          ; alle Paare weg! = nächster Level!
  1271.                 rts
  1272. notallpaars:    clr.w   kasten1aktiv         ; Kasten an
  1273.                 clr.b   tile1selektpos       ; kein Tile selekt.
  1274.                 bsr     checkmatetest        ; Kucken ob noch was geht!
  1275. notileselekt2:  rts
  1276.  
  1277. notawegfound:   move.w  tile2selektx,D0
  1278.                 move.w  tile2selekty,D1
  1279.                 movea.l screen1(PC),A0       ; wieder Tiles zeichnen
  1280.                 bsr     draw_tile
  1281.                 clr.w   kasten1aktiv         ; Joystick an
  1282.                 bra.s   notileselekt2
  1283.  
  1284. deselekttile:   tst.b   tile1selektpos       ; schon Tile selekt.
  1285.                 beq.s   notiledeselekt
  1286.  
  1287.  
  1288.                 movea.l cheatpoint,A0
  1289.                 cmpa.l  #cheatmode+4,A0      ; Pos. in Cheatmode
  1290.                 beq.s   nomorecheat
  1291.                 move.b  tile1selektpos,(A0)+
  1292.                 move.l  A0,cheatpoint
  1293.                 cmpi.l  #$136d7c22,cheatmode
  1294.                 bne.s   nomorecheat
  1295.                 movem.w cheatpalette(PC),D0-D2
  1296.                 movem.w D0-D2,palette1+26
  1297. nomorecheat:
  1298.                 move.w  #-1,kasten1aktiv
  1299.                 bsr     restmouse
  1300.                 clr.l   rettbuff
  1301.                 move.w  tile1selektx,D0
  1302.                 move.w  tile1selekty,D1
  1303.                 movea.l screen1(PC),A0
  1304.                 bsr     draw_tile            ; Tile zeichnen
  1305.                 clr.w   kasten1aktiv
  1306.                 clr.b   tile1selektpos
  1307. notiledeselekt: rts
  1308.  
  1309.  
  1310. helpfunktion:   tst.w   helpcount
  1311.                 beq     nomorehelp           ; kein Help mehr da?
  1312.  
  1313.                 bsr     vsync
  1314.                 bsr     restmouse
  1315.                 clr.l   rettbuff
  1316.                 move.w  #-1,kasten1aktiv
  1317.  
  1318.                 moveq   #0,D4
  1319.                 moveq   #0,D5
  1320.                 lea     posbuff+96,A0        ; Pos.
  1321.                 moveq   #0,D0                ; 95 Tiles (wegen 2Loop)
  1322. searchhelploop: move.b  -(A0),D4             ; Pos. 1
  1323.                 tst.b   D4
  1324.                 beq     posgleich0
  1325.                 movea.l A0,A1
  1326.                 move.w  #94,D1
  1327.                 sub.w   D0,D1
  1328. searchhelploop2:move.b  -(A1),D5             ; Pos. 2
  1329.                 tst.b   D5
  1330.                 beq     pos2gleich0
  1331.                 lea     matchitbuff,A2
  1332.  
  1333.                 move.b  0(A2,D4.w),D2        ; 2 Tiles holen
  1334.                 move.b  0(A2,D5.w),D3
  1335.  
  1336.                 bsr     tilevergleich        ; mögliche Kombination?
  1337.                 tst.w   D7
  1338.                 bne     pos2gleich0
  1339.                 move.l  D0,-(A7)
  1340.                 move.l  D1,-(A7)
  1341.  
  1342.                 moveq   #0,D2                ; umrechnen in Koord.
  1343.                 move.w  D4,D2
  1344.                 divu    #18,D2
  1345.                 move.w  D2,D1
  1346.                 swap    D2
  1347.                 move.w  D2,D0
  1348.                 moveq   #0,D2
  1349.                 move.w  D5,D2
  1350.                 divu    #18,D2
  1351.                 move.w  D2,D3
  1352.                 swap    D2
  1353.  
  1354.                 move.w  D0,tile1selektx
  1355.                 move.w  D1,tile1selekty
  1356.                 move.w  D2,tile2selektx
  1357.                 move.w  D3,tile2selekty
  1358.  
  1359.                 bsr     such_weg             ; Weg da?
  1360.  
  1361.                 move.w  D0,D6
  1362.                 move.l  (A7)+,D1
  1363.                 move.l  (A7)+,D0
  1364.                 tst.w   D6
  1365.                 bne.s   pos2gleich0          ; Ja-Wegnehmen
  1366.  
  1367.                 move.b  D4,tile1selektpos
  1368.                 move.b  D5,tile2selektpos
  1369.                 move.w  tile1selektx,D0
  1370.                 move.w  tile1selekty,D1
  1371.                 bsr     draw_kasten          ; Feld umrahmen
  1372.                 move.w  tile2selektx,D0
  1373.                 move.w  tile2selekty,D1
  1374.                 bsr     draw_kasten          ; Feld umrahmen
  1375.  
  1376.  
  1377.                 move.w  #-1,helpverbraucht
  1378.                 cmpi.l  #$136d7c22,cheatmode ; Cheatmode an?
  1379.                 beq.s   unlimitedhelps
  1380.                 subq.w  #1,helpcount
  1381.                 bra.s   limitedhelps
  1382. unlimitedhelps: move.w  #5,helpcount         ; wieder 5 Helps bei Cheatmode!
  1383. limitedhelps:   move.w  tile1selektx,D0
  1384.                 move.w  tile1selekty,D1
  1385.                 move.w  tile2selektx,D2
  1386.                 move.w  tile2selekty,D3
  1387.                 move.b  tile1selektpos,D4
  1388.                 move.b  tile2selektpos,D5
  1389.                 bra     helpeinsprung
  1390.  
  1391. pos2gleich0:    dbra    D1,searchhelploop2
  1392. posgleich0:     addq.w  #1,D0
  1393.                 cmp.w   #95,D0
  1394.                 bne     searchhelploop
  1395.  
  1396.                 move.w  #-2,endeflag         ; Game over! (checkmated)
  1397.  
  1398. nomorehelp:     clr.w   kasten1aktiv
  1399.                 rts
  1400.  
  1401.  
  1402. endgame:        move.w  #2,endeflag          ; zurück ins Menü springen
  1403.                 rts
  1404.  
  1405.  
  1406. checkmatetest:
  1407. ; überprüft ob noch mögliche Tiles da sind
  1408.                 moveq   #0,D4
  1409.                 moveq   #0,D5
  1410.                 lea     posbuff+96,A0        ; Pos.
  1411.                 moveq   #0,D0                ; 95 Tiles (wegen 2Loop)
  1412. searchhloop:    move.b  -(A0),D4             ; Pos. 1
  1413.                 tst.b   D4
  1414.                 beq     posgleich01
  1415.                 movea.l A0,A1
  1416.                 move.w  #94,D1
  1417.                 sub.w   D0,D1
  1418. searchhloop2:   move.b  -(A1),D5             ; Pos. 2
  1419.                 tst.b   D5
  1420.                 beq     pos2gleich01
  1421.                 lea     matchitbuff,A2
  1422.  
  1423.                 move.b  0(A2,D4.w),D2        ; 2 Tiles holen
  1424.                 move.b  0(A2,D5.w),D3
  1425.  
  1426.                 bsr     tilevergleich        ; mögliche Kombination?
  1427.                 tst.w   D7
  1428.                 bne     pos2gleich01
  1429.                 move.l  D0,-(A7)
  1430.                 move.l  D1,-(A7)
  1431.  
  1432.                 moveq   #0,D2                ; umrechnen in Koord.
  1433.                 move.w  D4,D2
  1434.                 divu    #18,D2
  1435.                 move.w  D2,D1
  1436.                 swap    D2
  1437.                 move.w  D2,D0
  1438.                 moveq   #0,D2
  1439.                 move.w  D5,D2
  1440.                 divu    #18,D2
  1441.                 move.w  D2,D3
  1442.                 swap    D2
  1443.  
  1444.                 move.w  D0,tile1selektx
  1445.                 move.w  D1,tile1selekty
  1446.                 move.w  D2,tile2selektx
  1447.                 move.w  D3,tile2selekty
  1448.  
  1449.                 bsr     such_weg             ; Weg da?
  1450.  
  1451.                 move.w  D0,D6
  1452.                 move.l  (A7)+,D1
  1453.                 move.l  (A7)+,D0
  1454.                 tst.w   D6
  1455.                 bne.s   pos2gleich01         ; Ja-Wegnehmen
  1456.  
  1457.                 rts                          ; OK! noch was da!
  1458.  
  1459. pos2gleich01:   dbra    D1,searchhloop2
  1460. posgleich01:    addq.w  #1,D0
  1461.                 cmp.w   #95,D0
  1462.                 bne     searchhloop
  1463.  
  1464.                 move.w  #-2,endeflag         ; Game over! (checkmated)
  1465.                 rts
  1466.  
  1467.  
  1468.  
  1469. make_leveltab:
  1470.  
  1471.                 lea     leveltab,A6          ; komplett löschen
  1472.                 moveq   #63,D7
  1473. clrleveltab:    move.b  #-1,(A6)+
  1474.                 dbra    D7,clrleveltab
  1475.  
  1476.                 lea     leveltab,A6
  1477.                 moveq   #63,D7
  1478. makelevelsloop: bsr     random
  1479.                 and.w   #63,D0
  1480.                 cmpi.b  #-1,0(A6,D0.w)       ; Feld dort belegt
  1481.                 bne.s   makelevelsloop
  1482.                 move.b  D7,0(A6,D0.w)        ; Nummer ablegen
  1483.                 dbra    D7,makelevelsloop
  1484.  
  1485.                 bsr     random
  1486.                 move.w  D0,D1
  1487.                 bsr     random
  1488.                 mulu    D1,D0
  1489.                 and.w   #63,D0
  1490.                 move.w  D0,level
  1491.                 rts
  1492.  
  1493. make_buff:      moveq   #0,D0
  1494.                 move.w  level,D0
  1495.                 addq.w  #1,D0
  1496.                 and.w   #63,D0               ; 64 Level
  1497.                 move.w  D0,level
  1498.                 lea     leveltab,A0
  1499.                 move.b  0(A0,D0.w),D0        ; Levelnummer holen
  1500.                 mulu    #240,D0
  1501.                 lea     buffers,A0
  1502.                 adda.w  D0,A0
  1503.                 lea     matchitbuff,A1
  1504.                 move.w  #143,D0
  1505. copybuff:       move.b  (A0)+,(A1)+
  1506.                 dbra    D0,copybuff
  1507.                 lea     posbuff,A1
  1508.                 moveq   #95,D0
  1509. copypbuff:      move.b  (A0)+,(A1)+
  1510.                 dbra    D0,copypbuff
  1511.                 rts
  1512.  
  1513.  
  1514. random:         movem.l D1-D7,-(A7)
  1515.                 move.l  $0466.w,D7           ; VBL-Count
  1516.                 not.l   D7
  1517.                 add.l   oldrandom(PC),D7
  1518.                 move.l  D7,D6
  1519.                 move.l  #127773,D2
  1520.                 bsr.s   div
  1521.                 move.l  D4,D5
  1522.                 muls    #-2836,D5
  1523.                 mulu    #42591,D4
  1524.                 move.l  D4,D6
  1525.                 add.l   D4,D4
  1526.                 add.l   D6,D4
  1527.                 sub.l   D4,D7
  1528.                 moveq   #4,D4
  1529. ran1:           move.l  D7,D6
  1530.                 lsl.l   #3,D7
  1531.                 sub.l   D6,D7
  1532.                 dbra    D4,ran1
  1533.                 add.l   D5,D7
  1534.                 bpl.s   exran1
  1535.                 add.l   #2147483647,D7
  1536. exran1:         move.l  D7,D0
  1537.                 move.l  D0,oldrandom
  1538.                 movem.l (A7)+,D1-D7
  1539.                 rts
  1540. oldrandom:      DC.L 0
  1541. div:            add.l   D6,D6
  1542.                 moveq   #0,D4
  1543.                 moveq   #14,D3
  1544.                 move.w  D6,D5
  1545.                 swap    D6
  1546.                 and.l   #$ffff,D6
  1547. div1:           add.w   D4,D4
  1548.                 add.w   D5,D5
  1549.                 addx.l  D6,D6
  1550.                 cmp.l   D2,D6
  1551.                 bmi.s   div2
  1552.                 sub.l   D2,D6
  1553.                 addq.w  #1,D4
  1554. div2:           dbra    D3,div1
  1555.                 rts
  1556.  
  1557. tilevergleich:
  1558. ; vergleicht die zwei Tiles und gibt in d7 zurück ob es geht.
  1559. ; (Blumen-Blumen, Jahreszeiten-Jahreszeiten)
  1560. ; d2,d3=Werte
  1561. ; d7=0 -> geht, d7<>0 geht nicht
  1562.  
  1563.                 clr.w   blumjzverz2
  1564.                 cmp.b   D2,D3
  1565.                 bne.s   nichtgleich          ; ungleich!
  1566.                 cmp.b   #35,D2
  1567.                 blt.s   noverzan
  1568.                 cmp.b   #42,D2
  1569.                 bgt.s   noverzan
  1570.                 move.w  #4,blumjzverz2       ; Verz. einschalten
  1571. noverzan:       moveq   #0,D7
  1572.                 rts
  1573. nichtgleich:    cmp.b   #35,D2               ; Jahreszeit?
  1574.                 blt.s   tileungleich         ; < -> ungleich
  1575.                 cmp.b   #38,D2
  1576.                 bgt.s   keinejahresz         ; keine Jahreszeit
  1577.                 cmp.b   #35,D3               ; anderes Tile?
  1578.                 blt.s   tileungleich
  1579.                 cmp.b   #38,D3
  1580.                 bgt.s   tileungleich         ; geht nicht!
  1581.                 moveq   #0,D7                ; war Jahreszeit!
  1582.                 move.w  #4,blumjzverz2
  1583.                 rts
  1584. keinejahresz:   cmp.b   #42,D2               ; größer als Blume?
  1585.                 bgt.s   tileungleich         ; ist verschieden!
  1586.                 cmp.b   #42,D3
  1587.                 bgt.s   tileungleich
  1588.                 cmp.b   #39,D3
  1589.                 blt.s   tileungleich
  1590.                 moveq   #0,D7
  1591.                 move.w  #4,blumjzverz2
  1592.                 rts
  1593. tileungleich:   moveq   #-1,D7               ; geht nicht!
  1594.                 rts
  1595.  
  1596. draw_tile2:
  1597. ; diese Routine zeichnet ein Steinchen an Pos. X und Y
  1598. ; diese Koordinaten bezeichnen das Bytefeld "Matchitbuff".
  1599. ; diese Routine holt auch den entsprechenden Wert aus der
  1600. ; Tabelle.
  1601. ; mit Schatten!
  1602. ;
  1603. ; Übergabe:
  1604. ; ---------
  1605. ; d0 = x
  1606. ; d1 = y
  1607. ; a0 = Screenadresse
  1608.  
  1609.                 movem.l D0-A2,-(A7)
  1610.                 moveq   #0,D2
  1611.                 moveq   #0,D3
  1612.                 move.w  D1,D2                ; Y nach d2
  1613.                 mulu    #18,D2               ; mal Breite
  1614.                 add.w   D0,D2                ; + X
  1615.                 lea     matchitbuff,A1       ; Spielfeld
  1616.                 move.b  0(A1,D2.w),D3        ; Wert holen
  1617.                 tst.b   D3
  1618.                 beq     nixfrei              ; Leerfeld!
  1619.                 move.w  D2,-(A7)
  1620.                 subq.w  #1,D3                ; -1 wegen Stein 1=0
  1621.                 lea     tilesgrafik(PC),A1   ; dort ist die Grafik
  1622.                 mulu    #20*8,D3             ; so groß ist ein Tile
  1623.                 adda.l  D3,A1                ; auf Adresse addieren
  1624.                 lsl.w   #3,D0                ; X mal 8
  1625.                 addq.w  #8,D0                ; X + 8 wegen Startfeld
  1626.                 and.l   #$ffff,D1            ; Y nur Lowword
  1627.                 mulu    #20*160,D1           ; mal einer "Zeile"
  1628.                 add.w   #ystartline*160,D1   ; ab dort beginnen Tiles
  1629.                 add.w   D0,D1
  1630.                 adda.l  D1,A0                ; auf Screen addieren
  1631.                 move.l  A0,-(A7)
  1632.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1633.                 move.l  D0,(A0)              ; auf Screen speichern
  1634.                 move.l  D1,4(A0)
  1635.                 move.l  D2,160(A0)
  1636.                 move.l  D3,164(A0)
  1637.                 move.l  D4,320(A0)
  1638.                 move.l  D5,324(A0)
  1639.                 move.l  D6,480(A0)
  1640.                 move.l  D7,484(A0)
  1641.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1642.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1643.                 move.l  D0,(A0)              ; auf Screen speichern
  1644.                 move.l  D1,4(A0)
  1645.                 move.l  D2,160(A0)
  1646.                 move.l  D3,164(A0)
  1647.                 move.l  D4,320(A0)
  1648.                 move.l  D5,324(A0)
  1649.                 move.l  D6,480(A0)
  1650.                 move.l  D7,484(A0)
  1651.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1652.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1653.                 move.l  D0,(A0)              ; auf Screen speichern
  1654.                 move.l  D1,4(A0)
  1655.                 move.l  D2,160(A0)
  1656.                 move.l  D3,164(A0)
  1657.                 move.l  D4,320(A0)
  1658.                 move.l  D5,324(A0)
  1659.                 move.l  D6,480(A0)
  1660.                 move.l  D7,484(A0)
  1661.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1662.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1663.                 move.l  D0,(A0)              ; auf Screen speichern
  1664.                 move.l  D1,4(A0)
  1665.                 move.l  D2,160(A0)
  1666.                 move.l  D3,164(A0)
  1667.                 move.l  D4,320(A0)
  1668.                 move.l  D5,324(A0)
  1669.                 move.l  D6,480(A0)
  1670.                 move.l  D7,484(A0)
  1671.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1672.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1673.                 move.l  D0,(A0)              ; auf Screen speichern
  1674.                 move.l  D1,4(A0)
  1675.                 move.l  D2,160(A0)
  1676.                 move.l  D3,164(A0)
  1677.                 move.l  D4,320(A0)
  1678.                 move.l  D5,324(A0)
  1679.                 move.l  D6,480(A0)
  1680.                 move.l  D7,484(A0)
  1681.  
  1682.                 movea.l (A7)+,A1
  1683.                 move.w  (A7)+,D2
  1684.                 lea     matchitbuff,A0
  1685.                 tst.b   1(A0,D2.w)           ; Tile rechts frei?
  1686.                 beq.s   rechtsfrei           ; Ja->Schatten
  1687.                 tst.b   18(A0,D2.w)          ; Tile unten frei?
  1688.                 bne.s   nixfrei
  1689. rechtsfrei:     lea     schatten(PC),A0
  1690.                 lea     schattenmaske(PC),A2
  1691.                 moveq   #$15,D0              ; 22 Zeilen
  1692. drawshadow:     movem.l (A0)+,D1-D4
  1693.                 move.w  (A2)+,D5             ; Maske
  1694.                 not.w   D5
  1695.                 and.w   D5,(A1)
  1696.                 and.w   D5,2(A1)
  1697.                 and.w   D5,4(A1)
  1698.                 and.w   D5,6(A1)
  1699.                 move.w  (A2)+,D5
  1700.                 not.w   D5
  1701.                 and.w   D5,8(A1)
  1702.                 and.w   D5,10(A1)
  1703.                 and.w   D5,12(A1)
  1704.                 and.w   D5,14(A1)
  1705.                 or.l    D1,(A1)+
  1706.                 or.l    D2,(A1)+
  1707.                 or.l    D3,(A1)+
  1708.                 or.l    D4,(A1)+
  1709.                 lea     144(A1),A1
  1710.                 dbra    D0,drawshadow
  1711. nixfrei:        movem.l (A7)+,D0-A2
  1712.                 rts
  1713.  
  1714.  
  1715. hexdez:
  1716. ; in d0=Wort
  1717. ; wandelt in Dezimal um
  1718. ; Ergebnis steht rechtsbündig in hexdezbuff
  1719.  
  1720.                 move.l  A0,-(A7)
  1721.  
  1722.                 move.l  #'0000',hexdezbuff   ; mit Null vorinitialisieren
  1723.                 move.w  #'00',hexdezbuff+4
  1724.  
  1725.                 lea     hexdezbuff+6,A0
  1726. makedezloop:    moveq   #0,D1
  1727.                 move.w  D0,D1
  1728.                 divu    #10,D1
  1729.                 swap    D1
  1730.                 add.b   #'0',D1
  1731.                 move.b  D1,-(A0)
  1732.                 swap    D1
  1733.                 move.w  D1,D0
  1734.                 cmp.w   #10,D0
  1735.                 bge.s   makedezloop
  1736.                 add.b   #'0',D0
  1737.                 move.b  D0,-(A0)
  1738.                 movea.l (A7)+,A0
  1739.                 rts
  1740.  
  1741. nullfix:
  1742. ; a0=Textpointer (erste Zahl)
  1743. ; d0=Länge (maximal)
  1744. ; Rückgabe: a0=neuer Pointer, d0=neue Länge
  1745.  
  1746.                 cmpi.b  #'0',(A0)            ; führende Nullen raushauen
  1747.                 bne.s   gibtwertraus
  1748.                 lea     1(A0),A0
  1749.                 subq.w  #1,D0                ; Anzahl -1
  1750.                 bne.s   nullfix
  1751.                 moveq   #1,D0                ; wenn Zeit=0 dann nur 1 Null
  1752.                 lea     hexdezbuff+5,A0
  1753. gibtwertraus:   rts
  1754.  
  1755.  
  1756. draw_time:
  1757. ; zeichnet die Zeit (3stellig) auf Screen1
  1758.  
  1759.                 movem.w hexdezbuff,D0-D2     ; 3 Worte
  1760.                 movem.w D0-D2,hexdezbuff2    ; retten
  1761.  
  1762.                 moveq   #0,D0
  1763.                 move.w  time,D0
  1764.                 bsr     hexdez               ; Zeit in Hex umwandeln
  1765.  
  1766.                 lea     obenplatte+80,A0     ; Retten
  1767.                 movea.l screen1(PC),A1
  1768.                 lea     80(A1),A1
  1769.                 moveq   #15,D1               ; 16 Scanlines
  1770. restoreoben:    movem.l (A0),D2-D7           ; 6 Longs
  1771.                 movem.l D2-D7,(A1)
  1772.                 lea     160(A0),A0
  1773.                 lea     160(A1),A1
  1774.                 dbra    D1,restoreoben
  1775.  
  1776.                 lea     hexdezbuff+3,A0      ; ab dort sehen
  1777.                 moveq   #3,D0                ; 3 Zeichen maximal
  1778.                 bsr     nullfix              ; führende Nullen weg
  1779.  
  1780.                 movea.l screen1(PC),A1
  1781.                 moveq   #10,D1
  1782.                 moveq   #1,D2
  1783.                 bsr     textaus
  1784.  
  1785.                 movem.w hexdezbuff2,D0-D2    ; 3 Worte
  1786.                 movem.w D0-D2,hexdezbuff     ; zurück retten
  1787.  
  1788.                 rts
  1789.  
  1790.  
  1791. draw_score:
  1792. ; zeichnet den Score (4stellig) auf Screen1
  1793. ; a1=Screenpointer
  1794.  
  1795.                 moveq   #0,D0
  1796.                 move.w  score,D0
  1797.                 bsr     hexdez               ; Zeit in Hex umwandeln
  1798.  
  1799.                 lea     obenplatte+24,A0     ; Retten
  1800.                 movea.l A1,A3                ; Screen
  1801.                 lea     24(A3),A3
  1802.                 moveq   #15,D1               ; 16 Scanlines
  1803. restoreoben2:   movem.l (A0),D2-D7/A2/A4-A6  ; 10 Longs
  1804.                 movem.l D2-D7/A2/A4-A6,(A3)
  1805.                 lea     160(A0),A0
  1806.                 lea     160(A3),A3
  1807.                 dbra    D1,restoreoben2
  1808.  
  1809.                 lea     hexdezbuff+1,A0      ; ab dort sehen
  1810.                 moveq   #5,D0                ; 3 Zeichen maximal
  1811.                 bsr     nullfix              ; führende Nullen weg
  1812.  
  1813.                 moveq   #3,D1
  1814.                 moveq   #1,D2
  1815.                 bsr     textaus
  1816.                 rts
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822. draw_tile:
  1823. ; diese Routine zeichnet ein Steinchen an Pos. X und Y
  1824. ; diese Koordinaten bezeichnen das Bytefeld "Matchitbuff".
  1825. ; diese Routine holt auch den entsprechenden Wert aus der
  1826. ; Tabelle.
  1827. ; ohne Schatten!
  1828. ;
  1829. ; Übergabe:
  1830. ; ---------
  1831. ; d0 = x
  1832. ; d1 = y
  1833. ; a0 = Screenadresse
  1834.  
  1835.                 movem.l D0-A2,-(A7)
  1836.                 moveq   #0,D2
  1837.                 moveq   #0,D3
  1838.                 move.w  D1,D2                ; Y nach d2
  1839.                 mulu    #18,D2               ; mal Breite
  1840.                 add.w   D0,D2                ; + X
  1841.                 lea     matchitbuff,A1       ; Spielfeld
  1842.                 move.b  0(A1,D2.w),D3        ; Wert holen
  1843.                 tst.b   D3
  1844.                 beq     nixfrei2             ; Leerfeld!
  1845.                 subq.w  #1,D3                ; -1 wegen Stein 1=0
  1846.                 lea     tilesgrafik(PC),A1   ; dort ist die Grafik
  1847.                 mulu    #20*8,D3             ; so groß ist ein Tile
  1848.                 adda.l  D3,A1                ; auf Adresse addieren
  1849.                 lsl.w   #3,D0                ; X mal 8
  1850.                 addq.w  #8,D0                ; X + 8 wegen Startfeld
  1851.                 and.l   #$ffff,D1            ; Y nur Lowword
  1852.                 mulu    #20*160,D1           ; mal einer "Zeile"
  1853.                 add.w   #ystartline*160,D1   ; ab dort beginnen Tiles
  1854.                 add.w   D0,D1
  1855.                 adda.l  D1,A0                ; auf Screen addieren
  1856.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1857.                 move.l  D0,(A0)              ; auf Screen speichern
  1858.                 move.l  D1,4(A0)
  1859.                 move.l  D2,160(A0)
  1860.                 move.l  D3,164(A0)
  1861.                 move.l  D4,320(A0)
  1862.                 move.l  D5,324(A0)
  1863.                 move.l  D6,480(A0)
  1864.                 move.l  D7,484(A0)
  1865.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1866.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1867.                 move.l  D0,(A0)              ; auf Screen speichern
  1868.                 move.l  D1,4(A0)
  1869.                 move.l  D2,160(A0)
  1870.                 move.l  D3,164(A0)
  1871.                 move.l  D4,320(A0)
  1872.                 move.l  D5,324(A0)
  1873.                 move.l  D6,480(A0)
  1874.                 move.l  D7,484(A0)
  1875.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1876.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1877.                 move.l  D0,(A0)              ; auf Screen speichern
  1878.                 move.l  D1,4(A0)
  1879.                 move.l  D2,160(A0)
  1880.                 move.l  D3,164(A0)
  1881.                 move.l  D4,320(A0)
  1882.                 move.l  D5,324(A0)
  1883.                 move.l  D6,480(A0)
  1884.                 move.l  D7,484(A0)
  1885.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1886.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1887.                 move.l  D0,(A0)              ; auf Screen speichern
  1888.                 move.l  D1,4(A0)
  1889.                 move.l  D2,160(A0)
  1890.                 move.l  D3,164(A0)
  1891.                 move.l  D4,320(A0)
  1892.                 move.l  D5,324(A0)
  1893.                 move.l  D6,480(A0)
  1894.                 move.l  D7,484(A0)
  1895.                 lea     640(A0),A0           ; 4 Zeilen tiefer
  1896.                 movem.l (A1)+,D0-D7          ; 8 Longs (=4 Zeilen)
  1897.                 move.l  D0,(A0)              ; auf Screen speichern
  1898.                 move.l  D1,4(A0)
  1899.                 move.l  D2,160(A0)
  1900.                 move.l  D3,164(A0)
  1901.                 move.l  D4,320(A0)
  1902.                 move.l  D5,324(A0)
  1903.                 move.l  D6,480(A0)
  1904.                 move.l  D7,484(A0)
  1905. nixfrei2:       movem.l (A7)+,D0-A2
  1906.                 rts
  1907.  
  1908.  
  1909. clear_tile:
  1910. ; diese Routine löscht zwei Steinchen an Pos. X und Y
  1911. ; mehrere Möglichkeiten, das Tile zu verschwinden lassen
  1912. ; diese Koordinaten bezeichnen das Bytefeld "Matchitbuff".
  1913. ; kopiert Eisplatte an die Stelle
  1914. ; löscht auch in Tabelle
  1915. ;
  1916. ; Übergabe:
  1917. ; ---------
  1918. ; d0 = x1
  1919. ; d1 = y1
  1920. ; d2 = x2
  1921. ; d3 = y2
  1922. ; a0 = Screenadresse
  1923.  
  1924.                 and.l   #$ffff,D0
  1925.                 and.l   #$ffff,D1
  1926.                 and.l   #$ffff,D2
  1927.                 and.l   #$ffff,D3
  1928.                 movea.l A0,A3
  1929.                 bsr.s   makeparasforclear
  1930.                 movem.l A0-A2,regs1          ; Register für Stein 1
  1931.                 move.l  D2,D0
  1932.                 move.l  D3,D1
  1933.                 movea.l A3,A0                ; Screen
  1934.                 bsr.s   makeparasforclear    ; Regsiter für Stein 2
  1935.                 movem.l A0-A2,regs2
  1936.  
  1937.                 lea     removeani1(PC),A6
  1938.                 moveq   #14,D7               ; 15 Animationsstufen
  1939. clearloop:      movea.l A6,A3
  1940.                 movem.l regs1,A0-A2
  1941.                 bsr     clearrout1
  1942.                 movea.l A6,A3
  1943.                 movem.l regs2,A0-A2
  1944.                 bsr.s   clearrout1
  1945.                 movea.l A3,A6
  1946.                 bsr     vsync
  1947.                 dbra    D7,clearloop
  1948.                 rts
  1949.  
  1950.  
  1951. makeparasforclear:
  1952. ; erstellt Register für Clear-Routine
  1953.                 moveq   #0,D4
  1954.                 move.w  D1,D4                ; Y nach d2
  1955.                 mulu    #18,D4               ; mal Breite
  1956.                 add.w   D0,D4                ; + X
  1957.                 lea     matchitbuff,A1
  1958.                 moveq   #0,D5
  1959.                 move.b  0(A1,D4.w),D5        ; Wert holen
  1960.                 subq.b  #1,D5
  1961.                 clr.b   0(A1,D4.w)           ; Tile löschen
  1962.                 move.w  #95,D6               ; 96 Tiles
  1963.                 lea     posbuff,A1
  1964. searchinposbuff:cmp.b   (A1),D4              ; in Posbuff löschen
  1965.                 bne.s   notthereinpos
  1966.                 clr.b   (A1)                 ; löschen
  1967.                 bra.s   readyinpos
  1968. notthereinpos:  lea     1(A1),A1
  1969.                 dbra    D6,searchinposbuff
  1970. readyinpos:     lea     eisplatte,A1         ; Eisplatte holen
  1971.                 lsl.w   #3,D0                ; X mal 8
  1972.                 addq.w  #8,D0                ; X + 8 wegen Startfeld
  1973.                 adda.l  D0,A1                ; auf Eisplatte addieren
  1974.                 and.l   #$ffff,D1            ; Y nur Lowword
  1975.                 mulu    #20*160,D1           ; mal einer "Zeile"
  1976.                 adda.l  D1,A1                ; auf Eisplatte
  1977.                 adda.l  #(eisrand-1)*160,A1  ; ab dort Steinchen
  1978.  
  1979.                 add.l   #ystartline*160,D1   ; ab dort beginnen Tiles
  1980.                 add.l   D0,D1
  1981.                 adda.l  D1,A0                ; auf Screen addieren
  1982.                 lea     tilesgrafik(PC),A2
  1983.                 mulu    #160,D5              ; Nummer des Tiles*160
  1984.                 adda.l  D5,A2
  1985.                 rts
  1986.  
  1987.  
  1988. clearrout1:
  1989. ; erste Löschroutine
  1990. ; in a0=Screenadresse
  1991. ; in a1=Eisplatte
  1992. ;    a2=altes Tile
  1993.  
  1994.                 moveq   #19,D0               ; 20 Zeilen
  1995.                 movea.l A0,A4                ; Screen
  1996.                 movea.l A1,A5                ; Eisplatte
  1997. clearr1l1:      move.l  (A5)+,(A4)+          ; Eisplatte kopieren
  1998.                 move.l  (A5)+,(A4)+
  1999.                 lea     152(A5),A5
  2000.                 lea     152(A4),A4
  2001.                 dbra    D0,clearr1l1
  2002.  
  2003.                 movea.l A0,A4                ; Screen
  2004.                 movea.l A2,A5                ; Tile
  2005.                 moveq   #19,D0               ; 20 Zeilen
  2006. clearr1l2:      move.w  (A3)+,D1             ; Maske holen
  2007.                 move.w  (A5)+,D2
  2008.                 and.w   D1,D2
  2009.                 move.w  (A5)+,D3
  2010.                 and.w   D1,D3
  2011.                 move.w  (A5)+,D4
  2012.                 and.w   D1,D4
  2013.                 move.w  (A5)+,D5
  2014.                 and.w   D1,D5
  2015.                 move.w  D2,D6                ; Maske bilden
  2016.                 or.w    D3,D6
  2017.                 or.w    D4,D6
  2018.                 or.w    D5,D6
  2019.                 not.w   D6
  2020.                 and.w   D6,(A4)
  2021.                 or.w    D2,(A4)+
  2022.                 and.w   D6,(A4)
  2023.                 or.w    D3,(A4)+
  2024.                 and.w   D6,(A4)
  2025.                 or.w    D4,(A4)+
  2026.                 and.w   D6,(A4)
  2027.                 or.w    D5,(A4)+
  2028.                 lea     152(A4),A4
  2029.                 dbra    D0,clearr1l2
  2030.                 rts
  2031.  
  2032. draw_screen:
  2033. ; baut Spielbildschirm auf
  2034. ; mit Platte
  2035.  
  2036.                 lea     obenplatte(PC),A0
  2037.                 movea.l screen2(PC),A1
  2038.                 move.w  #(16*40)-1,D0
  2039. copyobenplatte: move.l  (A0)+,(A1)+
  2040.                 dbra    D0,copyobenplatte
  2041.  
  2042.  
  2043.                 movea.l screen2(PC),A1
  2044.                 lea     17*160(A1),A1        ; ab Zeile 16
  2045.                 lea     eisplatte,A0
  2046.                 move.w  #(181*40)-1,D0
  2047. copyeisplatte:  move.l  (A0)+,(A1)+
  2048.                 dbra    D0,copyeisplatte
  2049.  
  2050.                 moveq   #1,D0                ; X-Start-Pos.
  2051. dsl0:           moveq   #1,D1                ; Y-Start-Pos.
  2052. dsl1:           movea.l screen2(PC),A0
  2053.                 move.l  D0,-(A7)
  2054.                 move.l  D1,-(A7)
  2055.                 bsr     draw_tile2
  2056.                 move.l  (A7)+,D1
  2057.                 move.l  (A7)+,D0
  2058.                 addq.w  #1,D1                ; Y+1
  2059.                 cmp.w   #7,D1
  2060.                 bne.s   dsl1
  2061.                 addq.w  #1,D0
  2062.                 cmp.w   #17,D0
  2063.                 bne.s   dsl0
  2064.  
  2065.  
  2066.                 movea.l screen2(PC),A1
  2067.                 bsr     draw_score
  2068.  
  2069.                 movea.l screen2(PC),A1
  2070.                 bsr     draw_helps
  2071.  
  2072.                 rts
  2073.  
  2074.  
  2075.  
  2076. draw_kasten:
  2077. ; knüpft Kasten ein (bei Helpfunktion)
  2078. ; d0,d1=X,Y
  2079.                 movem.l D0-A1,-(A7)
  2080.                 lea     kasten(PC),A0
  2081.                 movea.l screen1(PC),A1
  2082.                 lsl.w   #3,D0                ; X mal 8
  2083.                 addq.w  #8,D0                ; X + 8 wegen Startfeld
  2084.                 and.l   #$ffff,D1            ; Y nur Lowword
  2085.                 mulu    #20*160,D1           ; mal einer "Zeile"
  2086.                 add.w   #ystartline*160,D1   ; ab dort beginnen Tiles
  2087.                 add.w   D0,D1
  2088.                 adda.l  D1,A1                ; auf Screen addieren
  2089.                 moveq   #19,D0
  2090. dkl0:           move.w  (A0)+,D1             ; Werte holen
  2091.                 move.w  (A0)+,D2
  2092.                 move.w  (A0)+,D3
  2093.                 move.w  (A0)+,D4
  2094.                 moveq   #0,D5                ; Maske bilden
  2095.                 move.w  D1,D5
  2096.                 or.w    D2,D5
  2097.                 or.w    D3,D5
  2098.                 or.w    D4,D5
  2099.                 not.w   D5
  2100.                 and.w   D5,(A1)
  2101.                 or.w    D1,(A1)+
  2102.                 and.w   D5,(A1)
  2103.                 or.w    D2,(A1)+
  2104.                 and.w   D5,(A1)
  2105.                 or.w    D3,(A1)+
  2106.                 and.w   D5,(A1)
  2107.                 or.w    D4,(A1)+
  2108.                 lea     152(A1),A1
  2109.                 dbra    D0,dkl0
  2110.                 movem.l (A7)+,D0-A1
  2111.                 rts
  2112.  
  2113.  
  2114. new_mouse:      movem.l D0-D1/A0,-(A7)
  2115.                 lea     keybuffer,A0
  2116.                 move.b  (A0)+,D0
  2117.                 cmp.b   #$f8,D0              ; Testen ob Mauspaket
  2118.                 bcs.s   nomousepak
  2119.                 cmp.b   #$fc,D0
  2120.                 bcc.s   nomousepak
  2121.  
  2122.                 move.b  D0,mousek            ; Taste
  2123.  
  2124.                 move.b  (A0)+,D0             ; Deltax
  2125.                 move.b  (A0)+,D1             ; Deltay
  2126.                 ext.w   D0
  2127.                 ext.w   D1
  2128.                 tst.w   D0
  2129.                 bne.s   nix_x_m
  2130.                 tst.w   D1
  2131.                 bne.s   nix_x_m
  2132.                 bra.s   nix_x_m1
  2133. nix_x_m:        clr.w   mousek               ; falls Maus bewegt und Taste->nix T.
  2134. nix_x_m1:       add.w   D0,mousex
  2135.                 add.w   D1,mousey
  2136.                 cmpi.w  #281,mousex
  2137.                 blt.s   nixxzgr
  2138.                 move.w  #281,mousex
  2139. nixxzgr:        cmpi.w  #28,mousex
  2140.                 bgt.s   nixxzkl
  2141.                 move.w  #28,mousex
  2142. nixxzkl:        cmpi.w  #ystartline+20-6,mousey
  2143.                 bgt.s   nixyzkl
  2144.                 move.w  #ystartline+20-6,mousey
  2145. nixyzkl:        cmpi.w  #ystartline+140-7,mousey
  2146.                 blt.s   nomousepak
  2147.                 move.w  #ystartline+140-7,mousey
  2148. nomousepak:     movem.l (A7)+,D0-D1/A0
  2149.                 rts
  2150.  
  2151. restmouse:
  2152. ; Maus restaurieren
  2153.                 movem.l D0-D4/A0-A1,-(A7)
  2154.                 lea     rettbuff,A0
  2155.                 movea.l (A0)+,A1             ; Screenwert
  2156.                 cmpa.l  #0,A1
  2157.                 beq.s   nichtrest            ; nicht restaur.
  2158.                 moveq   #12,D0               ; 13 Zeilen
  2159. reml0:          movem.l (A0)+,D1-D4          ; 4 Longs
  2160.                 movem.l D1-D4,(A1)
  2161.                 lea     160(A1),A1
  2162.                 dbra    D0,reml0
  2163. nichtrest:      movem.l (A7)+,D0-D4/A0-A1
  2164.                 rts
  2165.  
  2166.  
  2167. putmouse:
  2168. ; Maus zeichnen
  2169.                 movem.l D0-A6,-(A7)
  2170.                 moveq   #0,D0
  2171.                 moveq   #0,D1
  2172.                 move.w  mousex,D0            ; Koord. holen
  2173.                 move.w  mousey,D1
  2174.                 move.w  D0,D4
  2175.                 ror.l   #4,D0                ; x/16
  2176.                 rol.w   #3,D0                ; x*8
  2177.                 movea.l screen1(PC),A1
  2178.                 move.w  D1,D2
  2179.                 mulu    #160,D1
  2180.                 adda.w  D0,A1
  2181.                 adda.w  D1,A1                ; Screenpos
  2182.                 clr.w   D0
  2183.                 rol.l   #4,D0                ; Rest -> Schiebwert
  2184.                 movea.l mousepointer,A0      ; Grafik der Maus (13 hoch)
  2185.                 lea     rettbuff,A2
  2186.                 moveq   #12,D1               ; 13 Zeilen
  2187.                 move.l  A1,(A2)+             ; Screen in Buff
  2188. pml0:           moveq   #0,D2                ; Shapewert 0
  2189.                 movem.l (A1),D4-D7           ; in Buffer retten
  2190.                 movem.l D4-D7,(A2)
  2191.                 lea     16(A2),A2
  2192.                 moveq   #0,D2
  2193.                 move.w  (A0)+,D2             ; 1 Wort holen
  2194.                 ror.l   D0,D2                ; Shiften
  2195.                 moveq   #0,D3
  2196.                 move.w  (A0)+,D3             ; 1 Wort holen
  2197.                 ror.l   D0,D3                ; Shiften
  2198.                 moveq   #0,D4
  2199.                 move.w  (A0)+,D4             ; 1 Wort holen
  2200.                 ror.l   D0,D4                ; Shiften
  2201.                 moveq   #0,D5
  2202.                 move.w  (A0)+,D5             ; 1 Wort holen
  2203.                 ror.l   D0,D5                ; Shiften
  2204.                 move.l  D2,D6                ; Maske bilden
  2205.                 or.l    D3,D6
  2206.                 or.l    D4,D6
  2207.                 or.l    D5,D6
  2208.                 not.l   D6
  2209.                 and.w   D6,(A1)
  2210.                 or.w    D2,(A1)+
  2211.                 and.w   D6,(A1)
  2212.                 or.w    D3,(A1)+
  2213.                 and.w   D6,(A1)
  2214.                 or.w    D4,(A1)+
  2215.                 and.w   D6,(A1)
  2216.                 or.w    D5,(A1)+
  2217.                 swap    D2
  2218.                 swap    D3
  2219.                 swap    D4
  2220.                 swap    D5
  2221.                 swap    D6
  2222.                 and.w   D6,(A1)
  2223.                 or.w    D2,(A1)+
  2224.                 and.w   D6,(A1)
  2225.                 or.w    D3,(A1)+
  2226.                 and.w   D6,(A1)
  2227.                 or.w    D4,(A1)+
  2228.                 and.w   D6,(A1)
  2229.                 or.w    D5,(A1)+
  2230.                 lea     144(A1),A1           ; eine Zeile tiefer
  2231.                 dbra    D1,pml0
  2232.                 movem.l (A7)+,D0-A6
  2233.                 rts
  2234.  
  2235.  
  2236. textaus:
  2237. ; gibt Text aus (knüpft ein)
  2238. ; a0=Textpointer
  2239. ; a1=Screenpointer
  2240. ; d0=Länge in Bytes     hört aber auch bei 0 als ASCII auf
  2241. ; d1=X (0-19)
  2242. ; d2=Y (0-199)
  2243.                 movem.l D0-D6/A0-A4,-(A7)
  2244.                 subq.w  #1,D0                ; -1 wegen DBRA
  2245.                 bmi.s   textausende
  2246.  
  2247.                 mulu    #160,D2              ; y
  2248.                 lsl.w   #3,D1                ; x
  2249.                 adda.w  D1,A1
  2250.                 adda.l  D2,A1                ; Screen aufaddieren
  2251.                 lea     fonttabelle,A2
  2252. textausloop:    moveq   #0,D1
  2253.                 move.b  (A0)+,D1
  2254.                 beq.s   textausende          ; 0 bekommen -> Textende
  2255.                 add.w   D1,D1                ; *2 wegen Worttabelle
  2256.                 move.w  0(A2,D1.w),D1        ; Offset auf Font holen
  2257.                 lea     fontbuff,A3
  2258.                 adda.w  D1,A3                ; Offset aufaddieren
  2259.                 movea.l A1,A4
  2260.                 moveq   #14,D1               ; 15 Scanlines
  2261. knuepfcharloop: movem.w (A3)+,D2-D6          ; 1 Wort Maske, 4 Worte Daten
  2262.                 and.w   D2,(A4)
  2263.                 or.w    D3,(A4)+
  2264.                 and.w   D2,(A4)
  2265.                 or.w    D4,(A4)+
  2266.                 and.w   D2,(A4)
  2267.                 or.w    D5,(A4)+
  2268.                 and.w   D2,(A4)
  2269.                 or.w    D6,(A4)+
  2270.                 lea     152(A4),A4           ; eine Scanline tiefer
  2271.                 dbra    D1,knuepfcharloop
  2272.                 lea     8(A1),A1             ; 16 Pixel weiter
  2273.                 dbra    D0,textausloop
  2274. textausende:    movem.l (A7)+,D0-D6/A0-A4
  2275.                 rts
  2276.  
  2277. textaus2:
  2278. ; gibt Text aus
  2279. ; a0=Textpointer
  2280. ; a1=Screenpointer
  2281. ; d0=Länge in Bytes     hört aber auch bei 0 als ASCII auf
  2282. ; d1=X (0-19)
  2283. ; d2=Y (0-199)
  2284.                 movem.l D0-D6/A0-A4,-(A7)
  2285.                 subq.w  #1,D0                ; -1 wegen DBRA
  2286.                 bmi.s   textausende2
  2287.  
  2288.                 mulu    #160,D2              ; y
  2289.                 lsl.w   #3,D1                ; x
  2290.                 adda.w  D1,A1
  2291.                 adda.l  D2,A1                ; Screen aufaddieren
  2292.                 lea     fonttabelle,A2
  2293. textausloop2:   moveq   #0,D1
  2294.                 move.b  (A0)+,D1
  2295.                 beq.s   textausende2         ; 0 bekommen -> Textende
  2296.                 add.w   D1,D1                ; *2 wegen Worttabelle
  2297.                 move.w  0(A2,D1.w),D1        ; Offset auf Font holen
  2298.                 lea     fontbuff,A3
  2299.                 adda.w  D1,A3                ; Offset aufaddieren
  2300.                 movea.l A1,A4
  2301.                 moveq   #14,D1               ; 15 Scanlines
  2302. knuepfcharloop2:movem.w (A3)+,D2-D6          ; 1 Wort Maske, 4 Worte Daten
  2303.                 movem.w D3-D6,(A4)
  2304.                 lea     160(A4),A4           ; eine Scanline tiefer
  2305.                 dbra    D1,knuepfcharloop2
  2306.                 lea     8(A1),A1             ; 16 Pixel weiter
  2307.                 dbra    D0,textausloop2
  2308. textausende2:   movem.l (A7)+,D0-D6/A0-A4
  2309.                 rts
  2310.  
  2311.  
  2312. textaus3:
  2313. ; gibt Text aus (8er Font)
  2314. ; a0=Textpointer
  2315. ; a1=Screenpointer
  2316. ; d0=Länge in Bytes     hört aber auch bei 0 als ASCII auf
  2317. ; d1=X (0-39)
  2318. ; d2=Y (0-199)
  2319.                 movem.l D0-D6/A0-A4,-(A7)
  2320.                 subq.w  #1,D0                ; -1 wegen DBRA
  2321.                 bmi.s   textausende3
  2322.  
  2323.                 mulu    #160,D2              ; y
  2324.                 adda.l  D2,A1
  2325.  
  2326.                 move.w  D1,D2
  2327.                 moveq   #0,D2
  2328.                 lsr.w   #1,D1                ; x/2 = 0-19
  2329.                 lsl.w   #3,D1
  2330.                 adda.w  D1,A1
  2331.                 and.w   #1,D2
  2332.                 beq.s   nixadd1
  2333.                 addq.l  #1,A1
  2334.                 moveq   #1,D2
  2335.                 bra.s   textausloop3
  2336. nixadd1:        moveq   #7,D2
  2337.  
  2338. textausloop3:   moveq   #0,D1
  2339.                 move.b  (A0)+,D1
  2340.                 beq.s   textausende3         ; 0 bekommen -> Textende
  2341.                 move.w  D1,D3
  2342.                 lea     chars8,A2
  2343.                 and.w   #31,D3
  2344.                 adda.w  D3,A2
  2345.                 lsr.w   #5,D1
  2346.                 lsl.w   #8,D1
  2347.                 adda.w  D1,A2                ; Zeichen errechnet
  2348.                 move.b  (A2),(A1)
  2349.                 move.b  32(A2),160(A1)
  2350.                 move.b  64(A2),320(A1)
  2351.                 move.b  96(A2),480(A1)
  2352.                 move.b  128(A2),640(A1)
  2353.                 move.b  160(A2),800(A1)
  2354.                 move.b  192(A2),960(A1)
  2355.                 move.b  224(A2),1120(A1)
  2356.  
  2357.                 eori.w  #6,D2
  2358.                 adda.w  D2,A1                ; 1 oder 7 Bytes weiter
  2359.                 dbra    D0,textausloop3
  2360. textausende3:   movem.l (A7)+,D0-D6/A0-A4
  2361.                 rts
  2362.  
  2363. such_weg:
  2364. ; Routine, die eine Verbindungslinie von Tile 1 zu Tile 2 sucht.
  2365. ; Die Verbindungslinie darf nicht mehr als 2 Knicke haben.
  2366. ; Die Lösung des Problems ist iterativ und nicht rekursiv.
  2367. ; (Alles in einem 20*10 großen Bytefeld)
  2368. ;
  2369. ; Übergabewerte:
  2370. ; --------------
  2371. ; d0=x1,d1=y1,d2=x2,d3=y2
  2372. ; Rückgabewerte:
  2373. ; --------------
  2374. ; d0=0          -> geklappt
  2375. ; d0=-1         -> nicht geklappt
  2376. ; in der Tabelle Weg ist der Weg zu finden, wobei bedeutet:
  2377. ; 1=rechts, 2=links, 3=unten, 4=oben
  2378.  
  2379.                 movem.l D1-A6,-(A7)
  2380.  
  2381.                 lea     matchitbuff2,A0
  2382.                 move.w  #(20*10)-1,D4
  2383. fillhelpbuff:   move.b  #-1,(A0)+            ; mit -1 füllen
  2384.                 dbra    D4,fillhelpbuff
  2385.  
  2386.                 lea     matchitbuff,A0
  2387.                 lea     matchitbuff2+21,A1
  2388.                 moveq   #7,D4                ; 8 Zeilen
  2389. fillhelpl:      moveq   #17,D5               ; 18 Spalten
  2390. fillhelpl1:     move.b  (A0)+,(A1)+
  2391.                 dbra    D5,fillhelpl1        ; Feld reinkopieren
  2392.                 lea     2(A1),A1
  2393.                 dbra    D4,fillhelpl
  2394.  
  2395.  
  2396.                 mulu    #20,D1               ; Höhe * 20
  2397.                 add.w   #21,D1               ; wegen Rahmen
  2398.                 add.w   D0,D1                ; + Breite
  2399.                 lea     matchitbuff2,A5      ; Hilfsbuffer
  2400.                 lea     0(A5,D1.w),A5        ; Pointer auf Pos.Start
  2401.  
  2402.                 mulu    #20,D3               ; Höhe * 20
  2403.                 add.w   #21,D3               ; wegen Rahmen
  2404.                 add.w   D2,D3                ; + Breite
  2405.                 lea     matchitbuff2,A6      ; Hilfsbuffer
  2406.                 lea     0(A6,D3.w),A6        ; Pointer auf Pos. Ziel
  2407.  
  2408.                 lea     weg,A0
  2409.                 lea     wege,A1
  2410.  
  2411.                 moveq   #-1,D0               ; alte Richtung
  2412.                 moveq   #-1,D1               ; Knicke wegen Startknick
  2413.                 bsr.s   suchweg
  2414.  
  2415.                 moveq   #-1,D0               ; nix gefunden
  2416.                 cmpa.l  #wege,A1
  2417.                 beq.s   foundnoweg
  2418.                 moveq   #0,D0                ; gefunden
  2419.                 lea     wege,A2
  2420.                 move.l  #10000,D1            ; aktuelle Länge
  2421. countwegloop:   cmpa.l  A1,A2
  2422.                 bge.s   allesgesucht
  2423.                 movea.l A2,A3                ;aktuellen Weg merken
  2424.                 moveq   #0,D7
  2425. laenge:         tst.b   (A2)+
  2426.                 beq.s   endweg
  2427.                 addq.w  #1,D7
  2428.                 bra.s   laenge
  2429. endweg:         cmp.w   D1,D7
  2430.                 bge.s   countwegloop
  2431.                 move.w  D7,D1
  2432.                 movea.l A3,A4
  2433.                 bra.s   countwegloop
  2434. allesgesucht:   lea     weg,A0
  2435. copywegeinweg:  move.b  (A4)+,(A0)+
  2436.                 dbra    D1,copywegeinweg
  2437. foundnoweg:     movem.l (A7)+,D1-A6
  2438.                 rts
  2439.  
  2440. suchweg:        movem.l D0-D1/A5,-(A7)       ; Parameter retten
  2441.  
  2442.                 cmp.b   #2,D0
  2443.                 beq.s   linksrout            ; von links kommend?
  2444.                 cmp.b   #1,D0                ; wieder rechts?
  2445.                 beq.s   keinknickrechts
  2446.                 cmp.w   #2,D1                ; Anz. Knicke=2?
  2447.                 beq.s   linksrout
  2448.                 addq.w  #1,D1                ; Knicke +1
  2449.                 moveq   #1,D0                ; Richt. rechts
  2450. keinknickrechts:lea     1(A5),A5             ; Pos. +1
  2451.                 cmpa.l  A5,A6                ; Ziel erreicht?
  2452.                 bne.s   rechtskeinz
  2453.                 bsr     wegsave
  2454.                 bra     nixmoeglich          ; eins zurück
  2455. rechtskeinz:    tst.b   (A5)                 ; Feld frei?
  2456.                 bne.s   linksrout            ; dort Rand oder Tile
  2457.                 move.b  D0,(A0)+             ; Weg
  2458.                 bsr.s   suchweg
  2459.                 lea     -1(A0),A0
  2460. linksrout:      movem.l (A7),D0-D1/A5
  2461.                 cmp.b   #1,D0
  2462.                 beq.s   untenrout            ; von rechts kommend?
  2463.                 cmp.b   #2,D0                ; wieder links?
  2464.                 beq.s   keinknicklinks
  2465.                 cmp.w   #2,D1                ; Anz. Knicke=2?
  2466.                 beq.s   untenrout
  2467.                 addq.w  #1,D1                ; Knicke +1
  2468.                 moveq   #2,D0                ; Richt. links
  2469. keinknicklinks: lea     -1(A5),A5            ; Pos. -1
  2470.                 cmpa.l  A5,A6                ; Ziel erreicht?
  2471.                 bne.s   linkskeinz
  2472.                 bsr.s   wegsave
  2473.                 bra.s   nixmoeglich          ; eins zurück
  2474. linkskeinz:     tst.b   (A5)                 ; Feld frei?
  2475.                 bne.s   untenrout            ; dort Rand oder Tile
  2476.                 move.b  D0,(A0)+             ; Weg
  2477.                 bsr.s   suchweg
  2478.                 lea     -1(A0),A0
  2479. untenrout:      movem.l (A7),D0-D1/A5
  2480.                 cmp.b   #4,D0
  2481.                 beq.s   obenrout             ; von oben kommend?
  2482.                 cmp.b   #3,D0                ; wieder unten?
  2483.                 beq.s   keinknickunten
  2484.                 cmp.w   #2,D1                ; Anz. Knicke=2?
  2485.                 beq.s   obenrout
  2486.                 addq.w  #1,D1                ; Knicke +1
  2487.                 moveq   #3,D0                ; Richt. unten
  2488. keinknickunten: lea     20(A5),A5            ; ypos1. +1
  2489.                 cmpa.l  A5,A6                ; Ziel erreicht?
  2490.                 bne.s   untenkeinz
  2491.                 bsr.s   wegsave
  2492.                 bra.s   nixmoeglich          ; eins zurück
  2493. untenkeinz:     tst.b   (A5)                 ; Feld frei?
  2494.                 bne.s   obenrout             ; dort Rand oder Tile
  2495.                 move.b  D0,(A0)+             ; Weg
  2496.                 bsr     suchweg
  2497.                 lea     -1(A0),A0
  2498. obenrout:       movem.l (A7),D0-D1/A5
  2499.                 cmp.b   #3,D0
  2500.                 beq.s   nixmoeglich          ; von unten kommend?
  2501.                 cmp.b   #4,D0                ; wieder oben?
  2502.                 beq.s   keinknickoben
  2503.                 cmp.w   #2,D1                ; Anz. Knicke=2?
  2504.                 beq.s   nixmoeglich
  2505.                 addq.w  #1,D1                ; Knicke +1
  2506.                 moveq   #4,D0                ; Richt. unten
  2507. keinknickoben:  lea     -20(A5),A5           ; ypos1. -1
  2508.                 cmpa.l  A5,A6                ; Ziel erreicht?
  2509.                 bne.s   obenkeinz
  2510.                 bsr.s   wegsave
  2511.                 bra.s   nixmoeglich          ; eins zurück
  2512. obenkeinz:      tst.b   (A5)                 ; Feld frei?
  2513.                 bne.s   nixmoeglich          ; dort Rand oder Tile
  2514.                 move.b  D0,(A0)+             ; Weg
  2515.                 bsr     suchweg
  2516.                 lea     -1(A0),A0
  2517. nixmoeglich:    lea     12(A7),A7
  2518.                 rts
  2519.  
  2520. wegsave:        move.b  D0,(A0)+             ; letztes Wegstück
  2521.                 clr.b   (A0)
  2522.                 lea     weg,A2
  2523. copyweg:        move.b  (A2)+,(A1)+          ; Weg kopieren
  2524.                 bne.s   copyweg
  2525.                 lea     -1(A0),A0
  2526.                 rts
  2527.  
  2528. draw_weg:
  2529. ; zeichnet den Weg von Tile 1 zu Tile 2
  2530.  
  2531.                 move.w  tile1selektx,D0
  2532.                 move.w  tile1selekty,D1      ; beide Steine zeichnen
  2533.                 movea.l screen1(PC),A0
  2534.                 bsr     draw_tile
  2535.                 move.w  tile2selektx,D0
  2536.                 move.w  tile2selekty,D1
  2537.                 movea.l screen1(PC),A0
  2538.                 bsr     draw_tile
  2539.  
  2540.                 lea     weg,A0               ; dort liegt der Weg
  2541.                 move.w  tile1selektx,D0      ; Koord.
  2542.                 move.w  tile1selekty,D1
  2543.                 move.w  tile2selektx,D2
  2544.                 move.w  tile2selekty,D3
  2545. makeweg:        move.b  (A0)+,D4             ; Weg holen
  2546.                 cmp.b   #1,D4                ; rechts?
  2547.                 bne.s   wegnotrechts
  2548.                 moveq   #0,D7
  2549.                 addq.w  #1,D0                ; X+1
  2550.                 cmpi.b  #3,(A0)              ; nächstes Stück unten
  2551.                 bne.s   nixnextur
  2552.                 move.w  #4*160,D7
  2553.                 bra.s   wegweiter
  2554. nixnextur:      cmpi.b  #4,(A0)
  2555.                 bne.s   wegweiter
  2556.                 move.w  #3*160,D7
  2557.                 bra.s   wegweiter
  2558. wegnotrechts:   cmp.b   #3,D4                ; unten?
  2559.                 bne.s   wegnotunten
  2560.                 move.w  #160,D7
  2561.                 addq.w  #1,D1                ; Y+1
  2562.                 cmpi.b  #1,(A0)
  2563.                 bne.s   nixnextru
  2564.                 move.w  #2*160,D7
  2565.                 bra.s   wegweiter
  2566. nixnextru:      cmpi.b  #2,(A0)
  2567.                 bne.s   wegweiter
  2568.                 move.w  #3*160,D7
  2569.                 bra.s   wegweiter
  2570. wegnotunten:    cmp.b   #4,D4                ; oben?
  2571.                 bne.s   wegnotoben
  2572.                 move.w  #160,D7
  2573.                 subq.w  #1,D1                ; Y-1
  2574.                 cmpi.b  #1,(A0)
  2575.                 bne.s   nixnextul
  2576.                 move.w  #5*160,D7
  2577.                 bra.s   wegweiter
  2578. nixnextul:      cmpi.b  #2,(A0)
  2579.                 bne.s   wegweiter
  2580.                 move.w  #4*160,D7
  2581.                 bra.s   wegweiter
  2582. wegnotoben:     subq.w  #1,D0                ; X-1
  2583.                 moveq   #0,D7
  2584.                 cmpi.b  #3,(A0)
  2585.                 bne.s   nixnextlu
  2586.                 move.w  #5*160,D7
  2587.                 bra.s   wegweiter
  2588. nixnextlu:      cmpi.b  #4,(A0)
  2589.                 bne.s   wegweiter
  2590.                 move.w  #2*160,D7
  2591. wegweiter:      cmp.w   D0,D2                ; X1=X2?
  2592.                 bne.s   nixkoorgleich
  2593.                 cmp.w   D1,D3
  2594.                 bne.s   nixkoorgleich
  2595.  
  2596.                 move.w  tile1selektx,D0
  2597.                 move.w  tile1selekty,D1
  2598.                 move.w  tile2selektx,D2
  2599.                 move.w  tile2selekty,D3
  2600.                 movea.l screen1(PC),A0
  2601.                 bsr     clear_tile           ; Tile 1+2 löschen
  2602.  
  2603.                 bsr     draw_screen
  2604.  
  2605.                 bsr     switch
  2606.  
  2607.                 tst.w   blumjzverz2
  2608.                 beq.s   nixnewverz
  2609.                 move.w  blumjzverz2,blumjzverz ; falls Verz. -> an
  2610. nixnewverz:
  2611.                 rts
  2612.  
  2613. nixkoorgleich:  movem.l D0-A0,-(A7)
  2614.                 movea.l screen1(PC),A2
  2615.                 lsl.w   #3,D0                ; X mal 8
  2616.                 addq.w  #8,D0                ; X + 8 wegen Startfeld
  2617.                 and.l   #$ffff,D1            ; Y nur Lowword
  2618.                 mulu    #20*160,D1           ; mal einer "Zeile"
  2619.                 add.w   #ystartline*160,D1   ; ab dort beginnen Tiles
  2620.                 add.w   D0,D1
  2621.                 adda.l  D1,A2                ; auf Screen addieren
  2622.                 lea     weggrafik(PC),A1
  2623.                 adda.w  D7,A1                ; Element addieren
  2624.                 moveq   #19,D0
  2625. dwgrf:          movem.w (A1)+,D1-D4          ; 4 Worte holen
  2626.                 moveq   #0,D5
  2627.                 move.w  D1,D5                ; Maske bilden
  2628.                 or.w    D2,D5
  2629.                 or.w    D3,D5
  2630.                 or.w    D4,D5
  2631.                 not.w   D5
  2632.                 and.w   D5,(A2)              ; Wert ausmaskieren
  2633.                 or.w    D1,(A2)+
  2634.                 and.w   D5,(A2)              ; Wert ausmaskieren
  2635.                 or.w    D2,(A2)+
  2636.                 and.w   D5,(A2)              ; Wert ausmaskieren
  2637.                 or.w    D3,(A2)+
  2638.                 and.w   D5,(A2)              ; Wert ausmaskieren
  2639.                 or.w    D4,(A2)+
  2640.                 lea     152(A2),A2           ; eine Zeile tiefer
  2641.                 dbra    D0,dwgrf
  2642.  
  2643.                 bsr     vsync
  2644.                 movem.l (A7)+,D0-A0
  2645.                 bra     makeweg
  2646.  
  2647.  
  2648.  
  2649. preferences:
  2650. ; Diese Routine setzt Bildschirm und Palette.
  2651. ; erstellt auch Font
  2652.                 move.l  #screenbase,D0
  2653.                 and.l   #-256,D0             ; wegen fehlenden 8 Bit
  2654.                 add.l   #256,D0
  2655.                 move.l  D0,screen1
  2656.                 add.l   #200*160,D0
  2657.                 move.l  D0,screen2
  2658.                 add.l   #200*160,D0
  2659.                 move.l  D0,screen3
  2660.                 add.l   #200*160,D0
  2661.                 move.l  D0,screen4
  2662.  
  2663.                 clr.w   screennumm           ; auf Bildschirm 0 (=1)
  2664.                 move.w  #-1,timestop         ; Zeit anhalten
  2665.  
  2666.                 movem.l $ffff8240.w,D0-D7    ; Farben retten
  2667.                 movem.l D0-D7,oldpal
  2668.  
  2669.  
  2670.                 movea.l screen1(PC),A0
  2671.                 bsr     cls                  ; alle Screens löschen
  2672.                 movea.l screen2(PC),A0
  2673.                 bsr     cls                  ; alle Screens löschen
  2674.                 movea.l screen3(PC),A0
  2675.                 bsr     cls                  ; alle Screens löschen
  2676.                 movea.l screen4(PC),A0
  2677.                 bsr     cls                  ; alle Screens löschen
  2678.  
  2679.                 bsr     vsync
  2680.         bset    #1,$ffff820a.w        ; 50Hz
  2681.                 move.b  #0,$ffff8260.w       ; Lowres
  2682.  
  2683.                 move.l  #palette1,palpointer1 ; Palettenpointer setzen
  2684.                 move.l  #palette2,palpointer2 ; Palettenpointer setzen
  2685.                 move.l  #blinkcolors,blinkpos
  2686.                 move.w  #0,blinkanaus        ; Blinken aus
  2687.                 clr.w   blinkdelay
  2688.  
  2689.                 move.l  screen1(PC),D0       ; Screen 1 setzen
  2690.                 lsr.l   #8,D0
  2691.                 move.b  D0,$ffff8203.w
  2692.                 lsr.w   #8,D0
  2693.                 move.b  D0,$ffff8201.w
  2694.  
  2695.                 move.l  #keybuffer,keypointer
  2696.                 clr.w   keycounter
  2697.                 clr.l   keybuffer
  2698.                 clr.l   keybuffer+4
  2699.  
  2700.                 bsr     makefont
  2701.  
  2702.                 moveq   #1,D0
  2703.                 jsr     music
  2704.  
  2705.                 moveq   #$08,D0
  2706.                 bsr     sendkeyboard         ; Maus anschalten
  2707.  
  2708.                 bsr     hbl_on               ; Interrupts anschalten
  2709.  
  2710.                 rts
  2711.  
  2712.  
  2713. makefont:
  2714. ; erstellt Tabelle für Font und schreibt Zeichen mit Maske in Buffer
  2715.  
  2716.                 lea     fonttabelle,A0
  2717.                 move.w  #(fonttabellelaenge/2)-1,D0
  2718. multab:         moveq   #0,D1
  2719.                 move.w  (A0),D1              ; Werte multiplizieren
  2720.                 mulu    #150,D1
  2721.                 move.w  D1,(A0)+
  2722.                 dbra    D0,multab
  2723.  
  2724.                 lea     font,A0
  2725.                 lea     fontbuff,A1          ; dort kommen die Zeichen hin
  2726.                 moveq   #0,D0                ; 40 Zeichen
  2727. makefontloop:   movea.l A0,A2
  2728.                 moveq   #14,D1               ; 15 Scanlines
  2729. makefontloop2:  moveq   #0,D2
  2730.                 movem.w (A2),D3-D6           ; 4 Worte holen
  2731.                 move.w  D3,D2
  2732.                 or.w    D4,D2
  2733.                 or.w    D5,D2
  2734.                 or.w    D6,D2                ; Maske erstellen
  2735.                 not.w   D2
  2736.                 movem.w D2-D6,(A1)
  2737.                 lea     10(A1),A1
  2738.                 lea     160(A2),A2           ; eine Scanline tiefer
  2739.                 dbra    D1,makefontloop2
  2740.                 lea     8(A0),A0             ; ein Zeichen weiter
  2741.                 addq.w  #1,D0
  2742.                 cmp.w   #20,D0
  2743.                 bne.s   nixnextline1
  2744.                 lea     14*160(A0),A0        ; eine Zeichenzeile tiefer
  2745.                 bra.s   makefontloop
  2746. nixnextline1:   cmp.w   #40,D0
  2747.                 bne.s   nixnextline
  2748.                 lea     14*160(A0),A0
  2749.                 bra.s   makefontloop
  2750. nixnextline:    cmp.w   #47,D0               ; schon 47 Zeichen?
  2751.                 bne.s   makefontloop
  2752.                 rts
  2753.  
  2754.  
  2755. initgame:
  2756. ; Inititalisiert alle Spielparameter
  2757.  
  2758.                 move.l  #vblgame2,$70.w
  2759.  
  2760.                 movem.l leerfeld,D0-D7
  2761.                 movem.l D0-D7,hilfspalette1
  2762.  
  2763.                 bsr     vsync
  2764.  
  2765.                 movea.l screen1(PC),A0
  2766.                 bsr     cls
  2767.  
  2768.                 clr.l   rettbuff             ; Maus nicht restaurieren
  2769.                 move.w  #1,timestop          ; Zeit anhalten
  2770.  
  2771.                 move.w  #8*16,mousex
  2772.                 move.w  #ystartline+80,mousey
  2773.                 clr.w   mousek
  2774.  
  2775.  
  2776.                 clr.w   helpverbraucht       ; noch kein Help verbraucht!
  2777.                 move.w  #-1,kasten1aktiv     ; Kasten 1 aus
  2778.                 clr.w   endeflag             ; noch spielen!
  2779.                 clr.b   tile1selektpos       ; noch kein Tile selekt.
  2780.                 move.w  #48,paaranzahl       ; Anzahl der Paare
  2781.                 bsr     make_buff            ; erstellt Spielbuffer
  2782.                 bsr     draw_screen          ; zeichnet Spielscreen
  2783.                 bsr     switch
  2784.                 clr.w   kasten1aktiv         ; Kasten an
  2785.  
  2786.                 move.w  #200,time            ; Zeit
  2787.                 clr.w   vblcount
  2788.                 clr.w   blumjzverz           ; Verz. von BlumeJz=0
  2789.                 clr.w   blumjzverz2
  2790.  
  2791. welchpalette:   bsr     random               ; Welche Plattenfarben?
  2792.                 and.w   #7,D0                ; Werte von 0-7
  2793.                 cmp.w   #5,D0
  2794.                 bgt.s   welchpalette         ; nur Werte von 0-5
  2795.                 lea     plattenfarben(PC),A0
  2796.                 lsl.w   #5,D0                ; d0*32
  2797.                 adda.w  D0,A0
  2798.                 movem.l (A0),D0-D7
  2799.                 movem.l D0-D7,palette2
  2800.  
  2801.                 move.w  #1,blinkanaus        ; Blinken an
  2802.  
  2803.                 move.l  #vblgame,$70.w
  2804.                 bsr     initpalpointers
  2805.                 movem.l leerfeld,D0-D7
  2806.                 movem.l D0-D7,hilfspalette1
  2807.                 movem.l D0-D7,hilfspalette2
  2808.                 bsr     fadeup
  2809.                 bsr     exitpalpointers
  2810.  
  2811.                 clr.w   timestop             ; Time starten
  2812.                 rts
  2813.  
  2814. pause:
  2815. ; geht in Pausemodus und entfernt Platte vom Screen
  2816.  
  2817.                 move.l  #vblpause,$70.w      ; neuer VBL
  2818.  
  2819.                 bsr     initpalpointers
  2820.  
  2821.                 clr.l   rettbuff
  2822.                 bsr     vsync
  2823.  
  2824. suchpauserout:  bsr     random
  2825.                 and.w   #3,D0                ; Routine 1,2 oder 3
  2826.                 cmp.w   #2,D0
  2827.                 bgt.s   suchpauserout        ; Zufallsmäßige Routine
  2828.                 lsl.w   #2,D0                ; d0 * 4
  2829.                 lea     pauseroutinen(PC),A0 ; welche Routine?
  2830.                 movea.l 0(A0,D0.w),A0
  2831.                 jsr     (A0)
  2832.                 move.l  #vblgame,$70.w
  2833. exitpalpointers:move.l  savepalpoint1,palpointer1
  2834.                 move.l  savepalpoint2,palpointer2
  2835.                 rts
  2836.  
  2837.  
  2838. initpalpointers:movea.l palpointer1,A0
  2839.                 move.l  A0,savepalpoint1     ; retten
  2840.                 movem.l (A0),D0-D7
  2841.                 movem.l D0-D7,hilfspalette1  ; Palette während Pause
  2842.                 move.l  #hilfspalette1,palpointer1
  2843.                 movea.l palpointer2,A0
  2844.                 move.l  A0,savepalpoint2     ; retten
  2845.                 movem.l (A0),D0-D7
  2846.                 movem.l D0-D7,hilfspalette2  ; Palette während Pause
  2847.                 move.l  #hilfspalette2,palpointer2
  2848.                 rts
  2849.  
  2850.  
  2851. pausedraw:
  2852. ; zeichnet Pausezeichen aus Wegelementen
  2853.                 bsr     fadeup2              ; Farben auf Weiß
  2854.                 movea.l screen1(PC),A0
  2855.                 bsr     cls                  ; Bildschirm löschen
  2856.                 bsr     fadedown
  2857.  
  2858.                 lea     pausegraf(PC),A0     ; Elemente
  2859.                 movea.l screen1(PC),A1
  2860.                 lea     50*160(A1),A1        ; auf Zeile 50
  2861.                 moveq   #4,D0                ; 5 Zeilen
  2862. makepause:      moveq   #19,D1               ; 20 Blöcke
  2863.                 movea.l A1,A2
  2864. makepause1:     moveq   #0,D3
  2865.                 move.b  (A0)+,D3             ; Wert holen
  2866.                 beq.s   notdrawpause         ; Leerfeld
  2867.                 subq.w  #1,D3
  2868.                 mulu    #160,D3              ; mal Größe eines Felds
  2869.                 lea     weggrafik(PC),A3
  2870.                 adda.w  D3,A3
  2871.                 movea.l A2,A4
  2872.                 moveq   #19,D3               ; 20 Zeilen
  2873. makepause2:     move.l  (A3)+,(A4)+
  2874.                 move.l  (A3)+,(A4)+
  2875.                 lea     152(A4),A4
  2876.                 dbra    D3,makepause2
  2877. notdrawpause:   lea     8(A2),A2
  2878.                 dbra    D1,makepause1
  2879.                 lea     20*160(A1),A1
  2880.                 dbra    D0,makepause
  2881.  
  2882.                 bsr     fadeup
  2883.                 bsr.s   waitforpauseend
  2884.                 rts
  2885.  
  2886. pausescroll:
  2887. ; scrollt Screen raus
  2888.                 bsr.s   scrollraus
  2889.                 bra.s   pausedraw
  2890.  
  2891.  
  2892. waitforpauseend:
  2893.                 cmpi.b  #$39,keybuffer
  2894.                 beq.s   endepause
  2895.  
  2896.                 move.b  mousek,D0
  2897.                 btst    #1,D0
  2898.                 bne.s   endepause
  2899.                 bra.s   waitforpauseend
  2900.  
  2901. endepause:      bsr     fadedown
  2902.                 bsr     draw_screen
  2903.                 bsr     switch
  2904.                 tst.b   tile1selektpos       ; ein Tile selektiert?
  2905.                 beq.s   nottilepause
  2906.                 move.w  tile1selektx,D0
  2907.                 move.w  tile1selekty,D1
  2908.                 bsr     draw_kasten
  2909. nottilepause:   bsr     fadeup
  2910.                 clr.w   mousek
  2911.                 rts
  2912.  
  2913.  
  2914. scrollraus:     movea.l screen1(PC),A0       ; auf alle Screens kopieren
  2915.                 movea.l screen2(PC),A1
  2916.                 movea.l screen3(PC),A2
  2917.                 movea.l screen4(PC),A3
  2918.                 move.w  #(264*40)-1,D0
  2919. copyonallscreens:
  2920.                 move.l  (A0),(A1)+
  2921.                 move.l  (A0),(A2)+
  2922.                 move.l  (A0)+,(A3)+
  2923.                 dbra    D0,copyonallscreens
  2924.  
  2925.                 movea.l screen1(PC),A0       ; Screen 2 shiften
  2926.                 movea.l screen2(PC),A1
  2927.                 bsr     preshift
  2928.                 movea.l screen2(PC),A0       ; Screen 3 shiften
  2929.                 movea.l screen3(PC),A1
  2930.                 bsr     preshift
  2931.                 movea.l screen3(PC),A0       ; Screen 4 shiften
  2932.                 movea.l screen4(PC),A1
  2933.                 bsr     preshift
  2934.  
  2935.                 clr.w   screennumm
  2936.                 clr.w   readycount           ; counter1 init.
  2937. scrolloutloop:  bsr     scroll
  2938.                 bsr     switchall            ; zwischen 4 Screens
  2939.                 cmpi.w  #100,readycount
  2940.                 bne.s   scrolloutloop
  2941.                 rts
  2942.  
  2943. eingabe:        lea     namebuff,A0
  2944.                 moveq   #9,D0                ; 10 Zeichen
  2945. clrnamebuff:    clr.b   (A0)+
  2946.                 dbra    D0,clrnamebuff
  2947.  
  2948.                 lea     namebuff,A6
  2949.                 lea     cursortext(PC),A0
  2950.                 moveq   #1,D0
  2951.                 moveq   #5,D1
  2952.                 move.w  #170,D2
  2953.                 movea.l screen1(PC),A1
  2954.                 bsr     textaus2
  2955.                 moveq   #0,D5                ; Anz. der schon eing. Zeichen=0
  2956. eingabeloop0:   clr.b   keybuffer
  2957.                 bsr     vsync
  2958.                 move.b  keybuffer,D0
  2959.                 tst.b   D0
  2960.                 beq.s   eingabeloop0
  2961.                 cmp.b   #$0e,D0              ; Backspace?
  2962.                 beq     backspace
  2963.                 cmp.b   #$1c,D0              ; Return?
  2964.                 beq     endeingabe
  2965.                 cmp.w   #10,D5               ; Zeichen schon maximal
  2966.                 bge     eingabeloop0
  2967.                 bsr     scantoascii
  2968.                 tst.b   D0
  2969.                 beq     eingabeloop0
  2970.                 move.b  D0,(A6)+
  2971.                 addq.w  #1,D5                ; Zeichen +1
  2972.                 lea     -1(A6),A0
  2973.                 moveq   #1,D0
  2974.                 move.w  D5,D1
  2975.                 addq.w  #4,D1
  2976.                 move.w  #170,D2
  2977.                 movea.l screen1(PC),A1
  2978.                 bsr     textaus2
  2979.                 addq.w  #1,D1                ; X-Pos +1
  2980.                 cmp.w   #20,D1
  2981.                 beq     eingabeloop0
  2982.                 lea     cursortext(PC),A0
  2983.                 moveq   #1,D0
  2984.                 move.w  #170,D2
  2985.                 movea.l screen1(PC),A1
  2986.                 bsr     textaus2             ; gibt Cursor aus
  2987.                 bra     eingabeloop0
  2988. endeingabe:     move.b  #0,(A6)+
  2989.                 rts
  2990. backspace:      tst.w   D5
  2991.                 beq     eingabeloop0         ; noch kein Zeichen eingegeben
  2992.                 lea     -1(A6),A6
  2993.                 clr.b   (A6)
  2994.                 subq.w  #1,D5                ; Zeichen -1
  2995.  
  2996.                 cmp.w   #20,D1
  2997.                 beq     notspaceit
  2998.  
  2999.                 lea     cursortext+1(PC),A0
  3000.                 moveq   #1,D0
  3001.                 move.w  #170,D2
  3002.                 movea.l screen1(PC),A1
  3003.                 bsr     textaus2
  3004.  
  3005. notspaceit:     subq.w  #1,D1
  3006.                 cmp.w   #20,D1
  3007.                 beq     eingabeloop0
  3008.  
  3009.                 lea     cursortext(PC),A0
  3010.                 moveq   #1,D0
  3011.                 move.w  #170,D2
  3012.                 movea.l screen1(PC),A1
  3013.                 bsr     textaus2
  3014.                 bra     eingabeloop0
  3015.  
  3016. scantoascii:    moveq   #0,D7
  3017.                 move.b  D0,D7
  3018.                 lea     asciitab(PC),A0
  3019.                 moveq   #0,D0
  3020.                 move.b  0(A0,D7.w),D0
  3021.                 rts
  3022.  
  3023. cursortext:     DC.B "? "
  3024. asciitab:       DC.B 0,0        ; 0 und ESC
  3025.                 DC.B "1234567890" ; 2 bis $b
  3026.                 DC.B 0,0,0,0    ; $c-$f
  3027.                 DC.B "QWERTZUIOP" ; $E-$19
  3028.                 DC.B 0,0,0,0    ; $1a-$1d
  3029.                 DC.B "ASDFGHJKL" ; $1e-$26
  3030.                 DC.B 0,0,0,0,0  ; $27-$2b
  3031.                 DC.B "YXCVBNM"  ; $2c-$32
  3032.                 DC.B 0,0,0,0,0,0," ",0 ; $33-$3a
  3033.                 DS.B 256-$38
  3034.                 EVEN
  3035.  
  3036. preshift:
  3037. ; shiftet Bild um 4 Pixel nach links
  3038. ; in a0=Pointer auf Bild (source)
  3039. ; a1=Dest.
  3040.                 lea     152(A0),A0           ; Pointer um an Ende Scanline
  3041.                 lea     152(A1),A1           ; Pointer um an Ende Scanline
  3042.                 lea     17*160(A0),A0        ; ab Zeile 17
  3043.                 lea     17*160(A1),A1
  3044.                 move.w  #180,D0              ; 181 Zeilen
  3045. sh8screen1:     moveq   #19,D1               ; 20 Bitblocks
  3046.                 moveq   #0,D4
  3047.                 moveq   #0,D5
  3048.                 moveq   #0,D6
  3049.                 moveq   #0,D7
  3050. sh8screen2:     moveq   #0,D2
  3051.                 move.w  (A0),D2
  3052.                 lsl.l   #4,D2
  3053.                 or.w    D4,D2
  3054.                 move.w  D2,(A1)
  3055.                 swap    D2
  3056.                 move.w  D2,D4
  3057.                 moveq   #0,D2
  3058.                 move.w  2(A0),D2
  3059.                 lsl.l   #4,D2
  3060.                 or.w    D5,D2
  3061.                 move.w  D2,2(A1)
  3062.                 swap    D2
  3063.                 move.w  D2,D5
  3064.                 moveq   #0,D2
  3065.                 move.w  4(A0),D2
  3066.                 lsl.l   #4,D2
  3067.                 or.w    D6,D2
  3068.                 move.w  D2,4(A1)
  3069.                 swap    D2
  3070.                 move.w  D2,D6
  3071.                 moveq   #0,D2
  3072.                 move.w  6(A0),D2
  3073.                 lsl.l   #4,D2
  3074.                 or.w    D7,D2
  3075.                 move.w  D2,6(A1)
  3076.                 swap    D2
  3077.                 move.w  D2,D7
  3078.                 lea     -8(A0),A0
  3079.                 lea     -8(A1),A1
  3080.                 dbra    D1,sh8screen2
  3081.                 lea     320(A0),A0
  3082.                 lea     320(A1),A1
  3083.                 dbra    D0,sh8screen1
  3084.                 rts
  3085.  
  3086. scroll:
  3087. ; schiebt die Screens dann raus
  3088.                 cmpi.w  #3,readycount
  3089.                 ble.s   notscrollout
  3090.                 move.w  screennumm,D0
  3091.                 lea     screen1(PC),A0
  3092.                 lsl.w   #2,D0
  3093.                 movea.l 0(A0,D0.w),A0
  3094.                 lea     17*160(A0),A0        ; Zeile 16
  3095.                 movea.l A0,A1
  3096.                 move.l  A1,-(A7)
  3097.                 lea     8(A0),A0
  3098.                 move.w  #180,D0              ; 181 Zeilen
  3099. sl0:            movem.l (A0)+,D1-D7/A1-A6
  3100.                 movem.l D1-D7/A1-A6,-60(A0)
  3101.                 movem.l (A0)+,D1-D7/A1-A6
  3102.                 movem.l D1-D7/A1-A6,-60(A0)
  3103.                 movem.l (A0)+,D1-D7/A1-A5
  3104.                 movem.l D1-D7/A1-A5,-56(A0)
  3105.                 lea     8(A0),A0
  3106.                 dbra    D0,sl0
  3107.                 movea.l (A7)+,A1
  3108.                 lea     152(A1),A1
  3109.                 moveq   #0,D1
  3110.                 move.w  #180,D0              ; 180 Zeilen
  3111. clrhinten:      move.l  D1,(A1)+
  3112.                 move.l  D1,(A1)+
  3113.                 lea     152(A1),A1
  3114.                 dbra    D0,clrhinten
  3115. notscrollout:   addq.w  #1,readycount        ; Zähler +1
  3116.                 rts
  3117.  
  3118. switchall:
  3119. ; Diese Routine stellt nächsten der 4 Bildschirme dar.
  3120.                 bsr     vsync                ; auf VBL warten
  3121.                 move.w  screennumm,D0        ; aktueller Screen
  3122.                 addq.w  #1,D0                ; nächster Screen
  3123.                 and.w   #3,D0                ; nur Werte von 0-3
  3124.                 move.w  D0,screennumm        ; wieder zurück
  3125.                 lsl.w   #2,D0                ; d0*4 -> Longs
  3126.                 lea     screen1(PC),A0       ; Basisadresse
  3127.                 move.l  0(A0,D0.w),D0        ; Adresse holen
  3128.                 lsr.l   #8,D0                ; Screen setzen
  3129.                 move.b  D0,$ffff8203.w
  3130.                 lsr.w   #8,D0
  3131.                 move.b  D0,$ffff8201.w
  3132.                 rts
  3133.  
  3134.  
  3135. zerkriesel:
  3136. ; zerkrieselt die Platte
  3137.                 bsr     random               ; Opcode (ROR Dx,D0)
  3138.                 and.w   #3,D0
  3139.                 cmp.w   #3,D0
  3140.                 beq.s   zerkriesel           ; nur Werte von 0-2
  3141.                 add.w   D0,D0                ; *2 wegen Opcode
  3142.                 lea     krieslopcodes(PC),A0
  3143.                 move.w  0(A0,D0.w),krieslopcode
  3144.  
  3145.                 bsr     random
  3146.                 and.w   #7,D0
  3147.                 move.w  D0,D3                ; Wert 1 für Krieseln
  3148.                 lea     kriesldat(PC),A6
  3149.                 movea.l screen1(PC),A5
  3150.                 lea     17*160(A5),A5
  3151.                 moveq   #19,D7
  3152. krieslloop:     cmpi.w  #-1,(A6)
  3153.                 bne.s   nixendkriesl
  3154.                 lea     kriesldat(PC),A6
  3155. nixendkriesl:   movea.l A5,A1
  3156.                 movea.l A6,A0
  3157.                 move.w  #19,D2
  3158. kloop0:         move.w  #180,D1
  3159.                 movea.l A1,A3
  3160.                 move.w  (A0)+,D0
  3161.                 cmp.w   #-1,D0
  3162.                 bne.s   nixendkries2
  3163.                 lea     kriesldat(PC),A0
  3164.                 move.w  (A0)+,D0
  3165. nixendkries2:   and.w   D0,(A3)+
  3166.                 and.w   D0,(A3)+
  3167.                 and.w   D0,(A3)+
  3168.                 and.w   D0,(A3)+
  3169. krieslopcode:   ror.w   D2,D0
  3170.                 lea     152(A3),A3
  3171.                 dbra    D1,nixendkries2
  3172.                 lea     8(A1),A1
  3173.                 dbra    D2,kloop0
  3174.                 lea     2(A6),A6
  3175.                 bsr     vsync
  3176.                 dbra    D7,krieslloop
  3177.                 bra     pausedraw
  3178.  
  3179.  
  3180.  
  3181.  
  3182. fadedown:
  3183. ; blendet Farbpaletten runter
  3184.                 lea     hilfspalette1,A6     ; während VBL dort Pal1
  3185.                 bsr.s   fadedwn
  3186.                 bsr     vsync
  3187.                 lea     hilfspalette2,A6     ; während VBL dort Pal3
  3188.                 bsr.s   fadedwn
  3189.  
  3190.                 moveq   #31,D7               ; 3 Pal. sind hintereinand.
  3191.                 lea     hilfspalette1,A0     ; im Speicher -> eine Rout.
  3192. count0col:      move.w  (A0)+,D0
  3193.                 and.w   #$0777,D0
  3194.                 bne.s   fadedown
  3195.                 dbra    D7,count0col
  3196.                 rts
  3197.  
  3198.  
  3199. fadedwn:        moveq   #15,D7
  3200. fdl0:           move.w  (A6),D0
  3201.                 and.w   #%111,D0
  3202.                 beq.s   col2
  3203.                 subq.w  #1,D0
  3204.                 move.w  (A6),D1
  3205.                 and.w   #%1111111111111000,D1
  3206.                 or.w    D0,D1
  3207.                 move.w  D1,(A6)
  3208.                 bra.s   colok
  3209. col2:           move.w  (A6),D0
  3210.                 and.w   #%1110000,D0
  3211.                 beq.s   col3
  3212.                 sub.w   #$10,D0
  3213.                 move.w  (A6),D1
  3214.                 and.w   #%1111111110001111,D1
  3215.                 or.w    D0,D1
  3216.                 move.w  D1,(A6)
  3217.                 bra.s   colok
  3218. col3:           move.w  (A6),D0
  3219.                 and.w   #%11100000000,D0
  3220.                 beq.s   colok
  3221.                 sub.w   #$0100,D0
  3222.                 move.w  (A6),D1
  3223.                 and.w   #%1111100011111111,D1
  3224.                 or.w    D0,D1
  3225.                 move.w  D1,(A6)
  3226. colok:          lea     2(A6),A6
  3227.                 dbra    D7,fdl0
  3228.                 rts
  3229.  
  3230. fadeup2:
  3231. ; blendet Farbpalette hoch (auf Weiß)
  3232.                 lea     hilfspalette1,A6
  3233.                 bsr     fade_up2
  3234.                 bsr     vsync
  3235.                 bsr     vsync
  3236.                 lea     hilfspalette2,A6
  3237.                 bsr     fade_up2
  3238.  
  3239.                 moveq   #31,D7
  3240.                 lea     hilfspalette1,A0
  3241. compcol2:       move.w  (A0)+,D0
  3242.                 and.w   #$0777,D0
  3243.                 cmp.w   #$0777,D0
  3244.                 bne.s   fadeup2
  3245.                 dbra    D7,compcol2
  3246.                 rts
  3247.  
  3248. fadedown2:
  3249. ; blendet Farbpalette von weiß runter auf Palette
  3250.  
  3251.                 lea     hilfspalette1,A6
  3252.                 lea     palette1(PC),A5
  3253.                 bsr     fade_down2
  3254.  
  3255.                 bsr     vsync
  3256.                 bsr     vsync
  3257.                 bsr     vsync
  3258.  
  3259.                 moveq   #15,D7
  3260.                 lea     hilfspalette1,A0
  3261.                 lea     palette1(PC),A1
  3262. compcol3:       move.w  (A0)+,D0
  3263.                 and.w   #$0777,D0
  3264.                 move.w  (A1)+,D1
  3265.                 and.w   #$0777,D1
  3266.                 cmp.w   D0,D1
  3267.                 bne.s   fadedown2
  3268.                 dbra    D7,compcol3
  3269.                 rts
  3270.  
  3271. fadeup:
  3272. ; blendet Farbpalette hoch
  3273.  
  3274.                 lea     hilfspalette1,A6
  3275.                 lea     palette1(PC),A5
  3276.                 bsr     fade_up
  3277.                 lea     hilfspalette2,A6
  3278.                 lea     palette2(PC),A5
  3279.                 bsr     fade_up
  3280.  
  3281.                 bsr     vsync
  3282.                 bsr     vsync
  3283.  
  3284.                 moveq   #31,D7
  3285.                 lea     palette1(PC),A1
  3286.                 lea     hilfspalette1,A0
  3287. compcol:        move.w  (A1)+,D0
  3288.                 and.w   #$0777,D0
  3289.                 move.w  (A0)+,D1
  3290.                 and.w   #$0777,D1
  3291.                 cmp.w   D0,D1
  3292.                 bne.s   fadeup
  3293.                 dbra    D7,compcol
  3294.  
  3295.                 rts
  3296.  
  3297. fadeup3:
  3298. ; blendet Farbpalette hoch
  3299.  
  3300.                 lea     hilfspalette1,A6
  3301.                 lea     palette1(PC),A5
  3302.                 bsr     fade_up
  3303.  
  3304.                 bsr     vsync
  3305.                 bsr     vsync
  3306.  
  3307.                 moveq   #15,D7
  3308.                 lea     palette1(PC),A1
  3309.                 lea     hilfspalette1,A0
  3310. compcol6:       move.w  (A1)+,D0
  3311.                 and.w   #$0777,D0
  3312.                 move.w  (A0)+,D1
  3313.                 and.w   #$0777,D1
  3314.                 cmp.w   D0,D1
  3315.                 bne.s   fadeup3
  3316.                 dbra    D7,compcol6
  3317.  
  3318.                 rts
  3319. fadedown3:
  3320. ; blendet Farbpalette runter
  3321.  
  3322.                 lea     hilfspalette1,A6
  3323.                 bsr     fadedwn
  3324.  
  3325.                 bsr     vsync
  3326.                 bsr     vsync
  3327.  
  3328.                 moveq   #15,D7
  3329.                 lea     hilfspalette1,A0
  3330. compcol5:       move.w  (A0)+,D0
  3331.                 and.w   #$0777,D0
  3332.                 bne.s   fadedown3
  3333.                 dbra    D7,compcol5
  3334.  
  3335.                 rts
  3336.  
  3337.  
  3338. fadeup4:
  3339. ; blendet Farbpalette hoch
  3340.  
  3341.                 lea     hilfspalette1,A6
  3342.                 lea     instrpal(PC),A5
  3343.                 bsr     fade_up
  3344.  
  3345.                 bsr     vsync
  3346.                 bsr     vsync
  3347.  
  3348.                 moveq   #15,D7
  3349.                 lea     instrpal(PC),A1
  3350.                 lea     hilfspalette1,A0
  3351. compcol7:       move.w  (A1)+,D0
  3352.                 and.w   #$0777,D0
  3353.                 move.w  (A0)+,D1
  3354.                 and.w   #$0777,D1
  3355.                 cmp.w   D0,D1
  3356.                 bne.s   fadeup4
  3357.                 dbra    D7,compcol7
  3358.  
  3359.                 rts
  3360.  
  3361. fade_up2:                                    ; blendet auf Weiss hoch
  3362.                 moveq   #15,D7
  3363. ful0:           move.w  (A6),D0
  3364.                 and.w   #%111,D0
  3365.                 moveq   #7,D1
  3366.                 cmp.w   D0,D1
  3367.                 beq.s   fcol2
  3368.                 addq.w  #1,D0
  3369.                 move.w  (A6),D1
  3370.                 and.w   #%1111111111111000,D1
  3371.                 or.w    D0,D1
  3372.                 move.w  D1,(A6)
  3373.                 bra.s   fcolok
  3374. fcol2:          move.w  (A6),D0
  3375.                 and.w   #%1110000,D0
  3376.                 move.w  #$70,D1
  3377.                 cmp.w   D0,D1
  3378.                 beq.s   fcol3
  3379.                 add.w   #$10,D0
  3380.                 move.w  (A6),D1
  3381.                 and.w   #%1111111110001111,D1
  3382.                 or.w    D0,D1
  3383.                 move.w  D1,(A6)
  3384.                 bra.s   fcolok
  3385. fcol3:          move.w  (A6),D0
  3386.                 and.w   #%11100000000,D0
  3387.                 move.w  #$0700,D1
  3388.                 cmp.w   D0,D1
  3389.                 beq.s   fcolok
  3390.                 add.w   #$0100,D0
  3391.                 move.w  (A6),D1
  3392.                 and.w   #%1111100011111111,D1
  3393.                 or.w    D0,D1
  3394.                 move.w  D1,(A6)
  3395. fcolok:         lea     2(A6),A6
  3396.                 lea     2(A5),A5
  3397.                 dbra    D7,ful0
  3398.                 rts
  3399.  
  3400. fade_up:        moveq   #15,D7
  3401. ful01:          move.w  (A6),D0
  3402.                 and.w   #%111,D0
  3403.                 move.w  (A5),D1
  3404.                 and.w   #%111,D1
  3405.                 cmp.w   D0,D1
  3406.                 beq.s   fcol21
  3407.                 addq.w  #1,D0
  3408.                 move.w  (A6),D1
  3409.                 and.w   #%1111111111111000,D1
  3410.                 or.w    D0,D1
  3411.                 move.w  D1,(A6)
  3412.                 bra.s   fcolok1
  3413. fcol21:         move.w  (A6),D0
  3414.                 and.w   #%1110000,D0
  3415.                 move.w  (A5),D1
  3416.                 and.w   #%1110000,D1
  3417.                 cmp.w   D0,D1
  3418.                 beq.s   fcol31
  3419.                 add.w   #$10,D0
  3420.                 move.w  (A6),D1
  3421.                 and.w   #%1111111110001111,D1
  3422.                 or.w    D0,D1
  3423.                 move.w  D1,(A6)
  3424.                 bra.s   fcolok1
  3425. fcol31:         move.w  (A6),D0
  3426.                 and.w   #%11100000000,D0
  3427.                 move.w  (A5),D1
  3428.                 and.w   #%11100000000,D1
  3429.                 cmp.w   D0,D1
  3430.                 beq.s   fcolok1
  3431.                 add.w   #$0100,D0
  3432.                 move.w  (A6),D1
  3433.                 and.w   #%1111100011111111,D1
  3434.                 or.w    D0,D1
  3435.                 move.w  D1,(A6)
  3436. fcolok1:        lea     2(A6),A6
  3437.                 lea     2(A5),A5
  3438.                 dbra    D7,ful01
  3439.                 rts
  3440.  
  3441. fade_down2:     moveq   #15,D7
  3442. ful012:         move.w  (A6),D0
  3443.                 and.w   #%111,D0
  3444.                 move.w  (A5),D1
  3445.                 and.w   #%111,D1
  3446.                 cmp.w   D0,D1
  3447.                 beq.s   fcol212
  3448.                 subq.w  #1,D0
  3449.                 move.w  (A6),D1
  3450.                 and.w   #%1111111111111000,D1
  3451.                 or.w    D0,D1
  3452.                 move.w  D1,(A6)
  3453.                 bra.s   fcolok12
  3454. fcol212:        move.w  (A6),D0
  3455.                 and.w   #%1110000,D0
  3456.                 move.w  (A5),D1
  3457.                 and.w   #%1110000,D1
  3458.                 cmp.w   D0,D1
  3459.                 beq.s   fcol312
  3460.                 sub.w   #$10,D0
  3461.                 move.w  (A6),D1
  3462.                 and.w   #%1111111110001111,D1
  3463.                 or.w    D0,D1
  3464.                 move.w  D1,(A6)
  3465.                 bra.s   fcolok12
  3466. fcol312:        move.w  (A6),D0
  3467.                 and.w   #%11100000000,D0
  3468.                 move.w  (A5),D1
  3469.                 and.w   #%11100000000,D1
  3470.                 cmp.w   D0,D1
  3471.                 beq.s   fcolok12
  3472.                 sub.w   #$0100,D0
  3473.                 move.w  (A6),D1
  3474.                 and.w   #%1111100011111111,D1
  3475.                 or.w    D0,D1
  3476.                 move.w  D1,(A6)
  3477. fcolok12:       lea     2(A6),A6
  3478.                 lea     2(A5),A5
  3479.                 dbra    D7,ful012
  3480.                 rts
  3481.  
  3482.  
  3483. draw_helps:
  3484. ; a1=Screen
  3485.                 lea     128(A1),A1
  3486.                 moveq   #0,D0
  3487.                 move.w  helpcount,D0
  3488.                 lsl.w   #8,D0                ; *512
  3489.                 add.w   D0,D0
  3490.                 lea     helpplatten(PC),A0
  3491.                 adda.w  D0,A0
  3492.                 moveq   #15,D0               ; 16 Zeilen
  3493. copyhelps:      movem.l (A0)+,D1-D7/A2       ; 8 Longs
  3494.                 movem.l D1-D7/A2,(A1)
  3495.                 lea     160(A1),A1
  3496.                 dbra    D0,copyhelps
  3497.                 rts
  3498.  
  3499.  
  3500. ;--------------------------------- System ----------------------------
  3501.  
  3502. switch:
  3503. ; Diese Routine tauscht die Bildschirme 1 + 2
  3504.  
  3505.                 bsr.s   vsync                ; auf VBL warten
  3506.                 move.l  screen2(PC),D0
  3507.                 move.l  screen1(PC),screen2  ; Screen 1+2 tauschen
  3508.                 move.l  D0,screen1
  3509. setscreen:      lsr.l   #8,D0                ; Screen setzen
  3510.                 move.b  D0,$ffff8203.w
  3511.                 lsr.w   #8,D0
  3512.                 move.b  D0,$ffff8201.w
  3513.                 rts
  3514.  
  3515. vsync:
  3516. ; Diese Routine wartet auf das Vertical Blank Signal
  3517.                 move.l  $0466.w,D0
  3518. waitstrahl:     cmp.l   $0466.w,D0
  3519.                 beq.s   waitstrahl
  3520.                 rts
  3521.  
  3522.  
  3523.  
  3524. cls:
  3525. ; Löscht Bildschirm
  3526. ; Parameter:    a0=Screenadresse
  3527.  
  3528.                 moveq   #0,D1                ; alle Register löschen
  3529.                 move.l  D1,D2
  3530.                 move.l  D1,D3
  3531.                 move.l  D1,D4
  3532.                 move.l  D1,D5
  3533.                 move.l  D1,D6
  3534.                 move.l  D1,D7
  3535.                 movea.l D1,A1
  3536.                 movea.l D1,A2
  3537.                 movea.l D1,A3
  3538.                 adda.l  #200*160,A0          ; auf unteren Rand gehen
  3539.                 move.w  #199,D0              ; 200 Scanlines löschen
  3540. clsloop:        movem.l D1-D7/A1-A3,-(A0)
  3541.                 movem.l D1-D7/A1-A3,-(A0)
  3542.                 movem.l D1-D7/A1-A3,-(A0)
  3543.                 movem.l D1-D7/A1-A3,-(A0)
  3544.                 dbra    D0,clsloop
  3545.                 rts
  3546.  
  3547.  
  3548. hbl_on:         move    SR,-(A7)
  3549.                 ori     #$0700,SR
  3550.                 lea     hbl_buff,A0
  3551.                 move.b  $fffffa09.w,(A0)+    ; Werte retten
  3552.                 move.b  $fffffa07.w,(A0)+
  3553.                 move.b  $fffffa13.w,(A0)+
  3554.                 move.b  $fffffa1b.w,(A0)+
  3555.                 move.b  $fffffa11.w,(A0)+
  3556.                 move.b  $fffffa21.w,(A0)+
  3557.                 move.b  $fffffa17.w,(A0)+
  3558.                 lea     1(A0),A0
  3559.                 move.l  $0118.w,(A0)+
  3560.                 move.l  $0120.w,(A0)+
  3561.                 move.l  $70.w,(A0)+
  3562.         move.l    $70.w,old_vbl
  3563.                 andi.b  #$df,$fffffa09.w     ; Timer C aus
  3564.                 andi.b  #$fe,$fffffa07.w     ; Timer B aus
  3565.                 move.l  #newkey,$0118.w
  3566.                 move.l  #vblstart,$70.w
  3567.                 move.l  #hbl1,$0120.w
  3568.                 ori.b   #1,$fffffa07.w       ; Timer B an
  3569.                 ori.b   #1,$fffffa13.w
  3570.                 bclr    #3,$fffffa17.w       ; automatic EOI
  3571.                 move    (A7)+,SR
  3572.                 rts
  3573.  
  3574. hbl_off:        move    SR,-(A7)
  3575.                 ori     #$0700,SR
  3576.                 lea     hbl_buff,A0          ; Werte zurück!
  3577.                 move.b  (A0)+,$fffffa09.w
  3578.                 move.b  (A0)+,$fffffa07.w
  3579.                 move.b  (A0)+,$fffffa13.w
  3580.                 move.b  (A0)+,$fffffa1b.w
  3581.                 move.b  (A0)+,$fffffa11.w
  3582.                 move.b  (A0)+,$fffffa21.w
  3583.                 move.b  (A0)+,$fffffa17.w
  3584.                 lea     1(A0),A0
  3585.                 move.l  (A0)+,$0118.w
  3586.                 move.l  (A0)+,$0120.w
  3587.                 move.l  (A0)+,$70.w
  3588.                 move    (A7)+,SR
  3589.                 rts
  3590.  
  3591. vblgame:        movem.l D0-A6,-(A7)
  3592.                 lea     $fffffa21.w,A0       ; Timer B DATA
  3593.                 clr.b   -6(A0)               ; Timer B Stop
  3594.                 move.b  #15,(A0)             ; 15 Zeilen zählen
  3595.                 move.b  #8,-6(A0)            ; Timer B Start
  3596.                 move.l  #hbl1,$0120.w
  3597.  
  3598.                 movea.l palpointer1,A0
  3599.                 movem.l (A0),D0-D7
  3600.                 movem.l D0-D7,$ffff8240.w
  3601.  
  3602.                 tst.w   blinkanaus
  3603.                 beq.s   nixblinken
  3604.                 eori.w  #1,blinkdelay
  3605.                 beq.s   nixblinken
  3606.                 addq.l  #2,blinkpos
  3607.                 movea.l blinkpos,A0
  3608.                 cmpi.w  #-1,(A0)
  3609.                 bne.s   nixendblinkpos
  3610.                 lea     blinkcolors(PC),A0
  3611. nixendblinkpos: move.w  (A0),palette2+2
  3612.                 move.l  A0,blinkpos
  3613.  
  3614. nixblinken:
  3615.                 bsr     controlmouse         ; jeweilige Routine
  3616.  
  3617.                 cmpi.l  #$136d7c22,cheatmode ; Cheat aktiviert?
  3618.                 beq.s   timenotende
  3619.  
  3620.                 tst.w   timestop             ; Zeit aus?
  3621.                 bne.s   timenotdraw
  3622.                 addq.w  #1,vblcount
  3623.                 move.w  timeverzoegerung,D0  ; Wartezeit
  3624.                 cmp.w   vblcount,D0          ; Wartezeit erreicht?
  3625.                 bne.s   timenotende
  3626.                 clr.w   vblcount
  3627.                 tst.w   blumjzverz           ; Verz. an?
  3628.                 beq.s   noverzoegerung
  3629.                 subq.w  #1,blumjzverz
  3630.                 bra.s   timenotende          ; Zeit anhalten!
  3631. noverzoegerung: subi.w  #1,time              ; Zeit -1
  3632.                 bne.s   timenotende
  3633.                 move.w  #-1,endeflag         ; Spiel zu Ende
  3634.                 clr.w   time
  3635. timenotende:    bsr     draw_time
  3636. timenotdraw:    jsr     music+8
  3637.  
  3638.                 addq.l  #1,$0466.w           ; System VBL ganz abgeklemmt
  3639.                 movem.l (A7)+,D0-A6
  3640.                 rte
  3641.  
  3642. vblpause:
  3643. ; VBL während der Pausefunktion
  3644.                 movem.l D0-A6,-(A7)
  3645.                 lea     $fffffa21.w,A0       ; Timer B DATA
  3646.                 clr.b   -6(A0)               ; Timer B Stop
  3647.                 move.b  #15,(A0)             ; 15 Zeilen zählen
  3648.                 move.b  #8,-6(A0)            ; Timer B Start
  3649.                 move.l  #hbl1,$0120.w
  3650.  
  3651.                 movea.l palpointer1,A0       ; Palette setzen
  3652.                 movem.l (A0),D0-D7
  3653.                 movem.l D0-D7,$ffff8240.w
  3654.  
  3655.                 jsr     music+8
  3656.  
  3657.                 addq.l  #1,$0466.w           ; VSYNC
  3658.                 movem.l (A7)+,D0-A6
  3659.                 rte
  3660.  
  3661. vblgame2:       movem.l D0-A6,-(A7)
  3662.                 clr.b   $fffffa1b.w
  3663.  
  3664.                 movem.l hilfspalette1,D0-D7
  3665.                 movem.l D0-D7,$ffff8240.w
  3666.  
  3667.                 jsr     music+8
  3668.  
  3669.                 addq.l  #1,$0466.w           ; VSYNC
  3670.                 movem.l (A7)+,D0-A6
  3671.                 rte
  3672.  
  3673. vblmenu:        movem.l D0-A6,-(A7)
  3674.                 clr.b   $fffffa1b.w
  3675.  
  3676.                 movem.l hilfspalette1,D0-D7
  3677.                 movem.l D0-D7,$ffff8240.w
  3678.  
  3679.                 tst.w   scrollready
  3680.                 bne.s   nixdoscroller
  3681.                 bsr     restmouse
  3682.                 bsr     putmouse
  3683.                 bsr     scroller
  3684. nixdoscroller:
  3685.                 jsr     music+8
  3686.  
  3687.                 addq.l  #1,$0466.w           ; VSYNC
  3688.                 movem.l (A7)+,D0-A6
  3689.                 rte
  3690.  
  3691. controlmouse:   tst.w   kasten1aktiv
  3692.                 bne.s   notdrawmouse
  3693.                 bsr     restmouse
  3694.                 bsr     putmouse
  3695. notdrawmouse:   rts
  3696.  
  3697.  
  3698. vblquit:        movem.l D0-D7,-(A7)
  3699.                 clr.b   $fffffa1b.w
  3700.                 movem.l hilfspalette1,D0-D7
  3701.                 movem.l D0-D7,$ffff8240.w
  3702.                 movem.l (A7)+,D0-D7
  3703.                 addq.l  #1,$0466.w
  3704.                 rte
  3705.  
  3706. vblstart:    addq.l    #1,$466.w
  3707.         rte
  3708.  
  3709. ;---------------------- Keyvector ----------------------------------------
  3710. newkey:
  3711. ; neuer Keyinterrupt
  3712.                 move    #$2500,SR
  3713.                 movem.l D0/A0-A1,-(A7)
  3714.                 moveq   #0,D0
  3715.                 lea     $fffffc00.w,A0       ; ACIA-Statusregister
  3716. abhol_loop:     move.b  (A0),D0              ; Wert holen
  3717.                 btst    #7,D0                ; Interrupt-Request?
  3718.                 beq.s   nixmehrkey           ; nix mehr Interrupt
  3719.  
  3720.                 move.b  2(A0),D0             ; Wert abholen
  3721.                 tst.b   keycounter           ; gehört das zum Paket?
  3722.                 bne.s   warpaketbyte
  3723.  
  3724.                 cmp.w   #$f7,D0              ; ist da ein Paket?
  3725.                 blt.s   istkeinpaket
  3726.  
  3727.                 move.l  #keybuffer+1,keypointer
  3728.                 move.b  D0,keybuffer
  3729.                 sub.w   #$f7,D0
  3730.                 lea     paket_tabelle,A1     ; dort sind Längen der Pakete
  3731.                 move.b  0(A1,D0.w),D0        ; Länge holen
  3732.                 subq.w  #1,D0                ; -1 weil das erste Byte schon da
  3733.                 move.b  D0,keycounter
  3734.                 bra.s   keytest
  3735. istkeinpaket:   move.b  D0,keybuffer         ; einfach ablegen
  3736.                 bra.s   keytest
  3737.  
  3738. warpaketbyte:   subq.b  #1,keycounter
  3739.                 movea.l keypointer,A1
  3740.                 move.b  D0,(A1)+
  3741.                 move.l  A1,keypointer
  3742.                 tst.w   keycounter
  3743.                 bne.s   keytest
  3744.                 bsr     new_mouse            ; Mausroutine
  3745.  
  3746. keytest:        move.b  (A0),D0              ; Status holen
  3747.                 btst    #0,D0                ; noch was zum abholen da?
  3748.                 bne     abhol_loop
  3749. nixmehrkey:     movem.l (A7)+,D0/A0-A1
  3750.                 bclr    #6,$fffffa11.w       ; Interrupt in Service löschen
  3751.                 rte
  3752.  
  3753.  
  3754. hbl1:
  3755. ; setzt in Zeile 16 die Eispalette
  3756.                 movem.l D0-A2,-(A7)
  3757.                 lea     $fffffa21.w,A0
  3758.                 clr.b   -6(A0)
  3759.                 move.b  #4,(A0)
  3760.                 move.b  #8,-6(A0)
  3761.                 movea.l palpointer2,A2       ; Palette 2
  3762.                 movem.l (A2),D1-D7/A1        ; Palette holen
  3763.                 move.b  (A0),D0              ; Zeile holen
  3764. waitrand2:      cmp.b   (A0),D0              ; noch gleiche Zeile?
  3765.                 beq.s   waitrand2
  3766.                 movem.l D1-D7/A1,$ffff8240.w ; Palette setzen
  3767.                 clr.b   -6(A0)               ; Timer B stop
  3768.                 movem.l (A7)+,D0-A2
  3769.                 rte
  3770.  
  3771. hbl2:
  3772. ; setzt in Zeile 32 die Eispalette
  3773.                 movem.l D0-A1,-(A7)
  3774.                 lea     $fffffa21.w,A0
  3775.                 clr.b   -6(A0)
  3776.                 move.b  #4,(A0)
  3777.                 move.b  #8,-6(A0)
  3778.                 movem.l hilfspalette2,D1-D7/A1 ; Palette holen
  3779.                 move.b  (A0),D0              ; Zeile holen
  3780. waitrand3:      cmp.b   (A0),D0              ; noch gleiche Zeile?
  3781.                 beq.s   waitrand3
  3782.                 movem.l D1-D7/A1,$ffff8240.w ; Palette setzen
  3783.                 clr.b   -6(A0)               ; Timer B stop
  3784.                 movem.l (A7)+,D0-A1
  3785.                 rte
  3786.  
  3787.  
  3788.                 DATA
  3789.  
  3790. screen1:        DS.L 1          ; Screen 1-4
  3791. screen2:        DS.L 1
  3792. screen3:        DS.L 1
  3793. screen4:        DS.L 1
  3794.  
  3795.  
  3796. keyroutinen:    DC.L endgame
  3797.                 DC.L helpfunktion
  3798.                 DC.L pause
  3799.                 DC.L cheatlevel
  3800.                 DC.L gameovererzeug
  3801.                 DC.L addscore
  3802.                 DC.L musiconoff
  3803.  
  3804. keytab:         DC.B 1          ; Escape
  3805.                 DC.B $62        ; HELP
  3806.                 DC.B $19        ; P
  3807.                 DC.B $44        ; f10
  3808.                 DC.B 2          ; 1
  3809.                 DC.B 3          ; 2
  3810.                 DC.B $32        ; M
  3811.                 DC.B -1
  3812.                 EVEN
  3813.  
  3814.  
  3815. pauseroutinen:  DC.L pausedraw  ; Farben faden
  3816.                 DC.L pausescroll ; Platte rausscrollen
  3817.                 DC.L zerkriesel ; Platte nach Zufall krieseln
  3818.  
  3819. blinkcolors:
  3820.                 DC.W $10,$20,$30,$40,$50,$60
  3821.                 DCB.W 10,$70
  3822.                 DC.W $60,$50,$40,$30,$20,$10
  3823.                 DC.W $0100,$0200,$0300,$0400,$0500,$0600
  3824.                 DCB.W 10,$0700
  3825.                 DC.W $0600,$0500,$0400,$0300,$0200,$0100
  3826.                 DC.W $01,$02,$03,$04,$05,$06
  3827.                 DCB.W 10,$07
  3828.                 DC.W $06,$05,$04,$03,$02,$01
  3829.                 DC.W -1
  3830.  
  3831.  
  3832. instrpal:       DC.W $00,$0777
  3833.  
  3834. palette1:                                    ; Palette für Zahlen
  3835.                 DC.W $20,$0761,$0640,$0430,$0764,$0555,$0333,$00
  3836.                 DC.W $12,$23,$34,$45,$56,$0201,$0403,$0705
  3837. palette2:                                    ; Palette für Eisplatte
  3838.                 DC.W $20,$70,$0300,$0533,$0333,$00,$0124,$0225
  3839.                 DC.W $0235,$0335,$0346,$0457,$0557,$0567,$0677,$0777
  3840.  
  3841. cheatpalette:
  3842. ; Plattenfarben (oben) im Cheatmodus
  3843.                 DC.W $0102,$0304,$0507
  3844.  
  3845.  
  3846. plattenfarben:                               ; Paletten für Eisplatte
  3847.                 DC.W $20,$70,$0300,$0533,$0333,$00,$0124,$0225
  3848.                 DC.W $0235,$0335,$0346,$0457,$0557,$0567,$0677,$0777
  3849.  
  3850.                 DC.W $20,$70,$0300,$0533,$0333,$00,$0323,$0333
  3851.                 DC.W $0434,$0444,$0545,$0555,$0656,$0666,$0767,$0777
  3852.  
  3853.                 DC.W $20,$70,$0300,$0533,$0333,$00,$0100,$0200
  3854.                 DC.W $0310,$0420,$0531,$0642,$0753,$0764,$0775,$0776
  3855.  
  3856.                 DC.W $20,$70,$0300,$0533,$0333,$00,$01,$02
  3857.                 DC.W $13,$24,$0135,$0246,$0357,$0467,$0577,$0677
  3858.  
  3859.                 DC.W $20,$70,$0300,$0533,$0333,$00,$0232,$0333
  3860.                 DC.W $0343,$0444,$0454,$0555,$0565,$0666,$0676,$0777
  3861.  
  3862.                 DC.W $20,$70,$0300,$0533,$0333,$00,$0322,$0332
  3863.                 DC.W $0433,$0443,$0544,$0554,$0655,$0665,$0766,$0777
  3864.  
  3865.  
  3866. pausegraf:
  3867. ; Nummern der Wegelemente für Pause aus Wegstücken
  3868.                 DC.B 6,1,5,0,6,1,5,0,2,0,2,0,6,1,1,0,6,1,1,0
  3869.                 DC.B 2,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,2,0,0,0
  3870.                 DC.B 2,1,4,0,2,1,2,0,2,0,2,0,3,1,5,0,2,1,1,0
  3871.                 DC.B 2,0,0,0,2,0,2,0,2,0,2,0,0,0,2,0,2,0,0,0
  3872.                 DC.B 2,0,0,0,2,0,2,0,3,1,4,0,1,1,4,0,3,1,1,0
  3873.  
  3874. schatten:
  3875. ;$16
  3876.                 DC.W $00,$00,$00,$00,$00,$00,$00,$00
  3877.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3878.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3879.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3880.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3881.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3882.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3883.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3884.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3885.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3886.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3887.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3888.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3889.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3890.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3891.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3892.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3893.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3894.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3895.                 DC.W $00,$00,$00,$00,$c000,$00,$c000,$00
  3896.                 DC.W $3fff,$00,$3fff,$00,$c000,$00,$c000,$00
  3897.                 DC.W $3fff,$00,$3fff,$00,$c000,$00,$c000,$00
  3898. schattenmaske:
  3899.                 DC.W $00,$00,$00,$c000,$00,$c000,$00,$c000
  3900.                 DC.W $00,$c000,$00,$c000,$00,$c000,$00,$c000
  3901.                 DC.W $00,$c000,$00,$c000,$00,$c000,$00,$c000
  3902.                 DC.W $00,$c000,$00,$c000,$00,$c000,$00,$c000
  3903.                 DC.W $00,$c000,$00,$c000,$00,$c000,$00,$c000
  3904.                 DC.W $3fff,$c000,$3fff,$c000
  3905.  
  3906. mauszeiger:
  3907.                 DC.W $00,$0f00,$00,$00,$0680,$0f00,$80,$00
  3908.                 DC.W $0680,$0f00,$80,$00,$0680,$0f00,$80,$00
  3909.                 DC.W $00,$fff0,$00,$00,$76e8,$fff0,$08,$00
  3910.                 DC.W $76e8,$fff0,$08,$00,$08,$fff0,$08,$00
  3911.                 DC.W $76f8,$0f00,$70f8,$00,$0680,$0f00,$80,$00
  3912.                 DC.W $0680,$0f00,$80,$00,$80,$0f00,$80,$00
  3913.                 DC.W $0780,$00,$0780,$00
  3914.  
  3915. mauszeiger2:
  3916. ; für Menue
  3917.                 DC.W $00,$80,$ff00,$00,$7e00,$0100,$8000,$00
  3918.                 DC.W $7c00,$0200,$8000,$00,$7e00,$0100,$8000,$00
  3919.                 DC.W $7f00,$80,$8000,$00,$7f80,$40,$8000,$00
  3920.                 DC.W $7fc0,$00,$8000,$00,$4fc0,$3000,$8000,$00
  3921.                 DC.W $07c0,$4800,$8000,$00,$03c0,$8400,$00,$00
  3922.                 DC.W $01c0,$0200,$00,$00,$c0,$0100,$00,$00
  3923.                 DC.W $40,$80,$00,$00
  3924.  
  3925.  
  3926. chars8:
  3927.                 DC.W $fe18,$3c18,$183c,$ffe7,$7e,$1818,$f000,$05a0
  3928.                 DC.W $7c06,$7c7c,$c67c,$7c7c,$7c7c,$78,$07f0,$1104
  3929.                 DC.W $fe3c,$241c,$3899,$ffc3,$c3,$3c1c,$c000,$05a0
  3930.                 DC.W $c606,$0606,$c6c0,$c006,$c6c6,$60,$0ff8,$0b28
  3931.                 DC.W $fe66,$24f6,$6fc3,$fe99,$d3,$3c16,$fe00,$05a0
  3932.                 DC.W $c606,$0606,$c6c0,$c006,$c6c6,$3c78,$1fec,$0dd8
  3933.                 DC.W $fec3,$e783,$c1e7,$fc3c,$d3,$3c10,$d800,$0db0
  3934.                 DC.W $00,$7c7c,$7c7c,$7c00,$7c7c,$0660,$1804,$0628
  3935.                 DC.W $fee7,$c383,$c1c3,$f999,$db,$7e10,$de00,$0db0
  3936.                 DC.W $c606,$c006,$0606,$c606,$c606,$7e7e,$1804,$07d0
  3937.                 DC.W $fe24,$66f6,$6f99,$f3c3,$c3,$1070,$1800,$1998
  3938.                 DC.W $c606,$c006,$0606,$c606,$c606,$6618,$1004,$2e10
  3939.                 DC.W $fe24,$3c1c,$383c,$e7e7,$c3,$38f0,$1800,$799e
  3940.                 DC.W $7c06,$7c7c,$067c,$7c06,$7c7c,$3c1e,$1e3c,$39e0
  3941.                 DC.W $fe3c,$1818,$1800,$00,$7e,$1060,$00,$718e
  3942.                 DC.W $00,$00,$00,$00,$00,$00,$1754,$3800
  3943.                 DC.W $30,$cc00,$1800,$3818,$0e70,$00,$00,$02
  3944.                 DC.W $7c18,$fcfc,$c0fe,$7efe,$7c7c,$00,$0600,$603c
  3945.                 DC.W $30,$cc6c,$3e66,$6c18,$1c38,$6618,$00,$06
  3946.                 DC.W $c638,$0606,$c0c0,$c006,$c6c6,$1818,$0c00,$3066
  3947.                 DC.W $30,$ccfe,$606c,$3818,$1818,$3c18,$00,$0c
  3948.                 DC.W $e678,$0606,$d8c0,$c00c,$c6c6,$1818,$187e,$1806
  3949.                 DC.W $30,$6c,$3c18,$7000,$1818,$ff7e,$7e,$18
  3950.                 DC.W $d618,$7c3e,$fefc,$fc18,$7c7e,$00,$3000,$0c0c
  3951.                 DC.W $30,$6c,$0630,$de00,$1818,$3c18,$00,$30
  3952.                 DC.W $ce18,$c006,$1806,$c630,$c606,$1818,$1800,$1818
  3953.                 DC.W $00,$fe,$7c66,$cc00,$1c38,$6618,$3000,$1860
  3954.                 DC.W $c618,$c006,$1806,$c660,$c606,$1818,$0c7e,$3000
  3955.                 DC.W $30,$6c,$1846,$7600,$0e70,$00,$3000,$1840
  3956.                 DC.W $7cfe,$fefc,$18fc,$7cc0,$7c7c,$30,$0600,$6018
  3957.                 DC.W $00,$00,$00,$00,$00,$00,$6000,$00
  3958.                 DC.W $00,$00,$00,$00,$00,$00,$00,$00
  3959.                 DC.W $787c,$fc7c,$fc7e,$7e7e,$c6fe,$fec6,$c082,$867c
  3960.                 DC.W $fc7c,$fc7e,$fec6,$c6c6,$c6c6,$fe3c,$80f0,$2000
  3961.                 DC.W $ccc6,$c6c6,$c6c0,$c0c0,$c638,$06cc,$c0c6,$c6c6
  3962.                 DC.W $c2c6,$c6c0,$38c6,$c6c6,$6c6c,$0e30,$c030,$7000
  3963.                 DC.W $dcc6,$c6c0,$c6c0,$c0c0,$c638,$06d8,$c0ee,$e6c6
  3964.                 DC.W $c2c6,$c6c0,$38c6,$c6c6,$3838,$1c30,$6030,$d800
  3965.                 DC.W $d4fe,$fec0,$c6f8,$f8de,$fe38,$06f0,$c0d6,$d6c6
  3966.                 DC.W $fcd6,$fc7c,$38c6,$c6d6,$1038,$3830,$3031,$8c00
  3967.                 DC.W $dcc6,$c6c0,$c6c0,$c0c6,$c638,$06d8,$c0c6,$cec6
  3968.                 DC.W $c0ca,$d806,$38c6,$6cee,$3838,$7030,$1830,$00
  3969.                 DC.W $c0c6,$c6c6,$c6c0,$c0c6,$c638,$06cc,$c0c6,$c6c6
  3970.                 DC.W $c0c4,$cc06,$38c6,$38c6,$6c38,$e030,$0c30,$00
  3971.                 DC.W $7cc6,$fc7c,$fc7e,$c07c,$c6fe,$fcc6,$7ec6,$c67c
  3972.                 DC.W $c07a,$c6fc,$387c,$1082,$c638,$fe3c,$04f0,$01fc
  3973.                 DC.W $00,$00,$00,$00,$00,$00,$00,$00
  3974.                 DC.W $00,$00,$00,$00,$00,$00,$00,$00
  3975.                 DC.W $c000,$c000,$0600,$1e00,$c038,$18c0,$3800,$00
  3976.                 DC.W $00,$00,$3000,$00,$00,$0e,$1870,$1000
  3977.                 DC.W $6000,$c000,$0600,$3000,$c000,$cc,$1800,$00
  3978.                 DC.W $00,$00,$3000,$00,$00,$18,$1818,$3860
  3979.                 DC.W $307c,$fc7c,$7e7c,$307c,$fc38,$18d8,$18c6,$fc7c
  3980.                 DC.W $fc7e,$f87e,$78c6,$c6c6,$c6c6,$7e18,$1818,$6cf2
  3981.                 DC.W $06,$c6c6,$c6c6,$fcc6,$c638,$18f0,$18ee,$c6c6
  3982.                 DC.W $c6c6,$ccc0,$30c6,$c6c6,$6cc6,$0c30,$180c,$c69e
  3983.                 DC.W $7e,$c6c0,$c6fc,$30c6,$c638,$18d8,$18d6,$c6c6
  3984.                 DC.W $c6c6,$c07c,$30c6,$6cd6,$38c6,$1818,$1818,$0c
  3985.                 DC.W $c6,$c6c6,$c6c0,$307e,$c638,$18cc,$18c6,$c6c6
  3986.                 DC.W $fc7e,$c006,$30c6,$38ee,$6c7e,$3018,$1818,$00
  3987.                 DC.W $7e,$fc7c,$7e7e,$3006,$c638,$18c6,$3cc6,$c67c
  3988.                 DC.W $c006,$c0fc,$1c7c,$10c6,$c606,$7e0e,$1870,$00
  3989.                 DC.W $00,$00,$00,$30fc,$00,$f000,$00,$00
  3990.                 DC.W $c006,$00,$00,$00,$fc,$00,$1800,$00
  3991.  
  3992. kasten:
  3993.                 DC.W $ffff,$00,$00,$00,$8001,$00,$00,$00
  3994.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  3995.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  3996.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  3997.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  3998.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  3999.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  4000.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  4001.                 DC.W $8001,$00,$00,$00,$8001,$00,$00,$00
  4002.                 DC.W $8001,$00,$00,$00,$ffff,$00,$00,$00
  4003.  
  4004. kriesldat:
  4005.                 DC.W $fffd,$fff7,$fdff,$fffb,$bfff,$feff,$fffe,$ffdf
  4006.                 DC.W $dfff,$7fff,$ffef,$ffbf,$efff,$f7ff,$fbff,$ff7f
  4007.                 DC.W -1
  4008. krieslopcodes:  DC.W $e278,$e478,$e678
  4009.  
  4010. removeani1:     INCBIN 'REMOVEAN.IMG'
  4011.  
  4012. obenplatte:     INCBIN 'OBENPLAT.IMG'
  4013.  
  4014. tilesgrafik:    INCBIN 'TILES.IMG'
  4015. weggrafik       EQU tilesgrafik+(43*160)
  4016.  
  4017. helpplatten:    INCBIN 'HELPPLAT.IMG'
  4018.  
  4019. font:           INCBIN 'FONT2.IMG'
  4020.  
  4021. eisplatte:      INCBIN 'EISPLA2.IMG'
  4022. buffers:        INCBIN 'GAMEAREA.IMG'
  4023.  
  4024. menuplatte:     INCBIN 'MENUPLAT.IMG'
  4025.  
  4026. music:          INCBIN 'MATCHIT.MUS'
  4027.  
  4028. paket_tabelle:
  4029. ; hier steht die Länge der Tastaturpakete in Bytes
  4030.                 DC.B 6          ; $f7 (absolute Mausposition)
  4031.                 DC.B 3          ; $f8 - $fb (relative Mausposition)
  4032.                 DC.B 3          ; $f9
  4033.                 DC.B 3          ; $fa
  4034.                 DC.B 3          ; $fb
  4035.                 DC.B 7          ; $fc (Uhrzeit abfragen)
  4036.                 DC.B 1          ; $fd (?)
  4037.                 DC.B 2          ; $fe-$ff (Joystick)
  4038.                 DC.B 2          ; $ff
  4039.                 EVEN
  4040.  
  4041.  
  4042. fonttabelle:
  4043. ; in der Tabelle liegen die Positionen der Zeichen im Font, gleich mit
  4044. ; Größe multipliziert (14*10)=140 daher auch Words
  4045.  
  4046.                 DCB.W 33,46      ; 0-Space
  4047.                 DC.W 26         ; !
  4048.                 DC.W 41,46,46,46,46,40,43,44,46,46,42,45,39,46 ; "-/
  4049.                 DC.W 27,28,29,30,31,32,33,34,35,36 ; 0-9
  4050.                 DC.W 37,46,46,46,46,38,46 ; : bis @
  4051.                 DC.W 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
  4052.                 DC.W 16,17,18,19,20,21,22,23,24,25 ; A-Z
  4053. fonttabelleende:
  4054. fonttabellelaenge EQU fonttabelleende-fonttabelle
  4055.  
  4056.  
  4057. welldonetext:   DC.B "WELL DONE!",0
  4058. clearedstagetext:DC.B "YOU CLEARED STAGE ",0
  4059. scoretext:      DC.B "SCORE     :",0
  4060. timebonustext:  DC.B "TIME BONUS:",0
  4061. helpbonustext:  DC.B "HELP BONUS:",0
  4062. pressbuttontext:DC.B "HIT BUTTON TO GO ON!",0
  4063. gameovermess:   DC.B "GAME OVER",0
  4064. checkmatedmess: DC.B "CHECKMATED!",0
  4065. timeoutmess:    DC.B "TIME OUT!",0
  4066. gamesolvedmess: DC.B "GAME SOLVED!",0
  4067. madehighscoretext:DC.B "NEW HIGHSCORE!",0
  4068. onplacetext:    DC.B "YOU ARE ON PLACE",0
  4069. enternametext:  DC.B "NOW ENTER YOUR NAME:",0
  4070. defaultname:    DC.B "MR RETURN ",0
  4071. stage64text:    DC.B "YOU SOLVED THE GAME!",0
  4072. bonus64text:    DC.B "SOLUTION BONUS: 5000",0
  4073.  
  4074.  
  4075. instrtext1:     DC.B "****************",0
  4076.                 DC.B "* INSTRUCTIONS *",0
  4077.                 DC.B "****************",0
  4078.                 DC.B "MATCH-IT! is a game very similiar to",0
  4079.                 DC.B "'Shanghai'. Your target is to remove",0
  4080.                 DC.B "all tiles from a gameboard.",0
  4081.                 DC.B "This sounds easy, but there's a time-",0
  4082.                 DC.B "limit that makes the game very hard.",0
  4083.                 DC.B "You can select tiles by clicking on",0
  4084.                 DC.B "them with the left mousebutton.",0
  4085.                 DC.B "Deselect them with right mousebutton.",0
  4086.                 DC.B "You just can remove two similiar tiles",0
  4087.                 DC.B "and the connection line just can have",0
  4088.                 DC.B "two corners and must be on free area.",0
  4089.                 DC.B "There are some special tiles:",0
  4090.                 DC.B "FLOWERS AND SEASONS",0
  4091.                 DC.B "You can remove every flower with every",0
  4092.                 DC.B "flower (the same with seasons).",0
  4093.                 DC.B "Flowers and Seasons stop the timer for",0
  4094.                 DC.B "some seconds.",0
  4095.                 DC.B " ",0
  4096.                 DC.B "PRESS MOUSE-BUTTON TO GO TO NEXT PAGE!",0
  4097.                 DC.B -1
  4098.  
  4099. instrtext2:     DC.B "To make the game easier, there is a",0
  4100.                 DC.B "HELP-option. At the beginning of the",0
  4101.                 DC.B "game you have two helps. If you need",0
  4102.                 DC.B "help, just press on the HELP-KEY.",0
  4103.                 DC.B "If you completed a level without",0
  4104.                 DC.B "using the helpfunction, you get",0
  4105.                 DC.B "one help for free. All helps left",0
  4106.                 DC.B "will be added to your score at the",0
  4107.                 DC.B "end of each stage, so think when",0
  4108.                 DC.B "using them.",0
  4109.                 DC.B " ",0
  4110.                 DC.B "Possible keys during game:",0
  4111.                 DC.B "-P-         Pause game (try this) ",0
  4112.                 DC.B "-HELP-      Get help from computer",0
  4113.                 DC.B "-ESC-       Abort game            ",0
  4114.                 DC.B "-M-         Toggle Music on/off   ",0
  4115.                 DC.B " ",0
  4116.                 DC.B "PRESS MOUSE-BUTTON TO GO TO MENU!",0
  4117.                 DC.B -1
  4118.  
  4119.  
  4120. scrolltext:
  4121.         DC.B "      WELCOME TO MATCH-IT!    THIS GAME IS"
  4122.         DC.B " BUDGIE LICENCEWARE!    IT WAS WRITTEN BY"
  4123.         DC.B " NEW MODE (CODING), SLIME (GRAPHICS) AND BIG ALEC"
  4124.         DC.B " (MUSIC).     HIGHSCORES WILL BE SAVED ON DISK!"
  4125.         DC.B "  SO NOW HAVE FUN WITH THIS GAME!!!!    BYE!"
  4126.         DC.B "           ",0
  4127.  
  4128.                 EVEN
  4129.  
  4130. menutext1:      DC.B "START GAME",0
  4131. menutext2:      DC.B "SEE HIGHSCORES",0
  4132. menutext3:      DC.B "INSTRUCTIONS",0
  4133. menutext4:      DC.B "QUIT",0
  4134. menutext0:      DC.B "MATCH-IT !",0
  4135. savemess:       DC.B "SAVING HIGHSCORES!",0
  4136. wpmess:         DC.B " ",0
  4137.                 DC.B " ",0
  4138.                 DC.B "CAN'T SAVE SCORES",0
  4139.                 DC.B " ",0
  4140.                 DC.B "YOUR DISK IS",0
  4141.                 DC.B "WRITEPROTECTED....",0
  4142.                 DC.B " ",0
  4143.                 DC.B "SPACE TO TRY AGAIN",0
  4144.                 DC.B "OR -ESC- TO CANCEL",0,-1
  4145.                 EVEN
  4146.  
  4147. filename:    DC.B "HIGHSCOR.ES",0
  4148.         EVEN
  4149.  
  4150. highscores2:
  4151.                 DC.W 1000
  4152.                 DC.B 'NEW MODE  '
  4153.                 DC.W 900
  4154.                 DC.B 'SLIME     '
  4155.                 DC.W 800
  4156.         DC.B 'BIG ALEC  '
  4157.         DC.W 700
  4158.                 DC.B 'BUDGIE UK '
  4159.                 DC.W 600
  4160.                 DC.B 'DELTAFORCE'
  4161.                 DC.W 500
  4162.                 DC.B 'FRONT 242 '
  4163.                 DC.W 400
  4164.                 DC.B 'KRAFTWERK '
  4165.                 DC.W 300
  4166.                 DC.B 'NITZER EBB'
  4167.                 DC.W 200
  4168.                 DC.B 'THE SHAMEN'
  4169.                 DC.W 100
  4170.                 DC.B 'THE CURE  '
  4171.                 DS.B 512-120
  4172.                 EVEN
  4173.  
  4174. budgie_pal:
  4175.         dc.w    $0000,$0200,$0300,$0410,$0520,$0631,$0742,$0753
  4176.         dc.w    $0764,$0775,$0776,$0777,$0000,$0000,$0000,$0777
  4177.  
  4178. budgie_pic:    INCBIN 'BUDGIE.IMG'
  4179.  
  4180.  
  4181.                 BSS
  4182. ; ---------- System -------------
  4183. ssp:            DS.L 1          ; alter Supervisor Stack
  4184. hbl_buff:       DS.L 5          ; alte Interruptwerte
  4185. oldpal:         DS.L 8          ; alte Palette (16 Werte)
  4186. oldstack:       DS.L 1
  4187. leerfeld:       DS.L 8
  4188. oldscreen:    DS.L 1
  4189. oldres:        DS.W 1
  4190. old_vbl:    DS.L 1
  4191. ; ------------- Variable --------------
  4192. leveltab:       DS.B 64         ; dort sind die Levelnummern zufallsm. verteilt
  4193. highscoremade:  DS.W 1          ; ist Highscore gemacht worden?
  4194. keycounter:     DS.W 1
  4195. keybuffer:      DS.B 8          ; dort werden die Pakete abgelegt
  4196. keypointer:     DS.L 1          ; jeweils ein Pointer auf die Daten
  4197.  
  4198. palpointer1:    DS.L 1          ; Palettenpointer für Raster
  4199. palpointer2:    DS.L 1
  4200. savepalpoint1:  DS.L 1          ; dort wird Pointer gerettet
  4201. savepalpoint2:  DS.L 1          ; dort wird Pointer gerettet
  4202. blinkpos:       DS.L 1          ; Pointer für blinkenden Kasten
  4203. blinkanaus:     DS.W 1          ; 0=Blinken aus, 1=Blinken an
  4204. blinkdelay:     DS.W 1          ; Verzögerer für Blinken
  4205. screennumm:     DS.W 1          ; dort steht aktuelle ScreenNr.
  4206. weg:            DS.B 18*8       ; Dort wird der Weg gespeichert
  4207. matchitbuff2:   DS.B 20*10
  4208. matchitbuff:    DS.B 18*8       ; Dort sind die Tiles abgelegt
  4209. workbuff:       DS.B 18*8       ; Dort drin wird gearbeitet
  4210. posbuff:        DS.B 16*6       ; Die Positionen der Tiles
  4211. anzahl:         DS.W 1          ; Schleifenzähler
  4212. mousek:         DS.W 1          ; Maustaste
  4213. mousex:         DS.W 1          ; Mauskoordinaten
  4214. mousey:         DS.W 1
  4215. hilfspalette1:  DS.L 8          ; Palette 1 während Pause
  4216. hilfspalette2:  DS.L 8          ; Palette 2 während Pause
  4217. musicflag:      DS.W 1          ; 0 oder 1
  4218. rettbuff:       DS.B 212        ; Rettbuffer für Maus
  4219. counter1:       DS.W 1          ; Zwischenvariable zum Zählen
  4220. counter2:       DS.W 1          ; daselbe für Port 0
  4221. textpos:        DS.L 1          ; Position im Scrolltext
  4222. mempos:         DS.L 1          ; Position im Fontbuffer
  4223. mousepointer:   DS.L 1          ; Zeiger auf Grafik für Mauszeiger
  4224. zeichen:        DS.W 1          ; soviel schon gescrollt
  4225. endeflag:       DS.W 1          ; dort wird Ende angezeigt
  4226. regs1:          DS.L 3          ; Register für Löschroutine
  4227. regs2:          DS.L 3          ; Register für Löschroutine
  4228. xpos1:          DS.W 1          ; Koord. im Feld
  4229. ypos1:          DS.W 1
  4230. level:          DS.W 1          ; aktueller Level
  4231. paaranzahl:     DS.W 1          ; Anzahl der Paare auf dem Feld
  4232. helpcount:      DS.W 1          ; Anzahl der Helps
  4233. blumjzverz:     DS.W 1          ; Verzögerung durch Blume, etc.
  4234. blumjzverz2:    DS.W 1          ; Hilfs-Verzögerung für Blume
  4235. kasten1aktiv:   DS.W 1          ; Kasten 1 an/aus Flag
  4236.  
  4237. time:           DS.W 1          ; Zeit Spieler1
  4238. timeverzoegerung:
  4239.                 DS.W 1          ; Werte von 70-20
  4240. highscoreplatz: DS.W 1
  4241. namebuff:       DS.B 22
  4242. score:          DS.W 1          ; Punkte!
  4243. stage:          DS.W 1
  4244. scrollready:    DS.W 1
  4245. scrollsavebuff: DS.B 15*160
  4246. helpverbraucht: DS.W 1          ; 0= Keins verbraucht,1=verbraucht
  4247. helpbonus:      DS.W 1          ; Restliche Helps * 100
  4248. timestop:       DS.W 1          ; Zeit anhalten=1 sonst 0
  4249. readycount:     DS.W 1          ; Zähler für Scrolling
  4250. vblcount:       DS.W 1          ; Zählvariable
  4251. tile1selektx:   DS.W 1          ; X-Koord. des 1. Tiles
  4252. tile1selekty:   DS.W 1          ; Y-Koord. des 1. Tiles
  4253. tile2selektx:   DS.W 1          ; X-Koord. des 2. Tiles
  4254. tile2selekty:   DS.W 1          ; Y-Koord. des 2. Tiles
  4255. tile1selektpos: DS.B 1          ; Pos. des 1. Tiles
  4256. tile2selektpos: DS.B 1          ; Pos. des 2. Tiles
  4257. cheatmode:      DS.L 1          ; Pos. für Cheatmode
  4258. cheatpoint:     DS.L 1          ; dort Cheatmode
  4259. hexdezbuff:     DS.B 6          ; 6 Zahlen
  4260. hexdezbuff2:    DS.B 6          ; für Retten
  4261. fontbuff:       DS.B 47*15*10   ; 47 Zeichen*15 Scanlines*10 Bytes
  4262. wege:           DS.B 20*10*200
  4263. highscores:     DS.B 512
  4264.                 DS.B 512
  4265. screenbase:     DS.B 32000*4    ; Platz für 4 Screen
  4266.                 DS.B 20000      ; 20 Kilo Stack genügt!
  4267. stack:
  4268.                 END
  4269.