gustate.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * GUSEMU32 - persistent GUS register state
  3. *
  4. * Copyright (C) 2000-2007 Tibor "TS" Schütz
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. */
  24. #ifndef GUSTATE_H
  25. #define GUSTATE_H
  26. /*state block offset*/
  27. #define gusdata (0)
  28. /* data stored using this structure is in host byte order! */
  29. /*access type*/
  30. #define PortRead (0)
  31. #define PortWrite (1)
  32. #define Port8Bitacc (0)
  33. #define Port16Bitacc (1)
  34. /*voice register offsets (in bytes)*/
  35. #define VSRegs (0)
  36. #define VSRControl (0)
  37. #define VSRegsEnd (VSRControl+VSRegs + 32*(16*2))
  38. #define VSRFreq (2)
  39. #define VSRLoopStartHi (4)
  40. #define VSRLoopStartLo (6)
  41. #define VSRLoopEndHi (8)
  42. #define VSRLoopEndLo (10)
  43. #define VSRVolRampRate (12)
  44. #define VSRVolRampStartVol (14)
  45. #define VSRVolRampEndVol (16)
  46. #define VSRCurrVol (18)
  47. #define VSRCurrPosHi (20)
  48. #define VSRCurrPosLo (22)
  49. #define VSRPanning (24)
  50. #define VSRVolRampControl (26)
  51. /*voice register offsets (in words)*/
  52. #define wVSRegs (0)
  53. #define wVSRControl (0)
  54. #define wVSRegsEnd (wVSRControl+wVSRegs + 32*(16))
  55. #define wVSRFreq (1)
  56. #define wVSRLoopStartHi (2)
  57. #define wVSRLoopStartLo (3)
  58. #define wVSRLoopEndHi (4)
  59. #define wVSRLoopEndLo (5)
  60. #define wVSRVolRampRate (6)
  61. #define wVSRVolRampStartVol (7)
  62. #define wVSRVolRampEndVol (8)
  63. #define wVSRCurrVol (9)
  64. #define wVSRCurrPosHi (10)
  65. #define wVSRCurrPosLo (11)
  66. #define wVSRPanning (12)
  67. #define wVSRVolRampControl (13)
  68. /*GUS register state block: 32 voices, padding filled with remaining registers*/
  69. #define DataRegLoByte3x4 (VSRVolRampControl+2)
  70. #define DataRegWord3x4 (DataRegLoByte3x4)
  71. #define DataRegHiByte3x5 (VSRVolRampControl+2 +1)
  72. #define DMA_2xB (VSRVolRampControl+2+2)
  73. #define IRQ_2xB (VSRVolRampControl+2+3)
  74. #define RegCtrl_2xF (VSRVolRampControl+2+(16*2))
  75. #define Jumper_2xB (VSRVolRampControl+2+(16*2)+1)
  76. #define GUS42DMAStart (VSRVolRampControl+2+(16*2)+2)
  77. #define GUS43DRAMIOlo (VSRVolRampControl+2+(16*2)*2)
  78. #define GUSDRAMPOS24bit (GUS43DRAMIOlo)
  79. #define GUS44DRAMIOhi (VSRVolRampControl+2+(16*2)*2+2)
  80. #define voicewavetableirq (VSRVolRampControl+2+(16*2)*3) /* voice IRQ pseudoqueue: 1 bit per voice */
  81. #define voicevolrampirq (VSRVolRampControl+2+(16*2)*4) /* voice IRQ pseudoqueue: 1 bit per voice */
  82. #define startvoices (VSRVolRampControl+2+(16*2)*5) /* statistics / optimizations */
  83. #define IRQStatReg2x6 (VSRVolRampControl+2+(16*2)*6)
  84. #define TimerStatus2x8 (VSRVolRampControl+2+(16*2)*6+1)
  85. #define TimerDataReg2x9 (VSRVolRampControl+2+(16*2)*6+2)
  86. #define MixerCtrlReg2x0 (VSRVolRampControl+2+(16*2)*6+3)
  87. #define VoiceSelReg3x2 (VSRVolRampControl+2+(16*2)*7)
  88. #define FunkSelReg3x3 (VSRVolRampControl+2+(16*2)*7+1)
  89. #define AdLibStatus2x8 (VSRVolRampControl+2+(16*2)*7+2)
  90. #define StatRead_2xF (VSRVolRampControl+2+(16*2)*7+3)
  91. #define GUS48SampSpeed (VSRVolRampControl+2+(16*2)*8)
  92. #define GUS41DMACtrl (VSRVolRampControl+2+(16*2)*8+1)
  93. #define GUS45TimerCtrl (VSRVolRampControl+2+(16*2)*8+2)
  94. #define GUS46Counter1 (VSRVolRampControl+2+(16*2)*8+3)
  95. #define GUS47Counter2 (VSRVolRampControl+2+(16*2)*9)
  96. #define GUS49SampCtrl (VSRVolRampControl+2+(16*2)*9+1)
  97. #define GUS4cReset (VSRVolRampControl+2+(16*2)*9+2)
  98. #define NumVoices (VSRVolRampControl+2+(16*2)*9+3)
  99. #define TimerIRQs (VSRVolRampControl+2+(16*2)*10) /* delayed IRQ, statistics */
  100. #define BusyTimerIRQs (VSRVolRampControl+2+(16*2)*10+2) /* delayed IRQ, statistics */
  101. #define AdLibCommand2xA (VSRVolRampControl+2+(16*2)*11)
  102. #define AdLibData2x9 (VSRVolRampControl+2+(16*2)*11+1)
  103. #define SB2xCd (VSRVolRampControl+2+(16*2)*11+2)
  104. #define SB2xE (VSRVolRampControl+2+(16*2)*11+3)
  105. #define SynVoiceIRQ8f (VSRVolRampControl+2+(16*2)*12)
  106. #define GUS50DMAHigh (VSRVolRampControl+2+(16*2)*12+1)
  107. #define portaccesses (VSRegsEnd) /* statistics / suspend mode */
  108. #define gusdataend (VSRegsEnd+4)
  109. #endif /* GUSTATE_H */