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