home *** CD-ROM | disk | FTP | other *** search
/ M.u.C.S. Disc 2000 / MUCS2000.iso / sound / mp2 / src / gem / snddefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-03  |  4.1 KB  |  137 lines

  1. /* Setbuffer regions */
  2.  
  3. #define    SR_PLAY        0    /* Set playback registers */
  4. #define    SR_RECORD    1    /* Set record registers */
  5.  
  6. /* Soundcmd Modes */
  7.  
  8. #define LTATTEN        0    /* Left-channel output attenuation */
  9. #define    RTATTEN        1    /* Right channel atten */
  10. #define    LTGAIN        2    /* Left input gain */
  11. #define    RTGAIN        3    /* Right channel gain */
  12.     /* gain and attenuation in 1.5db units, 0x00V0, V:0-15 */
  13. #define    ADDERIN        4    /* Select inputs to adder 0=off, 1=on */
  14. #define    ADCIN        1    /* Input from ADC */
  15. #define    MATIN        2    /* Input from connection matrix */
  16. #define    ADCINPUT    5    /* Select input to ADC, 0=mic, 1=PSG */
  17. #define    ADCRT        1    /* Right channel input */
  18. #define    ADCLT        2    /* Left input */
  19. #define    SETPRESCALE    6    /* Set TT compatibility prescaler */
  20. #define    PREMUTE        0    /* was /1280, now is invalid, mutes */
  21. #define    PRE1280        PREMUTE
  22. #define    PRE640        1    /* divide by 640 */
  23. #define    PRE320        2    /* / 320 */
  24. #define    PRE160        3    /* / 160 */
  25.  
  26. /* Record/Playback modes */
  27.  
  28. #define    STEREO8        0    /* 8 bit stereo */
  29. #define    STEREO16    1    /* 16 bit stereo */
  30. #define    MONO8        2    /* 8 bit mono */
  31.  
  32. /* Record/Playback tracks range from 0 to 3 */
  33.  
  34. /* XXX Doc for Settracks could be clearer. Can we individually set, e.g.,
  35.    tracks 0 & 2 for playback, or must track selections be contiguous? */
  36.  
  37. /* Sound buffer interrupts */
  38.     /* sources */
  39. #define    SI_TIMERA    0    /* Timer A interrupt */
  40. #define    SI_MFPI7    1    /* MFP interrupt 7 */
  41.     /* causes */
  42. #define    SI_NONE        0    /* No interrupts */
  43. #define    SI_PLAY        1    /* Intr at end of play buffer */
  44. #define    SI_RECORD    2    /* Intr at end of record buffer */
  45. #define    SI_BOTH        3    /* Interrupt for either play or record */
  46.  
  47. /* Buffoper flags */
  48.  
  49. #define    SB_PLA_ENA    1    /* Play enable */
  50. #define    SB_PLA_RPT    2    /* Play repeat (continuous loop mode) */
  51. #define    SB_REC_ENA    4    /* Record enable */
  52. #define SB_REC_RPT    8    /* Record repeat */
  53.  
  54. /* Dsptristate - 0=tristate, 1=enable */
  55.  
  56. /* Gpio modes */
  57.  
  58. #define    GPIO_SET    0    /* Set I/O direction, 0=in, 1=out */
  59. #define    GPIO_READ    1    /* Read bits - only 3 bits on gpio */
  60. #define    GPIO_WRITE    2    /* Write gpio data bits */
  61.  
  62. /* Devconnect (connection matrix) source devices */
  63.  
  64. #define    DMAPLAY        0    /* DMA playback */
  65. #define    DSPXMIT        1    /* DSP transmit */
  66. #define    EXTINP        2    /* External input */
  67. #define    ADC        3    /* Microphone/PSG, see Soundcmd(ADCINPUT) */
  68.  
  69. /* Devconnect destination devices, bitmapped */
  70.  
  71. #define    DMAREC        1    /* DMA record */
  72. #define    DSPRECV        2    /* DSP receive */
  73. #define    EXTOUT        4    /* External output */
  74. #define    DAC        8    /* Headphone, internal speaker, monitor */
  75.  
  76. /* Devconnect clock sources */
  77.  
  78. #define    CLK25M        0    /* Internal 25.175 MHz clock */
  79. #define    CLKEXT        1    /* External clock */
  80. #define    CLK32M        2    /* Internal 32 MHz. Invalid for CODEC */
  81.  
  82. /* Devconnect clock prescaler values */
  83.  
  84. /* XXX Doc lists incorrect hz numbers for many of these... */
  85.  
  86. #define CLKOLD        0    /* TT compatible, see Soundcmd(SETPRESCALE) */
  87. #define    CLK50K        1    /* 49170 hz */
  88. #define    CLK33K        2    /* 32780 hz */
  89. #define    CLK25K        3    /* 24585 hz */
  90. #define    CLK20K        4    /* 19668 hz */
  91. #define    CLK16K        5    /* 16390 hz */
  92.         /*    6    (14049 hz) invalid for CODEC */
  93. #define    CLK12K        7    /* 12292 hz */
  94.         /*    8    (10927 hz) invalid for CODEC */
  95. #define    CLK10K        9    /* 9834 hz */
  96.         /*    10    (8940 hz) invalid for CODEC */
  97. #define    CLK8K        11    /* 8195 hz */
  98.         /*    12    (7565 hz) invalid */
  99.         /*    13    (7024 hz) invalid */
  100.         /*    14    (6556 hz) invalid */
  101.         /*    15    (6146 hz) invalid */
  102.  
  103. #define DISABLE     0
  104. #define ENABLE      1
  105.  
  106. #define HANDSHAKE   0
  107. #define NOSHAKE     1
  108.  
  109. /* Sndstatus command */
  110.  
  111. #define    SND_CHECK    0    /* Check current status */
  112. #define    SND_RESET    1    /* Reset sound system */
  113.     /*
  114.      * Reset effects: DSP tristated, gain=atten=0, matrix reset,
  115.      * ADDERIN=0, Mode=STEREO8, Play=Record=Monitor tracks=0,
  116.      * interrupts disabled, buffer operation disabled.
  117.      */
  118.  
  119. /* Sndstatus status return */
  120.  
  121. #define    SS_OK        0    /* No errors */
  122. #define    SS_CTRL        1    /* Invalid control field (Data assumed OK) */
  123. #define    SS_SYNC        2    /* Invalid sync format (mutes) */
  124. #define    SS_SCLK        3    /* Serial clock out of valid range (mutes) */
  125.  
  126. #define    SS_RTCLIP    0x10    /* Right channel is clipping */
  127. #define    SS_LTCLIP    0x20    /* Left channel is clipping */
  128.  
  129. /* Structure used by Buffptr */
  130.  
  131. typedef struct SndBufPtr {
  132.     char *play;
  133.     char *record;
  134.     long reserve1;
  135.     long reserve2;
  136. } SndBufPtr;
  137.