home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: Amiga KQ 6 Levels Data / Lowe_AmigaKQ6LevelsData.adf / death / kq6death.s < prev   
Encoding:
Text File  |  1978-05-28  |  29.8 KB  |  1,827 lines

  1.  
  2.  
  3.  
  4.  
  5.     ;    DRIVER AND MUSIC REMAIN COPYRIGHT D.LOWE 
  6.  
  7.     ;       KINGS QUEST VI..DEEEAAATTTHHH..........
  8.     ;
  9.  
  10.  
  11.     ;music list
  12.  
  13.         ;1]    death tune
  14.  
  15. ;-------
  16.     ;fx list
  17.  
  18.  
  19.     ;  no fx in this driver
  20.  
  21.     ;  .....fade only affects music in this version
  22.  
  23.     ;    JEREMY
  24.     ;    devpac source code file... no macros.
  25.     ;       Its commented wherever needed
  26.     ;    The samples are incbin at the end,you will
  27.     ;    need to change the directory to your own.
  28.     ;    This source files contains a devpac pseudo op
  29.     ;    called set. it allows redefining of values
  30.     ;    you may need to change this to something else if
  31.     ;    using a different assembler.
  32.  
  33.     ;    It must be assembled with SYMBOLS CASE independent.
  34.  
  35.     ;       dont hesitate to ring with any problems
  36.  
  37.  
  38.  
  39.     ;        DAVE LOWE.....0723  870648
  40.  
  41.  
  42.  
  43. ;        **************************
  44.  
  45.     section issA,code_c    ;must be in low memory for dma access
  46.                 ;DEVPAC PSEUDO OP ..CAN BE DELETED
  47.  
  48.  
  49. ;*****************************************
  50.  
  51.  
  52. select_tunes    equ 0        ;for conditional assembly whilst testing
  53.                 ; zero to step tunes on mouse button
  54.                 ; can be deleted..not essential
  55.  
  56.         ;  ALL EQUs
  57.  
  58. a00  equ  508*2
  59. bb00  equ  480*2
  60. b00  equ  453*2
  61.  
  62. c01  equ  428*2
  63. db01  equ  404*2
  64. d01 equ  381*2
  65. eb01  equ  360*2
  66. e01  equ  339*2
  67. f01  equ  320*2
  68. gb01  equ  302*2
  69. g01  equ  285*2
  70. ab01 equ 269*2
  71. a01  equ  508
  72. bb01  equ  480
  73. b01  equ  453
  74.  
  75. c02  equ  428
  76. db02  equ  404
  77. d02  equ  381
  78. eb02  equ  360
  79. e02  equ  339
  80. f02  equ  320
  81. gb02  equ  302
  82. g02  equ  285
  83. ab02 equ 269
  84. a02  equ  254
  85. bb02  equ  240
  86. b02  equ  226
  87.  
  88. c03  equ  214
  89. db03  equ  202
  90. d03  equ  190
  91. eb03  equ  180
  92. e03  equ  170
  93. f03  equ  160
  94. gb03  equ  151
  95. g03  equ  143
  96. ab03 equ 135
  97. a03  equ  127
  98.  
  99. bb03  equ  480*2
  100. b03  equ  453*2
  101.  
  102. c04  equ  428*2
  103. db04  equ  404*2
  104. d04 equ  381*2
  105. eb04  equ  360*2
  106. e04  equ  339*2
  107. f04  equ  320*2
  108. gb04  equ  302*2
  109. g04  equ  285*2
  110. ab04 equ 269*2
  111. a04  equ  508
  112. bb04  equ  480
  113. b04  equ  453
  114.  
  115. c05  equ  428
  116. db05  equ  404
  117. d05  equ  381
  118. eb05  equ  360
  119. e05  equ  339
  120. f05  equ  320
  121. gb05  equ  302
  122. g05  equ  285
  123. ab05 equ 269
  124. a05  equ  254
  125. bb05  equ  240
  126. b05  equ  226
  127.  
  128. c06  equ  214
  129. db06  equ  202
  130. d06  equ  190
  131. eb06  equ  180
  132. e06  equ  170
  133. f06  equ  160
  134. gb06  equ  151
  135. g06  equ  143
  136. ab06 equ 135
  137. a06  equ  127
  138. bb06  equ  480*2
  139. b06  equ  453*2
  140.  
  141. c07  equ  428*2
  142. db07  equ  404*2
  143. d07 equ  381*2
  144. eb07  equ  360*2
  145. e07  equ  339*2
  146. f07  equ  320*2
  147. gb07  equ  302*2
  148. g07  equ  285*2
  149. ab07 equ 269*2
  150. a07  equ  508
  151. bb07  equ  480
  152. b07  equ  453
  153.  
  154. c08  equ  428
  155. db08  equ  404
  156. d08  equ  381
  157. eb08  equ  360
  158. e08  equ  339
  159. f08  equ  320
  160. gb08  equ  302
  161. g08  equ  285
  162. ab08 equ 269
  163. a08  equ  254
  164. bb08  equ  240
  165. b08  equ  226
  166.  
  167.  
  168. v equ 0
  169.  
  170. no_loop equ 0
  171. loop equ 0
  172. chann1reg   equ $dff0a0    
  173. chann2reg   equ $dff0b0
  174. chann3reg   equ $dff0c0
  175. chann4reg   equ $dff0d0
  176. dmacon     equ $dff096
  177. int_bf_int   equ   $dff01e
  178. int_bf_w    equ   $dff09a
  179. vhposr     equ   $dff006
  180. in_line    equ   0
  181. new_snd    equ   4
  182. end_song     equ   1
  183. end_patt    equ   8
  184. new_env    equ   12
  185. pbend     equ   16
  186.  
  187.  
  188.  
  189. hi: equ 223
  190. lo:  equ 446
  191.  
  192. r22    equ 134
  193. r20    equ 179        ;correctum
  194. r19    equ 150
  195. r18    equ 178
  196. r17    equ 200
  197. r16:    equ 227        ;correctum
  198. r15:    equ 249
  199. r14    equ 280
  200. r13:    equ 305
  201. r12:    equ 333
  202. r11:    equ 361
  203. r10:    equ 389
  204. r9:    equ 419
  205. r8:    equ 446
  206. r7:    equ 446+112
  207. r6:    equ 446+223
  208. r5:    equ 446+223+112
  209. r4:    equ 446*2
  210. r3:    equ 446*3
  211. r2:    equ 446*4
  212. r1:    equ 446*8
  213.  
  214.  
  215. filter: equ $bfe001
  216. filter_on equ 44
  217. filter_off equ 48
  218.  
  219. modon     equ   20
  220. pboff     equ   24
  221. modoff     equ   28
  222. rest     equ 32
  223. end_fxp  equ 36
  224. end_fx3  equ 36
  225. end_fx4  equ 40
  226. acc    equ 52
  227. repeat    equ 56
  228. down      equ   1
  229. up       equ   2
  230.  
  231. fx    equ 0
  232.  
  233.  
  234.  
  235. ;**************************************************************************
  236. ;**************************************************************************
  237.  
  238.  
  239.  ;    THIS IS THE CONTROL SECTION FOR TESTING AS A STAND ALONE PRG. 
  240.  
  241.     ;       AND CAN BE DELETED WHEN NOT REQUIRED
  242.  
  243.     move.l    #1,song_buffer
  244.     jsr select_new_song    ;set up tune..number 1
  245.  
  246. testloop:
  247.     jsr delay    ;wait for scan line  at 50hz on pal
  248.  
  249.     jsr driver    ;run driver at 50 hz for testing
  250.  
  251.         bra testloop    ;loop back
  252.  
  253.  
  254. ;--------
  255.  
  256.         ;these are all routines used during test/stand alone
  257.         ;        assembly
  258.  
  259. delay:
  260.     tst.w fxtimer
  261.     bne no_test
  262.     clr.l d0
  263.     move.b $bfe001,d0
  264.     btst #6,d0
  265.     bne no_test1
  266.     move.w #10,fxtimer
  267.     bra testfx4
  268. no_test
  269.     subq #1,fxtimer
  270. no_test1
  271.     clr.l d0
  272.         move.w vhposr,d0
  273.         andi.w #%1111111100000000,d0
  274.         cmpi.w #%1111111100000000,d0
  275.  
  276.     bne no_test1
  277.     rts
  278.  
  279. testfx4:  
  280.  
  281.     clr.l d0
  282.     move.b $bfe001,d0
  283.     btst #6,d0
  284.     beq testfx4
  285.  
  286.     move.l song_buffer,d0
  287.     addq.l #1,d0
  288.     cmp.l    max_songs,d0
  289.     bne nores
  290.     move.l #1,d0
  291. nores    move.l d0,song_buffer
  292.  
  293.  
  294.     ifeq    select_tunes
  295.  
  296.     jsr    select_new_song        ;new song on mouse button
  297.  
  298.  
  299.     endc
  300.  
  301.     move.l fx_last,d0
  302.     move.l d0,fx_kill
  303.  
  304.     jsr kill_loopfx            ;use only one fx at a time
  305.                     ;for testing
  306.  
  307. no_k
  308.         move.l fx_no,fx_number
  309.     move.l fx_no,fx_last
  310.     addq.l #1,fx_no
  311.     move.l    max_fx,d0
  312.         cmp.l fx_no,d0
  313.     bne noreset
  314.     move.l #1,fx_no    
  315. noreset: 
  316.  
  317.  
  318.     ifne    select_tunes
  319.  
  320.     jsr set_up_fx
  321.  
  322.     endc
  323.  
  324.     bra no_test    
  325.  
  326. fxtc:          dc.w 10
  327. fx_no:         dc.l  1
  328. fx_last        dc.l  0
  329.  
  330.  
  331. ;        END OF CONTROL (DELETABLE) SECTION
  332.  
  333. ;********************************************************************
  334. ;********************************************************************
  335.  
  336. ;    MAIN VARIABLES TO BE ACCESSED BY PROGRAMMER DURING RUNTIME
  337.  
  338.  
  339. fx_number:     dc.l 0 ;     number of fx required here
  340.  
  341.  
  342. fx_kill        dc.l 0 ;     number of fx to kill/used mainly
  343.                ;     to kill looping fx
  344.  
  345.  
  346. song_buffer     dc.l 1 ;     number of piece of music required here ie.1 to ?               ;     currently playing beach background..see list
  347.  
  348. music_disable:  dc.w 0 ;     1 = disable music
  349.  
  350. fx_disable:     dc.w 0 ;     1 = disable fx
  351.  
  352.  
  353. fade:        dc.w 0 ;      0 to 64..0 = full volume/64 = off
  354.  
  355.  
  356. ;    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  357.  
  358. ;  THESE VARIABLES ARE USED INTERNALLY BY THE DRIVER
  359. fxr1         dc.l 0  
  360. fxr2         dc.l 0  
  361. fxr3         dc.l 0  
  362. fxr4         dc.l 0  
  363. fxc1        dc.l 0
  364. fxc2          dc.l 0
  365. fxc3        dc.l 0
  366. fxc4          dc.l 0
  367. fx1_flag    dc.w 0
  368. fx2_flag    dc.w 0
  369. fx3_flag    dc.w 0
  370. fx4_flag    dc.w 0
  371. fxtimer        dc.w 0
  372. gen        dc.w 0
  373. int_disable    dc.w 0
  374. altpf         dc.w 0
  375. kill_flag    dc.w 0
  376. mode        dc.w 0
  377. ;  *******************************************************
  378.  
  379. ;  CALL THIS SUBROUTINE TO SET UP THE REQIURED FX
  380. ;  on entry it requires the fx number to be in "fx_number"(see above)
  381.  
  382.  
  383. set_up_fx
  384.     movem.l d5/a2,-(a7)    ;save used registers
  385.  
  386.     tst.l fxc4
  387.     bne check3
  388. use4:    
  389.     move.w #%0000000000001000,d5
  390.     lea chann4reg,a2
  391.     jsr end_fx4p
  392.     move.l fx_number,fxr4
  393.     move.l fx_number,fxc4
  394.     move.l #0,fx_number
  395.     bra no_fx
  396. check3:    tst.l fxc3
  397.     bne check2
  398. use3:
  399.     move.w #%0000000000000100,d5
  400.     lea chann3reg,a2
  401.     jsr end_fx3p
  402.     move.l fx_number,fxr3
  403.     move.l fx_number,fxc3
  404.     move.l #0,fx_number
  405.     bra no_fx
  406. check2:    tst.l fxc2
  407.     bne check1
  408. use2:
  409.     move.w #%0000000000000010,d5
  410.     lea chann2reg,a2
  411.     jsr end_fx2p
  412.     move.l fx_number,fxr2
  413.     move.l fx_number,fxc2
  414.     move.l #0,fx_number
  415.     bra no_fx
  416. check1:    tst.l fxc1
  417.     bne use3
  418. use1:
  419.     move.w #%0000000000000001,d5
  420.     lea chann1reg,a2
  421.     jsr end_fx1p
  422.     move.l fx_number,fxr1
  423.     move.l fx_number,fxc1
  424.     move.l #0,fx_number
  425. no_fx
  426.     movem.l (a7)+,d5/a2    ;restore registers
  427.     rts
  428.  
  429. ;*************************************************
  430. ;          CALL HERE TO KILL ANY FX...
  431. ;       after putting the number of the fx you want to kill
  432. ;            into fx_kill
  433.  
  434. kill_loopfx
  435.  
  436.     movem.l d5/a2,-(a7)    ;save used registers
  437.     move.l fx_kill,d5
  438.     cmp.l fxc1,d5
  439.     bne k2
  440.     move.w #%0000000000000001,d5
  441.     lea chann1reg,a2
  442.     jsr end_fx1p
  443.     bra error
  444. k2    cmp.l fxc2,d5
  445.     bne k3
  446.     move.w #%0000000000000010,d5
  447.     lea chann2reg,a2
  448.     jsr end_fx2p
  449.     bra error
  450. k3    cmp.l fxc3,d5
  451.     bne k4
  452.     move.w #%0000000000000100,d5
  453.     lea chann3reg,a2
  454.     jsr end_fx3p
  455.     bra error
  456. k4    cmp.l fxc4,d5
  457.     bne error
  458.     move.w #%0000000000001000,d5
  459.     lea chann2reg,a2
  460.     jsr end_fx4p
  461. error
  462.     clr.l fx_kill
  463.     movem.l (a7)+,d5/a2    ;restore registers
  464.     rts
  465. ;*************************************************
  466.  
  467.     ; CALL HERE TO KILL ANY SOUNDS LEFT ON CHIP
  468.  
  469. kill_chip:
  470.     move.w #%0000000000001111,dmacon
  471.     move.l rest_data,chann1reg
  472.     move.l rest_data,chann2reg
  473.     move.l rest_data,chann3reg
  474.     move.l rest_data,chann4reg
  475.     move.w #16,chann1reg+4    
  476.     move.w #16,chann2reg+4    
  477.     move.w #16,chann3reg+4    
  478.     move.w #16,chann4reg+4    
  479.     move.w #0,chann1reg+8
  480.     move.w #0,chann2reg+8
  481.     move.w #0,chann3reg+8
  482.     move.w #0,chann4reg+8
  483.     move.w #1,chann1reg+6
  484.     move.w #1,chann2reg+6
  485.     move.w #1,chann3reg+6
  486.     move.w #1,chann4reg+6
  487.     move.l #0,fxr1
  488.     move.l #0,fxr2
  489.     move.l #0,fxr3
  490.     move.l #0,fxr4
  491.     move.w #0,fx1_flag
  492.     move.w #0,fx2_flag
  493.     move.w #0,fx3_flag
  494.     move.w #0,fx4_flag
  495.     move.l #0,fxc1
  496.     move.l #0,fxc2
  497.     move.l #0,fxc3
  498.     move.l #0,fxc4
  499.     rts
  500. ;****************************************
  501.  
  502. ;  CALL HERE TO SELECT WHICH PIECE OF MUSIC TO PLAY
  503. ;  AFTER PLACING NUMBER (1 to ?) IN "SONG_BUFFER"..see above
  504. ;  a call to this routine will initiliase the driver/kill any sound etc.      
  505. ;  make sure this routine has been called before running the interrupt
  506. ;  driven section....see below
  507.  
  508. select_new_song:
  509.  
  510.     move.w #1,int_disable
  511.     movem.l d0/d1/a0/a1,-(a7)    ;save used registers
  512.     move.w music_disable,gen
  513.     move.w #1,music_disable
  514.         jsr kill_chip           
  515.     clr.l d0
  516.         move.w #204,d0
  517.         lea gvars,a0
  518. clloop: clr.w (a0)+        
  519.         dbra  d0,clloop
  520.     tst.l song_buffer
  521.     beq no_song
  522.         move.l song_buffer,d1
  523.     add.l d1,d1
  524.      add.l d1,d1
  525.      add.l d1,d1
  526.      add.l d1,d1
  527.         LEA  SONG_TABLE-16,A1
  528.  
  529.         add.l d1,a1      
  530.         MOVE.L (A1)+,WSONG1    
  531.         move.l (a1)+,wsong2    
  532.         move.l (a1)+,wsong3
  533.     move.l (a1),wsong4
  534.         MOVE.L #pstart,PATTR1
  535.         MOVE.L #pstart,PATTR2
  536.         MOVE.L #pstart,PATTR3
  537.     move.l #pstart,pattr4
  538.         move.l #sstart,songr1
  539.         MOVE.L #sstart,SONGR2
  540.         MOVE.L #sstart,SONGR3
  541.     move.l #sstart,songr4
  542. no_song
  543.     move.w #1,ch1vars
  544.     move.w #2,ch2vars
  545.     move.w #3,ch3vars
  546.     move.w #4,ch4vars
  547.     move.w #6,ch4fxvars
  548.     move.w #5,ch3fxvars
  549.     move.w #7,ch2fxvars
  550.     move.w #8,ch1fxvars
  551.     move.w gen,music_disable
  552.     clr.w int_disable
  553.     movem.l (a7)+,d0/d1/a0/a1    ;restore registers
  554.         rts
  555.  
  556. ;**************************************************
  557.  
  558.         ;This is the interrupt routine
  559.  
  560.  
  561. ;  CALL HERE ON A 50hz INTERRUPT DURING RUNTIME
  562. ;  TO PLAY FX AND TUNES
  563.  
  564. driver:  
  565.     tst.w int_disable
  566.     beq process_data
  567.     rts        
  568. process_data
  569.     movem.l d0-d6/a0-a6,-(a7)    ;save used registers
  570.  
  571.  
  572. ch1:
  573.     tst.w fx_disable
  574.     bne test_music1
  575.     tst.l fxr1
  576.     bne   ch1j1
  577.     tst.l fxc1
  578.     beq test_music1
  579.     bra ch1j3
  580. ch1j2    jsr run_dummy1
  581.     jsr run_fx1
  582.     bra ch2
  583. ch1j1
  584.     jsr set_up1
  585. ch1j3    tst.w music_disable    
  586.     beq ch1j2
  587.     jsr run_fx1
  588.     bra ch2
  589. test_music1
  590.     tst.w music_disable
  591.     bne ch2
  592.     jsr run_music1
  593.     bra ch2
  594.     ;***********************
  595.  
  596.     ; channel 1 subroutines
  597.  
  598. run_dummy1    
  599.      lea ch1vars,a0
  600.      lea dummy_reg,a2 
  601.      move.w #0,d5 
  602.      jsr sect1    
  603.     rts
  604.  
  605. set_up1    
  606.          move.l fxr1,d0
  607.          add d0,d0
  608.          add d0,d0
  609.          lea  fxjump_table-4,A1
  610.      add.l d0,a1
  611.          move.l (a1),currfx1
  612.       clr.l fxr1
  613.      clr.w fxintc1
  614.       rts
  615.   
  616.      
  617. run_fx1
  618.     lea ch1fxvars,a0
  619.        lea chann1reg,a2
  620.       move.w #%0000000000000001,d5 
  621.      move.w #%1000000000000001,d1 
  622.  
  623.     move.w    #1,mode
  624.      jsr sect1
  625.     rts
  626.  
  627. run_music1
  628.     lea ch1vars,a0
  629.        lea chann1reg,a2
  630.       move.w #%0000000000000001,d5 
  631.       move.w #%1000000000000001,d1 
  632.     move.w    #0,mode
  633.       jsr sect1     
  634.     rts
  635.  
  636.     ;  **************************
  637. ch2
  638.     tst.w fx_disable
  639.     bne test_music2
  640.     tst.l fxr2
  641.     bne   ch2j1
  642.     tst.l fxc2
  643.     beq test_music2
  644.     bra ch2j3
  645. ch2j2    jsr run_dummy2
  646.     jsr run_fx2
  647.     bra ch3
  648. ch2j1
  649.     jsr set_up2
  650. ch2j3    tst.w music_disable    
  651.     beq ch2j2
  652.     jsr run_fx2
  653.     bra ch3
  654.  
  655. test_music2
  656.     tst.w music_disable
  657.     bne ch3
  658.     jsr run_music2
  659.     bra ch3
  660.     ;***********************
  661.     ; channel 2 subroutines
  662. run_dummy2    
  663.      lea ch2vars,a0
  664.      lea dummy_reg,a2 
  665.      move.w #0,d5 
  666.      jsr sect1    
  667.     rts
  668.  
  669. set_up2    
  670.          move.l fxr2,d0
  671.          add d0,d0
  672.          add d0,d0
  673.          lea  fxjump_table-4,A1
  674.      add.l d0,a1
  675.          move.l (a1),currfx2
  676.       clr.l fxr2
  677.      clr.w fxintc2
  678.       rts
  679.   
  680.      
  681. run_fx2
  682.     lea ch2fxvars,a0
  683.        lea chann2reg,a2
  684.       move.w #%0000000000000010,d5 
  685.      move.w #%1000000000000010,d1 
  686.     move.w    #1,mode
  687.      jsr sect1
  688.     rts
  689.  
  690. run_music2
  691.     lea ch2vars,a0
  692.        lea chann2reg,a2
  693.       move.w #%0000000000000010,d5 
  694.       move.w #%1000000000000010,d1 
  695.     move.w    #0,mode
  696.       jsr sect1     
  697.     rts
  698.  
  699.     ;  **************************
  700.  
  701. ch3:
  702.     tst.w fx_disable
  703.     bne test_music3
  704.     tst.l fxr3
  705.     bne   ch3j1
  706.     tst.l fxc3
  707.     beq test_music3
  708.     bra ch3j3
  709. ch3j2    jsr run_dummy3
  710.     jsr run_fx3
  711.     bra ch4
  712. ch3j1
  713.     jsr set_up3
  714. ch3j3    tst.w music_disable    
  715.     beq ch3j2
  716.     jsr run_fx3
  717.     bra ch4
  718.  
  719. test_music3
  720.     tst.w music_disable
  721.     bne ch4
  722.     jsr run_music3
  723.     bra ch4
  724.  
  725.     ;***********************
  726.  
  727.     ; channel 3 subroutines
  728.  
  729. run_dummy3    
  730.      lea ch3vars,a0
  731.      lea dummy_reg,a2 
  732.      move.w #0,d5 
  733.      jsr sect1    
  734.     rts
  735.  
  736. set_up3    
  737.          move.l fxr3,d0
  738.          add d0,d0
  739.          add d0,d0
  740.          lea  fxjump_table-4,A1
  741.      add.l d0,a1
  742.          move.l (a1),currfx3
  743.       clr.l fxr3
  744.      clr.w fxintc3
  745.       rts
  746.   
  747.      
  748. run_fx3
  749.     lea ch3fxvars,a0
  750.        lea chann3reg,a2
  751.       move.w #%0000000000000100,d5 
  752.      move.w #%1000000000000100,d1 
  753.     move.w    #1,mode
  754.      jsr sect1
  755.     rts
  756.  
  757. run_music3
  758.     lea ch3vars,a0
  759.        lea chann3reg,a2
  760.       move.w #%0000000000000100,d5 
  761.       move.w #%1000000000000100,d1 
  762.     move.w    #0,mode
  763.       jsr sect1     
  764.     rts
  765.  
  766.     ;  **************************
  767.  
  768. ch4:
  769.     tst.w fx_disable
  770.     bne test_music4
  771.     tst.l fxr4
  772.     bne   ch4j1
  773.     tst.l fxc4
  774.     beq test_music4
  775.     bra ch4j3
  776. ch4j2    jsr run_dummy4
  777.     jsr run_fx4
  778.     bra no4
  779. ch4j1
  780.     jsr set_up4
  781. ch4j3    tst.w music_disable    
  782.     beq ch4j2
  783.     jsr run_fx4
  784.     bra no4
  785.  
  786. test_music4
  787.     tst.w music_disable
  788.     bne no4
  789.     jsr run_music4
  790. no4    
  791.     movem.l (a7)+,d0-d6/a0-a6    ;restore registers
  792.     rts
  793.  
  794.     ;***********************
  795.  
  796.     ; channel 4 subroutines
  797.  
  798. run_dummy4    
  799.      lea ch4vars,a0
  800.      lea dummy_reg,a2 
  801.      move.w #0,d5 
  802.      jsr sect1    
  803.     rts
  804.  
  805. set_up4    
  806.          move.l fxr4,d0
  807.          add d0,d0
  808.          add d0,d0
  809.          lea  fxjump_table-4,A1
  810.      add.l d0,a1
  811.          move.l (a1),currfx4
  812.       clr.l fxr4
  813.      clr.w fxintc4
  814.       rts
  815.   
  816.      
  817. run_fx4
  818.     lea ch4fxvars,a0
  819.        lea chann4reg,a2
  820.       move.w #%0000000000001000,d5 
  821.      move.w #%1000001000001000,d1 
  822.     move.w    #1,mode
  823.      jsr sect1
  824.     rts
  825.  
  826. run_music4
  827.     lea ch4vars,a0
  828.        lea chann4reg,a2
  829.       move.w #%0000000000001000,d5 
  830.       move.w #%1000001000001000,d1 
  831.     move.w    #0,mode
  832.       jsr sect1     
  833.     rts
  834.     ;  **************************
  835.  
  836. sect1: tst.w (a0)
  837.     bne s1j1
  838.     rts
  839.  
  840. s1j1:    tst.w 2(a0)
  841.         beq sect3       
  842.         cmpi.w #1,2(a0)
  843.         beq sect4
  844.  
  845.         cmpi.w #3,4(a0)    
  846.         beq part2       
  847.     
  848. mode_switch:  subq.w #1,2(a0)     
  849.  
  850. check_effects: clr.w altpf      
  851.         move.w 6(a0),d2    
  852.         tst.w 8(a0)      
  853.         beq check_mod
  854.         tst.w 14(a0)      
  855.         beq cont_bend
  856.         subq.w #1,14(a0)
  857.         bra check_mod
  858. cont_bend:   addq.w #1,altpf    
  859.         move.w 10(a0),d3    
  860.         move.w 12(a0),d4    
  861.         cmpi.w #1,8(a0)
  862.         beq pbup
  863.     
  864.         sub.w d3,d2
  865.         cmp.w d2,d4
  866.         bcs check_mod
  867.         bra fbend
  868.  
  869. pbup:     add.w d3,d2
  870.         cmp.w d2,d4
  871.         bcc check_mod
  872. fbend:     move.w d4,d2
  873.         clr.w 8(a0)      
  874. check_mod:   tst.w 16(a0)
  875.         beq send_alt_pitch
  876.    
  877.  
  878.     tst.w  58(a0)
  879.     beq st_ok
  880.     subq.w #1,58(a0)
  881.     bra send_alt_pitch
  882. st_ok:
  883.         tst.w 50(a0)
  884.         beq cont_mod
  885.         subq #1,50(a0)
  886.         bra send_alt_pitch
  887. cont_mod:    move.w 52(a0),50(a0)  
  888.         addq #1,altpf
  889.         cmpi #3,16(a0)
  890.         bcc addmod
  891.     
  892.         move.w 56(a0),d3 
  893.         sub.w d3,d2
  894.         addq.w #1,16(a0)  
  895.         bra send_alt_pitch
  896. addmod:
  897.  
  898.         move.w 54(a0),d3 
  899.         add.w d3,d2
  900.         addq.w #1,16(a0)
  901.         cmpi.w #5,16(a0)
  902.        bne send_alt_pitch
  903.         move.w #1,16(a0)  
  904.  
  905. send_alt_pitch: tst.w altpf
  906.         beq send_env
  907.         move.w d2,6(a0)  
  908.         move.w d2,6(a2)  
  909.  
  910. send_env: 
  911.  
  912. do_env_check:
  913.  
  914. norm_env:
  915.     move.l 18(a0),a1    
  916.         cmpi.w #255,(a1)
  917.         beq env_finished
  918.     ;cmpi.w #1,66(a0)    
  919.     ;bne    no_acc 
  920.  
  921. resu    clr.l d0
  922.     move.w (a1)+,d0
  923.     ;sub.w 64(a0),d0    
  924.  
  925.             ;test for mode here
  926.     tst.w mode
  927.     bne sete
  928.  
  929.     sub.w fade,d0
  930.     bcc sete
  931.  
  932.  
  933.     move.w #0,d0
  934.  
  935.  
  936. sete    move.w d0,8(a2)    
  937.     move.l a1,18(a0)
  938.     rts        
  939.  
  940.  
  941. no_acc:
  942. ;resu:  
  943. no_off
  944.     ;move.w (a1)+,d0
  945.     sub.w fade,d0
  946.     bcc sete2
  947.     move.w #0,d0
  948. sete2    move.w d0,8(a2)
  949.      move.w (a1)+,8(a2)
  950.    
  951. fint:   move.l a1,18(a0)    
  952.     rts
  953.  
  954. env_finished:
  955.     subq.l #2,a1    
  956.     bra resu
  957.     rts
  958.  
  959.  
  960.  
  961. one_shot_note: move.w #3,4(a0)     
  962.         move.l 38(a0),(a2)
  963.         move.w 42(a0),4(a2)
  964.         move.w d1,dmacon     
  965.         bra send_env
  966.  
  967.  
  968. part2:                         
  969.         move.l 44(a0),(a2)
  970.         move.w 48(a0),4(a2)
  971.         subq.w #1,2(a0)      
  972.         move.w #1,4(a0)
  973.         bra check_effects
  974.  
  975. sect3:
  976.     move.w #0,66(a0)    
  977.  
  978.     move.l 22(a0),a1  
  979. control_ret: move.w (a1)+,d0  
  980.     cmpi.w #100,d0   
  981.     bls sect5   
  982.   
  983. acc_note:
  984.     move.w d0,6(a0)  
  985.     move.w d0,6(a2)  
  986.     move.w (a1)+,2(a0) 
  987.     subq.w #1,2(a0)  
  988.     move.l a1,22(a0)  
  989.     move.l 34(a0),18(a0) 
  990.     move.w 60(a0),58(a0) 
  991.  
  992.  
  993.     tst.w 16(a0)
  994.     beq no_mod_res
  995.     move.w #1,16(a0)
  996. no_mod_res:
  997.     cmpi.w #0,4(a0)
  998.     beq do_loop
  999.     bra one_shot_note    
  1000.  
  1001.  
  1002. do_loop:    move.w d1,dmacon   
  1003.         bra send_env
  1004.  
  1005. do_rest:
  1006.     move.w (a1)+,2(a0) 
  1007.     subq.w #1,2(a0)  
  1008.     move.l a1,22(a0)  
  1009.     move.l  #rest_env,18(a0)
  1010.  
  1011.         move.w #0,8(a2)
  1012.         bra send_env
  1013.    
  1014. sect4:
  1015.         cmpi.w #0,4(a0)
  1016.         beq noof
  1017.         move.w d5,dmacon   
  1018. noof:     subq.w #1,2(a0)
  1019.         bra check_effects
  1020.    
  1021. sect5:     move.l #jump_table,a3
  1022.         move.l (a3,d0),a4
  1023.         jmp (a4)
  1024.  
  1025. jump_table: 
  1026.     dc.l  in_line_data
  1027.         dc.l  nsound
  1028.         dc.l  patt_end
  1029.         dc.l  get_env
  1030.         dc.l  check_pbend
  1031.         dc.l  do_mod
  1032.         dc.l  bend_off
  1033.         dc.l  mod_off
  1034.         dc.l  do_rest
  1035.         dc.l  end_fx
  1036.         dc.l  end_fx
  1037.     dc.l  s_f_on
  1038.     dc.l  s_f_off
  1039.     dc.l  set_acc
  1040.     dc.l  rept
  1041.  
  1042. in_line_data:
  1043.  
  1044.         nop
  1045.         rts
  1046.  
  1047. rept:
  1048.     move.l (a1),a1
  1049.     bra control_ret
  1050.  
  1051. s_f_on: 
  1052.     bclr #1,filter
  1053.     bra control_ret
  1054. s_f_off:
  1055.     bset #1,filter
  1056.     bra control_ret
  1057.  
  1058. nsound:    move.l (a1)+,a3     
  1059.         cmpi.w #0,(a3)
  1060.         bne one_shot_sound
  1061.         move.w (a3)+,4(a0)    
  1062.         move.l (a3)+,(a2)     
  1063.         move.w (a3),4(a2)    
  1064.         jmp control_ret
  1065.  
  1066. one_shot_sound:
  1067.         move.w (a3)+,4(a0)
  1068.         move.l (a3)+,38(a0)   
  1069.         move.l (a3)+,42(a0)
  1070.         move.l (a3),46(a0)
  1071.         jmp control_ret
  1072.  
  1073. patt_end:
  1074.  
  1075.         move.l 26(a0),a1    
  1076.         cmpi.l #0,(a1)     
  1077.         beq song_control
  1078.         addq.l #4,26(a0)    
  1079.         move.l (a1),a1     
  1080.         jmp control_ret
  1081. get_env: 
  1082.        move.l (a1)+,a4 
  1083.     move.l (a4)+,62(a0)    
  1084.     
  1085.     move.l  a4,34(a0)    
  1086.     
  1087.         bra control_ret
  1088.  
  1089. check_pbend:
  1090.      move.l (a1)+,8(a0)
  1091.         move.l (a1)+,12(a0)
  1092.         bra control_ret
  1093.  
  1094. do_mod:    move.w #1,16(a0)  
  1095.         move.l (a1)+,50(a0)
  1096.         move.l (a1)+,54(a0)
  1097.         move.l (a1)+,58(a0)
  1098.         bra control_ret
  1099.  
  1100. bend_off:   clr.w 8(a0)
  1101.         bra control_ret
  1102.  
  1103. mod_off:    clr.w 16(a0)
  1104.         bra control_ret
  1105.  
  1106.  
  1107. end_fx:    
  1108.     cmpi.w #6,(a0)
  1109.     beq end_fx4p
  1110.     cmpi.w #5,(a0)
  1111.     beq end_fx3p
  1112.     cmpi.w #7,(a0)
  1113.     beq end_fx2p
  1114.  
  1115. end_fx1p:
  1116.         move.w d5,dmacon   
  1117.     move.w  #1,chann1reg+6
  1118.     move.w #0,8(a2)
  1119.     move.l #0,fxc1
  1120.     rts
  1121.  
  1122. end_fx2p:
  1123.     move.w d5,dmacon 
  1124.     move.w  #1,chann2reg+6
  1125.         move.w #0,8(a2) 
  1126.     move.l #0,fxc2
  1127.         rts
  1128.  
  1129.  
  1130. end_fx3p:
  1131.         move.w d5,dmacon   
  1132.     move.w  #1,chann3reg+6
  1133.     move.w #0,8(a2)
  1134.     move.l #0,fxc3
  1135.     rts
  1136.  
  1137. end_fx4p:
  1138.     move.w d5,dmacon 
  1139.     move.w  #1,chann4reg+6
  1140.         move.w #0,8(a2) 
  1141.     move.l #0,fxc4
  1142.         rts
  1143.  
  1144. set_acc: move.w #1,66(a0) 
  1145.     bra control_ret
  1146.  
  1147. song_control:
  1148.         addq.l #4,a1
  1149.         move.l 30(a0),26(a0)
  1150.         move.l 26(a0),a1
  1151.         addq.l #4,26(a0)
  1152.         move.l (a1),a1
  1153.         jmp control_ret
  1154.  
  1155.  
  1156.     ;"""""""""""""""""""""""""""""""""""""""""""""""""
  1157.         ;DATA HERE
  1158.  
  1159.  
  1160.     ;"""""""""""""""""""""""""""""""""""""""""""""""""
  1161.  
  1162.     ;;; DATA
  1163.  
  1164.  
  1165. max_songs    dc.l    2
  1166.  
  1167. song_table:
  1168.  
  1169.         dc.l s1_d,s2_d,s3_d,s4_d    ;death
  1170.         dc.l ssilence,ssilence,ssilence,ssilence
  1171.  
  1172.  
  1173. ;************************************************************
  1174. gvars:
  1175. ch1vars     
  1176.     dc.w 0     
  1177.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1178. pattr1: dc.l 0    
  1179. songr1: dc.l 0    
  1180. wsong1: dc.l 0   
  1181.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1182.  
  1183. ch2vars     
  1184.     dc.w 0     
  1185.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1186. pattr2: dc.l 0    
  1187. songr2: dc.l 0    
  1188. wsong2: dc.l 0    
  1189.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1190.  
  1191. ch3vars 
  1192.     dc.w 0     
  1193.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1194. pattr3: dc.l 0    
  1195. songr3: dc.l 0    
  1196. wsong3: dc.l 0    
  1197.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1198.  
  1199. ch4vars 
  1200.     dc.w 0     
  1201.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1202. pattr4: dc.l 0    
  1203. songr4: dc.l 0    
  1204. wsong4: dc.l 0    
  1205.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1206.  
  1207.  
  1208. ch1fxvars 
  1209.     dc.w 0     
  1210. fxintc1:
  1211.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1212. currfx1:
  1213.     dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    
  1214.  
  1215. ch2fxvars 
  1216.     dc.w 0     
  1217. fxintc2:
  1218.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1219. currfx2:
  1220.     dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    
  1221.  
  1222.  
  1223. ch3fxvars
  1224.     dc.w 0     
  1225. fxintc3:
  1226.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1227. currfx3:
  1228.     dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    
  1229.  
  1230. ch4fxvars 
  1231.     dc.w 0     
  1232. fxintc4:
  1233.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1234. currfx4:
  1235.     dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    
  1236. ;************************************************************
  1237.  
  1238. dummy_reg dc.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1239.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1240.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1241.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1242. ;************************************************************
  1243.  
  1244. ;       THESE ARE THE FX PATTERNS................
  1245.  
  1246. ; The interrupt counter in these patterns is dependent on the
  1247. ; playback speed.The figure is calculated as follows
  1248. ; (length/playback speed) *50
  1249. ; the figure then needs rounding up to give a clear finish
  1250. ; if you have the count longer than needed it will cut
  1251. ; out the music on the relevent channel for longer than
  1252. ; neccessary and make it sound jerky
  1253. ; The fx table is below the patterns
  1254.  
  1255.  
  1256. ;fight:
  1257.       ;dc.w new_env
  1258.       ;dc.l fight_env
  1259.       ;dc.w new_snd
  1260.       ;dc.l fightp
  1261.     ;dc.w r8,8        ;r8=8000 playback speed/8=int counter
  1262.       ;dc.w end_fxp
  1263.  
  1264. ;fight_env:            dc.w 0,64,64,64,255
  1265.  
  1266. ;*************************
  1267.  
  1268.  
  1269. fxjump_table:  
  1270.  
  1271.     dc.l 0            ;fx number 1
  1272.  
  1273. max_fx    dc.l    30
  1274. ;______________________________________________________________________
  1275.  
  1276.  
  1277. sstart: dc.l 0,end_song
  1278.  
  1279. pstart: dc.w end_patt
  1280.  
  1281.  
  1282. ;----------------------------------
  1283.  
  1284. ;;;;;;;;;;;;;;;;;;;;;   Music Data ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1285.  
  1286. cr  set   32
  1287. q set  cr/2
  1288. sq set q/2
  1289. dsq set sq/4
  1290.  
  1291. tq1 set      7
  1292. tq2 set   6
  1293. tsq1 set  3
  1294. tsq2 set 4
  1295.  
  1296. ssilence:
  1297.     dc.l    pr
  1298.       dc.l     0,end_song
  1299.  
  1300.  
  1301. ;************************************************
  1302.  
  1303.  
  1304. patterns:
  1305.  
  1306. pr:
  1307.     dc.w rest,cr*4
  1308.     dc.w end_patt
  1309.  
  1310. cp:
  1311.  
  1312. pri
  1313.     dc.w    rest,65000
  1314.     dc.w    rest,65000
  1315.     dc.w    rest,65000
  1316.     dc.w    rest,65000
  1317.     dc.w    rest,65000
  1318.     dc.w     end_patt
  1319.  
  1320.  
  1321.  
  1322. ;----------------
  1323.         ;DEATH MUSIC
  1324.  
  1325. cr  set   32
  1326. q set  cr/2
  1327. sq set q/2
  1328. dsq set sq/4
  1329.  
  1330. tcr1 set  0
  1331. tq1 set      11
  1332. tq2 set      10
  1333. tsq1 set  5
  1334. tsq2 set  6
  1335.  
  1336.  
  1337.  
  1338. s1_d:
  1339.     dc.l    flute_snd
  1340.     dc.l    death_strings
  1341.     dc.l    pri
  1342.       dc.l     0,end_song
  1343.  
  1344. s2_d:
  1345.     dc.l    trumpet_snd
  1346.     dc.l    death_bass
  1347.     dc.l    pri
  1348.       dc.l     0,end_song
  1349.  
  1350.  
  1351. s3_d:
  1352.  
  1353.     dc.l    trumpet_snd
  1354.     dc.l    death_tune
  1355.     dc.l    pri
  1356.       dc.l     0,end_song
  1357.  
  1358.  
  1359. s4_d:
  1360.     dc.l    abass_snd
  1361.     dc.l    death_bass2
  1362.     dc.l    pri
  1363.       dc.l     0,end_song
  1364.  
  1365. ;----------
  1366.  
  1367. death_strings:
  1368.     dc.w c03,$0004,bb02,$0004,ab02,$0004,g02,$0004,f02,$0004
  1369.     dc.w eb02,$0004,d02,$0004,db02,$0004
  1370.     dc.w c02,cr
  1371.     dc.w d02,$0004
  1372.     dc.w eb02,$0004,f02,$0004,g02,$0004,a02,$0004,b02,$0004
  1373.     dc.w c03,$0004,bb02,$0004,ab02,$0004,g02,$0004,ab02,$0004
  1374.     dc.w g02,$0004,f02,$0004,eb02,$0004,f02,$0004,eb02,$0004
  1375.     dc.w d02,$0004
  1376.     dc.w eb02,$0004,f02,$0004,g02,$0004,a02,$0004,b02,$0004
  1377.     dc.w eb02,4,c03,4
  1378.     dc.w eb02,cr
  1379.     dc.w d02,$0004
  1380.     dc.w eb02,$0004,f02,$0004,g02,$0004,a02,$0004,b02,$0004
  1381.     dc.w c03,$0004,bb02,$0004,ab02,$0004,g02,$0004,ab02,$0004
  1382.     dc.w g02,$0004,f02,$0004,eb02,$0004,f02,$0004,eb02,$0004
  1383.     dc.w d02,$0004
  1384.     dc.w eb02,$0004,f02,$0004,g02,$0004,a02,$0004,b02,$0004
  1385.     dc.w eb02,4,c03,4
  1386.     dc.w    f02,cr*2,g02,cr*2,eb03,cr*4
  1387.     dc.w end_patt
  1388.  
  1389. death_bass:
  1390.     dc.w rest,cr,c01,$0080,ab01,$0080,f01,$0040,g01,$0040
  1391.     dc.w g02,cr*4 
  1392.     dc.w end_patt
  1393.  
  1394. death_tune:
  1395.     dc.w    rest,cr
  1396.     dc.w c02,cr*3,c02,tq1,eb02,tq2,g02,tq1,c03,cr*3
  1397.     dc.w c02,tq1,eb02,tq2,g02,tq1,c03,cr,b02,tq1,c03,tq2,d03,tq1+dsq+cr
  1398.     dc.w eb03,cr,c03,cr*4
  1399.     dc.w end_patt
  1400.  
  1401. death_bass2:
  1402.     dc.w rest,cr
  1403.     dc.w c02,cr,c02,cr,c02,cr,c02,cr
  1404.     dc.w c02,cr,c02,cr,c02,cr,c02,cr
  1405.     dc.w c02,cr,c02,cr,g02,cr*2
  1406.     dc.w    new_env
  1407.     dc.l    snare_env
  1408.     dc.w    new_snd
  1409.     dc.l    snarep
  1410.  
  1411.  
  1412.     dc.w 4000,cr*4
  1413.     dc.w end_patt
  1414.  
  1415.  
  1416.  
  1417.  
  1418. ;-----------------
  1419.  
  1420. sounds:
  1421.  
  1422. flute_snd:
  1423.     dc.w    new_env
  1424.     dc.l    flute_env
  1425.     dc.w    new_snd
  1426.     dc.l    flutep
  1427.     dc.w     end_patt
  1428.  
  1429. flute_sndq:
  1430.     dc.w    new_env
  1431.     dc.l    flute_envq
  1432.     dc.w    new_snd
  1433.     dc.l    flutep
  1434.     dc.w     end_patt
  1435.  
  1436. flute_sndmq:
  1437.     dc.w    new_env
  1438.     dc.l    flute_envmq
  1439.     dc.w    new_snd
  1440.     dc.l    flutep
  1441.     dc.w     end_patt
  1442.  
  1443.  
  1444. aguitar_snd:
  1445.     dc.w    new_env
  1446.     dc.l    aguitar_env
  1447.     dc.w    new_snd
  1448.     dc.l    aguitp
  1449.     dc.w     end_patt
  1450.  
  1451. aguitar_sndq:
  1452. aguitar_snd_quiet:
  1453.     dc.w    new_env
  1454.     dc.l    aguitar_env_quiet
  1455.     dc.w    new_snd
  1456.     dc.l    aguitp
  1457.     dc.w     end_patt
  1458.  
  1459.  
  1460. tamb_snd:
  1461.     dc.w    new_env
  1462.     dc.l    tamb_env
  1463.     dc.w    new_snd
  1464.     dc.l    tambp
  1465.     dc.w     end_patt
  1466.  
  1467.  
  1468.  
  1469. abass_snd:
  1470.     dc.w    new_env
  1471.     dc.l    abass_env
  1472.     dc.w    new_snd
  1473.     dc.l    abassp
  1474.     dc.w     end_patt
  1475.  
  1476. sitar_snd:
  1477.     dc.w    new_env
  1478.     dc.l    sitar_env
  1479.     dc.w    new_snd
  1480.     dc.l    sitarp
  1481.     dc.w     end_patt
  1482.  
  1483. bassoon_snd:
  1484.     dc.w    new_env
  1485.     dc.l    bassoon_env
  1486.     dc.w    new_snd
  1487.     dc.l    bassoonp
  1488.     dc.w     end_patt
  1489.  
  1490. bassoon_snd_short:
  1491.     dc.w    new_env
  1492.     dc.l    bassoon_env
  1493.     dc.w    new_snd
  1494.     dc.l    bassoonsp
  1495.     dc.w     end_patt
  1496.  
  1497. snare_snd:
  1498.     dc.w    new_env
  1499.     dc.l    snare_env
  1500.     dc.w    new_snd
  1501.     dc.l    snarep
  1502.     dc.w     end_patt
  1503.  
  1504. snare_sndq:
  1505.     dc.w    new_env
  1506.     dc.l    snare_envq
  1507.     dc.w    new_snd
  1508.     dc.l    snarep
  1509.     dc.w     end_patt
  1510.  
  1511. trumpet_snd:
  1512.     dc.w    new_env
  1513.     dc.l    trumpet_env
  1514.     dc.w    new_snd
  1515.     dc.l    trumpetp
  1516.     dc.w     end_patt
  1517.  
  1518. trumpet_sndq:
  1519.     dc.w    new_env
  1520.     dc.l    trumpet_envq
  1521.     dc.w    new_snd
  1522.     dc.l    trumpetp
  1523.     dc.w     end_patt
  1524.  
  1525. pizzo_snd:
  1526.     dc.w    new_env
  1527.     dc.l    pizzo_env
  1528.     dc.w    new_snd
  1529.     dc.l    pizzop
  1530.     dc.w     end_patt
  1531.  
  1532. pizzoh_snd:
  1533.     dc.w    new_env
  1534.     dc.l    pizzo_env
  1535.     dc.w    new_snd
  1536.     dc.l    pizzohp
  1537.     dc.w     end_patt
  1538.  
  1539.  
  1540. fhorn_snd:
  1541.     dc.w    new_env
  1542.     dc.l    fhorn_env
  1543.     dc.w    new_snd
  1544.     dc.l    fhornp
  1545.     dc.w     end_patt
  1546.  
  1547. fhorn_sndq:
  1548.     dc.w    new_env
  1549.     dc.l    fhorn_envq
  1550.     dc.w    new_snd
  1551.     dc.l    fhornp
  1552.     dc.w     end_patt
  1553.  
  1554.  
  1555.  
  1556. strings_snd:
  1557.     dc.w    new_env
  1558.     dc.l    strings_env
  1559.     dc.w    new_snd
  1560.     dc.l    stringsp
  1561.     dc.w     end_patt
  1562.  
  1563. tymp_snd:
  1564.     dc.w    new_env
  1565.     dc.l    tymp_env
  1566.     dc.w    new_snd
  1567.     dc.l    tympp
  1568.     dc.w     end_patt
  1569.  
  1570. taiko_snd:
  1571.     dc.w    new_env
  1572.     dc.l    taiko_env
  1573.     dc.w    new_snd
  1574.     dc.l    taikop
  1575.     dc.w     end_patt
  1576.  
  1577.  
  1578. monk_snd:
  1579.     dc.w    new_env
  1580.     dc.l    monk_env
  1581.     dc.w    new_snd
  1582.     dc.l    monkp
  1583.     dc.w     end_patt
  1584.  
  1585. wave_snd:
  1586.     dc.w    new_env
  1587.     dc.l    wave_envq
  1588.     dc.w    new_snd
  1589.     dc.l    wavep
  1590.     dc.w     end_patt
  1591.  
  1592.  
  1593.  
  1594.  
  1595. ;***********************************************
  1596.  
  1597. parameters:
  1598.  
  1599. iff    equ 108
  1600.  
  1601.     ; sample parameters
  1602.  
  1603.  
  1604. snarep
  1605.         dc.w 1  
  1606.              dc.l snared
  1607.              dc.w 2240/2  
  1608.              dc.l restd
  1609.              dc.w 16/2
  1610.  
  1611.  
  1612. trumpetp
  1613.         dc.w 1  
  1614.              dc.l synbras1d
  1615.              dc.w 3338/2  
  1616.              dc.l synbras1d
  1617.              dc.w 3338/2  
  1618.  
  1619. abassp
  1620.         dc.w 1  
  1621.              dc.l abassd+iff
  1622.              dc.w 8000/2 
  1623.              dc.l restd
  1624.              dc.w 16/2
  1625.  
  1626. flutep
  1627.         dc.w 1  
  1628.              dc.l fluted+iff
  1629.              dc.w 7278/2
  1630.              dc.l fluted+4173+iff
  1631.              dc.w 3106/2
  1632.  
  1633. tambp
  1634.         dc.w 1  
  1635.              dc.l tambd
  1636.              dc.w 1457/2 
  1637.              dc.l restd
  1638.              dc.w 16/2
  1639.  
  1640. sitarp
  1641.         dc.w 1  
  1642.              dc.l sitard
  1643.              dc.w 7708/2 
  1644.              dc.l restd
  1645.              dc.w 16/2
  1646.  
  1647. aguitp
  1648.         dc.w 1  
  1649.              dc.l aguitd+iff
  1650.              dc.w 9576/2 
  1651.              dc.l restd
  1652.              dc.w 16/2
  1653.  
  1654. bassoonlp
  1655.         dc.w 1  
  1656.              dc.l bassoond+iff
  1657.              dc.w 4788/2 
  1658.              dc.l bassoond+iff+2033
  1659.              dc.w 2755/2
  1660.  
  1661.  
  1662. bassoonp
  1663.         dc.w 1  
  1664.              dc.l bassoond+iff
  1665.              dc.w 4788/2 
  1666.              dc.l restd
  1667.              dc.w 16/2
  1668.  
  1669. bassoonsp
  1670.         dc.w 1  
  1671.              dc.l bassoond+iff
  1672.              dc.w 4788/2-1000 
  1673.              dc.l restd
  1674.              dc.w 16/2
  1675.  
  1676. pizzop:
  1677.         dc.w 1  
  1678.              dc.l pizzod
  1679.              dc.w 5550/2 
  1680.              dc.l restd
  1681.              dc.w 16/2
  1682.  
  1683. pizzohp:
  1684.         dc.w 1  
  1685.              dc.l pizzohd
  1686.              dc.w 3796/2 
  1687.              dc.l restd
  1688.              dc.w 16/2
  1689.  
  1690. fhornp:
  1691.         dc.w 1  
  1692.              dc.l fhornd+iff
  1693.              dc.w (6684-iff)/2 
  1694.              dc.l fhornd+iff
  1695.              dc.w (6684-iff)/2
  1696.  
  1697. stringsp:
  1698.         dc.w 1  
  1699.              dc.l stringsd
  1700.              dc.w (8668)/2 
  1701.              dc.l restd
  1702.              dc.w 16/2
  1703.  
  1704. tympp:
  1705.         dc.w 1  
  1706.              dc.l tympd
  1707.              dc.w 7378/2 
  1708.              dc.l restd
  1709.              dc.w 16/2
  1710.  
  1711. taikop:
  1712.         dc.w 1  
  1713.              dc.l taikod+iff
  1714.              dc.w (4118-iff)/2 
  1715.              dc.l restd
  1716.              dc.w 16/2
  1717.  
  1718. monkp:
  1719.         dc.w 1  
  1720.              dc.l monkd+iff
  1721.              dc.w (6290-iff)/2 
  1722.              dc.l restd
  1723.              dc.w 16/2
  1724.  
  1725. wavep:
  1726.         dc.w 1  
  1727.              dc.l waved+iff
  1728.              dc.w (9094-iff)/2 
  1729.              dc.l restd
  1730.              dc.w 16/2
  1731.  
  1732.  
  1733.  
  1734.  
  1735. envelopes:
  1736.  
  1737.  
  1738. rest_env:            dc.w 0,0,0,0,0,0,0,0,255
  1739. flute_env:            dc.w 0,32,255
  1740. tymp_env:            dc.w 0,48,255
  1741. flute_envq:            dc.w 0,8,255
  1742. flute_envmq:            dc.w 0,18,255
  1743. tamb_env:            dc.w 0,62,255
  1744. aguitar_env:            dc.w 0,45,255
  1745. aguitar_env_quiet:        dc.w 0,30,255
  1746. sitar_env:            dc.w 0,42,255
  1747. abass_env:            dc.w 0,54,255
  1748. snare_env:            dc.w 0,35,255
  1749. snare_envq:            dc.w 0,15,255
  1750. trumpet_env:            dc.w 0,35,255
  1751. trumpet_envq:            dc.w 0,25,255
  1752. bassoon_env:            dc.w 0,40,255
  1753. pizzo_env:            dc.w 0,35,255
  1754. fhorn_env:            dc.w 0,40,255
  1755. fhorn_envq:            dc.w 0,28,255
  1756. strings_env:            dc.w 0,48,255
  1757. taiko_env:            dc.w 0,38,255
  1758. taiko_envq:            dc.w 0,38,255
  1759. bird2_env:            dc.w 0,28,255
  1760. bird_env:            dc.w 0,18,255
  1761. monk_env:            dc.w 0,38,255
  1762. wave_env:            dc.w 0,38,255
  1763. wave_envq:            dc.w 0,18,255
  1764.  
  1765.  
  1766.  
  1767. ;guit.sam                    6191 rwed Today     01:27:11
  1768. ;tamb.sam                    1457 rwed Today     01:27:10
  1769. ;flute.sam                   8410 rwed Today     01:27:08
  1770. ;sitar.sam                   8993 rwed Today     01:27:07
  1771. ;bass.sam                    8583 rwed Today     01:27:05
  1772. ;7 files - 207 blocks used
  1773.  
  1774. ;**************************************************
  1775.  
  1776.  
  1777. aguitd            ;incbin c:instruments/aguit.sam 
  1778. tambd            ;incbin c:instruments/tamb.sam 
  1779. fluted            incbin c:instruments/flute.sam 
  1780. sitard            ;incbin c:instruments/sitar.sam 
  1781. abassd            incbin c:instruments/abass.sam 
  1782. snared            incbin c:instruments/snare.sam 
  1783. synbras1d        incbin c:instruments/hbrass3l.sam 
  1784. bassoond        ;incbin c:instruments/bassoonl.sam 
  1785. pizzod            ;incbin c:instruments/pizzo1.sam 
  1786. pizzohd            ;incbin c:instruments/pizzo2.sam 
  1787.  
  1788. fhornd            ;incbin c:instruments/fhorn.sam 
  1789. stringsd        ;incbin c:instruments/strings2.sam
  1790. tympd            ;incbin c:instruments/tymp1.sam
  1791. taikod            ;incbin c:instruments/taiko.sam
  1792. monkd            ;incbin c:instruments/monk.sam
  1793. waved            ;incbin c:instruments/wave.sam
  1794.  
  1795.  
  1796. ;********************************************
  1797.  
  1798. ;;THE FX SAMPLES ARE PULLED IN HERE...THis section can be anywhere
  1799. ;; in lower memory,and in any order
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806. ;***********************
  1807.  
  1808. restd:
  1809. rest_data:
  1810.              dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1811.              dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1812.              dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1813.              dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1814. sined:
  1815. sine_datad:
  1816.              dc.w 127,80,50,25,0,-25,-50,-100,-127
  1817.              dc.w -127,-100,-50,-35,0,35,50,80,127
  1818.  
  1819.  
  1820. ;*************************************************
  1821.  
  1822. ;------------
  1823.  
  1824.  
  1825.  
  1826.     end
  1827.