<sect>Sound Code

<sect1>Current DOSEmu sound code
<p>
Unfortunately I haven't documented this yet. However, the current code has been
completely rewritten and has been designed to support multiple operating
systems and sound systems.

For details of the internal interface and any available patches see my WWW page
at 
<htmlurl url="http://www.slitesys.demon.co.uk/a.macdonald/dosemu/sound/"
name="http://www.slitesys.demon.co.uk/a.macdonald/dosemu/sound/">

<sect1>Original DOSEMU sound code
<p>
<tscreen><verb>
    Copyright (C) 1995  Joel N. Weber II

    This sound code is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
</verb></tscreen>
This is a very incomplete sound blaster pro emulator.  I recomend you get the
PC Game Programmer's Encycolpedia; I give the URL at the end of this document.
<p>
The mixer emulator probably doesn't do the math precisely enough (why did Hannu
use a round base 10 number when all the sound boards I know use base 2?)  It
ignores obscure registers.  So repeatedly reading and writing data will zero
the volume.  If you want to fix this, send Hannu a message indicating that
you want the volume to be out of 255.  It will probably fix the problem that
he advertises with his driver: if you read the volume and write it back as is,
you'll get zero volume in the end.  And on the obscure registers issue, it
only pays attention to volumes and the dsp stereo bit.  The filters probably
don't matter much, but the record source will need to be added some day.
<p>
The dsp only supports reset and your basic dma playpack.  Recording hasn't been
implemented, directly reading and writing samples won't work too well because
it's too timing sensitive, and compression isn't supported.
<p>
FM currently has been ignored.  Maybe there's a PCGPE newer than 1.0 which
describes the OPL3.  But I have an OPL3, and it would be nice if it emulated
that.
<p>
MIDI and joystick functions are ignored.  And I think that DOSEMU is supposed
to already have good CDROM support, but I don't know how well audio CD players
will work.
<p>
If you're having performance problems with wavesample playback, read
/usr/src/linux/drivers/sound/Readme.v30, which describes the fragment parameter
which you currently can adjust in ../include/sound.h
<p>
I haven't tested this code extensively.  All the software that came with my
system is for Windows.  (My father claimed that one of Compaq's advantages
is user friendlyness.  Well, user friendlyness and hackerfriendlyness
don't exactly go hand in hand.  I also haven't found a way to disable bios
shadowing or even know if it's happening...)  I can't get either of my DOS
games to work, either (Descent and Sim City 2000).  Can't you guys support
the Cirrus?  (Oh, and while I'm complaining, those mystery ports that SimEarth
needs are for the FM synthesiser.  Watch it guys, you might generate interrupts
with that....)
<p>
Reference:
<p>
PC Game Programers Encyclopedia
<htmlurl url="ftp://teeri.oulu.fi/pub/msdos/programming/gpe/" name="ftp://teeri.oulu.fi/pub/msdos/programming/gpe/">
<p>
Joel Weber (age 15)
<p>
July 17, 1995
