Date: Wed, 01 Oct 1997 20:44:07 +1000 From: Stephen Hocking <shocking@mailbox.uq.edu.au> To: multimedia@freebsd.org Subject: PAS16 diffs for guspnp19.tar.gz Message-ID: <199710011044.UAA00310@mailbox.uq.edu.au>
next in thread | raw e-mail | index | archive | help
This patch adds the TRIGGER capability to the PAS16 code, allowing one
to play quake!! I'll be following it up in a few days with a patch that allows
the sb clone on the PAS16 card to also be detected, allowing for a crude form
of full duplex sound.
Stephen
*** pas2_pcm.c.old Tue Sep 23 12:09:46 1997
--- pas2_pcm.c Wed Oct 1 20:40:37 1997
***************
*** 53,58 ****
--- 53,59 ----
static u_long pcm_count = 0;
static u_short pcm_bitsok = 8; /* mask of OK bits */
static int my_devnum = 0;
+ static int open_mode = 0;
int
pcm_set_speed(int arg)
***************
*** 228,233 ****
--- 229,235 ----
pcm_count = 0;
+ open_mode = mode;
return 0;
}
***************
*** 245,250 ****
--- 247,254 ----
pas_remove_intr(PAS_PCM_INTRBITS);
pcm_mode = PCM_NON;
+ open_mode = 0;
+
splx(flags);
}
***************
*** 286,292 ****
--- 290,298 ----
pcm_count = count;
}
pas_write(pas_read(FILTER_FREQUENCY) | F_F_PCM_BUFFER_COUNTER | F_F_PCM_RATE_COUNTER, FILTER_FREQUENCY);
+ #ifdef NO_TRIGGER
pas_write(pas_read(PCM_CONTROL) | P_C_PCM_ENABLE | P_C_PCM_DAC_MODE, PCM_CONTROL);
+ #endif
pcm_mode = PCM_DAC;
***************
*** 329,340 ****
--- 335,368 ----
pcm_count = count;
}
pas_write(pas_read(FILTER_FREQUENCY) | F_F_PCM_BUFFER_COUNTER | F_F_PCM_RATE_COUNTER, FILTER_FREQUENCY);
+ #ifdef NO_TRIGGER
pas_write((pas_read(PCM_CONTROL) | P_C_PCM_ENABLE) & ~P_C_PCM_DAC_MODE, PCM_CONTROL);
+ #endif
pcm_mode = PCM_ADC;
splx(flags);
}
+ #ifndef NO_TRIGGER
+ static void
+ pas_audio_trigger (int dev, int state)
+ {
+ unsigned long flags;
+
+ flags = splhigh();
+
+ state &= open_mode;
+
+ if (state & PCM_ENABLE_OUTPUT)
+ pas_write (pas_read (0xF8A) | 0x40 | 0x10, 0xF8A);
+ else if (state & PCM_ENABLE_INPUT)
+ pas_write ((pas_read (0xF8A) | 0x40) & ~0x10, 0xF8A);
+ else
+ pas_write (pas_read (0xF8A) & ~0x40, 0xF8A);
+
+ splx(flags);
+ }
+ #endif
static int
pas_pcm_prepare_for_input(int dev, int bsize, int bcount)
***************
*** 363,369 ****
pas_pcm_reset,
pas_pcm_reset,
NULL,
! NULL
};
void
--- 391,400 ----
pas_pcm_reset,
pas_pcm_reset,
NULL,
! NULL,
! NULL,
! NULL,
! pas_audio_trigger
};
void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710011044.UAA00310>
