au88x0_a3d.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /***************************************************************************
  2. * au88x0_a3d.h
  3. *
  4. * Fri Jul 18 14:16:03 2003
  5. * Copyright 2003 mjander
  6. * mjander@users.sourceforge.net
  7. ****************************************************************************/
  8. /*
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Library General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef _AU88X0_A3D_H
  24. #define _AU88X0_A3D_H
  25. //#include <openal.h>
  26. #define HRTF_SZ 0x38
  27. #define DLINE_SZ 0x28
  28. #define CTRLID_HRTF 1
  29. #define CTRLID_ITD 2
  30. #define CTRLID_ILD 4
  31. #define CTRLID_FILTER 8
  32. #define CTRLID_GAINS 16
  33. /* 3D parameter structs */
  34. typedef unsigned short int a3d_Hrtf_t[HRTF_SZ];
  35. typedef unsigned short int a3d_ItdDline_t[DLINE_SZ];
  36. typedef unsigned short int a3d_atmos_t[5];
  37. typedef unsigned short int a3d_LRGains_t[2];
  38. typedef unsigned short int a3d_Itd_t[2];
  39. typedef unsigned short int a3d_Ild_t[2];
  40. typedef struct {
  41. void *vortex; // Formerly CAsp4HwIO*, now vortex_t*.
  42. unsigned int source; /* this_04 */
  43. unsigned int slice; /* this_08 */
  44. a3d_Hrtf_t hrtf[2];
  45. a3d_Itd_t itd;
  46. a3d_Ild_t ild;
  47. a3d_ItdDline_t dline;
  48. a3d_atmos_t filter;
  49. } a3dsrc_t;
  50. /* First Register bank */
  51. #define A3D_A_HrtfCurrent 0x18000 /* 56 ULONG */
  52. #define A3D_A_GainCurrent 0x180E0
  53. #define A3D_A_GainTarget 0x180E4
  54. #define A3D_A_A12Current 0x180E8 /* Atmospheric current. */
  55. #define A3D_A_A21Target 0x180EC /* Atmospheric target */
  56. #define A3D_A_B01Current 0x180F0 /* Atmospheric current */
  57. #define A3D_A_B10Target 0x180F4 /* Atmospheric target */
  58. #define A3D_A_B2Current 0x180F8 /* Atmospheric current */
  59. #define A3D_A_B2Target 0x180FC /* Atmospheric target */
  60. #define A3D_A_HrtfTarget 0x18100 /* 56 ULONG */
  61. #define A3D_A_ITDCurrent 0x181E0
  62. #define A3D_A_ITDTarget 0x181E4
  63. #define A3D_A_HrtfDelayLine 0x181E8 /* 56 ULONG */
  64. #define A3D_A_ITDDelayLine 0x182C8 /* 40/45 ULONG */
  65. #define A3D_A_HrtfTrackTC 0x1837C /* Time Constants */
  66. #define A3D_A_GainTrackTC 0x18380
  67. #define A3D_A_CoeffTrackTC 0x18384
  68. #define A3D_A_ITDTrackTC 0x18388
  69. #define A3D_A_x1 0x1838C
  70. #define A3D_A_x2 0x18390
  71. #define A3D_A_y1 0x18394
  72. #define A3D_A_y2 0x18398
  73. #define A3D_A_HrtfOutL 0x1839C
  74. #define A3D_A_HrtfOutR 0x183A0
  75. #define A3D_A_TAIL 0x183A4
  76. /* Second register bank */
  77. #define A3D_B_HrtfCurrent 0x19000 /* 56 ULONG */
  78. #define A3D_B_GainCurrent 0x190E0
  79. #define A3D_B_GainTarget 0x190E4
  80. #define A3D_B_A12Current 0x190E8
  81. #define A3D_B_A21Target 0x190EC
  82. #define A3D_B_B01Current 0x190F0
  83. #define A3D_B_B10Target 0x190F4
  84. #define A3D_B_B2Current 0x190F8
  85. #define A3D_B_B2Target 0x190FC
  86. #define A3D_B_HrtfTarget 0x19100 /* 56 ULONG */
  87. #define A3D_B_ITDCurrent 0x191E0
  88. #define A3D_B_ITDTarget 0x191E4
  89. #define A3D_B_HrtfDelayLine 0x191E8 /* 56 ULONG */
  90. #define A3D_B_TAIL 0x192C8
  91. /* There are 4 slices, 4 a3d each = 16 a3d sources. */
  92. #define A3D_SLICE_BANK_A 0x18000 /* 4 sources */
  93. #define A3D_SLICE_BANK_B 0x19000 /* 4 sources */
  94. #define A3D_SLICE_VDBDest 0x19C00 /* 8 ULONG */
  95. #define A3D_SLICE_VDBSource 0x19C20 /* 4 ULONG */
  96. #define A3D_SLICE_ABReg 0x19C30
  97. #define A3D_SLICE_CReg 0x19C34
  98. #define A3D_SLICE_Control 0x19C38
  99. #define A3D_SLICE_DebugReserved 0x19C3c /* Dangerous! */
  100. #define A3D_SLICE_Pointers 0x19C40
  101. #define A3D_SLICE_TAIL 0x1A000
  102. // Slice size: 0x2000
  103. // Source size: 0x3A4, 0x2C8
  104. /* Address generator macro. */
  105. #define a3d_addrA(slice,source,reg) (((slice)<<0xd)+((source)*0x3A4)+(reg))
  106. #define a3d_addrB(slice,source,reg) (((slice)<<0xd)+((source)*0x2C8)+(reg))
  107. #define a3d_addrS(slice,reg) (((slice)<<0xd)+(reg))
  108. //#define a3d_addr(slice,source,reg) (((reg)>=0x19000) ? a3d_addr2((slice),(source),(reg)) : a3d_addr1((slice),(source),(reg)))
  109. #endif /* _AU88X0_A3D_H */