home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / dse-src5.dms / in.adf / scroller3.S < prev    next >
Encoding:
Text File  |  1990-05-07  |  17.1 KB  |  921 lines

  1.  
  2. ; RI   Font3           ==> font 
  3. ; RI   First_one_logo  ==> logo
  4.  
  5. ;org    $6a000
  6. ;load    $6a000
  7.  
  8. begin:
  9. move.l    $4,a6
  10. jsr    -132(a6)
  11.  
  12. move.b    #$ff,$bfd100
  13. move.b    #$87,$bfd100
  14.  
  15. lea    gfxname,a1
  16. jsr    -408(a6)
  17. move.l    d0,gfxbase
  18.  
  19. lea    $70000,a0
  20. lea    $80000,a1
  21.  
  22. clloop:
  23. clr.l    (a0)+
  24. cmp.l    a0,a1
  25. bne    clloop
  26.  
  27. lea    logo,a0
  28. lea    $70000,a1
  29. bsr    unpack
  30. bsr    setupcol
  31.  
  32. lea    font,a0
  33. lea    $77000,a1
  34. bsr    unpack
  35.  
  36. bsr    setcop
  37.  
  38. bsr     mt_init
  39.  
  40. move.l  #sprite,d0
  41. move.w  d0,sprite0+6
  42. swap    d0
  43. move.w  d0,sprite0+2
  44. bsr     sterne
  45.  
  46. move.l    $6c,oldirq+2
  47.  
  48. move.l    gfxbase,a0
  49. move.l    38(a0),oldclist
  50.  
  51. move.w    #$8180,$dff096
  52. move.l    #newclist,$dff080
  53. move.w    #0,$dff088
  54.  
  55. move.l    #newirq,$6c
  56.  
  57. wait:   
  58. move.b  $dff006,d0
  59. cmp.b   #$ff,d0
  60. bne     wait
  61. bsr     stern_move
  62. btst    #6,$bfe001
  63. bne    wait
  64. eor.b   #02,$bfe001
  65. move.l    oldirq+2,$6c
  66. move.l    oldclist,$dff080
  67. move.w    #0,$dff088
  68.  
  69. move.w    #$f,$dff096
  70. move.w    #0,$dff0a8
  71. move.w    #0,$dff0b8
  72. move.w    #0,$dff0c8
  73. move.w    #0,$dff0d8
  74.  
  75. move.l    $4,a6
  76. move.l    gfxbase,a1
  77. jsr    -414(a6)
  78. jsr    -138(a6)
  79. rts
  80.  
  81. nextchr:
  82. move.w    #26,newchar
  83. move.l    textzeiger,a6
  84.  
  85. nextchr1:
  86. move.b    (a6)+,d0
  87. bne    nextchr2
  88. move.l    #text,a6
  89. bra    nextchr1
  90.  
  91. nextchr2:
  92. cmp.b    #'+',d0
  93. bne    nextchr3
  94. move.b    (a6)+,d0
  95. sub.b    #'0',d0
  96. move.b    d0,xshft+1
  97. bra    nextchr1
  98.  
  99. nextchr3:
  100. move.l    #38,d1
  101. lea    asc,a0
  102.  
  103. lprint:
  104. cmp.b    (a0,d1.l),d0
  105. beq    okprint
  106. sub.l    #1,d1
  107. bpl    lprint
  108. add.l    #1,a6
  109. move.l    a6,textzeiger
  110. rts
  111.  
  112. okprint:
  113. lsl.l    #2,d1
  114. add.l    #atable,d1
  115. move.l    d1,a2
  116. move.l    (a2),a0
  117. lea    $7b028,a1
  118.  
  119. move.l    a6,textzeiger
  120. return:
  121. move.l    #32,d0
  122.  
  123. loopset:
  124. move.b    (a0),(a1)
  125. move.b    1(a0),1(a1)
  126. move.b    2(a0),2(a1)
  127. clr.b    3(a1)
  128. move.b    $28(a0),$2c(a1)
  129. move.b    $29(a0),$2d(a1)
  130. move.b    $2a(a0),$2e(a1)
  131. clr.b    $2f(a1)
  132. move.b    $50(a0),$58(a1)
  133. move.b    $51(a0),$59(a1)
  134. move.b    $52(a0),$5a(a1)
  135. clr.b    $5b(a1)
  136. add.l    #$78,a0
  137. add.l    #$84,a1
  138. sub.w    #1,d0
  139. bne    loopset
  140. rts
  141.  
  142. a = $77000
  143. b = $77000 + [$28*3*32]
  144. c = $77000 + [$28*3*64]
  145. d = $77000 + [$28*3*96]
  146.  
  147. asc:    dc.b    "abcdefghijklmnopqrstuvwxyz0123456789!- "
  148.  
  149. even
  150. atable:    dc.l    a,a+3,a+6,a+9,a+12,a+15,a+18,a+21,a+24,a+27
  151.     dc.l    a+30,a+33,a+36
  152.     dc.l    b,b+3,b+6,b+9,b+12,b+15,b+18,b+21,b+24,b+27
  153.     dc.l    b+30,b+33,b+36
  154.     dc.l    c,c+3,c+6,c+9,c+12,c+15,c+18,c+21,c+24,c+27
  155.     dc.l    c+30,c+33,c+36
  156.  
  157. inhalt:    dc.l $80000000,$00008000,$00008000,$80008000
  158.     dc.l $80008000
  159.  
  160. speed:    dc.b 2,4,1,3,5,3,2,1,3,2,5,1,4,3,4,3,4,1,3,2,5,4,3,2,5
  161.     dc.b 2,3,1,5,4,1,4,2,3,1,4,3,2,5,1,3,2,4,5,1,2,4,5,3,1
  162.     dc.b 4,3,5,1,2,1,4,4,5,3,2,4,1,5,2,4,2,5,3,5,3,4,3,1,4
  163.     dc.b 4,5,3,2,4,1,3,4,1,3,2,5,4,1,3,4,2,3,1,4,3,4,1,2,5
  164.     dc.b 3,5,1,4,3,5,2,4,2,5,1,4,2,3,4,1,3,5,2,4,3,2,1,5,3
  165.     dc.b 4,3,5,1,2,4,1
  166.  
  167.  
  168. xpos:    dc.b $1e,$4f,$ab,$dd,$1b,$bb,$6a,$f3,$88,$ab,$f3,$73
  169.     dc.b $27,$8a,$0e,$22,$bc,$3b,$20,$0e,$91,$14,$59,$f0
  170.     dc.b $d5,$79,$b0,$32,$d3,$55,$b1,$95,$89,$5b,$c3,$99
  171.     dc.b $01,$30,$d4,$c3,$b9,$a1,$7e,$91,$09,$4e,$70,$a0
  172.     dc.b $c0,$5b,$1a,$98,$81,$d3,$22,$48,$91,$c5,$ff,$12
  173.     dc.b $45,$95,$a1,$39,$e0,$84,$05,$b4,$af,$76,$72,$19
  174.     dc.b $49,$58,$c0,$d2,$e2,$92,$19,$f5,$06,$35,$a8,$d3
  175.     dc.b $89,$7e,$29,$90,$a4,$12,$b9,$c0,$e3,$88,$41,$2e
  176.     dc.b $59,$12,$f0,$c3,$6e,$91,$2c,$55,$79,$1c,$01,$96
  177.     dc.b $a5,$c1,$d9,$e7,$14,$86,$10,$99,$d3,$69,$a3,$c8
  178.     dc.b $93,$12,$f5,$28,$c2,$39,$92,$a0,$38,$bb,$e1,$e3
  179.  
  180.  
  181. textzeiger:    dc.l    text
  182.  
  183. font:           blk.b   7194,0
  184. logo:           blk.b   12042,0
  185. sprite:         blk.l   265,0
  186.  
  187. clear1:
  188. btst    #6,$dff002
  189. bne    clear1
  190. rts
  191.  
  192. newirq:
  193. movem.l    d0-d7/a0-a6,-(a7)
  194.  
  195.  
  196. move.l    #$7b000,d0
  197. bsr    scroll
  198. tst.w    newchar
  199. bpl    irq1
  200. ;eor.b #02,$bfe001
  201. bsr    nextchr
  202. ;eor.b #02,$bfe001
  203. irq1:
  204.  
  205. endirq:
  206. bsr     mt_music
  207. movem.l    (sp)+,d0-d7/a0-a6
  208. oldirq:
  209. jmp    $000000
  210.  
  211. unpack:    add.l    #12,a0
  212.     move.l    4(a0),d0
  213.     add.l    d0,a0
  214.     add.l    #8,a0
  215.     move.l    a0,cmapchunk
  216.  
  217. iff1:    cmp.l    #$424f4459,(a0)
  218.     beq    iff0
  219.     add.l    #2,a0
  220.     bra    iff1
  221.  
  222. iff0:    move.l    4(a0),d0    ; Anzahl Bytes
  223.     add.l    #1,d0
  224.     and.l    #$fffffffe,d0
  225.  
  226.     add.l    #8,a0        ; Pointer to first Byte
  227.  
  228. iff4:    clr.l    d2
  229.     move.b    (a0)+,d2
  230.     bmi    iff6
  231.  
  232. iff5:    move.b    (a0)+,(a1)+
  233.     subi.l    #1,d0
  234.     subi.b    #1,d2
  235.     bpl    iff5
  236.     bra    iff7
  237.     
  238. iff6:    neg.b    d2
  239.     beq    iff7
  240.  
  241. iff61:    move.b    (a0),(a1)+
  242.     subi.b    #1,d2
  243.     bpl    iff61
  244.     subi.l    #1,d0
  245.     add.l    #1,a0
  246.  
  247. iff7:    subi.l    #1,d0
  248.     bmi    iff8
  249.     beq    iff8
  250.     bra    iff4
  251.  
  252. iff8:    move.l    cmapchunk,a0
  253.     move.l    cmap,a1
  254.     add.l    #8,a0
  255.     move.l    #16,d0
  256.  
  257. cmaploop:
  258.     clr.l    d1
  259.     move.b    (a0),d1
  260.     lsl.w    #4,d1
  261.     move.b    2(a0),d1
  262.     lsr.b    #4,d1
  263.     or.b    1(a0),d1
  264.     move.w    d1,(a1)+
  265.     add.l    #3,a0
  266.     sub.w    #1,d0
  267.     bne    cmaploop
  268.     rts
  269.  
  270. cmapchunk:
  271.     dc.l    0
  272.  
  273. cmap:    dc.l    color1
  274.  
  275. color1:    blk.w    16,0
  276.  
  277. setupcol:
  278. lea    color1,a0
  279. lea    copcol,a1
  280. move.l    #$01800000,d0
  281. move.l    #16,d1
  282.  
  283. suc1:
  284. move.w    (a0)+,d0
  285. move.l    d0,(a1)+
  286. add.l    #$00020000,d0
  287. sub.w    #1,d1
  288. bne    suc1
  289. bchg #1,$bfe001
  290. rts
  291.  
  292. newchar:dc.w    24
  293. xshft:    dc.w    1
  294.  
  295. scroll:    tst.w    xshft
  296.     bne    scroll2
  297.     rts
  298.  
  299. scroll2:move.w    xshft,d1
  300.     sub.w    d1,newchar
  301.     move.l    d0,$dff054
  302.     add.l    #2,d0
  303.     move.l    d0,$dff050
  304.     move.w    #0,$dff064
  305.     move.w    #0,$dff066
  306.     move.l    #$ffffffff,$dff044
  307.     move.w    #16,d1
  308.     sub.w    xshft,d1
  309.     lsl.w    #8,d1
  310.     lsl.w    #4,d1
  311.     or.w    #$09f0,d1
  312.     move.w    d1,$dff040
  313.     move.w    #0,$dff042
  314.     move.w    #$1816,$dff058
  315.     bra    clear1
  316.  
  317. sterne:    clr.l    d0            ;Set stars (as Sprite 1, which
  318.     clr.l    d2            ; reuses the DMA channel)
  319.     lea    xpos(pc),a0        ;table with X-coordinates
  320.     lea    speed(pc),a2        ;table with speed/color (1-5)
  321.     lea    sprite(pc),a1        ;sprite start (Datalist)
  322.     move.b    #$20,d0            ;start at line 32
  323. sternloop:
  324.     clr.l    d1
  325.     lea    inhalt-4(pc),a3        ;table with color
  326.     move.b    d0,(a1)+        ;set sprite vertikal
  327.     move.b    (a0)+,(a1)+        ;set sprite horizontal
  328.     addq.w    #1,d0            ;add 1 for V-stop position
  329.     move.b    d0,(a1)+        ;set vertikal stop
  330.     move.b    d2,(a1)+        ;sprite vert. < or > 255 ??
  331.     move.b    (a2)+,d1
  332.     lsl.w    #2,d1
  333.     add.l    d1,a3
  334.     move.l    (a3),(a1)+        ;set color
  335.     addq.w    #1,d0            ;next sprite reuse !!
  336.     cmp.w    #$00fe,d0        ;until line 254 (then I must
  337.     ble.S    sternloop        ; change vertikal bit 8 to 1
  338.     moveq    #6,d2            ;<= this is it (Bit8 = 1)
  339.     cmp.w    #$0128,d0        ;end in line 296
  340.     bne.S    sternloop
  341.     rts                ;all stars are set
  342.  
  343. stern_move:
  344.     move.w    #131,d0            ;move 306 points
  345.     lea    speed(pc),a2        ;table with speed (1/5)
  346.     lea    sprite+1(pc),a1        ;1. sprite X-position
  347. move_loop:
  348.     move.b    (a1),d1            ;sprite X to d1
  349.     move.b    (a2)+,d2        ;speed to d2
  350.     add.b    d2,d1            ;add d1 to d2 (stars to the
  351.     move.b    d1,(a1)            ;              right)
  352.     add.l    #8,a1            ;point to next line
  353.     dbf    d0,move_loop        ;until all stars are moved
  354.     rts                ;end of sprite moving !
  355.  
  356.  
  357. newclist:
  358. dc.w    $008e,$2c61,$0090,$2cd1,$0092,$0038,$0094,$00d0
  359. dc.w    $0102,$0000,$0104,$0000,$0108,$0078,$010a,$0078
  360. dc.w    $0100,$4200,$0180,$0000
  361.  
  362. adr:
  363. dc.w    $00e0,$0007,$00e2,$00,$00e4,$0007,$00e6,$28
  364. dc.w    $00e8,$0007,$00ea,$50,$00ec,$0007,$00ee,$78
  365. sprite0:
  366. dc.w    $120,0,$122,0,$124,0,$126,0,$128,0,$12a,0,$12c,0
  367. dc.w    $12e,0,$130,0,$132,0,$134,0,$136,0,$138,0,$13a,0
  368. dc.w    $13c,0,$13e,0,$1a2,$888,$1a4,$aaa,$1a6,$fff
  369. copcol:
  370. blk.l    16,0
  371. frcol:
  372. blk.w    32,0
  373. dc.w    $d811,$fffe,$180,0,$182,$aaa,$184,$400
  374. dc.w    $186,$004,$188,$040,$18a,$080,$18c,$800,$18e,$008
  375. dc.w    $0100,$0200,$e0,$7,$e2,$b000
  376. dc.w    $e4,$7,$e6,$b02c,$e8,$7,$ea,$b058,$102,0
  377. dc.w    $108,$5c,$10a,$5c
  378. dc.w    $da11,$fffe,$180,0,$0100,$3200
  379. dc.w    $e011,$fffe,$180,$b00
  380. dc.w    $e111,$fffe,$180,$f00
  381. dc.w    $e411,$fffe,$180,$b00
  382. dc.w    $e511,$fffe,$180,$000
  383. dc.w    $e811,$fffe,$180,$00b
  384. dc.w    $e911,$fffe,$180,$00f
  385. dc.w    $ec11,$fffe,$180,$00b
  386. dc.w    $ed11,$fffe,$180,$000
  387. dc.w    $f011,$fffe,$180,$0b0
  388. dc.w    $f111,$fffe,$180,$0f0
  389. dc.w    $f411,$fffe,$180,$0b0
  390. dc.w    $f511,$fffe,$180,$000
  391. end:
  392.  
  393. oldclist:
  394. dc.l    0
  395. gfxbase:
  396. dc.l    0
  397. gfxname:
  398. dc.b    "graphics.library",0
  399. even
  400.  
  401. yko:    dc.b    $54,0
  402.  
  403. setcol:
  404. move.l    a1,a3
  405. add.l    #4,a3
  406. move.w    (a4),2(a3)
  407. rts
  408.  
  409. setcop:
  410. lea    table,a6
  411. lea    frcol,a2
  412. lea    frcol,a1
  413. move.l    trck1,a4
  414. move.l    #8,d3
  415. nsc:
  416. move.b    (a6)+,d5
  417. add.b    yko,d5
  418. move.b    d5,(a2)+
  419. move.b    #$11,(a2)+
  420. move.w    #$fffe,(a2)+
  421. move.l    #$01020000,(a2)+
  422. bsr    setcol
  423. add.l    #8,a1
  424. add.l    #2,a4
  425. subi.l    #1,d3
  426. bne    nsc
  427. rts
  428.  
  429. copscroll:
  430. clr.l    d6
  431. move.b    1(a2),d0
  432. add.b    d0,(a2)
  433. bcc    scrl1
  434. add.l    #2,a3
  435. cmp.l    a3,a5
  436. bne    scrl2
  437. lea    track1,a3
  438.  
  439. scrl2:
  440. move.l    a3,a4
  441. move.l    #7,d2
  442. move.l    a1,a0
  443. add.l    #4,a0
  444.  
  445. scrl3:
  446. move.w    50(a0),58(a0)
  447. sub.l    #8,a0
  448. sub.l    #1,d2
  449. bne    scrl3
  450. move.l    a3,zwsp
  451. jsr    setcol
  452. move.l    zwsp,a3
  453.  
  454. scrl1:
  455. clr.l    d0
  456. move.b    (a2),d0
  457. lsr.w    #2,d0
  458. and.w    #$fff8,d0
  459. lea    table,a0
  460. add.l    d0,a0
  461. move.l    #8,d2
  462.  
  463. scrl4:
  464. move.b    (a0)+,d0
  465. add.b    yko,d0
  466. move.b    d0,(a1)
  467. add.l    #8,a1
  468. sub.l    #1,d2
  469. bne    scrl4
  470. rts
  471.  
  472. zwsp:    dc.l    0
  473. count1:    dc.b    0,80
  474. trck1:    dc.l    track1
  475. etrck1:    dc.l    etrack1
  476.  
  477. table:    dc.b 13,21,29,37,45,53,61,69
  478.     dc.b 14,22,30,38,46,54,62,70
  479.     dc.b 15,23,31,39,47,55,63,71
  480.     dc.b 16,24,32,40,48,56,64,72
  481.     dc.b 17,25,33,41,49,57,65,73
  482.     dc.b 18,26,34,42,50,58,66,74
  483.     dc.b 19,27,35,43,51,59,67,75
  484.     dc.b 20,28,36,44,52,60,68,76
  485.  
  486. track1:    dc.w    0,0,0,0,0,0,0,0 
  487.         dc.w    0,0,0,0,0,0,0,0
  488.         dc.w    $f00,$e00,$d00,$c00,$b00,$a00,$900,$800
  489.     dc.w    $710,$620,$530,$440,$350,$260,$170
  490.     dc.w    $080,$090,$0a0,$0b0,$0c0,$0d0,$0e0,$0f0
  491.     dc.w    $e0,$d0,$c0,$b0,$a0,$90,$80
  492.     dc.w    $71,$62,$53,$44,$35,$26,$17
  493.     dc.w    $008,$009,$00a,$00b,$00c,$00d,$00e,$00f
  494.     dc.w    $00e,$00d,$00c,$00b,$00a,$009,$008
  495.     dc.w    $117,$226,$335,$444,$555,$666,$777
  496.     dc.w    $888,$999,$aaa,$bbb,$ccc,$ddd,$eee,$ddd
  497.     dc.w    $ccc,$bbb,$aaa,$999,$888,$887
  498.     dc.w    $886,$885,$884,$883,$882,$881
  499.     dc.w    $880,$990,$aa0,$bb0,$cc0,$dd0,$ee0,$ff0
  500.     dc.w    $fe0,$fd0,$fc0,$fb1,$fa2,$f93,$f84,$f75
  501.     dc.w    $f66,$f55,$f44,$f33,$f22,$f11
  502. etrack1:
  503. text:    dc.b "+3  howdy!!  this is sigma striking with their first"
  504.         dc.b " intro "
  505.         dc.b "ever on this wonderful machine! release date for this intro"
  506.         dc.b " is the 5th of june 1989"
  507.         dc.b "  first some credits  -  "
  508.         dc.b "coding by me            +1- mastermind -"            
  509.         dc.b "             +3and             +1- mr f -"
  510.         dc.b "             +3all graphics by           "     
  511.         dc.b "  +1- megastar -              "
  512.         dc.b "+3the great music is made by frederic hahn "
  513.         dc.b " megastar composed some music in soundtracker but when"
  514.         dc.b " he was finished after about 5 hours of work his amiga said"
  515.         dc.b " poff and it was gone!!  i was angry  mr f was angry and"
  516.         dc.b " megastar was maaaaaaad as hell!!" 
  517.         dc.b " now i am going to tell you a little about sigmas history!"
  518.         dc.b " sigma was founded by me and megastar about 8 months ago"
  519.         dc.b "  in the beginning we were gigalamers!! we did not know"
  520.         dc.b " anything about the amiga  actually we were lamers until"
  521.         dc.b " my birthday the 14th of march 1989!  at my birthday i got"
  522.         dc.b " the technical reference series and i started to code in"
  523.         dc.b " seka  the result after 3 months spare time coding can"
  524.         dc.b " you see on the screen right now!!!  we did it in a weekend"
  525.         dc.b " when we were gatherd together at my place  we did not get"
  526.         dc.b " to much sleep that weekend i can ensure you that!"
  527.         dc.b "  now to the mezzies - mastermind sends a mezzie to"
  528.         dc.b " striper of horizon -- please send my disks back now!!! --" 
  529.         dc.b " megastar sends mezzies to all musaxers -- we need you "
  530.         dc.b " feel free to contact megastar at            +1roger"
  531.         dc.b " nilsson             skragatan 20            275 36  sjobo"
  532.         dc.b "             sweden              +3now some greetz - special greetz to"
  533.         dc.b "+5            - delta of triax - big bang of air force -"
  534.         dc.b " iceman of oversize - striper of horizon - the taxman of" 
  535.         dc.b " bsc -             bye from sigma"
  536.         dc.b "+9 -------------------------------- ",0
  537.  
  538.         
  539. ; -----------------------------------------------------------------
  540. ; ------- Mega fast playroutine for D.O.C-SoundTracker V2.1 -------
  541. ; -----------------------------------------------------------------
  542. ; ---------- Improved and omptimized by Unknown of D.O.C ----------
  543. ; --------------- Based on the playroutine from TJC ---------------
  544. ; -----------------------------------------------------------------
  545.  
  546. mt_init:lea    mt_data(pc),a0
  547.     add.l    #$01d8,a0
  548.     move.l    #$0080,d0
  549.     moveq    #$00,d1
  550. mt_init1:
  551.     move.l    d1,d2
  552.     subq.w    #1,d0
  553. mt_init2:
  554.     move.b    (a0)+,d1
  555.     cmp.b    d2,d1
  556.     bgt.s    mt_init1
  557.     dbf    d0,mt_init2
  558.     addq.b    #1,d2
  559.  
  560. mt_init3:
  561.     lea    mt_data(pc),a0
  562.     lea    mt_sample1(pc),a1
  563.     asl.l    #$08,d2
  564.     asl.l    #$02,d2
  565.     add.l    #$0258,d2
  566.     add.l    a0,d2
  567.     moveq    #$0e,d0
  568. mt_init4:
  569.     move.l    d2,(a1)+
  570.     moveq    #$00,d1
  571.     move.w    42(a0),d1
  572.     asl.l    #1,d1
  573.     add.l    d1,d2
  574.     add.l    #$1e,a0
  575.     dbf    d0,mt_init4
  576.  
  577.     lea    mt_sample1(pc),a0
  578.     moveq    #$00,d0
  579. mt_clear:
  580.     move.l    (a0,d0),a1
  581.     clr.l    (a1)
  582.     addq.l    #4,d0
  583.     cmp.l    #$3c,d0
  584.     bne.s    mt_clear
  585.  
  586.     clr.w    $dff0a8
  587.     clr.w    $dff0b8
  588.     clr.w    $dff0c8
  589.     clr.w    $dff0d8
  590.     clr.l    mt_partnrplay
  591.     clr.l    mt_partnote
  592.     clr.l    mt_partpoint
  593.  
  594.     move.b    mt_data+$1d6,mt_maxpart+1
  595.     rts
  596.  
  597. mt_end:    clr.w    $dff0a8
  598.     clr.w    $dff0b8
  599.     clr.w    $dff0c8
  600.     clr.w    $dff0d8
  601.     move.w    #$000f,$dff096
  602.     rts
  603.  
  604. mt_music:
  605.     addq.l    #1,mt_counter
  606. mt_cool:cmp.l    #6,mt_counter
  607.     bne.s    mt_notsix
  608.     clr.l    mt_counter
  609.     bra    mt_rout2
  610.  
  611. mt_notsix:
  612.     lea    mt_aud1temp(pc),a6
  613.     tst.b    3(a6)
  614.     beq.s    mt_arp1
  615.     lea    $dff0a0,a5        
  616.     bsr.s    mt_arprout
  617. mt_arp1:lea    mt_aud2temp(pc),a6
  618.     tst.b    3(a6)
  619.     beq.s    mt_arp2
  620.     lea    $dff0b0,a5
  621.     bsr.s    mt_arprout
  622. mt_arp2:lea    mt_aud3temp(pc),a6
  623.     tst.b    3(a6)
  624.     beq.s    mt_arp3
  625.     lea    $dff0c0,a5
  626.     bsr.s    mt_arprout
  627. mt_arp3:lea    mt_aud4temp(pc),a6
  628.     tst.b    3(a6)
  629.     beq.s    mt_arp4
  630.     lea    $dff0d0,a5
  631.     bra.s    mt_arprout
  632. mt_arp4:rts
  633.  
  634. mt_arprout:
  635.     move.b    2(a6),d0
  636.     and.b    #$0f,d0
  637.     tst.b    d0
  638.     beq.s    mt_arpegrt
  639.     cmp.b    #1,d0
  640.     beq.s    mt_portup
  641.     cmp.b    #2,d0
  642.     beq.s    mt_portdwn
  643.     rts
  644.  
  645. mt_portup:
  646.     moveq    #$00,d0
  647.     move.b    3(a6),d0
  648.     sub.w    d0,22(a6)
  649.     cmp.w    #$71,22(a6)
  650.     bpl.s    mt_ok1
  651.     move.w    #$71,22(a6)
  652. mt_ok1:    move.w    22(a6),6(a5)
  653.     rts
  654.  
  655. mt_portdwn:
  656.     moveq    #$00,d0
  657.     move.b    3(a6),d0
  658.     add.w    d0,22(a6)
  659.     cmp.w    #$358,22(a6)
  660.     bmi.s    mt_ok2
  661.     move.w    #$358,22(a6)
  662. mt_ok2:    move.w    22(a6),6(a5)
  663.     rts
  664.  
  665. mt_arpegrt:
  666.     cmp.l    #1,mt_counter
  667.     beq.s    mt_loop2
  668.     cmp.l    #2,mt_counter
  669.     beq.s    mt_loop3
  670.     cmp.l    #3,mt_counter
  671.     beq.s    mt_loop4
  672.     cmp.l    #4,mt_counter
  673.     beq.s    mt_loop2
  674.     cmp.l    #5,mt_counter
  675.     beq.s    mt_loop3
  676.     rts
  677.  
  678. mt_loop2:
  679.     moveq    #$00,d0
  680.     move.b    3(a6),d0
  681.     lsr.b    #4,d0
  682.     bra.s    mt_cont
  683. mt_loop3:
  684.     moveq    #$00,d0
  685.     move.b    3(a6),d0
  686.     and.b    #$0f,d0
  687.     bra.s    mt_cont
  688. mt_loop4:
  689.     move.w    16(a6),d2
  690.     bra.s    mt_endpart
  691. mt_cont:
  692.     asl.w    #1,d0
  693.     moveq    #$00,d1
  694.     move.w    16(a6),d1
  695.     lea    mt_arpeggio(pc),a0
  696. mt_loop5:
  697.     move.w    (a0,d0),d2
  698.     cmp.w    (a0),d1
  699.     beq.s    mt_endpart
  700.     addq.l    #2,a0
  701.     bra.s    mt_loop5
  702. mt_endpart:
  703.     move.w    d2,6(a5)
  704.     rts
  705.  
  706. mt_rout2:
  707.     lea    mt_data(pc),a0
  708.     move.l    a0,a3
  709.     add.l    #$0c,a3
  710.     move.l    a0,a2
  711.     add.l    #$1d8,a2
  712.     add.l    #$258,a0
  713.     move.l    mt_partnrplay,d0
  714.     moveq    #$00,d1
  715.     move.b    (a2,d0),d1
  716.     asl.l    #$08,d1
  717.     asl.l    #$02,d1
  718.     add.l    mt_partnote,d1
  719.     move.l    d1,mt_partpoint
  720.     clr.w    mt_dmacon
  721.  
  722.     lea    $dff0a0,a5
  723.     lea    mt_aud1temp(pc),a6
  724.     bsr    mt_playit
  725.     lea    $dff0b0,a5
  726.     lea    mt_aud2temp(pc),a6
  727.     bsr    mt_playit
  728.     lea    $dff0c0,a5
  729.     lea    mt_aud3temp(pc),a6
  730.     bsr    mt_playit
  731.     lea    $dff0d0,a5
  732.     lea    mt_aud4temp(pc),a6
  733.     bsr    mt_playit
  734.     move.w    #$008a,d1
  735. mt_loop:dbf    d1,mt_loop
  736.     move.w    #$8000,d0
  737.     or.w    mt_dmacon,d0
  738.     move.w    d0,$dff096
  739.  
  740.     lea    mt_aud4temp(pc),a6
  741.     cmp.w    #1,14(a6)
  742.     bne.s    mt_voice3
  743.     move.l    10(a6),$dff0d0
  744.     move.w    #1,$dff0d4
  745. mt_voice3:
  746.     lea    mt_aud3temp(pc),a6
  747.     cmp.w    #1,14(a6)
  748.     bne.s    mt_voice2
  749.     move.l    10(a6),$dff0c0
  750.     move.w    #1,$dff0c4
  751. mt_voice2:
  752.     lea    mt_aud2temp(pc),a6
  753.     cmp.w    #1,14(a6)
  754.     bne.s    mt_voice1
  755.     move.l    10(a6),$dff0b0
  756.     move.w    #1,$dff0b4
  757. mt_voice1:
  758.     lea    mt_aud1temp(pc),a6
  759.     cmp.w    #1,14(a6)
  760.     bne.s    mt_voice0
  761.     move.l    10(a6),$dff0a0
  762.     move.w    #1,$dff0a4
  763. mt_voice0:
  764.     move.l    mt_partnote,d0
  765.     add.l    #$10,d0
  766.     move.l    d0,mt_partnote
  767.     cmp.l    #$400,d0
  768.     bne.s    mt_stop
  769. mt_higher:
  770.     clr.l    mt_partnote
  771.     addq.l    #1,mt_partnrplay
  772.     moveq    #$00,d0
  773.     move.w    mt_maxpart,d0
  774.     move.l    mt_partnrplay,d1
  775.     cmp.l    d0,d1
  776.     bne.s    mt_stop
  777.     clr.l    mt_partnrplay
  778.  
  779. mt_stop:tst.w    mt_status
  780.     beq.s    mt_stop2
  781.     clr.w    mt_status
  782.     bra.s    mt_higher
  783. mt_stop2:
  784.     rts
  785.  
  786. mt_playit:
  787.     move.l    (a0,d1),(a6)
  788.     addq.l    #4,d1
  789.     moveq    #$00,d2
  790.     move.b    2(a6),d2
  791.     and.b    #$f0,d2
  792.     lsr.b    #4,d2
  793.     tst.b    d2
  794.     beq.s    mt_nosamplechange
  795.  
  796.     moveq    #$00,d3
  797.     lea    mt_samples(pc),a1
  798.     move.l    d2,d4
  799.     asl.l    #2,d2
  800.     mulu    #$1e,d4
  801.     move.l    (a1,d2),4(a6)
  802.     move.w    (a3,d4),8(a6)
  803.     move.w    2(a3,d4),18(a6)
  804.     move.w    4(a3,d4),d3
  805.     tst.w    d3
  806.     beq.s    mt_displace
  807.     move.l    4(a6),d2
  808.     add.l    d3,d2
  809.     move.l    d2,4(a6)
  810.     move.l    d2,10(a6)
  811.     move.w    6(a3,d4),8(a6)
  812.     move.w    6(a3,d4),14(a6)
  813.     move.w    18(a6),8(a5)
  814.     bra.s    mt_nosamplechange
  815.  
  816. mt_displace:
  817.     move.l    4(a6),d2
  818.     add.l    d3,d2
  819.     move.l    d2,10(a6)
  820.     move.w    6(a3,d4),14(a6)
  821.     move.w    18(a6),8(a5)
  822. mt_nosamplechange:
  823.     tst.w    (a6)
  824.     beq.s    mt_retrout
  825.     move.w    (a6),16(a6)
  826.     move.w    20(a6),$dff096
  827.     move.l    4(a6),(a5)
  828.     move.w    8(a6),4(a5)
  829.     move.w    (a6),6(a5)
  830.     move.w    20(a6),d0
  831.     or.w    d0,mt_dmacon
  832.  
  833. mt_retrout:
  834.     tst.w    (a6)
  835.     beq.s    mt_nonewper
  836.     move.w    (a6),22(a6)
  837.  
  838. mt_nonewper:
  839.     move.b    2(a6),d0
  840.     and.b    #$0f,d0
  841.     cmp.b    #11,d0
  842.     beq.s    mt_posjmp
  843.     cmp.b    #12,d0
  844.     beq.s    mt_setvol
  845.     cmp.b    #13,d0
  846.     beq.s    mt_break
  847.     cmp.b    #14,d0
  848.     beq.s    mt_setfil
  849.     cmp.b    #15,d0
  850.     beq.s    mt_setspeed
  851.     rts
  852.  
  853. mt_posjmp:
  854.     not.w    mt_status
  855.     moveq    #$00,d0
  856.     move.b    3(a6),d0
  857.     subq.b    #$01,d0
  858.     move.l    d0,mt_partnrplay
  859.     rts
  860.  
  861. mt_setvol:
  862.     move.b    3(a6),8(a5)
  863.     rts
  864.  
  865. mt_break:
  866.     not.w    mt_status
  867.     rts
  868.  
  869. mt_setfil:
  870.     moveq    #$00,d0
  871.     move.b    3(a6),d0
  872.     and.b    #$01,d0
  873.     rol.b    #$01,d0
  874.     and.b    #$fd,$bfe001
  875.     or.b    d0,$bfe001
  876.     rts
  877.  
  878. mt_setspeed:
  879.     move.b    3(a6),d0
  880.     and.b    #$0f,d0
  881.     beq.s    mt_back
  882.     clr.l    mt_counter
  883.     move.b    d0,mt_cool+5
  884. mt_back:rts
  885.  
  886. mt_aud1temp:
  887.     blk.w    10,0
  888.     dc.w    $0001
  889.     blk.w    2,0
  890. mt_aud2temp:
  891.     blk.w    10,0
  892.     dc.w    $0002
  893.     blk.w    2,0
  894. mt_aud3temp:
  895.     blk.w    10,0
  896.     dc.w    $0004
  897.     blk.w    2,0
  898. mt_aud4temp:
  899.     blk.w    10,0
  900.     dc.w    $0008
  901.     blk.w    2,0
  902. mt_partnote:    dc.l    0
  903. mt_partnrplay:    dc.l    0
  904. mt_counter:    dc.l    0
  905. mt_partpoint:    dc.l    0
  906. mt_samples:dc.l    0
  907. mt_sample1:blk.l 15,0
  908. mt_maxpart:dc.w    $0000
  909. mt_dmacon:dc.w    $0000
  910. mt_status:dc.w    $0000
  911.  
  912. mt_arpeggio:
  913. dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  914. dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  915. dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  916. dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  917. dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  918.  
  919. mt_data:
  920. blk.b    109226,0
  921.