home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / grfx_snd / tcbtrack / tracker.s next >
Text File  |  1991-03-18  |  26KB  |  840 lines

  1.  
  2.                 jmp     main
  3.  
  4. over_buff       equ 700
  5.  
  6. *********** init routs ************
  7. save_ints:
  8.                 move.b  $fffffa07.w,mfpa07
  9.                 move.b  $fffffa09.w,mfpa09
  10.                 move.b  $fffffa13.w,mfpa13
  11.                 move.b  $fffffa15.w,mfpa15
  12.                 move.b  $fffffa19.w,mfpa19
  13.                 move.b  $fffffa1f.w,mfpa1f
  14.                 move.b  $fffffa21.w,mfpa21
  15.                 move.b  $fffffa1b.w,mfpa1b
  16.                 move.l  $0120.w,oldhbl
  17.                 move.l  $0134,old134
  18.                 move.l  $70.w,oldvbl
  19.                 bclr    #3,$fffffa17.w
  20.                 rts
  21. init_ints:
  22.                 move    #$2700,sr
  23.                 clr.b   $fffffa07.w
  24.                 clr.b   $fffffa09.w
  25.                 clr.b   $fffffa13.w
  26.                 clr.b   $fffffa15.w
  27.  
  28.                 move.l  #samp1,$0134
  29.                 move.b  #31,$fffffa1f.w ;16     ;32
  30.                 move.b  #2,$fffffa19.w
  31.                 bset    #5,$fffffa07.w  ;09
  32.                 bset    #5,$fffffa13.w  ;15
  33.                 move.l  #vbi,$70.w
  34.                 move    #$2300,sr
  35.                 rts
  36. ret_ints:
  37.                 move    #$2700,sr
  38.                 move.b  mfpa07(pc),$fffffa07.w
  39.                 move.b  mfpa09(pc),$fffffa09.w
  40.                 move.b  mfpa13(pc),$fffffa13.w
  41.                 move.b  mfpa15(pc),$fffffa15.w
  42.                 move.b  mfpa19(pc),$fffffa19.w
  43.                 move.b  mfpa1f(pc),$fffffa1f.w
  44.                 move.b  mfpa21(pc),$fffffa21.w
  45.                 move.b  mfpa1b(pc),$fffffa1b.w
  46.                 move.l  old134(pc),$0134
  47.                 move.l  oldvbl(pc),$70.w
  48.                 move.l  oldhbl(pc),$0120.w
  49.                 move    #$2300,sr
  50.                 rts
  51.  
  52.  
  53.  
  54. mfpa07:         dc.b 0
  55. mfpa09:         dc.b 0
  56. mfpa13:         dc.b 0
  57. mfpa15:         dc.b 0
  58. mfpa19:         dc.b 0
  59. mfpa1f:         dc.b 0
  60. mfpa21:         dc.b 0
  61. mfpa1b:         dc.b 0
  62. oldhbl:         dc.l 0
  63. old134:         dc.l 0
  64. oldvbl:         dc.l 0
  65.  
  66. init_dig:
  67.                 moveq   #0,d0
  68.                 move.l  musaxx+8,d0
  69.                 mulu    #64*8,d0
  70.                 add.l   #$0110,d0
  71.                 add.l   #musaxx,d0
  72.                 move.l  d0,start_buff_add
  73.                 add.l   #4,d0
  74.                 move.l  d0,samtab_pet
  75.                 add.l   #64,d0
  76.                 move.l  d0,samp_pet_buff_pet
  77.                 lea     emptysamp(pc),a6
  78.                 lea     emptysamp(pc),a5
  79.                 lea     emptysamp(pc),a4
  80.                 lea     emptysamp(pc),a3
  81.                 lea     speedtabs(pc),a2
  82.  
  83.                 move.b  musaxx+$0e,currpatt
  84.                 jsr     init_digishit
  85.                 rts
  86.  
  87.  
  88. *********** main routs ************
  89. start_buff_add:
  90.                 dc.l 0
  91. samp_pet_buff_pet:
  92.                 dc.l 0
  93. samtab_pet:
  94.                 dc.l 0
  95. polle:
  96.                 dc.w 0
  97. minipek:
  98.                 dc.w 0
  99. currposs:
  100.                 dc.w 0
  101. currpatt:
  102.                 dc.w 0
  103. curr_tunes:
  104.                 dc.w 0
  105.                 dc.w 0
  106.                 dc.w 0
  107.                 dc.w 0
  108. play_musaxx:
  109.                 addq.b  #1,polle
  110.                 move.b  musaxx+12,d0
  111.                 subq.b  #1,d0
  112.                 and.b   #$0f,d0
  113.                 eori.b  #$0f,d0
  114.                 cmp.b   polle(pc),d0
  115.                 bne.s   no_uppdate
  116.  
  117.                 clr.b   polle
  118.                 addq.b  #1,minipek
  119.                 move.b  minipek(pc),d0
  120.                 and.b   #%111111,d0
  121.                 move.b  d0,minipek
  122.                 addq.b  #3,d0
  123.                 and.b   #%111111,d0
  124.                 beq.s   next_patt
  125.  
  126.                 jsr     play_line
  127.  
  128. no_uppdate:
  129.                 rts
  130. next_patt:
  131.                 jsr     ms_pos
  132.  
  133.                 move.b  currposs(pc),d0
  134.                 cmp.b   musaxx+$8e,d0
  135.                 blo.s   forbi_pos
  136.  
  137.                 move.w  #1,loopch1
  138.                 move.w  #1,loopch2
  139.                 move.w  #1,loopch3
  140.                 move.w  #1,loopch4
  141.                 lea     emptysamp(pc),a3
  142.                 move.l  #emptysamp,endchan1
  143.                 lea     emptysamp(pc),a4
  144.                 move.l  #emptysamp,endchan2
  145.                 lea     emptysamp(pc),a5
  146.                 move.l  #emptysamp,endchan3
  147.                 lea     emptysamp(pc),a6
  148.                 move.l  #emptysamp,endchan4
  149.  
  150.                 move.b  #-1,currposs
  151.                 jsr     ms_pos
  152. forbi_pos:
  153.                 jsr     play_line
  154.                 rts
  155.  
  156. play_line:
  157.                 moveq   #0,d0
  158.                 moveq   #0,d1
  159.                 move.b  minipek(pc),d3
  160.                 addq.b  #3,d3
  161.                 and.b   #%111111,d3
  162.                 lea     musaxx+$0110,a0
  163.                 move.b  currpatt(pc),d0
  164.                 mulu    #8*64,d0
  165.                 move.b  d3,d1
  166.                 mulu    #8,d1
  167.                 add.l   d1,d0
  168.                 adda.l  d0,a0
  169.                 lea     curr_tunes(pc),a1
  170.  
  171.                 move.w  (a0)+,(a1)+
  172.                 move.w  (a0)+,(a1)+
  173.                 move.w  (a0)+,(a1)+
  174.                 move.w  (a0)+,(a1)+
  175.                 jsr     start_digi
  176.                 rts
  177. ms_pos:
  178.                 move.b  currposs(pc),d1
  179.                 addq.b  #1,d1
  180.                 and.b   #%1111111,d1
  181.                 move.b  d1,currposs
  182.                 moveq   #0,d0
  183.                 move.b  currposs(pc),d0
  184.                 lea     musaxx+$0e,a0
  185.                 adda.l  d0,a0
  186.                 move.b  (a0),d1
  187.                 move.b  d1,currpatt
  188.                 rts
  189.  
  190. init_digishit:
  191. ;                bsr     conv_imp
  192.                 bsr     makespeedtabs
  193.                 bsr     intsamp
  194.  
  195.                 move.b  #$3d,minipek
  196.                 clr.b   polle
  197.  
  198.                 move.w  #1,loopch1
  199.                 move.w  #1,loopch2
  200.                 move.w  #1,loopch3
  201.                 move.w  #1,loopch4
  202.                 lea     emptysamp(pc),a3
  203.                 move.l  #emptysamp,endchan1
  204.                 lea     emptysamp(pc),a4
  205.                 move.l  #emptysamp,endchan2
  206.                 lea     emptysamp(pc),a5
  207.                 move.l  #emptysamp,endchan3
  208.                 lea     emptysamp(pc),a6
  209.                 move.l  #emptysamp,endchan4
  210.                 jsr     play_line(pc)
  211.                 rts
  212.  
  213. start_digi:
  214.                 move    #$2700,sr
  215. ;       move.w  #$070,$ff8240
  216.                 lea     curr_tunes(pc),a0
  217. ;-------------- channel 1
  218.                 moveq   #0,d0
  219.                 moveq   #0,d1
  220.                 move.b  (a0)+,d0
  221.                 move.b  (a0)+,d1
  222.                 tst.b   d0
  223.                 beq     forbdv3
  224.                 lea     convtab(pc),a1
  225.                 move.b  0(a1,d0.w),d0
  226.                 add.w   d0,d0
  227.                 add.w   d0,d0
  228.                 lea     speedadds(pc),a1
  229.                 move.l  0(a1,d0.w),chan1bepos
  230.                 move.w  d1,d2
  231.                 and.w   #-16,d2
  232.                 lsr.w   #1,d2
  233.                 movea.l samp_pet_buff_pet(pc),a1
  234.                 movea.l 0(a1,d2.w),a3
  235.                 adda.l  start_buff_add,a3
  236.                 move.l  4(a1,d2.w),endchan1
  237.                 move.l  a3,d0
  238.                 add.l   d0,endchan1
  239.                 subi.l  #over_buff,endchan1
  240.  
  241.                 moveq   #0,d0
  242.                 movea.l samtab_pet(pc),a1
  243.                 lsr.w   #1,d2
  244.                 move.w  2(a1,d2.w),d0
  245.                 cmp.w   #0,d0
  246.                 beq     no_loop
  247.                 move.l  endchan1(pc),start_end
  248.                 move.l  endchan1(pc),end_end
  249.                 sub.l   d0,start_end
  250.                 clr.w   loopch1
  251.                 bra     forbdv3
  252. no_loop:
  253.                 move.w  #1,loopch1
  254.                 move.l  #emptysamp,start_end
  255.                 move.l  #emptysamp,end_end
  256. forbdv3:
  257.                 and.w   #15,d1
  258.                 move.w  d1,chan1special
  259. ;-------------- channel 2
  260.                 moveq   #0,d0
  261.                 moveq   #0,d1
  262.                 move.b  (a0)+,d0
  263.                 move.b  (a0)+,d1
  264.                 tst.b   d0
  265.                 beq     forbdv4
  266.                 lea     convtab(pc),a1
  267.                 move.b  0(a1,d0.w),d0
  268.                 add.w   d0,d0
  269.                 add.w   d0,d0
  270.                 lea     speedadds(pc),a1
  271.                 move.l  0(a1,d0.w),chan2bepos
  272.                 move.w  d1,d2
  273.                 and.w   #-16,d2
  274.                 lsr.w   #1,d2
  275.                 movea.l samp_pet_buff_pet(pc),a1
  276.                 movea.l 0(a1,d2.w),a4
  277.                 adda.l  start_buff_add,a4
  278.                 move.l  4(a1,d2.w),endchan2
  279.                 move.l  a4,d0
  280.                 add.l   d0,endchan2
  281.                 subi.l  #over_buff,endchan2
  282.  
  283.                 moveq   #0,d0
  284.                 movea.l samtab_pet(pc),a1
  285.                 lsr.w   #1,d2
  286.                 move.w  2(a1,d2.w),d0
  287.                 cmp.w   #0,d0
  288.                 beq     no_loop2
  289.                 move.l  endchan2(pc),start_end2
  290.                 move.l  endchan2(pc),end_end2
  291.                 sub.l   d0,start_end2
  292.                 clr.w   loopch2
  293.                 bra     forbdv4
  294. no_loop2:
  295.                 move.w  #1,loopch2
  296.                 move.l  #emptysamp,start_end2
  297.                 move.l  #emptysamp,end_end2
  298. forbdv4:
  299.                 and.w   #15,d1
  300.                 move.w  d1,chan2special
  301. ;-------------- channel 3
  302.                 moveq   #0,d0
  303.                 moveq   #0,d1
  304.                 move.b  (a0)+,d0
  305.                 move.b  (a0)+,d1
  306.                 tst.b   d0
  307.                 beq     forbdv5
  308.                 lea     convtab(pc),a1
  309.                 move.b  0(a1,d0.w),d0
  310.                 add.w   d0,d0
  311.                 add.w   d0,d0
  312.                 lea     speedadds(pc),a1
  313.                 move.l  0(a1,d0.w),chan3bepos
  314.                 move.w  d1,d2
  315.                 and.w   #-16,d2
  316.                 lsr.w   #1,d2
  317.                 movea.l samp_pet_buff_pet(pc),a1
  318.                 movea.l 0(a1,d2.w),a5
  319.                 adda.l  start_buff_add,a5
  320.                 move.l  4(a1,d2.w),endchan3
  321.                 move.l  a5,d0
  322.                 add.l   d0,endchan3
  323.                 subi.l  #over_buff,endchan3
  324.  
  325.                 moveq   #0,d0
  326.                 movea.l samtab_pet(pc),a1
  327.                 lsr.w   #1,d2
  328.                 move.w  2(a1,d2.w),d0
  329.                 cmp.w   #0,d0
  330.                 beq     no_loop3
  331.                 move.l  endchan3(pc),start_end3
  332.                 move.l  endchan3(pc),end_end3
  333.                 sub.l   d0,start_end3
  334.                 clr.w   loopch3
  335.                 bra     forbdv5
  336. no_loop3:
  337.                 move.w  #1,loopch3
  338.                 move.l  #emptysamp,start_end3
  339.                 move.l  #emptysamp,end_end3
  340. forbdv5:
  341.                 and.w   #15,d1
  342.                 move.w  d1,chan3special
  343. ;----------- channel 4 - drum-voice
  344.                 moveq   #0,d0
  345.                 moveq   #0,d1
  346.                 move.b  (a0)+,d0
  347.                 move.b  (a0)+,d1
  348.                 tst.b   d0
  349.                 beq     forbdv6
  350.                 lea     convtab(pc),a1
  351.                 move.b  0(a1,d0.w),d0
  352.                 add.w   d0,d0
  353.                 add.w   d0,d0
  354.                 lea     speedadds(pc),a1
  355.                 move.l  0(a1,d0.w),chan4bepos
  356.                 move.w  d1,d2
  357.                 and.w   #-16,d2
  358.                 lsr.w   #1,d2
  359.                 movea.l samp_pet_buff_pet(pc),a1
  360.                 movea.l 0(a1,d2.w),a6
  361.                 adda.l  start_buff_add,a6
  362.                 move.l  4(a1,d2.w),endchan4
  363.                 move.l  a6,d0
  364.                 add.l   d0,endchan4
  365.                 subi.l  #over_buff,endchan4
  366.  
  367.                 moveq   #0,d0
  368.                 movea.l samtab_pet(pc),a1
  369.                 lsr.w   #1,d2
  370.                 move.w  2(a1,d2.w),d0
  371.                 cmp.w   #0,d0
  372.                 beq     no_loop4
  373.                 move.l  endchan4(pc),start_end4
  374.                 move.l  endchan4(pc),end_end4
  375.                 sub.l   d0,start_end4
  376.                 clr.w   loopch4
  377.                 bra     forbdv6
  378. no_loop4:
  379.                 move.w  #1,loopch4
  380.                 move.l  #emptysamp,start_end4
  381.                 move.l  #emptysamp,end_end4
  382. forbdv6:
  383.                 and.w   #15,d1
  384.                 move.w  d1,chan4special
  385.  
  386.                 move.l  chan2bepos(pc),d0
  387.                 sub.l   chan1bepos(pc),d0
  388.                 move.l  chan3bepos(pc),d1
  389.                 sub.l   chan1bepos(pc),d1
  390.                 move.l  chan4bepos(pc),d2
  391.                 sub.l   chan1bepos(pc),d2
  392.  
  393.                 movea.l chann1(pc),a0
  394.                 move.w  d0,2(a0)
  395.                 movea.l chann2(pc),a0
  396.                 move.w  d1,2(a0)
  397.                 movea.l chann3(pc),a0
  398.                 move.w  d2,2(a0)
  399.  
  400.                 move.l  chan1bepos(pc),d0
  401.                 cmp.l   oldchan1bepos(pc),d0
  402.                 beq.s   forbdv19
  403.                 move.l  d0,oldchan1bepos
  404.                 movea.l d0,a2
  405. forbdv19:
  406.                 add.l   #600,d0
  407.                 move.l  d0,endspeedchan1
  408.                 move    #$2300,sr
  409.                 rts
  410. forbdv:                                 ********
  411.  
  412.                 movea.l $0134,a0
  413.                 tst.w   chan1special
  414.                 beq.s   frrb2
  415.                 cmpi.w  #1,chan1special
  416.                 bne     frrb2
  417.                 move.w  #$0700,$ffff8240.w
  418.                 move.l  #20,d0
  419.                 sub.l   d0,chan1bepos
  420.                 sub.l   d0,endspeedchan1
  421.                 movea.l chan1bepos(pc),a2
  422.                 movea.l chann1(pc),a0
  423.                 add.w   d0,2(a0)
  424.                 movea.l chann2(pc),a0
  425.                 add.w   d0,2(a0)
  426.                 movea.l chann3(pc),a0
  427.                 add.w   d0,2(a0)
  428. frrb2:
  429.                 cmpa.l  endspeedchan1(pc),a2
  430.                 blt.s   forbdv11
  431.                 movea.l chan1bepos(pc),a2
  432. forbdv11:
  433.  
  434.                 cmpa.l  endchan1(pc),a3
  435.                 blt.s   forbdv12
  436.                 cmpi.w  #1,loopch1
  437.                 beq     noch1
  438.                 suba.l  endchan1,a3
  439.                 adda.l  start_end,a3
  440.                 move.l  end_end(pc),endchan1
  441.                 bra.s   forbdv12
  442. noch1:
  443.                 lea     emptysamp(pc),a3
  444.                 move.l  #emptysamp,endchan1
  445. forbdv12:
  446.                 cmpa.l  endchan2(pc),a4
  447.                 blt.s   forbdv13
  448.                 cmpi.w  #1,loopch2
  449.                 beq     noch2
  450.                 suba.l  endchan2,a4
  451.                 adda.l  start_end2,a4
  452.                 move.l  end_end2(pc),endchan2
  453.                 bra.s   forbdv13
  454. noch2:
  455.                 lea     emptysamp(pc),a4
  456.                 move.l  #emptysamp,endchan2
  457. forbdv13:
  458.                 cmpa.l  endchan3(pc),a5
  459.                 blt.s   forbdv14
  460.                 cmpi.w  #1,loopch3
  461.                 beq     noch3
  462.                 suba.l  endchan3,a5
  463.                 adda.l  start_end3,a5
  464.                 move.l  end_end3(pc),endchan3
  465.                 bra.s   forbdv14
  466. noch3:
  467.                 lea     emptysamp(pc),a5
  468.                 move.l  #emptysamp,endchan3
  469. forbdv14:
  470.                 cmpa.l  endchan4(pc),a6
  471.                 blt.s   forbdv15
  472.                 cmpi.w  #1,loopch4
  473.                 beq     noch4
  474.                 suba.l  endchan4,a6
  475.                 adda.l  start_end4,a6
  476.                 move.l  end_end4(pc),endchan4
  477.                 bra.s   forbdv15
  478. noch4:
  479.                 lea     emptysamp(pc),a6
  480.                 move.l  #emptysamp,endchan4
  481. forbdv15:
  482.                 rts
  483. chann1:
  484.                 dc.l vec11
  485. chann2:
  486.                 dc.l vec12
  487. chann3:
  488.                 dc.l vec13
  489. start_end:
  490.                 dc.l emptysamp
  491. start_end2:
  492.                 dc.l emptysamp
  493. start_end3:
  494.                 dc.l emptysamp
  495. start_end4:
  496.                 dc.l emptysamp
  497. end_end:
  498.                 dc.l emptysamp
  499. end_end2:
  500.                 dc.l emptysamp
  501. end_end3:
  502.                 dc.l emptysamp
  503. end_end4:
  504.                 dc.l emptysamp
  505. loopch1:
  506.                 dc.w 1
  507. loopch2:
  508.                 dc.w 1
  509. loopch3:
  510.                 dc.w 1
  511. loopch4:
  512.                 dc.w 1
  513.  
  514. convtab:
  515.                 dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  516.                 dc.b 0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0
  517.                 dc.b 12,13,14,15,16,17,18,19,20,21,22,23,0,0,0,0
  518.                 dc.b 24,25,26,27,28,29,30,31,32,33,34,35,0,0,0,0
  519.                 even
  520.  
  521. chan1bepos:     dc.l speedtabs
  522. oldchan1bepos:  dc.l 0
  523. chan2bepos:     dc.l speedtabs
  524. chan3bepos:     dc.l speedtabs
  525. chan4bepos:     dc.l speedtabs
  526. endspeedchan1:  dc.l speedtabs
  527. chan1special:   dc.w 0
  528. chan2special:   dc.w 0
  529. chan3special:   dc.w 0
  530. chan4special:   dc.w 0
  531. endchan1:       dc.l emptysamp
  532. endchan2:       dc.l emptysamp
  533. endchan3:       dc.l emptysamp
  534. endchan4:       dc.l emptysamp
  535. speedadds:      ds.l 37
  536. speedtabs:      ds.w 400*37
  537. emptysamp:      dcb.b 1000,128
  538.  
  539. makespeedtabs:
  540.                 move.w  #36,d0
  541.                 lea     midspeeddata-12*4(pc),a0
  542.                 lea     speedtabs(pc),a1
  543.                 lea     speedadds(pc),a2
  544. omsp:           move.l  (a0)+,d1
  545.                 move.l  a1,(a2)+
  546.                 moveq   #0,d2
  547.                 moveq   #0,d3
  548.                 moveq   #0,d4
  549.                 move.w  #399,d7
  550. omsp2:
  551.                 add.l   d1,d2
  552.                 move.l  d2,d3
  553.                 lsr.l   #8,d3
  554.                 lsr.l   #8,d3           ;7 for 15khz samples and 7.5 rout!
  555.                 sub.w   d3,d4
  556.                 neg.w   d4
  557.                 move.w  d4,(a1)+
  558.                 move.w  d3,d4
  559.                 dbra    d7,omsp2
  560.                 dbra    d0,omsp
  561.                 rts
  562.  
  563.  
  564. speeddata:
  565.                 dc.l 8192,8679,9195,9741,10321,10935
  566.                 dc.l 11585,12274,13003,13777,14596,15464
  567.                 dc.l 16384,17358,18390,19483,20642,21870
  568.                 dc.l 23170,24548,26007,27554,29192,30928
  569.                 dc.l 32768,34716,36780,38967,41285,43740
  570.                 dc.l 46340,49096,52015,55108,58385,61857
  571. midspeeddata:
  572.                 dc.l 65536,69432,73561,77935,82570,87480
  573.                 dc.l 92681,98193,104031,110217,116771,123715
  574.                 dc.l 131072,138865,147123,155871,165140,174960
  575.                 dc.l 185363,196386,208063,220435,233543,247430
  576.                 dc.l 262144,277731,294246,311743,330280,349920
  577.                 dc.l 370727,392772,416127,440871,467087,494861
  578.                 dc.l 524288
  579.  
  580.  
  581. intsamp:
  582.                 move    #$2700,sr
  583.                 moveq   #10,d0
  584. omis:
  585.                 move.b  d0,$ffff8800.w
  586.                 clr.b   $ffff8802.w
  587.                 dbra    d0,omis
  588.                 move.b  #7,$ffff8800
  589.                 move.b  #%11111111,$ffff8802
  590.                 move    #$2300,sr
  591.                 rts
  592.  
  593.  
  594. conv_imp:
  595.                 move.w  #255,d7
  596.                 lea     imptab+4(pc),a0
  597. .loop:          move.b  (a0),d0
  598.                 move.b  1(a0),d1
  599.                 move.b  d0,(a0)+
  600.                 move.b  d0,(a0)+
  601.                 move.b  d1,(a0)+
  602.                 move.b  d1,(a0)+
  603.                 lea     4(a0),a0
  604.                 dbra    d7,.loop
  605. ;------ megafix imptab!!!!!!!!!!!!
  606.                 lea     imptab(pc),a0
  607.                 lea     384*8(a0),a1    ;dont ask, believe!
  608.                 move.w  #255,d0
  609. .loop2:         move.l  (a0)+,(a1)+
  610.                 move.l  (a0)+,(a1)+
  611.                 dbra    d0,.loop2
  612. ;--- fill top of imp
  613.                 lea     imptab(pc),a0
  614.                 move.w  #384-1,d0
  615.                 move.l  (a0),d1
  616.                 move.l  4(a0),d2
  617. .loop3:         move.l  d1,(a0)+
  618.                 move.l  d2,(a0)+
  619.                 dbra    d0,.loop3
  620. ;---- fill bottom
  621.                 move.w  #1024-384-256-1,d0
  622.                 move.l  -8(a1),d1
  623.                 move.l  -4(a1),d2
  624. .loop4:         move.l  d1,(a1)+
  625.                 move.l  d2,(a1)+
  626.                 dbra    d0,.loop4
  627.                 rts
  628.  
  629.  
  630.  
  631. samp1:
  632.                 move    a1,usp          ;1
  633.                 moveq   #0,d7           ;1
  634.                 moveq   #0,d6           ;1
  635.                 move.b  (a6)+,d7        ;2
  636.                 move.b  (a5),d6         ;2
  637.                 add.w   d6,d7           ;1
  638.                 move.b  (a4),d6         ;2
  639.                 add.w   d6,d7           ;1
  640.                 move.b  (a3),d6         ;2
  641.                 add.w   d6,d7           ;1
  642.                 asl.w   #3,d7           ;3
  643.                 lea     $ffff8800.w,a1  ;2
  644.                 move.l  imptab(pc,d7.w),d6 ;4
  645.                 movep.l d6,0(a1)        ;7
  646.                 move.l  imptab+4(pc,d7.w),(a1) ;6
  647. vec11:          adda.w  0(a2),a4        ;4
  648. vec12:          adda.w  0(a2),a5        ;4
  649.                 adda.w  (a2)+,a3        ;3
  650.                 move    usp,a1          ;1
  651. * 48 nop
  652.                 rte
  653. vec13:
  654.                 dc.l 0
  655.                 dc.l 0
  656. imptab:
  657.                 path 'A:\SEC_PROJ.ECT\DIGIPART\'
  658.                 ibytes 'SNDTAB.TAB'
  659.                 ds.w 4*256*3
  660.  
  661. * digi-rout end ***********************************
  662.  
  663. init_resse:
  664.                 lea     $fffa01,a0
  665.                 lea     save_mfp(pc),a1
  666.                 moveq   #15,d0
  667. save_mfp_loop:
  668.                 move.b  (a0),(a1)+
  669.                 addq.l  #2,a0
  670.                 dbra    d0,save_mfp_loop
  671.  
  672.                 lea     $28,a0
  673.                 lea     save_tex(pc),a1
  674.                 move.l  #$0200-1,d0
  675. save_tex_loop:
  676.                 move.l  (a0)+,(a1)+
  677.                 dbra    d0,save_tex_loop
  678.  
  679.                 move.l  #retvars,$042a
  680.                 move.l  #$31415926,$0426
  681.                 rts
  682. retvars:
  683.                 lea     nullstk(pc),sp
  684.  
  685.                 move.w  #$0700,$ff8240
  686.  
  687.                 lea     $28,a0
  688.                 lea     save_tex(pc),a1
  689.                 move.l  #$0200-1,d0
  690. ret_tex_loop:
  691.                 move.l  (a1)+,(a0)+
  692.                 dbra    d0,ret_tex_loop
  693.  
  694.                 move.w  #$30,$ff8240
  695.  
  696.                 lea     $fffa01,a0
  697.                 lea     save_mfp(pc),a1
  698.                 moveq   #15,d0
  699. ret_mfp:
  700.                 move.b  (a1)+,(a0)
  701.                 addq.l  #2,a0
  702.                 dbra    d0,ret_mfp
  703.                 move.w  #$0770,$ff8240
  704.  
  705.                 move.l  #retvars,$042a
  706.                 move.l  #$31415926,$0426
  707.  
  708.                 move.b  #2,$ff820a
  709.  
  710.                 move.w  #$0707,$ff8240
  711.  
  712.                 move.l  #$0707ffff,$ffff8800.w
  713.  
  714.                 move.w  #$0777,$ff8240
  715.  
  716.                 dc.w $a000
  717.  
  718.                 move.w  #$0444,$ff8240
  719.  
  720.                 move.w  #1,d0
  721.                 andi.w  #3,d0
  722.                 lea     skumtab(pc),a1
  723.                 add.w   d0,d0
  724.                 add.w   d0,d0
  725.                 move.l  0(a1,d0.w),(a0)
  726.                 move.b  #3,$fffffc04.w
  727.                 move.b  #$95,$fffffc04.w
  728.                 move.b  #3,$fffffc00.w
  729.                 move.b  #$96,$fffffc00.w
  730.                 move.w  #$c8,d0
  731. tima:           nop
  732.                 dbra    d0,tima
  733.  
  734.                 move.w  #$00,$ff8240
  735.                 move.w  #$0666,$ff8242
  736.                 move.w  #$0666,$ff8244
  737.                 move.w  #$0666,$ff8246
  738.                 move.w  #$0666,$ff8248
  739.  
  740.                 move    #$2300,sr
  741.  
  742.                 clr.w   (sp)
  743.                 trap    #1
  744. save_stk:
  745.                 dc.l 0
  746.  
  747. skumtab:
  748.                 dc.w $04,$a0
  749.                 dc.w $02,$a0
  750.                 dc.w $01,$50
  751.                 dc.w $01,$50
  752.                 dc.w $8001,$1214
  753.  
  754. save_mfp:
  755.                 ds.b 24
  756.                 even
  757. resolution:
  758.                 dc.w 0
  759. phys_base:
  760.                 dc.l 0
  761. log_base:
  762.                 dc.l 0
  763. save_tex:
  764.                 ds.l $0300
  765.                 ds.l 100
  766. nullstk:
  767.  
  768. main:
  769.                 pea     0
  770.                 move.w  #$20,-(sp)
  771.                 trap    #1
  772.                 addq.l  #6,sp
  773.  
  774.                 move.b  #2,$ff820a
  775.                 bclr    #0,$0484
  776.  
  777.                 move.w  #0,-(sp)
  778.                 pea     $0f0000
  779.                 pea     $0f0000
  780.                 move.w  #5,-(sp)
  781.                 trap    #14
  782.                 adda.l  #12,sp
  783.                 move.w  #0,-(sp)
  784.                 pea     $0f8000
  785.                 pea     $0f8000
  786.                 move.w  #5,-(sp)
  787.                 trap    #14
  788.                 adda.l  #12,sp
  789.  
  790.                 jsr     init_resse
  791.  
  792.                 pea     text
  793.                 move.w  #9,-(sp)
  794.                 trap    #1
  795.                 addq.l  #6,sp
  796.  
  797.                 jsr     init_dig
  798.                 jsr     save_ints
  799.                 jsr     init_ints
  800.  
  801.  
  802.                 move.w  #0,wfnc
  803. demo_loop:
  804.                 cmpi.w  #1,wfnc
  805.                 bne     demo_loop
  806.                 move.w  #0,wfnc
  807.  
  808.                 move.w  #2000,d0
  809. om:             dbra    d0,om
  810.  
  811.                 jsr     play_musaxx
  812.                 move.w  #0,$ffff8240.w
  813.                 cmpi.b  #185,$fffffc02.w
  814.                 bne     demo_loop
  815.                 jsr     ret_ints
  816.                 move.b  #2,$ff820a
  817.                 move.w  #0,$ff8240
  818.                 move.w  #$0777,$ff8242
  819.                 move.w  #$0777,$ff8244
  820.                 move.w  #$0777,$ff8246
  821.                 move.w  #$0777,$ff8248
  822.                 clr.w   -(sp)
  823.                 trap    #1
  824.  
  825. vbi:
  826.                 movem.l d0-a1,-(sp)
  827.                 move.w  #1,wfnc
  828.                 jsr     forbdv
  829.                 movem.l (sp)+,d0-a1
  830.                 rte
  831. wfnc:
  832.                 dc.w 0
  833. text:
  834.                 dc.b 27,'E',"NOW PLAYING....",0
  835.                 even
  836. musaxx:
  837.                 ibytes 'ROCK.MOD'
  838.                 even
  839.                 end
  840.