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