home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 4: Demo 1 / almathera_demo1.bin / sourcecode / amigacomputing / the-right-button-demo.s < prev   
Text File  |  1995-03-17  |  17KB  |  1,045 lines

  1.  
  2.  section amigacomputing,code_c
  3.  opt c-,o+,d+
  4.  opt o3-         (use this with DEVPAC V2.14)
  5.  
  6.  
  7. go:
  8.  
  9.  
  10.  
  11.  
  12.  bset #1,$bfe001
  13.  
  14.  lea GFXLIB,a1
  15.  MOVEQ #0,D0
  16.  MOVE.L 4.w,a6
  17.  JSR -$228(a6) ; OpenLibrary
  18.  TST D0
  19.  BEQ ERROR
  20.  MOVE.L D0,GFXBASE
  21.  
  22.  bsr mt_init
  23.  
  24. ; move.l 4.w,a6
  25. ; jsr -132(a6)
  26.  
  27.  move.l #showplane2,d0
  28.  move.w d0,eq0l
  29.  swap d0
  30.  move.w d0,eq0h 
  31.  move.l #amigalogo,d0
  32.  move.w d0,pl0l
  33.  swap d0
  34.  move.w d0,pl0h
  35.  swap d0
  36.  add.l #3840,d0
  37.  move.w d0,pl1l
  38.  swap d0
  39.  move.w d0,pl1h
  40.  swap d0
  41.  add.l #3840,d0
  42.  move.w d0,pl2l
  43.  swap d0
  44.  move.w d0,pl2h
  45.  swap d0
  46.  add.l #3840,d0
  47.  move.w d0,pl3l
  48.  swap d0
  49.  move.w d0,pl3h
  50.  
  51.  SWAP D0
  52.  ADD.L #3840,D0
  53.  MOVE.l d0,a0
  54.  lea cols,a1
  55.  moveq #15,d1
  56.  move.w #$180,d2
  57. tt 
  58.  move.w d2,(a1)+
  59.  addq.w #$2,d2
  60.  move.w (a0)+,(a1)+
  61.  dbra d1,tt
  62.  
  63.  
  64.  
  65.  
  66.  MOVE.L GFXBASE,A6
  67.  ADD.L #$32,A6
  68.  MOVE.W #$80,$dff096
  69.  MOVE.L (A6),OLDCOPPER
  70.  MOVE.L #NEWCOPPER,(A6)
  71.  MOVE.W #$8080,$dff096
  72.  
  73.  move.w #$8010,$dff09a
  74.  move.l $6c.w,old
  75.  move.l  #new,$6c.w
  76.  
  77.  move.w #%001111000010,$dff098        ; mask for collision
  78. ;       ||||||||||||            
  79. ;      ||||||000010 = Colour 2    (red)
  80. ;      001111       = Bitplanes 1 to 4 enabled
  81.  
  82.  
  83. WAIT: btst #6,$BFE001
  84.  Bne.s wait
  85.  
  86.  move.l old,$6c.w
  87.  
  88.  
  89.  MOVE.L GFXBASE,A6
  90.  ADD.L #$32,A6
  91.  
  92.  MOVE.W #$0080,$dff096
  93.  MOVE.L OLDCOPPER,(A6)
  94.  MOVE.W #$8080,$dff096
  95.  
  96.  
  97.  
  98. ERROR: 
  99.  
  100. ; move.l 4.w,a6
  101. ; jsr -138(a6)
  102.  
  103.  moveq #0,d0
  104.  move.w #$f,$dff096
  105.  clr.w $dff0a8
  106.  clr.w $dff0b8
  107.  clr.w $dff0c8
  108.  clr.w $dff0d8
  109.  RTS
  110.  
  111. even
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120. new:
  121.  
  122.  
  123.  movem.l d0-d7/a0-a6,-(sp)
  124.  and #$10,$dff01e        
  125.  beq out
  126.  move.w #$10,$dff09c
  127.  
  128. ; interupt routine goes in here
  129.  
  130.  bsr mt_music
  131.  btst #7,$bfe001
  132.  beq out
  133.  bsr blitclear
  134.  bsr equalizer2
  135.  
  136.  cmp.b #0,counter
  137.  bne.s notzero
  138.  move.b #1,counter
  139.  
  140.  move.w #%001111000001,$dff098        ; mask for collision
  141. ;       ||||||||||||            
  142. ;      ||||||000001 = Colour 1    (red)
  143. ;      001111       = Bitplanes 1 to 4 enabled
  144.  
  145.  move.w $dff00e,d0
  146.  
  147.  cmp.w #$8021,d0     (value for a hit with box 1)
  148.  bne out
  149.  btst #10,$dff016    ; is the right button pressed?
  150.  bne out
  151.  ; now restart song....
  152.  
  153.  
  154.  clr.l    mt_partnrplay
  155.  clr.l    mt_partnote
  156.  clr.l    mt_partpoint
  157.  
  158.  
  159.  bra.s out
  160.  
  161. notzero:
  162.  
  163.  cmp.b #1,counter
  164.  bne.s notone
  165.  move.b #2,counter
  166.  
  167.  move.w #%001111000010,$dff098        
  168.  move.w $dff00e,d0
  169.  
  170.  cmp.w #$8021,d0     (value for a hit with box 3)
  171.  bne.s out
  172.  btst #10,$dff016    ; is the right button pressed?
  173.  bne.s out
  174.  ; now change cols
  175.  
  176.  lea coppercols+6,a0
  177.  moveq #45,d0
  178. copchglp
  179.  eor.w #$fff,(a0)
  180.  addq.l #8,a0
  181.  dbra d0,copchglp
  182.  
  183.  
  184.  
  185.  bra.s out
  186.  
  187.  
  188.  bra.s out
  189.  
  190. notone: 
  191.  
  192.  move.b #0,counter
  193.  move.w #%001111000011,$dff098
  194.  move.w $dff00e,d0
  195.  
  196.  cmp.w #$8021,d0     (value for a hit with box 2)
  197.  bne.s out
  198.  btst #10,$dff016    ; is the right button pressed?
  199.  bne.s out
  200.  ; now toggle filter
  201.  bchg #1,$bfe001
  202.  
  203.  
  204. out: movem.l (sp)+,d0-d7/a0-a6
  205.  
  206.  
  207.  dc.w $4ef9
  208. old: dc.l 0
  209.  
  210. counter dc.w 0
  211.  
  212. OLDCOPPER: DC.L 0
  213. NEWCOPPER:
  214.  dc.w $100,0,$180,0,$4309,$fffe
  215.  dc.w $100,$1200,$102,$0,$104,$a,$108,0,$10a,0
  216.  dc.w $92,$38,$94,$d0,$8e,$2c81,$90,$2cc1
  217.  
  218.     dc.w $e0
  219. eq0h: dc.w 0,$e2
  220. eq0l: dc.w 0,$182,0
  221.  
  222. coppercols
  223.  dc.w $4409,$fffe,$182,$f00
  224.  dc.w $4609,$fffe,$182,$f10
  225.  dc.w $4809,$fffe,$182,$f20
  226.  dc.w $4a09,$fffe,$182,$f30
  227.  dc.w $4c09,$fffe,$182,$f40
  228.  dc.w $4e09,$fffe,$182,$f50
  229.  dc.w $5009,$fffe,$182,$f60
  230.  dc.w $5209,$fffe,$182,$f70
  231.  dc.w $5409,$fffe,$182,$f80
  232.  dc.w $5609,$fffe,$182,$f90
  233.  dc.w $5809,$fffe,$182,$fa0
  234.  dc.w $5a09,$fffe,$182,$fb0
  235.  dc.w $5c09,$fffe,$182,$fc0
  236.  dc.w $5e09,$fffe,$182,$fd0
  237.  dc.w $6009,$fffe,$182,$fe0
  238.  dc.w $6209,$fffe,$182,$ff0
  239.  dc.w $6409,$fffe,$182,$ef0
  240.  dc.w $6609,$fffe,$182,$df0
  241.  dc.w $6809,$fffe,$182,$cf0
  242.  dc.w $6a09,$fffe,$182,$bf0
  243.  dc.w $6c09,$fffe,$182,$af0
  244.  dc.w $6e09,$fffe,$182,$9f0
  245.  dc.w $7009,$fffe,$182,$8f0
  246.  dc.w $7209,$fffe,$182,$7f0
  247.  dc.w $7409,$fffe,$182,$6f0
  248.  dc.w $7609,$fffe,$182,$5f0
  249.  dc.w $7809,$fffe,$182,$4f0
  250.  dc.w $7a09,$fffe,$182,$3f0
  251.  dc.w $7c09,$fffe,$182,$2f0
  252.  dc.w $7e09,$fffe,$182,$1f0
  253.  dc.w $8009,$fffe,$182,$0f0
  254.  dc.w $8209,$fffe,$182,$f1
  255.  dc.w $8409,$fffe,$182,$f2
  256.  dc.w $8609,$fffe,$182,$f3
  257.  dc.w $8809,$fffe,$182,$f4
  258.  dc.w $8a09,$fffe,$182,$f5
  259.  dc.w $8c09,$fffe,$182,$f6
  260.  dc.w $8e09,$fffe,$182,$f7
  261.  dc.w $9009,$fffe,$182,$f8
  262.  dc.w $9209,$fffe,$182,$f9
  263.  dc.w $9409,$fffe,$182,$fa
  264.  dc.w $9609,$fffe,$182,$fb
  265.  dc.w $9809,$fffe,$182,$fc
  266.  dc.w $9a09,$fffe,$182,$fd
  267.  dc.w $9c09,$fffe,$182,$fe
  268.  dc.w $9e09,$fffe,$182,$ff
  269.     dc.w $9f09,$fffe
  270.     dc.w $100,$4200,$e0
  271. pl0h: dc.w    0,$e2
  272. pl0l: dc.w    0,$e4
  273. pl1h: dc.w    0,$e6
  274. pl1l: dc.w    0,$e8
  275. pl2h: dc.w    0,$ea
  276. pl2l: dc.w    0,$ec
  277. pl3h: dc.w    0,$ee
  278. pl3l: dc.w    0
  279.  
  280. COLS DCB.W 32,0
  281.  
  282.  dc.w $9c,$8010
  283.   dc.w $ff09,$fffe,$100,0
  284.  
  285.   DC.W $FFFF,$FFFE ; End copper
  286. gfxlib: dc.b "graphics.library",0 ; Yeuch! Libraries!!!!!
  287.  EVEN
  288. gfxbase: dc.l 0
  289.  
  290. amigalogo: incbin "sources:musiclogo"
  291.  
  292.  
  293.  
  294. upbig equ 25
  295. upsmall equ 12
  296. downvalue equ 1
  297. barht equ 80
  298. winheight equ 165
  299.  
  300. ***********SPECTRUM ANALYZER (EQUALIQUIZER) ROUTINE**************
  301. ***********========================================**************
  302.  
  303.  
  304. ; yes, this was in the first demo!
  305.  
  306. eqsub:    move.w (a0),d0
  307.     bne.s eqsub2
  308.     rts
  309.  
  310. eqsub2    clr.w (a0)
  311.     lea notetable,a1
  312.     moveq #0,d1
  313. nomatch    move.w (a1)+,d2            ; this works out the position
  314.     cmp.w d2,d0            ; along the equalizer for the
  315.     bgt.s match            ; bar by using the note table
  316.     addq.b #1,d1            ; in the music play routine
  317.     bra.s nomatch
  318. match    ;move.w d1,testpt2
  319.     lea eqtab(pc),a1
  320.     add.l d1,a1
  321.     add.b #upbig,(a1)
  322.     add.b #upsmall,-1(a1)
  323.     add.b #upsmall,1(a1)
  324.     
  325. noplus    move.b (a1),d0
  326.     cmp.b #barht,d0
  327.     bls.s less50
  328.     move.b #barht,(a1)
  329. less50    move.b -1(a1),d0
  330.     cmp.b #barht-2,d0
  331.     bls.s less41
  332.     move.b #barht-2,-1(a1)
  333. less41    move.b 1(a1),d0
  334.     cmp.b #barht-2,d0
  335.     bls.s less42
  336.     move.b #barht-2,1(a1)
  337. less42    
  338.     rts
  339.  
  340.  
  341.  
  342.  
  343. equalizer2
  344.  
  345.  
  346.     
  347.     lea eq1p,a0
  348.     bsr.s eqsub
  349.     lea eq2p,a0
  350.     bsr.s eqsub
  351.     lea eq3p,a0
  352.     bsr.s eqsub
  353.     lea eq4p,a0
  354.     bsr.s eqsub
  355. blitfin2:
  356.     btst #14,$dff002        
  357.     bne.s blitfin2        ; wait till blitter ready
  358.  
  359.     moveq #39,d0        ; 40 segments    
  360.     
  361.     lea eqtab(pc),a1     ; table
  362.     lea showplane2,a2    ; picture
  363. mainlp    moveq #0,d1
  364.     move.b (a1),d1        ; get byte
  365.     move.l d1,d4        ;
  366.     neg.w d1
  367.     add.w #barht/2+6,d1        ; subtract from bar height
  368.     mulu #80,d1        ; multiply by 80
  369.     
  370.     
  371. fillbar    
  372.     move.b #%11111110,0(a2,d1)    ; splat on equalizer
  373.     add.w #80,d1
  374.     dbra d4,fillbar
  375.     
  376.     
  377.     move.b (a1),d3
  378. ;    cmp.b #0,d3
  379.     ;beq iszero
  380.     subq.b #downvalue,(a1)
  381.     bpl.s izok        ; hasn't gone below zero
  382.     move.b #0,(a1)
  383. izok    addq.l #1,a2
  384.     addq.l #1,a1
  385.     dbf d0,mainlp
  386.     
  387.  
  388.     rts
  389.  
  390.  
  391.  
  392.     
  393. blitclear:
  394.     lea showplane2,a0        ; visible bitplane
  395. blitfin:
  396.     btst #14,$dff002        
  397.     bne.s blitfin            ; wait till blitter ready
  398.  
  399.     move.l a0,$dff054        ; source address
  400.     move.l a0,$dff050        ; destination address
  401.     clr.l $dff044            ; no FWM/LWM (see hardware manual)
  402.     clr.l $dff064            ; no MODULO (see hardware manual)
  403.  
  404.     move.w #%100000000,$dff040     ; Enable DMA channel D, nothing
  405.                     ; else, no minterms active. 
  406.     clr.w $dff042            ; nothing set in BLTCON1
  407.     move.w #20+64*winheight,$dff058    
  408.  
  409.  
  410.  
  411.     rts
  412.     
  413. eq1 dc.b 0
  414. eq2 dc.b 0
  415. eq3 dc.b 0
  416. eq4 dc.b 0
  417. eq1p dc.w 381
  418. eq2p dc.w 381
  419. eq3p dc.w 381
  420. eq4p dc.w 381
  421. eqtab dcb.w 40
  422.  
  423.  
  424.  
  425. mt_init:lea    mt_data,a0
  426.     add.l    #$03b8,a0
  427.     moveq    #$7f,d0
  428.     moveq    #0,d1
  429. mt_init1:
  430.     move.l    d1,d2
  431.     subq.w    #1,d0
  432. mt_init2:
  433.     move.b    (a0)+,d1
  434.     cmp.b    d2,d1
  435.     bgt.s    mt_init1
  436.     dbf    d0,mt_init2
  437.     addq.b    #1,d2
  438.  
  439. mt_init3:
  440.     lea    mt_data,a0
  441.     lea    mt_sample1(pc),a1
  442.     asl.l    #8,d2
  443.     asl.l    #2,d2
  444.     add.l    #$438,d2
  445.     add.l    a0,d2
  446.     moveq    #$1e,d0
  447. mt_init4:
  448.     move.l    d2,(a1)+
  449.     moveq    #0,d1
  450.     move.w    42(a0),d1
  451.     asl.l    #1,d1
  452.     add.l    d1,d2
  453.     add.l    #$1e,a0
  454.     dbf    d0,mt_init4
  455.  
  456.     lea    mt_sample1(PC),a0
  457.     moveq    #0,d0
  458. mt_clear:
  459.     move.l    (a0,d0.w),a1
  460.     clr.l    (a1)
  461.     addq.w    #4,d0
  462.     cmp.w    #$7c,d0
  463.     bne.s    mt_clear
  464.  
  465.     clr.w    $dff0a8
  466.     clr.w    $dff0b8
  467.     clr.w    $dff0c8
  468.     clr.w    $dff0d8
  469.     clr.l    mt_partnrplay
  470.     clr.l    mt_partnote
  471.     clr.l    mt_partpoint
  472.  
  473.     move.b    mt_data+$3b6,mt_maxpart+1
  474.     rts
  475.  
  476. ; call 'mt_end' to switch the sound off
  477.  
  478. mt_end:    clr.w    $dff0a8
  479.     clr.w    $dff0b8
  480.     clr.w    $dff0c8
  481.     clr.w    $dff0d8
  482.     move.w    #$f,$dff096
  483.     rts
  484.  
  485. ; the playroutine - call this every frame
  486.  
  487. mt_music:
  488.     addq.w    #1,mt_counter
  489. mt_cool:cmp.w    #6,mt_counter
  490.     bne.s    mt_notsix
  491.     clr.w    mt_counter
  492.     bra    mt_rout2
  493.  
  494. mt_notsix:
  495.     lea    mt_aud1temp(PC),a6
  496.     tst.b    3(a6)
  497.     beq.s    mt_arp1
  498.     lea    $dff0a0,a5        
  499.     bsr.s    mt_arprout
  500. mt_arp1:lea    mt_aud2temp(PC),a6
  501.     tst.b    3(a6)
  502.     beq.s    mt_arp2
  503.     lea    $dff0b0,a5
  504.     bsr.s    mt_arprout
  505. mt_arp2:lea    mt_aud3temp(PC),a6
  506.     tst.b    3(a6)
  507.     beq.s    mt_arp3
  508.     lea    $dff0c0,a5
  509.     bsr.s    mt_arprout
  510. mt_arp3:lea    mt_aud4temp(PC),a6
  511.     tst.b    3(a6)
  512.     beq.s    mt_arp4
  513.     lea    $dff0d0,a5
  514.     bra.s    mt_arprout
  515. mt_arp4:rts
  516.  
  517. mt_arprout:
  518.     move.b    2(a6),d0
  519.     and.b    #$0f,d0
  520.     tst.b    d0
  521.     beq    mt_arpegrt
  522.     cmp.b    #$01,d0
  523.     beq.s    mt_portup
  524.     cmp.b    #$02,d0
  525.     beq.s    mt_portdwn
  526.     cmp.b    #$0a,d0
  527.     beq.s    mt_volslide
  528.     rts
  529.  
  530. mt_portup:
  531.     moveq    #0,d0
  532.     move.b    3(a6),d0
  533.     sub.w    d0,22(a6)
  534.     cmp.w    #$71,22(a6)
  535.     bpl.s    mt_ok1
  536.     move.w    #$71,22(a6)
  537. mt_ok1:    move.w    22(a6),6(a5)
  538.     rts
  539.  
  540. mt_portdwn:
  541.     moveq    #0,d0
  542.     move.b    3(a6),d0
  543.     add.w    d0,22(a6)
  544.     cmp.w    #$538,22(a6)
  545.     bmi.s    mt_ok2
  546.     move.w    #$538,22(a6)
  547. mt_ok2:    move.w    22(a6),6(a5)
  548.     rts
  549.  
  550. mt_volslide:
  551.     moveq    #0,d0
  552.     move.b    3(a6),d0
  553.     lsr.b    #4,d0
  554.     tst.b    d0
  555.     beq.s    mt_voldwn
  556.     add.w    d0,18(a6)
  557.     cmp.w    #64,18(a6)
  558.     bmi.s    mt_ok3
  559.     move.w    #64,18(a6)
  560. mt_ok3:    move.w    18(a6),8(a5)
  561.     rts
  562. mt_voldwn:
  563.     moveq    #0,d0
  564.     move.b    3(a6),d0
  565.     and.b    #$0f,d0
  566.     sub.w    d0,18(a6)
  567.     bpl.s    mt_ok4
  568.     clr.w    18(a6)
  569. mt_ok4:    move.w    18(a6),8(a5)
  570.     rts
  571.  
  572. mt_arpegrt:
  573.     move.w    mt_counter(PC),d0
  574.     cmp.w    #1,d0
  575.     beq.s    mt_loop2
  576.     cmp.w    #2,d0
  577.     beq.s    mt_loop3
  578.     cmp.w    #3,d0
  579.     beq.s    mt_loop4
  580.     cmp.w    #4,d0
  581.     beq.s    mt_loop2
  582.     cmp.w    #5,d0
  583.     beq.s    mt_loop3
  584.     rts
  585.  
  586. mt_loop2:
  587.     moveq    #0,d0
  588.     move.b    3(a6),d0
  589.     lsr.b    #4,d0
  590.     bra.s    mt_cont
  591. mt_loop3:
  592.     moveq    #$00,d0
  593.     move.b    3(a6),d0
  594.     and.b    #$0f,d0
  595.     bra.s    mt_cont
  596. mt_loop4:
  597.     move.w    16(a6),d2
  598.     bra.s    mt_endpart
  599. mt_cont:
  600.     add.w    d0,d0
  601.     moveq    #0,d1
  602.     move.w    16(a6),d1
  603.     and.w    #$fff,d1
  604.     lea    mt_arpeggio(PC),a0
  605. mt_loop5:
  606.     move.w    (a0,d0),d2
  607.     cmp.w    (a0),d1
  608.     beq.s    mt_endpart
  609.     addq.l    #2,a0
  610.     bra.s    mt_loop5
  611. mt_endpart:
  612.     move.w    d2,6(a5)
  613.     rts
  614.  
  615. mt_rout2:
  616.     lea    mt_data,a0
  617.     move.l    a0,a3
  618.     add.l    #$0c,a3
  619.     move.l    a0,a2
  620.     add.l    #$3b8,a2
  621.     add.l    #$43c,a0
  622.     move.l    mt_partnrplay(PC),d0
  623.     moveq    #0,d1
  624.     move.b    (a2,d0),d1
  625.     asl.l    #8,d1
  626.     asl.l    #2,d1
  627.     add.l    mt_partnote(PC),d1
  628.     move.l    d1,mt_partpoint
  629.     clr.w    mt_dmacon
  630.  
  631.     lea    $dff0a0,a5
  632.     lea    mt_aud1temp(PC),a6
  633.     bsr    mt_playit
  634.     lea    $dff0b0,a5
  635.     lea    mt_aud2temp(PC),a6
  636.     bsr    mt_playit
  637.     lea    $dff0c0,a5
  638.     lea    mt_aud3temp(PC),a6
  639.     bsr    mt_playit
  640.     lea    $dff0d0,a5
  641.     lea    mt_aud4temp(PC),a6
  642.     bsr    mt_playit
  643.     move.w    #$01f4,d0
  644. mt_rls:    dbf    d0,mt_rls
  645.  
  646.     move.w    #$8000,d0
  647.     or.w    mt_dmacon,d0
  648.     move.w    d0,$dff096
  649.  
  650.     lea    mt_aud4temp(PC),a6
  651.     cmp.w    #1,14(a6)
  652.     bne.s    mt_voice3
  653.     move.l    10(a6),$dff0d0
  654.  
  655.     move.b #$1c,eq4
  656.     move.w (a6),eq4p
  657.  
  658.     move.w    #1,$dff0d4
  659. mt_voice3:
  660.     lea    mt_aud3temp(PC),a6
  661.     cmp.w    #1,14(a6)
  662.     bne.s    mt_voice2
  663.     move.l    10(a6),$dff0c0
  664.  
  665.     move.b #$1c,eq3
  666.     move.w (a6),eq3p
  667.  
  668.     move.w    #1,$dff0c4
  669. mt_voice2:
  670.     lea    mt_aud2temp(PC),a6
  671.     cmp.w    #1,14(a6)
  672.     bne.s    mt_voice1
  673.     move.l    10(a6),$dff0b0
  674.  
  675.     move.b #$1c,eq2
  676.     move.w (a6),eq2p
  677.  
  678.     move.w    #1,$dff0b4
  679. mt_voice1:
  680.     lea    mt_aud1temp(PC),a6
  681.     cmp.w    #1,14(a6)
  682.     bne.s    mt_voice0
  683.     move.l    10(a6),$dff0a0
  684.  
  685.     move.b #$1c,eq1
  686.     move.w (a6),eq1p
  687.  
  688.     move.w    #1,$dff0a4
  689. mt_voice0:
  690.     move.l    mt_partnote(PC),d0
  691.     add.l    #$10,d0
  692.     move.l    d0,mt_partnote
  693.     cmp.l    #$400,d0
  694.     bne.s    mt_stop
  695. mt_higher:
  696.     clr.l    mt_partnote
  697.     addq.l    #1,mt_partnrplay
  698.     moveq    #0,d0
  699.     move.w    mt_maxpart(PC),d0
  700.     move.l    mt_partnrplay(PC),d1
  701.     cmp.l    d0,d1
  702.     bne.s    mt_stop
  703.     clr.l    mt_partnrplay
  704. ;    st    Pflag
  705. mt_stop:tst.w    mt_status
  706.     beq.s    mt_stop2
  707.     clr.w    mt_status
  708.     bra.s    mt_higher
  709. mt_stop2:
  710.     rts
  711.  
  712. mt_playit:
  713.     move.l    (a0,d1.l),(a6)
  714.     addq.l    #4,d1
  715.     moveq    #0,d2
  716.     move.b    2(a6),d2
  717.     and.b    #$f0,d2
  718.     lsr.b    #4,d2
  719.  
  720.     move.b    (a6),d0
  721.     and.b    #$f0,d0
  722.     or.b    d0,d2
  723.     tst.b    d2
  724.     beq.s    mt_nosamplechange
  725.  
  726.     moveq    #0,d3
  727.     lea    mt_samples(PC),a1
  728.     move.l    d2,d4
  729.     asl.l    #2,d2
  730.     mulu    #$1e,d4
  731.     move.l    (a1,d2),4(a6)
  732.     move.w    (a3,d4.l),8(a6)
  733.     move.w    2(a3,d4.l),18(a6)
  734.     move.w    4(a3,d4.l),d3
  735.     tst.w    d3
  736.     beq.s    mt_displace
  737.     move.l    4(a6),d2
  738.     add.l    d3,d2
  739.     move.l    d2,4(a6)
  740.     move.l    d2,10(a6)
  741.     move.w    6(a3,d4.l),8(a6)
  742.     move.w    6(a3,d4.l),14(a6)
  743.     move.w    18(a6),8(a5)
  744.     bra.s    mt_nosamplechange
  745.  
  746. mt_displace:
  747.     move.l    4(a6),d2
  748.     add.l    d3,d2
  749.     move.l    d2,10(a6)
  750.     move.w    6(a3,d4.l),14(a6)
  751.     move.w    18(a6),8(a5)
  752. mt_nosamplechange:
  753.     move.w    (a6),d0
  754.     and.w    #$fff,d0
  755.     tst.w    d0
  756.     beq.s    mt_retrout
  757.     move.w    (a6),16(a6)
  758.     move.w    20(a6),$dff096
  759.     move.l    4(a6),(a5)
  760.     move.w    8(a6),4(a5)
  761.     move.w    (a6),d0
  762.     and.w    #$fff,d0
  763.     move.w    d0,6(a5)
  764.     move.w    20(a6),d0
  765.     or.w    d0,mt_dmacon
  766.  
  767. mt_retrout:
  768.     tst.w    (a6)
  769.     beq.s    mt_nonewper
  770.     move.w    (a6),22(a6)
  771.  
  772. mt_nonewper:
  773.     move.b    2(a6),d0
  774.     and.b    #$0f,d0
  775.     cmp.b    #$0b,d0
  776.     beq.s    mt_posjmp
  777.     cmp.b    #$0c,d0
  778.     beq.s    mt_setvol
  779.     cmp.b    #$0d,d0
  780.     beq.s    mt_break
  781.     cmp.b    #$0e,d0
  782.     beq.s    mt_setfil
  783.     cmp.b    #$0f,d0
  784.     beq.s    mt_setspeed
  785.     rts
  786.  
  787. mt_posjmp:
  788.     not.w    mt_status
  789.     moveq    #0,d0
  790.     move.b    3(a6),d0
  791.     subq.b    #1,d0
  792.     move.l    d0,mt_partnrplay
  793.     rts
  794.  
  795. mt_setvol:
  796.     move.b    3(a6),8(a5)
  797.     rts
  798.  
  799. mt_break:
  800.     not.w    mt_status
  801.     rts
  802.  
  803. mt_setfil:
  804.     moveq    #0,d0
  805.     move.b    3(a6),d0
  806.     and.b    #1,d0
  807.     rol.b    #1,d0
  808.     and.b    #$fd,$bfe001
  809.     or.b    d0,$bfe001
  810.     rts
  811.  
  812. mt_setspeed:
  813.     move.b    3(a6),d0
  814.     and.b    #$0f,d0
  815.     beq.s    mt_back
  816.     clr.w    mt_counter
  817.     move.b    d0,mt_cool+3
  818. mt_back:rts
  819.  
  820. mt_aud1temp:
  821.     dcb.w    10,0
  822.     dc.w    1
  823.     dcb.w    2,0
  824. mt_aud2temp:
  825.     dcb.w    10,0
  826.     dc.w    2
  827.     dcb.w    2,0
  828. mt_aud3temp:
  829.     dcb.w    10,0
  830.     dc.w    4
  831.     dcb.w    2,0
  832. mt_aud4temp:
  833.     dcb.w    10,0
  834.     dc.w    8
  835.     dcb.w    2,0
  836.  
  837. mt_partnote:    dc.l    0
  838. mt_partnrplay:    dc.l    0
  839. mt_counter:    dc.w    0
  840. mt_partpoint:    dc.l    0
  841. mt_samples:    dc.l    0
  842. mt_sample1:    dcb.l    31,0
  843. mt_maxpart:    dc.w    0
  844. mt_dmacon:    dc.w    0
  845. mt_status:    dc.w    0
  846.  
  847. mt_arpeggio:
  848.     dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  849.     dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  850.     dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  851.     dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  852.     dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  853.  
  854.  
  855. notetable:    dc.w    856,808,762,720,678,640,604,570
  856.         dc.w    538,508,480,453,428,404,381,360
  857.         dc.w    339,320,302,285,269,254,240,226  
  858.         dc.w    214,202,190,180,170,160,151,143
  859.         dc.w    135,127,120,113,000
  860.  
  861.  
  862.  
  863.  
  864. mt_data:        incbin st-00:modules/mod.aussiefoot
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  dc.l 0
  871. showplane2 dcb.b 8000,0
  872.  
  873. ;EQUATES for HARDWARE REGISTERS
  874.  
  875.  
  876. ; NOTE: For more information about these hardware registers, read
  877. ; either the 'Amiga Hardware Reference Manual' by Addison Wesley or
  878. ; the 'Amiga System Programmers Guide' by Abacus, both of which
  879. ; document them fully.
  880.  
  881. bltddat    EQU   $000
  882. dmaconr    EQU   $002
  883. vposr    EQU   $004
  884. vhposr    EQU   $006
  885. dskdatr    EQU   $008
  886. joy0dat    EQU   $00A
  887. joy1dat    EQU   $00C
  888. clxdat    EQU   $00E
  889.  
  890. adkconr    EQU   $010
  891. pot0dat    EQU   $012
  892. pot1dat    EQU   $014
  893. potinp    EQU   $016
  894. serdatr    EQU   $018
  895. dskbytr    EQU   $01A
  896. intenar    EQU   $01C
  897. intreqr    EQU   $01E
  898.  
  899. dskpt    EQU   $020
  900. dsklen    EQU   $024
  901. dskdat    EQU   $026
  902. refptr    EQU   $028
  903. vposw    EQU   $02A
  904. vhposw    EQU   $02C
  905. copcon    EQU   $02E
  906. serdat    EQU   $030
  907. serper    EQU   $032
  908. potgo    EQU   $034
  909. joytest    EQU   $036
  910. strequ    EQU   $038
  911. strvbl    EQU   $03A
  912. strhor    EQU   $03C
  913. strlong    EQU   $03E
  914.  
  915. bltcon0    EQU   $040
  916. bltcon1    EQU   $042
  917. bltafwm    EQU   $044
  918. bltalwm    EQU   $046
  919. bltcpth    EQU   $048
  920. bltcptl EQU   $04A
  921. bltbpth    EQU   $04C
  922. bltbptl EQU   $04E
  923. bltapth    EQU   $050
  924. bltaptl EQU   $052
  925. bltdpth    EQU   $054
  926. bltdptl EQU   $056
  927. bltsize    EQU   $058
  928.  
  929. bltcmod    EQU   $060
  930. bltbmod    EQU   $062
  931. bltamod    EQU   $064
  932. bltdmod    EQU   $066
  933.  
  934. bltcdat    EQU   $070
  935. bltbdat    EQU   $072
  936. bltadat    EQU   $074
  937.  
  938. dsksync    EQU   $07E
  939.  
  940. cop1lc    EQU   $080
  941. cop2lc    EQU   $084
  942. copjmp1    EQU   $088
  943. copjmp2    EQU   $08A
  944. copins    EQU   $08C
  945. diwstrt    EQU   $08E
  946. diwstop    EQU   $090
  947. ddfstrt    EQU   $092
  948. ddfstop    EQU   $094
  949. dmacon    EQU   $096
  950. clxcon    EQU   $098
  951. intena    EQU   $09A
  952. intreq    EQU   $09C
  953. adkcon    EQU   $09E
  954.  
  955.  
  956. aud0vol    EQU   $0A8
  957. aud1vol EQU   $0B8
  958. aud2vol    EQU   $0C8
  959. aud3vol    EQU   $0D8
  960.  
  961. bpl1pth    EQU   $0E0
  962. bpl1ptl    EQU   $0E2
  963. bpl2pth    EQU   $0E4
  964. bpl2ptl    EQU   $0E6
  965. bpl3pth    EQU   $0E8
  966. bpl3ptl    EQU   $0EA
  967. bpl4pth    EQU   $0EC
  968. bpl4ptl    EQU   $0EE
  969. bpl5pth    EQU   $0F0
  970. bpl5ptl    EQU   $0F2
  971. bpl6pth    EQU   $0F4
  972. bpl6ptl    EQU   $0F6
  973.  
  974. bplcon0    EQU   $100
  975. bplcon1    EQU   $102
  976. bplcon2    EQU   $104
  977. bpl1mod    EQU   $108
  978. bpl2mod    EQU   $10A
  979.  
  980. bpldat    EQU   $110
  981.  
  982. spr0pth    EQU   $120
  983. spr0ptl EQU   $122
  984. spr1pth EQU   $124
  985. spr1ptl EQU   $126
  986. spr2pth    EQU   $128
  987. spr2ptl EQU   $12A
  988. spr3pth EQU   $12C
  989. spr3ptl EQU   $12E
  990. spr4pth    EQU   $130
  991. spr4ptl EQU   $132
  992. spr5pth EQU   $134
  993. spr5ptl EQU   $136
  994. spr6pth    EQU   $138
  995. spr6ptl EQU   $13A
  996. spr7pth EQU   $13C
  997. spr7ptl EQU   $13E
  998.  
  999. spr0pos    EQU   $140
  1000. spr1pos    EQU   $148
  1001. spr2pos EQU   $150
  1002. spr3pos EQU   $158
  1003. spr4pos EQU   $160
  1004. spr5pos EQU   $168
  1005. spr6pos EQU   $170
  1006. spr7pos EQU   $178
  1007.  
  1008. spr0ctl    EQU   $142
  1009. spr1ctl    EQU   $14A
  1010. spr2ctl EQU   $152
  1011. spr3ctl EQU   $15A
  1012. spr4ctl EQU   $162
  1013. spr5ctl EQU   $16A
  1014. spr6ctl EQU   $172
  1015. spr7ctl EQU   $17A
  1016.  
  1017. spr0data EQU  $144
  1018. spr1data EQU  $14c
  1019. spr2data EQU  $154
  1020. spr3data EQU  $15c
  1021. spr4data EQU  $164
  1022. spr5data EQU  $16c
  1023. spr6data EQU  $174
  1024. spr7data EQU  $17c
  1025.  
  1026.  
  1027. spr0datb EQU  $146
  1028. spr1datb EQU  $14e
  1029. spr2datb EQU  $156
  1030. spr3datb EQU  $15e
  1031. spr4datb EQU  $166
  1032. spr5datb EQU  $16e
  1033. spr6datb EQU  $176
  1034. spr7datb EQU  $17e
  1035.  
  1036. col0    EQU   $180
  1037. col1     EQU   $182
  1038. col2    EQU   $184
  1039. col3    EQU   $186
  1040. col8    EQU   $190
  1041. col16   EQU   $1A0    
  1042.  
  1043.   
  1044.  
  1045.