home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / TIMESRC.ZIP / LOW_DATA.M < prev    next >
Text File  |  1994-02-16  |  4KB  |  82 lines

  1. public  _low_init, _low_uninit, _low_set_bps, _low_set_rate, _low_set_voices
  2. public  _low_get_freq, _low_put_data, _low_get_data, _low_mix, _low_rout
  3. public    _low_vccmnd, _low_vccntrl, _low_vcsbeg, _low_vclbeg, _low_vclend
  4. public    _low_vcfreq, _low_vcpan, _low_vcvol
  5. public  _low_buf, _low_buflen, _low_bufptr, _low_ram, _low_rambase
  6. public    _low_port, _low_irq, _low_dma
  7.  
  8. public  _sound_init
  9.  
  10. ;═════════════════════════════════════════════════════════════════════════════
  11. align 4
  12. _low_init       dd      ?               ; ptr to init function
  13. _low_uninit     dd      ?               ; ptr to uninit function
  14. _low_set_bps    dd      ?               ; ptr to beats per second set function
  15. _low_set_rate   dd      ?               ; ptr to mixing rate set function
  16. _low_set_voices dd      ?               ; ptr to number of voices set function
  17. _low_get_freq   dd      ?               ; ptr to frequency conversion function
  18. _low_put_data   dd      ?               ; ptr to sample data put function
  19. _low_get_data   dd      ?               ; ptr to sample data get function
  20. _low_mix        dd      ?               ; ptr to mix ahead function
  21.  
  22. _low_rout       dd      _ret            ; ptr to routine to call on every beat
  23.  
  24. _low_vccmnd     db      16 dup(?)       ; virtual channel command bits       |
  25.                                         ;  bit 0: volume change              |
  26.                                         ;  bit 1: balance change             |
  27.                                         ;  bit 2: frequency change           |
  28.                                         ;  bit 3: sample note-on             |
  29.                                         ;  bits 4-7: must be 0               |
  30. _low_vccntrl    db      16 dup(?)       ; virtual channel voice control      |
  31.                                         ;  bits 0-2: must be 0               |
  32.                                         ;  bit 3: looping instrument         |
  33.                                         ;  bits 4-7: must be 0               |
  34. _low_vcsbeg     dd      16 dup(?)       ; virtual channel sample begin       |
  35. _low_vclbeg     dd      16 dup(?)       ; virtual channel loop begin         |
  36. _low_vclend     dd      16 dup(?)       ; virtual channel loop end           |
  37. _low_vcfreq     dw      16 dup(?)       ; virtual channel frequency value    |
  38. _low_vcpan      db      16 dup(?)       ; virtual channel pan position (0-15)|
  39. _low_vcvol      db      16 dup(?)       ; virtual channel volume (0-0ffh)    |
  40.  
  41. _low_buf        dd      ?               ; length of buffer needed by driver
  42. _low_buflen     dd      10000000h       ; really stupid length
  43. _low_bufptr     dd      ?               ; ptr to buffer
  44. _low_ram        dd      ?               ; amount of RAM for samples
  45. _low_rambase    dd      ?               ; base of RAM ptr
  46.  
  47. _low_port       dw      ?               ; base port of sound card
  48. _low_irq        db      ?               ; IRQ of sound card
  49. _low_dma        db      ?               ; DMA channel of sound card
  50.  
  51. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  52. ; Initialize sound driver
  53. ; In:
  54. ;   AL - beats per second (15-255)
  55. ;   AH - number of voices (1-16)
  56. ;   BX - mixing rate (8000-44100)
  57. ;   ESI -> soundcard data structure
  58. ; Notes:
  59. ;   _low_rout, _low_ram, _low_rambase, _low_port, _low_irq, _low_dma,
  60. ;    _low_bufptr, and _low_buflen must all be set before calling.
  61. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  62. _sound_init:
  63.         push eax ecx esi edi
  64.         mov edi,offset _low_vccmnd
  65.         xor ecx,ecx
  66.         mov [edi],ecx
  67.         mov [edi+4],ecx
  68.         mov [edi+8],ecx
  69.         mov [edi+12],ecx
  70.         mov edi,offset _low_init
  71.         mov ecx,9
  72.         rep movsd
  73.         call _low_init
  74.         call _low_set_bps
  75.         mov al,ah
  76.         call _low_set_voices
  77.         mov ax,bx
  78.         call _low_set_rate
  79.         pop edi esi ecx eax
  80.         ret
  81.  
  82.