BLASTER.H 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. Copyright (C) 1994-1995 Apogee Software, Ltd.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. /**********************************************************************
  16. module: BLASTER.H
  17. author: James R. Dose
  18. date: February 4, 1994
  19. Public header for BLASTER.C
  20. (c) Copyright 1994 James R. Dose. All Rights Reserved.
  21. **********************************************************************/
  22. #ifndef __BLASTER_H
  23. #define __BLASTER_H
  24. typedef struct
  25. {
  26. unsigned Address;
  27. unsigned Type;
  28. unsigned Interrupt;
  29. unsigned Dma8;
  30. unsigned Dma16;
  31. unsigned Midi;
  32. unsigned Emu;
  33. } BLASTER_CONFIG;
  34. extern BLASTER_CONFIG BLASTER_Config;
  35. extern int BLASTER_DMAChannel;
  36. #define UNDEFINED -1
  37. enum BLASTER_ERRORS
  38. {
  39. BLASTER_Warning = -2,
  40. BLASTER_Error = -1,
  41. BLASTER_Ok = 0,
  42. BLASTER_EnvNotFound,
  43. BLASTER_AddrNotSet,
  44. BLASTER_DMANotSet,
  45. BLASTER_DMA16NotSet,
  46. BLASTER_InvalidParameter,
  47. BLASTER_CardNotReady,
  48. BLASTER_NoSoundPlaying,
  49. BLASTER_InvalidIrq,
  50. BLASTER_UnableToSetIrq,
  51. BLASTER_DmaError,
  52. BLASTER_NoMixer,
  53. BLASTER_DPMI_Error,
  54. BLASTER_OutOfMemory
  55. };
  56. enum BLASTER_Types
  57. {
  58. SB = 1,
  59. SBPro = 2,
  60. SB20 = 3,
  61. SBPro2 = 4,
  62. SB16 = 6
  63. };
  64. #define BLASTER_MinCardType SB
  65. #define BLASTER_MaxCardType SB16
  66. #define STEREO 1
  67. #define SIXTEEN_BIT 2
  68. #define MONO_8BIT 0
  69. #define STEREO_8BIT ( STEREO )
  70. #define MONO_16BIT ( SIXTEEN_BIT )
  71. #define STEREO_16BIT ( STEREO | SIXTEEN_BIT )
  72. #define BLASTER_MaxMixMode STEREO_16BIT
  73. #define MONO_8BIT_SAMPLE_SIZE 1
  74. #define MONO_16BIT_SAMPLE_SIZE 2
  75. #define STEREO_8BIT_SAMPLE_SIZE ( 2 * MONO_8BIT_SAMPLE_SIZE )
  76. #define STEREO_16BIT_SAMPLE_SIZE ( 2 * MONO_16BIT_SAMPLE_SIZE )
  77. #define BLASTER_DefaultSampleRate 11000
  78. #define BLASTER_DefaultMixMode MONO_8BIT
  79. #define BLASTER_MaxIrq 15
  80. char *BLASTER_ErrorString( int ErrorNumber );
  81. void BLASTER_EnableInterrupt( void );
  82. void BLASTER_DisableInterrupt( void );
  83. int BLASTER_WriteDSP( unsigned data );
  84. int BLASTER_ReadDSP( void );
  85. int BLASTER_ResetDSP( void );
  86. int BLASTER_GetDSPVersion( void );
  87. void BLASTER_SpeakerOn( void );
  88. void BLASTER_SpeakerOff( void );
  89. void BLASTER_SetPlaybackRate( unsigned rate );
  90. unsigned BLASTER_GetPlaybackRate( void );
  91. int BLASTER_SetMixMode( int mode );
  92. void BLASTER_StopPlayback( void );
  93. int BLASTER_SetupDMABuffer( char *BufferPtr, int BufferSize, int mode );
  94. int BLASTER_GetCurrentPos( void );
  95. int BLASTER_DSP1xx_BeginPlayback( int length );
  96. int BLASTER_DSP2xx_BeginPlayback( int length );
  97. int BLASTER_DSP4xx_BeginPlayback( int length );
  98. int BLASTER_BeginBufferedRecord( char *BufferStart, int BufferSize,
  99. int NumDivisions, unsigned SampleRate, int MixMode,
  100. void ( *CallBackFunc )( void ) );
  101. int BLASTER_BeginBufferedPlayback( char *BufferStart,
  102. int BufferSize, int NumDivisions, unsigned SampleRate,
  103. int MixMode, void ( *CallBackFunc )( void ) );
  104. void BLASTER_WriteMixer( int reg, int data );
  105. int BLASTER_ReadMixer( int reg );
  106. int BLASTER_GetVoiceVolume( void );
  107. int BLASTER_SetVoiceVolume( int volume );
  108. int BLASTER_GetMidiVolume( void );
  109. int BLASTER_SetMidiVolume( int volume );
  110. int BLASTER_CardHasMixer( void );
  111. void BLASTER_SaveVoiceVolume( void );
  112. void BLASTER_RestoreVoiceVolume( void );
  113. void BLASTER_SaveMidiVolume( void );
  114. void BLASTER_RestoreMidiVolume( void );
  115. int BLASTER_GetEnv( BLASTER_CONFIG *Config );
  116. int BLASTER_SetCardSettings( BLASTER_CONFIG Config );
  117. int BLASTER_GetCardSettings( BLASTER_CONFIG *Config );
  118. int BLASTER_GetCardInfo( int *MaxSampleBits, int *MaxChannels );
  119. void BLASTER_SetCallBack( void ( *func )( void ) );
  120. void BLASTER_SetupWaveBlaster( void );
  121. void BLASTER_ShutdownWaveBlaster( void );
  122. int BLASTER_Init( void );
  123. void BLASTER_Shutdown( void );
  124. void BLASTER_UnlockMemory( void );
  125. int BLASTER_LockMemory( void );
  126. #endif