_BLASTER.H 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. Private header for for BLASTER.C
  20. (c) Copyright 1994 James R. Dose. All Rights Reserved.
  21. **********************************************************************/
  22. #ifndef ___BLASTER_H
  23. #define ___BLASTER_H
  24. #define VALID ( 1 == 1 )
  25. #define INVALID ( !VALID )
  26. #define TRUE ( 1 == 1 )
  27. #define FALSE ( !TRUE )
  28. #define YES ( 1 == 1 )
  29. #define NO ( !YES )
  30. #define lobyte( num ) ( ( int )*( ( char * )&( num ) ) )
  31. #define hibyte( num ) ( ( int )*( ( ( char * )&( num ) ) + 1 ) )
  32. #define BLASTER_MixerAddressPort 0x04
  33. #define BLASTER_MixerDataPort 0x05
  34. #define BLASTER_ResetPort 0x06
  35. #define BLASTER_ReadPort 0x0A
  36. #define BLASTER_WritePort 0x0C
  37. #define BLASTER_DataAvailablePort 0x0E
  38. #define BLASTER_Ready 0xAA
  39. #define BLASTER_16BitDMAAck 0x0F
  40. #define MIXER_DSP4xxISR_Ack 0x82
  41. #define MIXER_DSP4xxISR_Enable 0x83
  42. #define MIXER_MPU401_INT 0x4
  43. #define MIXER_16BITDMA_INT 0x2
  44. #define MIXER_8BITDMA_INT 0x1
  45. #define MIXER_DisableMPU401Interrupts 0xB
  46. #define MIXER_SBProOutputSetting 0x0E
  47. #define MIXER_SBProStereoFlag 0x02
  48. #define MIXER_SBProVoice 0x04
  49. #define MIXER_SBProMidi 0x26
  50. #define MIXER_SB16VoiceLeft 0x32
  51. #define MIXER_SB16VoiceRight 0x33
  52. #define MIXER_SB16MidiLeft 0x34
  53. #define MIXER_SB16MidiRight 0x35
  54. #define DSP_Version1xx 0x0100
  55. #define DSP_Version2xx 0x0200
  56. #define DSP_Version201 0x0201
  57. #define DSP_Version3xx 0x0300
  58. #define DSP_Version4xx 0x0400
  59. #define DSP_SB16Version DSP_Version4xx
  60. #define DSP_MaxNormalRate 22000
  61. #define DSP_MaxHighSpeedRate 44000
  62. #define DSP_8BitAutoInitRecord 0x2c
  63. #define DSP_8BitHighSpeedAutoInitRecord 0x98
  64. #define DSP_Old8BitADC 0x24
  65. #define DSP_8BitAutoInitMode 0x1c
  66. #define DSP_8BitHighSpeedAutoInitMode 0x90
  67. #define DSP_SetBlockLength 0x48
  68. #define DSP_Old8BitDAC 0x14
  69. #define DSP_16BitDAC 0xB6
  70. #define DSP_8BitDAC 0xC6
  71. #define DSP_8BitADC 0xCe
  72. #define DSP_SetTimeConstant 0x40
  73. #define DSP_Set_DA_Rate 0x41
  74. #define DSP_Set_AD_Rate 0x42
  75. #define DSP_Halt8bitTransfer 0xd0
  76. #define DSP_Continue8bitTransfer 0xd4
  77. #define DSP_Halt16bitTransfer 0xd5
  78. #define DSP_Continue16bitTransfer 0xd6
  79. #define DSP_SpeakerOn 0xd1
  80. #define DSP_SpeakerOff 0xd3
  81. #define DSP_GetVersion 0xE1
  82. #define DSP_Reset 0xFFFF
  83. #define DSP_SignedBit 0x10
  84. #define DSP_StereoBit 0x20
  85. #define DSP_UnsignedMonoData 0x00
  86. #define DSP_SignedMonoData ( DSP_SignedBit )
  87. #define DSP_UnsignedStereoData ( DSP_StereoBit )
  88. #define DSP_SignedStereoData ( DSP_SignedBit | DSP_StereoBit )
  89. #define BlasterEnv_Address 'A'
  90. #define BlasterEnv_Interrupt 'I'
  91. #define BlasterEnv_8bitDma 'D'
  92. #define BlasterEnv_16bitDma 'H'
  93. #define BlasterEnv_Type 'T'
  94. #define BlasterEnv_Midi 'P'
  95. #define BlasterEnv_EmuAddress 'E'
  96. #define CalcTimeConstant( rate, samplesize ) \
  97. ( ( 65536L - ( 256000000L / ( ( samplesize ) * ( rate ) ) ) ) >> 8 )
  98. #define CalcSamplingRate( tc ) \
  99. ( 256000000L / ( 65536L - ( tc << 8 ) ) )
  100. typedef struct
  101. {
  102. int IsSupported;
  103. int HasMixer;
  104. int MaxMixMode;
  105. int MinSamplingRate;
  106. int MaxSamplingRate;
  107. } CARD_CAPABILITY;
  108. #endif