This version of xapple2 was modified by Robert Munafo to produce
sound through /dev/audio, which on most modern Linux systems is linked
through a driver to the sound card.
It also includes a much more accurate set of colors. The Hires "orange"
and "blue" were particularly bad in the official version.
Advantages of /dev/audio output:
Precise pitch. All sounds, from the bootup BEEP to music programs
to games to elaborate stuff like the Software Automated MouthTM
sound exactly like a real Apple ][. I've tried dozens of different
types of sound programs on my real Apple //c and the emulator, and
it's perfect every time.
No need to fiddle with F9. If you like running at "full speed"
(accessed by hitting F9 once after starting the emulator), you no
longer have to go back to "slow" speed when you do things that involve
sound. The emulator automatically slows to exact Apple-II speed
whenever sound starts playing. It accomplishes this by counting the
exact number of 6502 clock cycles that are emulated and writing a
corresponding number of bytes to the sound output the blocking
nature of the fwrite() to /dev/audio takes care of the rest.
No wasted CPU bandwidth. (This is a corollary to the previous
point) When you rely on the "speed" setting to control the speed of
emulation, you're really just making your computer waste a lot of time
in a delay loop; this interferes with the responsiveness of other
tasks. The new sound method allows you to fun at full speed (by
pressing F9); even when sound is playing it regulates its speed
through the IO calls (kernel blocking).
Multitasking and VM do not interfere with emulator sound. With
"PC speaker" sound, you hear glitches whenever anything else happens
on your system (including X windows, kernal daemons, etc.) This made
it nearly impossible to get good sound even when the speed was set
properly. /dev/audio sound doesn't have that problem, because it's
buffered and played by an interrupt routine or by a coprocessor chip.
Disadvantages of /dev/audio output:
Sound delayed with respect to emulation. This happens on my system
because the buffer on my sound card holds about 2 seconds worth of
audio. I'm looking for a way to fix it. I know that some programs,
like MP3 players, have displays that are synchronized with the sound
output; I just have to find out how they accomplish the synchronization.
/dev/audio is exclusive access. This means you can't use another
sound program (e.g. MP3 player) and get sound from the Apple II
emulator at the same time. Whichever you run first will win. I'm also
looking for a workaround for this I know it's possible for multiple
programs to play sound at the same time.
To get the /dev/audio version of xapple2:
get the real xapple2 from the FTP site listed above
or from another location. Make sure it's version 0.7.4.
Unpack the tar file.
Get the patchfile:
apple2-emul-0.7.4-rpm.diff
and save it in the same directory you saved the tarfile. Make sure
it's called apple2-emul-0.7.4-rpm.diff.
gunzip apple2-emul-0.7.4.tar.gz if necessary
tar xvf apple2-emul-0.7.4.tar
mv apple2-emul-0.7.4 apple2-emul-0.7.4-patched
cd apple2-emul-0.7.4-patched
patch -Ep1 < ../apple2-emul-0.7.4-rpm.diff
Then proceed with the normal build process:
./configure
make
make install
to use /dev/audio output, change your "sound" line
in ~/.apple2 to "sound = on" or "sound = /dev/audio"
or "sound = autodetect"
When you launch the emulator it will try to access /dev/audio.
If it can't and if you picked "on" or "autodetect" it will fall
back to the PC Speaker method.
Enjoy!
I am an Apple ][ programmer since the summer of 1980. I did most of my
best work in assembly language, including a hires character generator
(HRCG) with lots of cool features including 32 lines of text, use of
half-pixel shift to improve character shapes, upper/lowercase and
graphics characters, boldface, text and background color attributes.
I did all my work on a 48K ][+ without the language card or lowercase
modification or 80-column card or any of that other new stuff they
added later.
HRCG in color
the full character set in mono
I now have a //e, //c, and IIGS.
I have made these other pages of interest to the Apple ][ community:
My file extraction script, written in
Perl. It reads a DOS 3.3 disk image (in a binhex-sort of format),
locates individual files and de-tokenizes them. In order to do this it
needs to know the 6+2 nybble conversion, sector interleaving, how to
locate D5-AA-96 at the beginning of each sector, and token tables for
both types of BASIC.