Mail Archives: djgpp/1998/07/03/19:33:03
On 3 Jul 98 at 17:17, John Kismul wrote:
> When using Allegro to autodetect the soundcard installed in a computer,
> is it possible in some way to get the base address, IRQ and DMA channel
> for the soundcard?
Yes, there are a number of ways. First though I encourage you not to
hardwire the parameters into your program, for obvious reasons.
The basic technique is to use a config file, which will be read by
Allegro at run-time. In the `[sound]' section of the config file you
can specify values for `sb_port', `sb_irq' and `sb_dma', among other
things. The port is given in hexadecimal; the others are in decimal.
A simpler way to get this information into the config file (and one
that allows dumb end-users to change the settings without editing
the config file directly) is through the setup utility. It's in the
`setup' directory of Allegro. You can just copy the `setup.exe'
file to the same directory as your main executable(s), and run it
from there. If you want to customise the setup program, have a look
at the source file `setup.c', and especially at its documentation --
`setup.txt'.
If these parameters aren't specified in the config file, Allegro uses
a mixture between values taken from the BLASTER environment variable,
detection, and guesswork. Generally if the user has a valid BLASTER
variable everything should be fine though.
Distributing a config file with your settings in it is probably a bad
idea too, since it may stop Allegro from using more accurate
information on other people's systems (such as the BLASTER variable).
For more information, see:
Allegro documentation (allegro/allegro.txt), chapter "Configuration"
Allegro setup program documentation (allegro/setup/setup.txt)
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -