home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !FALCON / NOCREW / MP2_0997.ZIP / mp2_0997 / src / snddefs.h < prev    next >
C/C++ Source or Header  |  1998-10-31  |  4KB  |  142 lines

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