home *** CD-ROM | disk | FTP | other *** search
/ Mega Magazine 5 / Mega_Magazine_05_19xx___nl_Side_B.atr / sampling.lzh / PLAY6BIT.SRC < prev    next >
Text File  |  1988-09-01  |  3KB  |  172 lines

  1. *************************************
  2. *                                   *
  3. *         - SAMPLE PLAYER -         *
  4. *                                   *
  5. *         >>>> 6-BITS <<<<          *
  6. * USES THE TABLE FROM SOUNDTRACKER! *
  7. * THANX TO THE MAKERS FOR THE TABLE *
  8. *                                   *
  9. *       (C)1992  FRANKENSTEIN       *
  10. *                                   *
  11. *************************************
  12.  
  13. SPBEG    EQU $0700
  14. SPEND    EQU $B7FF
  15.  
  16. SPL    EQU $F2        (AND $F3)
  17. END    EQU $F4        (AND $F5)
  18. ZPAGE    EQU $F6
  19.  
  20. SPEED    EQU $0600
  21.  
  22.     ORG $B800
  23.  
  24.     LDA #SPBEG:L
  25.     STA SPL
  26.     LDA #SPBEG:H
  27.     STA SPL+1
  28.  
  29.     LDA #SPEND:L
  30.     STA END
  31.     LDA #SPEND:H
  32.     STA END+1
  33.  
  34. *------------------------------------
  35. * MAIN LOOP
  36. *------------------------------------
  37.  
  38.     JSR INTOFF
  39.  
  40.     LDA #0
  41.     STA $D400
  42.  
  43.     JSR PLAY
  44.  
  45.     JSR INTON
  46.     RTS
  47.  
  48. *------------------------------------
  49. * INTERRUPTS OFF
  50. *------------------------------------
  51.  
  52. INTOFF    LDA #0
  53.     STA $D20E
  54.     STA $D40E
  55.     RTS
  56.  
  57. *------------------------------------
  58. * INTERRUPTS ON
  59. *------------------------------------
  60.  
  61. INTON    LDA 16
  62.     STA $D20E
  63.     LDA #$C0
  64.     STA $D40E
  65.     RTS
  66.  
  67. *------------------------------------
  68. * THIS ROUTINE PLAYS 8-BIT SAMPLES
  69. * (IT PLAYS THE UPPER 6-BITS ONLY!)
  70. *------------------------------------
  71.  
  72. PLAY    LDY #0
  73.  
  74. RUN    LDA (SPL),Y
  75.     LSR
  76.     LSR
  77.     TAX
  78.     LDA VOL0,X
  79.     STA ZPAGE
  80.     LDA VOL1,X
  81.     TAY
  82.     LDA VOL2,X
  83.     TAX
  84.     LDA ZPAGE
  85.     STA $D201
  86.     STY $D203
  87.     STX $D205
  88.  
  89.     LDX SPEED
  90. DELAY    DEX
  91.     BNE DELAY
  92.  
  93.     INC SPL
  94.     BNE SKIPHI
  95.     INC SPL+1
  96.  
  97. SKIPHI    LDA SPL+1
  98.     CMP END+1
  99.     BNE PLAY
  100.     LDA SPL
  101.     CMP END
  102.     BNE PLAY
  103.  
  104.     RTS
  105.  
  106. * VOLUME LOOKUP TABLE
  107.  
  108. VOL0    DFB $10,$10,$11,$11
  109.     DFB $11,$12,$11,$12
  110.     DFB $13,$12,$14,$13
  111.     DFB $14,$13,$15,$14
  112.  
  113.     DFB $15,$13,$16,$14
  114.     DFB $15,$15,$18,$16
  115.     DFB $18,$16,$19,$17
  116.     DFB $1A,$15,$1C,$17
  117.  
  118.     DFB $1D,$17,$19,$17
  119.     DFB $1C,$1B,$18,$1E
  120.     DFB $1A,$19,$1B,$1C
  121.     DFB $1C,$1B,$1F,$1D
  122.  
  123.     DFB $1C,$1C,$1C,$1B
  124.     DFB $1D,$1C,$1D,$1C
  125.     DFB $1B,$1D,$1F,$1E
  126.     DFB $1E,$1F,$1F,$1F
  127.  
  128.     DFB $00
  129.  
  130. VOL1    DFB $10,$10,$10,$10
  131.     DFB $11,$10,$11,$11
  132.     DFB $11,$11,$10,$11
  133.     DFB $11,$12,$11,$12
  134.  
  135.     DFB $11,$13,$11,$12
  136.     DFB $13,$14,$11,$12
  137.     DFB $12,$13,$12,$14
  138.     DFB $12,$15,$11,$14
  139.  
  140.     DFB $11,$15,$15,$16
  141.     DFB $12,$15,$15,$12
  142.     DFB $18,$16,$16,$18
  143.     DFB $15,$17,$15,$1A
  144.  
  145.     DFB $1A,$1B,$1B,$1A
  146.     DFB $18,$1A,$1D,$1B
  147.     DFB $1B,$1B,$1E,$1E
  148.     DFB $1E,$1D,$1E,$1F
  149.  
  150.     DFB $00
  151.  
  152. VOL2    DFB $10,$10,$10,$10
  153.     DFB $10,$10,$11,$10
  154.     DFB $10,$11,$10,$11
  155.     DFB $10,$11,$10,$10
  156.  
  157.     DFB $11,$12,$11,$12
  158.     DFB $11,$10,$10,$12
  159.     DFB $10,$12,$10,$11
  160.     DFB $10,$13,$10,$13
  161.  
  162.     DFB $10,$13,$11,$13
  163.     DFB $12,$11,$14,$12
  164.     DFB $10,$14,$13,$10
  165.     DFB $14,$14,$13,$10
  166.  
  167.     DFB $12,$12,$13,$16
  168.     DFB $17,$17,$14,$18
  169.     DFB $1B,$1A,$17,$19
  170.     DFB $1B,$1D,$1E,$1F
  171.  
  172.     DFB $00¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯