Home | History | Annotate | Download | only in isa

Lines Matching defs:voice

132  * Software state of a single "voice" on the GUS
141 unsigned char voccntl; /* State of voice control register */
144 int rate; /* Sample rate of voice being played back */
147 * Address of the voice data into the GUS's DRAM. 20 bits each
150 u_long start_addr; /* Starting address of voice data loop area */
151 u_long end_addr; /* Ending address of voice data loop */
152 u_long current_addr; /* Beginning address of voice data
196 #define GUS_PLAYING 0x08 /* GUS is playing a voice */
250 * Voice information array. All voice-specific information is stored
254 struct gus_voice sc_voc[32]; /* Voice data for each voice */
469 * voices. Since the GUS samples a voice every 1.6 us, the maximum frequency
565 #define GUS_VOICE_LEFT 0 /* Voice used for left (and mono) playback */
566 #define GUS_VOICE_RIGHT 1 /* Voice used for right playback */
1425 DMAPRINTF(("gusintr voice flags=%x\n", sc->sc_flags));
1439 int gus_stops; /* how many times did voice stop? */
1577 * If the voice is stopped, then start it. Reset the loop
1579 * we're starting a stopped voice, that means that the next
1599 * at least one more time. The voice interrupt
1608 * the voice could be just approaching the
1677 * Service voice interrupts
1685 int ignore, voice, rval;
1695 * The point of this may not be obvious at first. A voice can
1697 * to ignore multiple interrupts for the same voice.
1714 * We've got a voice interrupt. Ignore previous
1715 * interrupts by the same voice.
1719 voice = intr & GUSMASK_WIRQ_VOICEMASK;
1721 if ((1 << voice) & ignore)
1724 ignore |= 1 << voice;
1727 * If the voice is stopped, then force it to stop
1734 if (voice != GUS_VOICE_LEFT) {
1735 DMAPRINTF(("%s: spurious voice %d "
1737 device_xname(sc->sc_dev), voice));
1738 gus_stop_voice(sc, voice, 0);
1741 gus_stop_voice(sc, voice, 1);
1742 /* also kill right voice */
1748 * voice stopped while the DMA code was
1750 * in place. Start the voice again.
1752 printf("%s: stopped voice not drained?"
1763 "voice", device_xname(sc->sc_dev));
1772 * This should always be taken if the voice
1776 if (gus_continue_playing(sc, voice)) {
1783 /* also kill right voice */
1801 * here, after the voice interrupts indicating
1915 gus_continue_playing(struct gus_softc *sc, int voice)
1923 * stop this voice from interrupting while we work.
1930 sc->sc_voc[voice].voccntl & ~(GUSMASK_VOICE_IRQ));
1942 DPRINTF(("gus: bufcnt 0 on continuing voice?\n"));
1960 gus_set_endaddr(sc, voice, GUS_MEM_OFFSET +
1969 sc->sc_voc[voice].voccntl &= ~GUSMASK_LOOP_ENABLE;
1970 sc->sc_voc[voice].volcntl &= ~GUSMASK_VOICE_ROLL;
1978 sc->sc_voc[voice].voccntl |= GUSMASK_LOOP_ENABLE;
1979 sc->sc_voc[voice].volcntl &= ~GUSMASK_VOICE_ROLL;
1982 sc->sc_voc[voice].voccntl &= ~GUSMASK_LOOP_ENABLE;
1983 sc->sc_voc[voice].volcntl |= GUSMASK_VOICE_ROLL;
1990 playstats[playcntr].curaddr = gus_get_curaddr(sc, voice);
1992 playstats[playcntr].voccntl = sc->sc_voc[voice].voccntl;
1993 playstats[playcntr].volcntl = sc->sc_voc[voice].volcntl;
1994 playstats[playcntr].endaddr = sc->sc_voc[voice].end_addr;
2003 * (re-)set voice parameters. This will reenable interrupts from this
2004 * voice.
2008 bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, sc->sc_voc[voice].voccntl);
2010 bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, sc->sc_voc[voice].volcntl);
2089 * Start a voice playing on the GUS.
2093 gus_start_voice(struct gus_softc *sc, int voice, int intrs)
2106 * Pick all the values for the voice out of the gus_voice struct
2107 * and use those to program the voice
2110 start = sc->sc_voc[voice].start_addr;
2111 current = sc->sc_voc[voice].current_addr;
2112 end = sc->sc_voc[voice].end_addr;
2118 if (sc->sc_voc[voice].voccntl & GUSMASK_DATA_SIZE16) {
2127 * Select the voice we want to use, and program the data addresses
2130 bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
2148 * (maybe) enable interrupts, disable voice stopping
2153 sc->sc_voc[voice].voccntl |= GUSMASK_VOICE_IRQ;
2154 DMAPRINTF(("gus voice playing=%x\n", sc->sc_flags));
2156 sc->sc_voc[voice].voccntl &= ~GUSMASK_VOICE_IRQ;
2157 sc->sc_voc[voice].voccntl &= ~(GUSMASK_VOICE_STOPPED |
2169 sc->sc_voc[voice].current_volume >> 4);
2176 bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, sc->sc_voc[voice].voccntl);
2181 bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, sc->sc_voc[voice].voccntl);
2188 * Stop a given voice.
2191 gus_stop_voice(struct gus_softc *sc, int voice, int intrs_too)
2200 sc->sc_voc[voice].voccntl |= GUSMASK_VOICE_STOPPED |
2203 sc->sc_voc[voice].voccntl &= ~(GUSMASK_VOICE_IRQ);
2207 DMAPRINTF(("gusintr voice
2211 bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
2216 bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, sc->sc_voc[voice].voccntl);
2221 bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, sc->sc_voc[voice].voccntl);
2232 * Set the volume of a given voice.
2235 gus_set_volume(struct gus_softc *sc, int voice, int volume)
2247 sc->sc_voc[voice].current_volume = gusvol;
2249 bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
2466 * Set the sample rate of the given voice.
2469 gus_set_samprate(struct gus_softc *sc, int voice, int freq)
2492 * Program the voice frequency, and set it in the voice data record
2495 bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
2499 sc->sc_voc[voice].rate = freq;
2619 * Set the end address of a give voice.
2622 gus_set_endaddr(struct gus_softc *sc, int voice, u_long addr)
2631 sc->sc_voc[voice].end_addr = addr;
2633 if (sc->sc_voc[voice].voccntl & GUSMASK_DATA_SIZE16)
2648 gus_set_curaddr(struct gus_softc *sc, int voice, u_long addr)
2657 sc->sc_voc[voice].current_addr = addr;
2659 if (sc->sc_voc[voice].voccntl & GUSMASK_DATA_SIZE16)
2662 bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
2675 gus_get_curaddr(struct gus_softc *sc, int voice)
2685 bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
2691 if (sc->sc_voc[voice].voccntl & GUSMASK_DATA_SIZE16)
2693 DPRINTF(("gus voice %d curaddr %ld end_addr %ld\n",
2694 voice, addr, sc->sc_voc[voice].end_addr));
2839 * Reset voice specific information