home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: Super Street …ghter II PC Format Disk 2 / Lowe_SuperStreetFighterIIPCFormatDisk2.img / TESTDRIV.S < prev    next >
Encoding:
Text File  |  1995-12-07  |  29.7 KB  |  1,668 lines

  1.  
  2.  
  3.  
  4.  
  5. ;**********************************************************************
  6.  
  7.  
  8.     ;        DRIVER REMAINS COPYRIGHT D.LOWE 
  9.  
  10.     ;       DRIVER TO RUN RELOCATABLE DATA BLK
  11.     ;
  12.     ;  .....fade only affects music in this version
  13.  
  14.     ;    devpac source code file... no macros.
  15.  
  16.     ;    It must be assembled with SYMBOLS CASE independent.
  17.  
  18.     ;       dont hesitate to ring with any problems
  19.  
  20.  
  21.  
  22.     ;        DAVE LOWE.....0723  870648
  23.  
  24.  
  25.  
  26. ;        **************************
  27.  
  28.     section issA,code_c    ;must be in low memory for dma access
  29.                 ;DEVPAC PSEUDO OP ..CAN BE DELETED
  30.  
  31.  
  32. ;*****************************************
  33.  
  34.  
  35.                 ; zero to step tunes on mouse button
  36.                 ; can be deleted..not essential
  37.  
  38.         ;  ALL EQUs
  39.  
  40.  
  41.  
  42.  
  43. v equ 0
  44.  
  45. no_loop equ 0
  46. loop equ 0
  47. chann1reg   equ $dff0a0    
  48. chann2reg   equ $dff0b0
  49. chann3reg   equ $dff0c0
  50. chann4reg   equ $dff0d0
  51. dmacon     equ $dff096
  52. int_bf_int   equ   $dff01e
  53. int_bf_w    equ   $dff09a
  54. vhposr     equ   $dff006
  55. in_line    equ   0
  56. new_snd    equ   4
  57. end_song     equ   1
  58. end_patt    equ   8
  59. new_env    equ   12
  60. pbend     equ   16
  61.  
  62.  
  63.  
  64. hi: equ 223
  65. lo:  equ 446
  66.  
  67. r22    equ 134
  68. r20    equ 179        ;correctum
  69. r19    equ 150
  70. r18    equ 178
  71. r17    equ 200
  72. r16:    equ 227        ;correctum
  73. r15:    equ 249
  74. r14    equ 280
  75. r13:    equ 305
  76. r12:    equ 333
  77. r11:    equ 361
  78. r10:    equ 389
  79. r9:    equ 419
  80. r8:    equ 446
  81. r7:    equ 446+112
  82. r6:    equ 446+223
  83. r5:    equ 446+223+112
  84. r4:    equ 446*2
  85. r3:    equ 446*3
  86. r2:    equ 446*4
  87. r1:    equ 446*8
  88.  
  89.  
  90. filter: equ $bfe001
  91. filter_on equ 44
  92. filter_off equ 48
  93.  
  94. modon     equ   20
  95. pboff     equ   24
  96. modoff     equ   28
  97. rest     equ 32
  98. end_fxp  equ 36
  99. end_fx3  equ 36
  100. end_fx4  equ 40
  101. acc    equ 52
  102. repeat    equ 56
  103. down      equ   1
  104. up       equ   2
  105.  
  106. fx    equ 0
  107.  
  108. ;------------------------------------
  109.  
  110.         ;some test equ settings
  111.  
  112. which_bank    equ    1    ;test identification for fx banks
  113. demo    equ 1        ;set to 0 to make returnable demo        
  114. select_tunes    equ 1   ; set to 0 for selecting music on mouse button
  115.  
  116. ;**************************************************************************
  117. ;**************************************************************************
  118.  
  119.  
  120.  
  121.  ;    THIS IS THE CONTROL SECTION FOR TESTING AS A STAND ALONE PRG. 
  122.  
  123.     ;       AND CAN BE DELETED WHEN NOT REQUIRED
  124.  
  125.     ; it shows the relevent calls for playing music fx/speech etc
  126.  
  127.  
  128.  
  129.  
  130.  
  131. ;                       OVERVIEW
  132.  
  133. ;  the driver can address 5 seperate data blks,these are
  134.  
  135. ;    music_data_blk        the current tune
  136. ;    fx_data_blk        the general fx data
  137. ;    speech_bank1        one bank of character speech
  138. ;    speech_bank2        one bank of character speech
  139. ;    jingle_bank        the jingles
  140.  
  141. ; this allows it to play one tune (either a main tune or a jingle)
  142. ; and up to 4 fx (speech or general fx) from any of the banks simultaneously.
  143. ; to do this it overwrites the music channels as and when it needs to.
  144.  
  145. ; to start a tune the tune number must be placed in SONG_BUFFER (see below)
  146. ; and the routine  SELECT_NEW_SONG is then called,this sets the
  147. ; pointers up to play the tune starting on the next 50th
  148. ; only music OR jingles can be selected..not both 
  149. ; and if switching between them the address set up routines must be
  150. ; called to reset the base address before SELECT_NEW_SONG IS CALLED
  151.  
  152. ;   NB.... if a music or jingle file is not being loaded ie. if
  153. ;   using only speech and fx; then the MUSIC_DISABLE (see below)
  154. ;   variable must be set to 1 
  155.  
  156.  
  157. ;        ----------------------------
  158.  
  159. ;to start an fx/speech the fx number must be placed in FX_NUMBER (see below)
  160. ;the bank number must be placed in BANK_NUMBER (see below) and the routine
  161. ; SET_UP_FX must be called.
  162.             
  163. ;        The bank numbers are  0 = general fx
  164. ;                      1 = speech bank 1
  165. ;                      2 = speech bank 2
  166.  
  167. ;  this will start the selected fx on the next 50th
  168. ;  up to 4 may be set by the main programme at once
  169. ;  if more than four are set running at once then the subsequent ones will
  170. ;  overwrite the first one.
  171.  
  172. ;    ------------------------------------
  173.  
  174.     ;;; do this call at the start to set up pointers etc
  175.  
  176.  
  177.         jsr  initiliase_driver
  178.  
  179.  
  180. ;    ------------------------------------
  181.  
  182.  
  183.     ;the calls demonstrated below set up the relevent
  184.     ;base address of each bank or data blk
  185.  
  186.  
  187.     ; the binary data blks can be anywhere in low memory
  188.     ; but the address must be passed to the driver as below.
  189.     ; this must be done before attempting to select tunes or fx
  190.  
  191.  
  192.  
  193.     ; ....these test addresses are labels at the end of this file
  194.  
  195.  
  196.     lea music_data_blk,a0        ;test address for music files
  197.     jsr set_up_music_address
  198.  
  199.  
  200.     ;lea jingle_data_blk,a0        ;test address for jingle files
  201.     ;jsr set_up_jingle_address    ;ONLY ONE of the music banks
  202.                     ;music or jingles can be selected
  203.                     ;at once
  204.  
  205.  
  206.     lea fx_data_blk,a0        ;test address for general fx
  207.     jsr set_up_fx_address
  208.  
  209.     lea speech_bank1,a0        ;test address for speech bank1
  210.     jsr set_up_speech1_address
  211.  
  212.     lea speech_bank2,a0        ;test address for speech bank2
  213.     jsr set_up_speech2_address
  214.  
  215. ;----------------------------------------------------
  216.  
  217.      ;; These commands will select tune 1 (if jingles) or the tune in the
  218.      ;;        music_data_blk  ready for playing
  219.  
  220.     move.l    #1,song_buffer
  221.     jsr select_new_song    ;set up tune..numnber 1
  222.  
  223. ;-----------------------------------------------------
  224.  
  225.     ; This section pretends to be an interrupt
  226.     ; and calls the driver every 50th
  227.     ; whilst triggering fx/tunes etc with the left mouse button
  228.  
  229.  
  230. testloop:
  231.     jsr delay    ;wait for scan line  at 50hz on pal
  232.     tst.w endf
  233.     beq noend
  234.     jsr kill_chip   ;stop the sound before finishing
  235.     rts        ;finish
  236.  
  237. endf    dc.w 0
  238.  
  239. noend
  240.     jsr driver    ;run driver at 50 hz for testing
  241.  
  242.         bra testloop    ;loop back
  243.  
  244. finish    
  245.     move.w #1,endf
  246.     rts
  247.  
  248. ;------------------------------------------------------------
  249.  
  250.         ;these are all routines used during test/stand alone
  251.         ;assembly
  252.         ;and trigger fx/tunes/speech etc. 
  253.  
  254.  
  255. delay:
  256.     tst.w fxtimer
  257.     bne no_test
  258.     clr.l d0
  259.     move.b $bfe001,d0
  260.     btst #6,d0
  261.     bne no_test1
  262.     move.w #10,fxtimer
  263.     bra testfx4
  264. no_test
  265.     subq #1,fxtimer
  266. no_test1
  267.     clr.l d0
  268.         move.w vhposr,d0
  269.         andi.w #%1111111100000000,d0
  270.         cmpi.w #%1111111100000000,d0
  271.  
  272.     bne no_test1
  273.     rts
  274.  
  275. testfx4:  
  276.  
  277.     clr.l d0
  278.     move.b $bfe001,d0
  279.     btst #6,d0
  280.     beq testfx4
  281.  
  282.     move.l song_buffer,d0
  283.     addq.l #1,d0
  284.     cmp.l    max_songs,d0
  285.     bne nores
  286.     move.l #1,d0
  287. nores    move.l d0,song_buffer
  288.  
  289.  
  290. ;-----------------------------
  291.  
  292.     ifeq    demo
  293.     bra finish            ;end on mouse button
  294.     endc
  295.  
  296. ;----------------------------
  297.  
  298.     ifeq    select_tunes
  299.  
  300.     jsr    select_new_song        ;new song on mouse button
  301.  
  302.     endc
  303. ;--------------------------
  304.  
  305.                     ;run fx on mouse button
  306.     move.l fx_last,d0
  307.  
  308.     move.l d0,fx_kill
  309.  
  310.     ;jsr kill_loopfx        ;use only one fx at a time
  311.                     ;for testing
  312.  
  313. no_k
  314.         move.l fx_no,fx_number
  315.     move.l fx_no,fx_last
  316.     addq.l #1,fx_no
  317.     move.l    max_fx,d0
  318.         cmp.l fx_no,d0
  319.     bne noreset
  320.     move.l #1,fx_no    
  321. noreset: 
  322.  
  323.     move.w #which_bank,fx_bank    ;select which fx bank to pick from
  324.  
  325.     ifne    select_tunes
  326.  
  327.     jsr set_up_fx
  328.  
  329.     endc
  330.  
  331.     bra no_test    
  332.  
  333. fxtc:          dc.w 10
  334. fx_no:         dc.l  1
  335. fx_last        dc.l  0
  336. max_songs    dc.l  4
  337. max_fx        dc.l  19
  338.  
  339.  
  340. ;        END OF CONTROL (DELETABLE) SECTION
  341.  
  342. ;********************************************************************
  343. ;********************************************************************
  344.  
  345. ;    MAIN VARIABLES TO BE ACCESSED BY PROGRAMMER DURING RUNTIME
  346.  
  347.  
  348. fx_number:     dc.l 0 ;     number of fx/speech required here
  349.  
  350. fx_bank        dc.w 0 ;     fx bank here. 0 to 3 for genfx/speech1/speech2
  351.  
  352. fx_kill        dc.l 0 ;     number of fx to kill/used mainly
  353.                ;     to kill looping fx
  354.  
  355.  
  356. song_buffer     dc.l 0 ;     number of piece of music/jingle required here
  357.                ;     all ingame tunes are number 1
  358.  
  359.  
  360.  
  361. music_disable:  dc.w 0 ;     1 = disable music..must be disabled if not
  362.                ;     loading or playing music/jingles
  363.  
  364. fx_disable:     dc.w 0 ;     1 = disable fx
  365.  
  366.  
  367. fade:        dc.w 0 ;      0 to 64..0 = full volume/64 = off
  368.                ;      this can only be used to fade music
  369.                ;      fairly rapidly as it does not scale the
  370.                ;      current envelope values due to the processor
  371.                ;      time involved...do not use to hold the music
  372.                ;      at a set level 
  373.  
  374.  
  375. ;    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  376.  
  377. ;  THESE VARIABLES ARE USED INTERNALLY BY THE DRIVER
  378. fxr1         dc.l 0  
  379. fxr2         dc.l 0  
  380. fxr3         dc.l 0  
  381. fxr4         dc.l 0  
  382. fxc1        dc.l 0
  383. fxc2          dc.l 0
  384. fxc3        dc.l 0
  385. fxc4          dc.l 0
  386. fx1_flag    dc.w 0
  387. fx2_flag    dc.w 0
  388. fx3_flag    dc.w 0
  389. fx4_flag    dc.w 0
  390. fxtimer        dc.w 0
  391. gen        dc.w 0
  392. int_disable    dc.w 0
  393. altpf         dc.w 0
  394. kill_flag    dc.w 0
  395. mode        dc.w 0
  396.  
  397. music_base_address    dc.l 0
  398. fx_base_address        dc.l 0
  399. bank1_base_address    dc.l 0
  400. bank2_base_address    dc.l 0
  401. jingles_base_address    dc.l 0
  402. curr_base_address    dc.l 0
  403. speech_bank1_address    dc.l 0
  404. speech_bank2_address    dc.l 0
  405. ch1fx_ident        dc.w 0
  406. ch2fx_ident        dc.w 0
  407. ch3fx_ident        dc.w 0
  408. ch4fx_ident        dc.w 0
  409. globalfx_ident        dc.w 0
  410. ch1_curr_base        dc.l 0
  411. ch2_curr_base        dc.l 0
  412. ch3_curr_base        dc.l 0
  413. ch4_curr_base        dc.l 0
  414.  
  415.  
  416.  
  417. tempo_counter    dc.l 0
  418. song_tempo    dc.l 0
  419. play_flag    dc.w    0
  420.  
  421.  
  422. ;*********************************
  423. set_up_music_address:
  424.  
  425.     move.w #1,int_disable
  426.     move.l a0,music_base_address
  427.     clr.w int_disable
  428.     rts
  429.  
  430. set_up_fx_address:
  431.     move.w #1,int_disable
  432.     move.l a0,fx_base_address
  433.     clr.w int_disable
  434.     rts
  435.  
  436. set_up_speech1_address:
  437.     move.w #1,int_disable
  438.     move.l a0,speech_bank1_address
  439.     clr.w int_disable
  440.     rts
  441.  
  442. set_up_speech2_address:
  443.     move.w #1,int_disable
  444.     move.l a0,speech_bank2_address
  445.     clr.w int_disable
  446.     rts
  447.  
  448. set_up_jingle_address:
  449.     move.w #1,int_disable
  450.     move.l a0,music_base_address
  451.     clr.w int_disable
  452.     rts
  453.  
  454.  
  455. ;  *******************************************************
  456.  
  457. ;  CALL THIS SUBROUTINE TO SET UP THE REQIURED FX
  458. ;on entry it requires the fx number to be in "fx_number"(long word see above)
  459. ;and the bank number to be in "fx_bank" (word..see above)
  460.  
  461. set_up_fx
  462.  
  463.     move.w #1,int_disable
  464.     movem.l d5/a2,-(a7)    ;save used registers
  465.  
  466.     tst.l fxc4
  467.     bne check3
  468. use4:    
  469.     move.w #%0000000000001000,d5
  470.     lea chann4reg,a2
  471.     jsr end_fx4p
  472.     move.l fx_number,fxr4
  473.     move.l fx_number,fxc4
  474.     move.w fx_bank,ch4fx_ident
  475.     move.l #0,fx_number
  476.     bra no_fx
  477. check3:    tst.l fxc3
  478.     bne check2
  479. use3:
  480.     move.w #%0000000000000100,d5
  481.     lea chann3reg,a2
  482.     jsr end_fx3p
  483.     move.l fx_number,fxr3
  484.     move.l fx_number,fxc3
  485.     move.w fx_bank,ch3fx_ident
  486.     move.l #0,fx_number
  487.     bra no_fx
  488. check2:    tst.l fxc2
  489.     bne check1
  490. use2:
  491.     move.w #%0000000000000010,d5
  492.     lea chann2reg,a2
  493.     jsr end_fx2p
  494.     move.l fx_number,fxr2
  495.     move.l fx_number,fxc2
  496.     move.w fx_bank,ch2fx_ident
  497.     move.l #0,fx_number
  498.     bra no_fx
  499. check1:    tst.l fxc1
  500.     bne use3
  501. use1:
  502.     move.w #%0000000000000001,d5
  503.     lea chann1reg,a2
  504.     jsr end_fx1p
  505.     move.l fx_number,fxr1
  506.     move.l fx_number,fxc1
  507.     move.w fx_bank,ch1fx_ident
  508.     move.l #0,fx_number
  509. no_fx
  510.     movem.l (a7)+,d5/a2    ;restore registers
  511.     clr.w int_disable
  512.     rts
  513.  
  514. ;*************************************************
  515. ;          CALL HERE TO KILL ANY FX...
  516. ;       after putting the number of the fx you want to kill
  517. ;            into fx_kill
  518.  
  519. kill_loopfx
  520.  
  521.     movem.l d5/a2,-(a7)    ;save used registers
  522.     move.l fx_kill,d5
  523.     cmp.l fxc1,d5
  524.     bne k2
  525.     move.w #%0000000000000001,d5
  526.     lea chann1reg,a2
  527.     jsr end_fx1p
  528.     bra error
  529. k2    cmp.l fxc2,d5
  530.     bne k3
  531.     move.w #%0000000000000010,d5
  532.     lea chann2reg,a2
  533.     jsr end_fx2p
  534.     bra error
  535. k3    cmp.l fxc3,d5
  536.     bne k4
  537.     move.w #%0000000000000100,d5
  538.     lea chann3reg,a2
  539.     jsr end_fx3p
  540.     bra error
  541. k4    cmp.l fxc4,d5
  542.     bne error
  543.     move.w #%0000000000001000,d5
  544.     lea chann2reg,a2
  545.     jsr end_fx4p
  546. error
  547.     clr.l fx_kill
  548.     movem.l (a7)+,d5/a2    ;restore registers
  549.     rts
  550. ;*************************************************
  551.  
  552.     ; CALL HERE TO KILL ANY SOUNDS LEFT ON CHIP
  553.  
  554. kill_chip:
  555.     move.w #%0000000000001111,dmacon
  556.     move.l arest_data,chann1reg
  557.     move.l arest_data,chann2reg
  558.     move.l arest_data,chann3reg
  559.     move.l arest_data,chann4reg
  560.     move.w #16,chann1reg+4    
  561.     move.w #16,chann2reg+4    
  562.     move.w #16,chann3reg+4    
  563.     move.w #16,chann4reg+4    
  564.     move.w #0,chann1reg+8
  565.     move.w #0,chann2reg+8
  566.     move.w #0,chann3reg+8
  567.     move.w #0,chann4reg+8
  568.     move.w #1,chann1reg+6
  569.     move.w #1,chann2reg+6
  570.     move.w #1,chann3reg+6
  571.     move.w #1,chann4reg+6
  572.     move.l #0,fxr1
  573.     move.l #0,fxr2
  574.     move.l #0,fxr3
  575.     move.l #0,fxr4
  576.     move.w #0,fx1_flag
  577.     move.w #0,fx2_flag
  578.     move.w #0,fx3_flag
  579.     move.w #0,fx4_flag
  580.     move.l #0,fxc1
  581.     move.l #0,fxc2
  582.     move.l #0,fxc3
  583.     move.l #0,fxc4
  584.     rts
  585.  
  586. arestd:
  587. arest_data:
  588.     dc.w    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  589.  
  590. ;***************************************
  591.  
  592.             ;SUBROUTINES TO MANIPULATE FILTER INGAME
  593.  
  594. turn_filter_on: 
  595.     bclr #1,filter
  596.     rts
  597.  
  598.  
  599. turn_filter_off:
  600.     bset #1,filter
  601.     rts
  602.  
  603. ;****************************************
  604.  
  605.  
  606. ;;;;    THIS ROUTINE WILL INITILIASE THE DRIVER 
  607. ;;;;    AND SHOULD BE CALLED BEFORE USING ANY OF THE
  608. ;;;;    DRIVER FUNCTIONS
  609.  
  610.  
  611. initiliase_driver
  612.  
  613.     clr.l    song_buffer
  614.     move.w #1,music_disable
  615.     jsr select_new_song
  616.     clr.w music_disable
  617.     rts
  618.  
  619.  
  620. ;*****************************************
  621.  
  622.  
  623. ;  CALL HERE TO SELECT WHICH PIECE OF MUSIC TO PLAY
  624. ;  AFTER PLACING NUMBER (1 to ?) IN "SONG_BUFFER"..see above
  625. ;  a call to this routine will initiliase the driver/kill any sound etc.      
  626. ;  make sure this routine has been called before running the interrupt
  627. ;  driven section....see below
  628.  
  629. select_new_song:
  630.  
  631.     move.w #1,int_disable
  632.     movem.l d0/d1/a0/a1,-(a7)    ;save used registers
  633.     move.w music_disable,gen
  634.     move.w #1,music_disable
  635.         jsr kill_chip           
  636.     clr.l d0
  637.         move.w #204,d0
  638.         lea gvars,a0
  639. clloop: clr.w (a0)+        
  640.         dbra  d0,clloop
  641.     tst.l song_buffer
  642.     beq no_song
  643.         move.l song_buffer,d1
  644.     add.l d1,d1
  645.      add.l d1,d1
  646.      add.l d1,d1
  647.      add.l d1,d1
  648.      add.l d1,d1
  649.  
  650. ;-----------------
  651.     movea.l (music_base_address),a1
  652.     move.w (a1),d0        ;word offset to song_table
  653.     lea (a1,d0),a1
  654.     sub.l #32,a1
  655. ;-----------------
  656.         ;LEA  SONG_TABLE-16,A1
  657.  
  658.         add.l d1,a1         ;a1 points to song table in data blk     
  659.  
  660.  
  661.     movea.l (music_base_address),a2    ;sort tempo
  662.         MOVE.L (A1)+,(song_tempo)
  663. ;        ---------------------------------
  664.  
  665.     movea.l (music_base_address),a2
  666.         MOVE.L (A1)+,d0
  667.     add.l d0,a2
  668.     move.l a2,wsong1    
  669.  
  670.     movea.l (music_base_address),a2
  671.         MOVE.L (A1)+,d0
  672.     add.l d0,a2
  673.     move.l a2,wsong2    
  674.  
  675.     movea.l (music_base_address),a2
  676.         MOVE.L (A1)+,d0
  677.     add.l d0,a2
  678.     move.l a2,wsong3
  679.  
  680.     movea.l (music_base_address),a2
  681.         MOVE.L (A1),d0
  682.     add.l d0,a2
  683.     move.l a2,wsong4    
  684.  
  685.  
  686.  
  687.  
  688.         MOVE.L #pstart,PATTR1
  689.         MOVE.L #pstart,PATTR2
  690.         MOVE.L #pstart,PATTR3
  691.     move.l #pstart,pattr4
  692.         move.l #sstart,songr1
  693.         MOVE.L #sstart,SONGR2
  694.         MOVE.L #sstart,SONGR3
  695.     move.l #sstart,songr4
  696. no_song
  697.     move.w #1,ch1vars
  698.     move.w #2,ch2vars
  699.     move.w #3,ch3vars
  700.     move.w #4,ch4vars
  701.     move.w #6,ch4fxvars
  702.     move.w #5,ch3fxvars
  703.     move.w #7,ch2fxvars
  704.     move.w #8,ch1fxvars
  705.     move.w gen,music_disable
  706.     clr.w int_disable
  707.     movem.l (a7)+,d0/d1/a0/a1    ;restore registers
  708.         rts
  709.  
  710.  
  711. sstart:        dc.l 0,1
  712. pstart:        dc.w 8
  713.  
  714.  
  715. ;********************************************************************
  716. ;********************************************************************
  717.  
  718.         ;This is the actual interrupt routine
  719.  
  720.  
  721. ;  CALL HERE ON A 50hz INTERRUPT DURING RUNTIME
  722. ;  TO PLAY FX AND TUNES
  723.  
  724. driver:  
  725.     tst.w int_disable
  726.     beq process_data
  727.     rts        
  728. ;------------------------------
  729.  
  730. process_data
  731.  
  732.     move.l #1,d0
  733.     add.l (tempo_counter),d0
  734.     move.l d0,(tempo_counter)
  735.     cmp.l (song_tempo),d0
  736.     bls process_data1
  737.  
  738.     move.w #1,play_flag    ;inhibit music play this frame
  739.     clr.l tempo_counter
  740.  
  741.  
  742. process_data1
  743.  
  744.     movem.l d0-d6/a0-a6,-(a7)    ;save used registers
  745.  
  746.  
  747. ch1:
  748.     tst.w fx_disable
  749.     bne test_music1
  750.     tst.l fxr1
  751.     bne   ch1j1
  752.     tst.l fxc1
  753.     beq test_music1
  754.     bra ch1j3
  755. ch1j2    jsr run_dummy1
  756.     jsr run_fx1
  757.     bra ch2
  758. ch1j1
  759.     jsr set_up1
  760. ch1j3    tst.w music_disable    
  761.     beq ch1j2
  762.     jsr run_fx1
  763.     bra ch2
  764. test_music1
  765.     tst.w music_disable
  766.     bne ch2
  767.     jsr run_music1
  768.     bra ch2
  769.     ;***********************
  770.  
  771.     ; channel 1 subroutines
  772.  
  773. run_dummy1    
  774.  
  775.  
  776.  
  777.     tst.w play_flag
  778.     beq rd1
  779.     rts
  780. rd1
  781.  
  782.     move.l (music_base_address),(curr_base_address)
  783.  
  784.  
  785.      lea ch1vars,a0
  786.      lea dummy_reg,a2 
  787.      move.w #0,d5 
  788.      jsr sect1    
  789.     rts
  790.  
  791. set_up1    
  792.     move.w ch1fx_ident,d0
  793.     jsr sort_fx_bank    ;move.l (fx_base_address),a1
  794.     move.l a1,ch1_curr_base
  795.     
  796.     move.l a1,-(a7)
  797.     move.w 2(a1),d0
  798.     add.w d0,a1
  799.     sub.l #4,a1        ;pointer to jumptable
  800.         move.l fxr1,d0
  801.         add d0,d0
  802.         add d0,d0
  803.     add.l d0,a1        ;pointer to fx offset within table
  804.     move.l (a1),d0
  805.  
  806.     move.l (a7)+,a1        ;get base address from stack
  807.  
  808.     add.l d0,a1
  809.     move.l a1,currfx1    ;store address
  810.      clr.l fxr1
  811.     clr.w fxintc1
  812.      rts
  813.      
  814. run_fx1
  815.  
  816.     move.l (ch1_curr_base),(curr_base_address)
  817.  
  818.     lea ch1fxvars,a0
  819.        lea chann1reg,a2
  820.       move.w #%0000000000000001,d5 
  821.      move.w #%1000000000000001,d1 
  822.  
  823.     move.w    #1,mode
  824.      jsr sect1
  825.     rts
  826.  
  827. run_music1
  828.  
  829.     tst.w play_flag
  830.     beq rm1
  831.     rts
  832. rm1
  833.     move.l (music_base_address),(curr_base_address)
  834.  
  835.  
  836.     lea ch1vars,a0
  837.        lea chann1reg,a2
  838.       move.w #%0000000000000001,d5 
  839.       move.w #%1000000000000001,d1 
  840.     move.w    #0,mode
  841.       jsr sect1     
  842.     rts
  843.  
  844.     ;  **************************
  845. ch2
  846.     tst.w fx_disable
  847.     bne test_music2
  848.     tst.l fxr2
  849.     bne   ch2j1
  850.     tst.l fxc2
  851.     beq test_music2
  852.     bra ch2j3
  853. ch2j2    jsr run_dummy2
  854.     jsr run_fx2
  855.     bra ch3
  856. ch2j1
  857.     jsr set_up2
  858. ch2j3    tst.w music_disable    
  859.     beq ch2j2
  860.     jsr run_fx2
  861.     bra ch3
  862.  
  863. test_music2
  864.     tst.w music_disable
  865.     bne ch3
  866.     jsr run_music2
  867.     bra ch3
  868.     ;***********************
  869.     ; channel 2 subroutines
  870. run_dummy2    
  871.  
  872.     tst.w play_flag
  873.     beq rd2
  874.     rts
  875. rd2
  876.  
  877.     move.l (music_base_address),(curr_base_address)
  878.  
  879.      lea ch2vars,a0
  880.      lea dummy_reg,a2 
  881.      move.w #0,d5 
  882.      jsr sect1    
  883.     rts
  884.  
  885. set_up2    
  886.     move.w ch2fx_ident,d0
  887.     jsr sort_fx_bank    ;move.l (fx_base_address),a1
  888.     move.l a1,ch2_curr_base
  889.     
  890.     move.l a1,-(a7)
  891.     move.w 2(a1),d0
  892.     add.w d0,a1
  893.     sub.l #4,a1        ;pointer to jumptable
  894.         move.l fxr2,d0
  895.         add d0,d0
  896.         add d0,d0
  897.     add.l d0,a1        ;pointer to fx offset within table
  898.     move.l (a1),d0
  899.  
  900.     move.l (a7)+,a1        ;get base address from stack
  901.  
  902.     add.l d0,a1
  903.     move.l a1,currfx2    ;store address
  904.      clr.l fxr2
  905.     clr.w fxintc2
  906.      rts
  907.      
  908. run_fx2
  909.  
  910.     move.l (ch2_curr_base),(curr_base_address)
  911.  
  912.     lea ch2fxvars,a0
  913.        lea chann2reg,a2
  914.       move.w #%0000000000000010,d5 
  915.      move.w #%1000000000000010,d1 
  916.     move.w    #1,mode
  917.      jsr sect1
  918.     rts
  919.  
  920. run_music2
  921.     tst.w play_flag
  922.     beq rm2
  923.     rts
  924. rm2
  925.     move.l (music_base_address),(curr_base_address)
  926.  
  927.     lea ch2vars,a0
  928.        lea chann2reg,a2
  929.       move.w #%0000000000000010,d5 
  930.       move.w #%1000000000000010,d1 
  931.     move.w    #0,mode
  932.       jsr sect1     
  933.     rts
  934.  
  935.     ;  **************************
  936.  
  937. ch3:
  938.     tst.w fx_disable
  939.     bne test_music3
  940.     tst.l fxr3
  941.     bne   ch3j1
  942.     tst.l fxc3
  943.     beq test_music3
  944.     bra ch3j3
  945. ch3j2    jsr run_dummy3
  946.     jsr run_fx3
  947.     bra ch4
  948. ch3j1
  949.     jsr set_up3
  950. ch3j3    tst.w music_disable    
  951.     beq ch3j2
  952.     jsr run_fx3
  953.     bra ch4
  954.  
  955. test_music3
  956.     tst.w music_disable
  957.     bne ch4
  958.     jsr run_music3
  959.     bra ch4
  960.  
  961.     ;***********************
  962.  
  963.     ; channel 3 subroutines
  964.  
  965. run_dummy3    
  966.     tst.w play_flag
  967.     beq rd3
  968.     rts
  969. rd3
  970.  
  971.     move.l (music_base_address),(curr_base_address)
  972.  
  973.      lea ch3vars,a0
  974.      lea dummy_reg,a2 
  975.      move.w #0,d5 
  976.      jsr sect1    
  977.     rts
  978.  
  979. set_up3    
  980.     move.w ch3fx_ident,d0
  981.     jsr sort_fx_bank    
  982.     move.l a1,ch3_curr_base
  983.     
  984.     move.l a1,-(a7)
  985.     move.w 2(a1),d0
  986.     add.w d0,a1
  987.     sub.l #4,a1        ;pointer to jumptable
  988.         move.l fxr3,d0
  989.         add d0,d0
  990.         add d0,d0
  991.     add.l d0,a1        ;pointer to fx offset within table
  992.     move.l (a1),d0
  993.  
  994.     move.l (a7)+,a1        ;get base address from stack
  995.  
  996.     add.l d0,a1
  997.     move.l a1,currfx3    ;store address
  998.      clr.l fxr3
  999.     clr.w fxintc3
  1000.      rts
  1001.   
  1002.      
  1003. run_fx3
  1004.     move.l (ch3_curr_base),(curr_base_address)
  1005.  
  1006.     lea ch3fxvars,a0
  1007.        lea chann3reg,a2
  1008.       move.w #%0000000000000100,d5 
  1009.      move.w #%1000000000000100,d1 
  1010.     move.w    #1,mode
  1011.      jsr sect1
  1012.     rts
  1013.  
  1014. run_music3
  1015.  
  1016.     tst.w play_flag
  1017.     beq rm3
  1018.     rts
  1019. rm3
  1020.  
  1021.     move.l (music_base_address),(curr_base_address)
  1022.  
  1023.     lea ch3vars,a0
  1024.        lea chann3reg,a2
  1025.       move.w #%0000000000000100,d5 
  1026.       move.w #%1000000000000100,d1 
  1027.     move.w    #0,mode
  1028.       jsr sect1     
  1029.     rts
  1030.  
  1031.     ;  **************************
  1032.  
  1033. ch4:
  1034.     tst.w fx_disable
  1035.     bne test_music4
  1036.     tst.l fxr4
  1037.     bne   ch4j1
  1038.     tst.l fxc4
  1039.     beq test_music4
  1040.     bra ch4j3
  1041. ch4j2    jsr run_dummy4
  1042.     jsr run_fx4
  1043.     bra no4
  1044. ch4j1
  1045.     jsr set_up4
  1046. ch4j3    tst.w music_disable    
  1047.     beq ch4j2
  1048.     jsr run_fx4
  1049.     bra no4
  1050.  
  1051. test_music4
  1052.     tst.w music_disable
  1053.     bne no4
  1054.     jsr run_music4
  1055. no4    
  1056.  
  1057.     clr.w play_flag            ;inhibit music tempo play
  1058.  
  1059.     movem.l (a7)+,d0-d6/a0-a6    ;restore registers
  1060.     rts
  1061.  
  1062.     ;***********************
  1063.  
  1064.     ; channel 4 subroutines
  1065.  
  1066. run_dummy4    
  1067.  
  1068.     tst.w play_flag
  1069.     beq rd4
  1070.     rts
  1071. rd4
  1072.  
  1073.  
  1074.     move.l (music_base_address),(curr_base_address)
  1075.  
  1076.      lea ch4vars,a0
  1077.      lea dummy_reg,a2 
  1078.      move.w #0,d5 
  1079.      jsr sect1    
  1080.     rts
  1081.  
  1082. set_up4    
  1083.     move.w ch4fx_ident,d0
  1084.     jsr sort_fx_bank    ;move.l (fx_base_address),a1
  1085.     move.l a1,ch4_curr_base
  1086.     
  1087.     move.l a1,-(a7)
  1088.     move.w 2(a1),d0
  1089.     add.w d0,a1
  1090.     sub.l #4,a1        ;pointer to jumptable
  1091.         move.l fxr4,d0
  1092.         add d0,d0
  1093.         add d0,d0
  1094.     add.l d0,a1        ;pointer to fx offset within table
  1095.     move.l (a1),d0
  1096.  
  1097.     move.l (a7)+,a1        ;get base address from stack
  1098.  
  1099.     add.l d0,a1
  1100.     move.l a1,currfx4    ;store address
  1101.      clr.l fxr4
  1102.     clr.w fxintc4
  1103.      rts
  1104.      
  1105. run_fx4
  1106.  
  1107.     move.l (ch4_curr_base),(curr_base_address)
  1108.  
  1109.     lea ch4fxvars,a0
  1110.        lea chann4reg,a2
  1111.       move.w #%0000000000001000,d5 
  1112.      move.w #%1000001000001000,d1 
  1113.     move.w    #1,mode
  1114.      jsr sect1
  1115.     rts
  1116.  
  1117. run_music4
  1118.  
  1119.     tst.w play_flag
  1120.     beq rm4
  1121.     rts
  1122. rm4
  1123.     move.l (music_base_address),(curr_base_address)
  1124.  
  1125.  
  1126.     lea ch4vars,a0
  1127.        lea chann4reg,a2
  1128.       move.w #%0000000000001000,d5 
  1129.       move.w #%1000001000001000,d1 
  1130.     move.w    #0,mode
  1131.       jsr sect1     
  1132.     rts
  1133. ;---------------------------------------
  1134.  
  1135.  
  1136. sort_fx_bank:            ;d0 contains bank ident
  1137.                 ;0 = gen fx
  1138.                 ;1 = speech bank1
  1139.                 ;2 = speech bank 2
  1140.  
  1141.     tst.w d0
  1142.     beq    set_gen
  1143.     cmp.w #1,d0
  1144.     beq    set_speech1
  1145.  
  1146.     move.l (speech_bank2_address),a1        ;set speech 2
  1147.     rts
  1148.  
  1149. set_gen
  1150.     move.l (fx_base_address),a1
  1151.     rts
  1152.  
  1153. set_speech1
  1154.     move.l (speech_bank1_address),a1
  1155.     rts
  1156.  
  1157.  
  1158.     ;  **************************
  1159.  
  1160. sect1: tst.w (a0)
  1161.     bne s1j1
  1162.     rts
  1163.  
  1164. s1j1:    tst.w 2(a0)
  1165.         beq sect3       
  1166.         cmpi.w #1,2(a0)
  1167.         beq sect4
  1168.  
  1169.         cmpi.w #3,4(a0)    
  1170.         beq part2       
  1171.     
  1172. mode_switch:  subq.w #1,2(a0)     
  1173.  
  1174. check_effects: clr.w altpf      
  1175.         move.w 6(a0),d2    
  1176.         tst.w 8(a0)      
  1177.         beq check_mod
  1178.         tst.w 14(a0)      
  1179.         beq cont_bend
  1180.         subq.w #1,14(a0)
  1181.         bra check_mod
  1182. cont_bend:   addq.w #1,altpf    
  1183.         move.w 10(a0),d3    
  1184.         move.w 12(a0),d4    
  1185.         cmpi.w #1,8(a0)
  1186.         beq pbup
  1187.     
  1188.         sub.w d3,d2
  1189.         cmp.w d2,d4
  1190.         bcs check_mod
  1191.         bra fbend
  1192.  
  1193. pbup:     add.w d3,d2
  1194.         cmp.w d2,d4
  1195.         bcc check_mod
  1196. fbend:     move.w d4,d2
  1197.         clr.w 8(a0)      
  1198. check_mod:   tst.w 16(a0)
  1199.         beq send_alt_pitch
  1200.    
  1201.  
  1202.     tst.w  58(a0)
  1203.     beq st_ok
  1204.     subq.w #1,58(a0)
  1205.     bra send_alt_pitch
  1206. st_ok:
  1207.         tst.w 50(a0)
  1208.         beq cont_mod
  1209.         subq #1,50(a0)
  1210.         bra send_alt_pitch
  1211. cont_mod:    move.w 52(a0),50(a0)  
  1212.         addq #1,altpf
  1213.         cmpi #3,16(a0)
  1214.         bcc addmod
  1215.     
  1216.         move.w 56(a0),d3 
  1217.         sub.w d3,d2
  1218.         addq.w #1,16(a0)  
  1219.         bra send_alt_pitch
  1220. addmod:
  1221.  
  1222.         move.w 54(a0),d3 
  1223.         add.w d3,d2
  1224.         addq.w #1,16(a0)
  1225.         cmpi.w #5,16(a0)
  1226.        bne send_alt_pitch
  1227.         move.w #1,16(a0)  
  1228.  
  1229. send_alt_pitch: tst.w altpf
  1230.         beq send_env
  1231.         move.w d2,6(a0)  
  1232.         move.w d2,6(a2)  
  1233.  
  1234. send_env: 
  1235.  
  1236. do_env_check:
  1237.  
  1238. norm_env:
  1239.     move.l 18(a0),a1    
  1240.         cmpi.w #255,(a1)
  1241.         beq env_finished
  1242.  
  1243. resu    clr.l d0
  1244.     move.w (a1)+,d0
  1245.  
  1246.             ;test for mode here
  1247.     tst.w mode
  1248.     bne sete
  1249.  
  1250.     sub.w fade,d0
  1251.     bcc sete
  1252.  
  1253.  
  1254.     move.w #0,d0
  1255.  
  1256.  
  1257. sete    move.w d0,8(a2)    
  1258.     move.l a1,18(a0)
  1259.     rts        
  1260.  
  1261.  
  1262. no_acc:
  1263. ;resu:  
  1264. no_off
  1265.     ;move.w (a1)+,d0
  1266.     sub.w fade,d0
  1267.     bcc sete2
  1268.     move.w #0,d0
  1269. sete2    move.w d0,8(a2)
  1270.      move.w (a1)+,8(a2)
  1271.    
  1272. fint:   move.l a1,18(a0)    
  1273.     rts
  1274.  
  1275. env_finished:
  1276.     subq.l #2,a1    
  1277.     bra resu
  1278.     rts
  1279.  
  1280.  
  1281.  
  1282. one_shot_note: move.w #3,4(a0)     
  1283.         move.l 38(a0),(a2)
  1284.         move.w 42(a0),4(a2)
  1285.         move.w d1,dmacon     
  1286.         bra send_env
  1287.  
  1288.  
  1289. part2:                         
  1290.         move.l 44(a0),(a2)
  1291.         move.w 48(a0),4(a2)
  1292.         subq.w #1,2(a0)      
  1293.         move.w #1,4(a0)
  1294.         bra check_effects
  1295.  
  1296. sect3:
  1297.     move.w #0,66(a0)    
  1298.  
  1299.     move.l 22(a0),a1  
  1300. control_ret: move.w (a1)+,d0  
  1301.     cmpi.w #100,d0   
  1302.     bls sect5   
  1303.   
  1304. acc_note:
  1305.     move.w d0,6(a0)  
  1306.     move.w d0,6(a2)  
  1307.     move.w (a1)+,2(a0) 
  1308.     subq.w #1,2(a0)  
  1309.     move.l a1,22(a0)  
  1310.     move.l 34(a0),18(a0) 
  1311.     move.w 60(a0),58(a0) 
  1312.  
  1313.  
  1314.     tst.w 16(a0)
  1315.     beq no_mod_res
  1316.     move.w #1,16(a0)
  1317. no_mod_res:
  1318.     cmpi.w #0,4(a0)
  1319.     beq do_loop
  1320.     bra one_shot_note    
  1321.  
  1322.  
  1323. do_loop:    move.w d1,dmacon   
  1324.         bra send_env
  1325.  
  1326. do_rest:
  1327.     move.w (a1)+,2(a0) 
  1328.     subq.w #1,2(a0)  
  1329.     move.l a1,22(a0)  
  1330.     move.l  #drest_env,18(a0)
  1331.  
  1332.         move.w #0,8(a2)
  1333.         bra send_env
  1334.    
  1335. sect4:
  1336.         cmpi.w #0,4(a0)
  1337.         beq noof
  1338.         move.w d5,dmacon   
  1339. noof:     subq.w #1,2(a0)
  1340.         bra check_effects
  1341.    
  1342. sect5:     move.l #jump_table,a3
  1343.         move.l (a3,d0),a4
  1344.         jmp (a4)
  1345.  
  1346. jump_table: 
  1347.     dc.l  in_line_data
  1348.         dc.l  nsound
  1349.         dc.l  patt_end
  1350.         dc.l  get_env
  1351.         dc.l  check_pbend
  1352.         dc.l  do_mod
  1353.         dc.l  bend_off
  1354.         dc.l  mod_off
  1355.         dc.l  do_rest
  1356.         dc.l  end_fx
  1357.         dc.l  end_fx
  1358.     dc.l  s_f_on
  1359.     dc.l  s_f_off
  1360.     dc.l  set_acc
  1361.     dc.l  rept
  1362.  
  1363. in_line_data:
  1364.  
  1365.         nop
  1366.         rts
  1367.  
  1368. rept:
  1369.     move.l (a1),d0
  1370.     move.l (curr_base_address),a1
  1371.     add.l    d0,a1
  1372.     bra control_ret
  1373.  
  1374. s_f_on: 
  1375.     bclr #1,filter
  1376.     bra control_ret
  1377. s_f_off:
  1378.     bset #1,filter
  1379.     bra control_ret
  1380.  
  1381. nsound:
  1382. ;----------------------------
  1383.     move.l (a1)+,d0        ;sound offset
  1384.     move.l (curr_base_address),a3
  1385.     add.l d0,a3
  1386. ;----------------------------
  1387.         ;move.l (a1)+,a3     
  1388.  
  1389.         cmpi.w #0,(a3)
  1390.         bne one_shot_sound
  1391.  
  1392. xxx
  1393.         move.w (a3)+,4(a0)        ;length    
  1394.  
  1395. ;-----------------
  1396.     move.l (curr_base_address),a6
  1397.     move.l (a3)+,d0
  1398.     add.l d0,a6
  1399.     move.l a6,(a2)
  1400. ;--------------------
  1401.         ;move.l (a3)+,(a2)     
  1402.  
  1403.         move.w (a3),4(a2)    
  1404.         jmp control_ret
  1405.  
  1406. one_shot_sound:
  1407.         move.w (a3)+,4(a0)        ;type of sound
  1408. ;-----------
  1409.     move.l (curr_base_address),a6
  1410.     move.l (a3)+,d0
  1411.     add.l d0,a6
  1412.     move.l a6,38(a0)        ;address sample 1
  1413. ;---------------
  1414.         move.w (a3)+,42(a0)        ;length sample 1
  1415. ;---------------------
  1416.     move.l (curr_base_address),a6
  1417.     move.l (a3)+,d0
  1418.     add.l d0,a6
  1419.     move.l a6,44(a0)
  1420.  
  1421. ;---------------------
  1422.     ;add.l #4,a3
  1423.         move.w (a3),48(a0)
  1424.         jmp control_ret
  1425.  
  1426. patt_end:
  1427.  
  1428.         move.l 26(a0),a1    
  1429.         cmpi.l #0,(a1)     
  1430.         beq song_control        ;end of song
  1431.         addq.l #4,26(a0)            ;get next pattern address
  1432. ;-----------------------
  1433.     move.l (a1),d0        ;offset
  1434.     move.l (curr_base_address),a1
  1435.     add.l d0,a1        ;new pattern
  1436.  
  1437. ;------------------------
  1438.         ;move.l (a1),a1     
  1439.         jmp control_ret
  1440. get_env:
  1441. ;-----------------------
  1442.     move.l (a1)+,d0        ;env offset
  1443.     move.l (curr_base_address),a4
  1444.     add.l d0,a4     
  1445. ;--------------------------
  1446.     ;move.l (a1)+,a4 
  1447.  
  1448.     move.l (a4)+,62(a0)    
  1449.     
  1450.     move.l  a4,34(a0)    
  1451.     
  1452.         bra control_ret
  1453.  
  1454. check_pbend:
  1455.      move.l (a1)+,8(a0)
  1456.         move.l (a1)+,12(a0)
  1457.         bra control_ret
  1458.  
  1459. do_mod:    move.w #1,16(a0)  
  1460.         move.l (a1)+,50(a0)
  1461.         move.l (a1)+,54(a0)
  1462.         move.l (a1)+,58(a0)
  1463.         bra control_ret
  1464.  
  1465. bend_off:   clr.w 8(a0)
  1466.         bra control_ret
  1467.  
  1468. mod_off:    clr.w 16(a0)
  1469.         bra control_ret
  1470.  
  1471.  
  1472. end_fx:    
  1473.     cmpi.w #6,(a0)
  1474.     beq end_fx4p
  1475.     cmpi.w #5,(a0)
  1476.     beq end_fx3p
  1477.     cmpi.w #7,(a0)
  1478.     beq end_fx2p
  1479.  
  1480. end_fx1p:
  1481.         move.w d5,dmacon   
  1482.     move.w  #1,chann1reg+6
  1483.     move.w #0,8(a2)
  1484.     move.l #0,fxc1
  1485.     rts
  1486.  
  1487. end_fx2p:
  1488.     move.w d5,dmacon 
  1489.     move.w  #1,chann2reg+6
  1490.         move.w #0,8(a2) 
  1491.     move.l #0,fxc2
  1492.         rts
  1493.  
  1494.  
  1495. end_fx3p:
  1496.         move.w d5,dmacon   
  1497.     move.w  #1,chann3reg+6
  1498.     move.w #0,8(a2)
  1499.     move.l #0,fxc3
  1500.     rts
  1501.  
  1502. end_fx4p:
  1503.     move.w d5,dmacon 
  1504.     move.w  #1,chann4reg+6
  1505.         move.w #0,8(a2) 
  1506.     move.l #0,fxc4
  1507.         rts
  1508.  
  1509. set_acc: move.w #1,66(a0) 
  1510.     bra control_ret
  1511.  
  1512. song_control:
  1513.         addq.l #4,a1
  1514.         move.l 30(a0),26(a0)
  1515.         move.l 26(a0),a1
  1516.         addq.l #4,26(a0)
  1517. ;------------------
  1518.     move.l (curr_base_address),a6
  1519.     move.l (a1),d0
  1520.     add.l d0,a6
  1521.     move.l a6,a1
  1522. ;-----------------------
  1523.         ;move.l (a1),a1
  1524.         jmp control_ret
  1525.  
  1526.  
  1527. ;"""""""""""""""""""""""""""""""""""""""""""""""""
  1528. ;************************************************************
  1529. gvars:
  1530. ch1vars     
  1531.     dc.w 0     
  1532.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1533. pattr1: dc.l 0    
  1534. songr1: dc.l 0    
  1535. wsong1: dc.l 0   
  1536.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1537.  
  1538. ch2vars     
  1539.     dc.w 0     
  1540.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1541. pattr2: dc.l 0    
  1542. songr2: dc.l 0    
  1543. wsong2: dc.l 0    
  1544.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1545.  
  1546. ch3vars 
  1547.     dc.w 0     
  1548.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1549. pattr3: dc.l 0    
  1550. songr3: dc.l 0    
  1551. wsong3: dc.l 0    
  1552.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1553.  
  1554. ch4vars 
  1555.     dc.w 0     
  1556.         dc.w 0,0,0,0,0,0,0,0,0,0     
  1557. pattr4: dc.l 0    
  1558. songr4: dc.l 0    
  1559. wsong4: dc.l 0    
  1560.         dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0   
  1561.  
  1562.  
  1563. ch1fxvars 
  1564.     dc.w 0     
  1565. fxintc1:
  1566.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1567. currfx1:
  1568.     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    
  1569.  
  1570. ch2fxvars 
  1571.     dc.w 0     
  1572. fxintc2:
  1573.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1574. currfx2:
  1575.     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    
  1576.  
  1577.  
  1578. ch3fxvars
  1579.     dc.w 0     
  1580. fxintc3:
  1581.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1582. currfx3:
  1583.     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    
  1584.  
  1585. ch4fxvars 
  1586.     dc.w 0     
  1587. fxintc4:
  1588.     dc.w 0,0,0,0,0,0,0,0,0,0     
  1589. currfx4:
  1590.     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    
  1591. ;************************************************************
  1592.  
  1593. drest_env    dc.w  0,0,0,0,0,0,0,0,255
  1594.  
  1595.  
  1596.  
  1597. dummy_reg dc.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1598.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1599.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1600.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1601.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1602.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1603.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1604.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1605.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1606.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1607.         dc.l  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1608.  
  1609. ;*******************************************************
  1610.     even
  1611.  
  1612.  
  1613. fx_data_blk:    ;test place for getting the general fx data blk in
  1614.  
  1615.  
  1616.     incbin c:sf2d/gfx.bin
  1617.  
  1618. ;***********************************************************
  1619.     even
  1620.  
  1621. speech_bank1    ;test place for speech1
  1622.  
  1623.  
  1624.     incbin c:sf2d/speech/chun_speech.bin
  1625.     
  1626.  
  1627. ;*********************************************
  1628.  
  1629.     even
  1630.  
  1631. speech_bank2    ;test place for speech2
  1632.  
  1633.  
  1634.     incbin c:sf2d/speech/guile_speech.bin
  1635.  
  1636. ;**********************************************
  1637.  
  1638.     even
  1639.  
  1640. music_data_blk: ;test place for music data blk
  1641.  
  1642.     
  1643.     incbin c:sf2d/ken.bin
  1644.     ;incbin c:sf2d/ryu.bin
  1645.     ;incbin c:sf2d/honda.bin
  1646.     ;incbin c:sf2d/chun.bin
  1647.     ;incbin c:sf2d/blanka.bin
  1648.     ;incbin c:sf2d/zangief.bin
  1649.     ;incbin c:sf2d/guile.bin
  1650.     ;incbin c:sf2d/dhal.bin
  1651.  
  1652. ;***********************************************************
  1653.  
  1654.     even
  1655.  
  1656. jingle_data_blk:    ;test place for the jingle data blk
  1657.  
  1658.     
  1659.     incbin c:sf2d/jingles3.bin
  1660.  
  1661.  
  1662. ;***********************************************************
  1663.  
  1664.     end
  1665.  
  1666.  
  1667.  
  1668.