Gravis UltraSound under Qemu

Gravis Ultrasound

Back when the Adlib & Sound Blaster cards were king, there also was the far more expensive, and far better sounding Gravis UltraSound. What really separated the GUS from the Adlib cards was a wavetable approach to midi file playback. The GUS was driven by a ‘soft’ table, meaning programs had to upload samples to the card before it could use them.  This was unlike cards like the SoundBlaster AWE editions which stored their wavetables in ROM.

Qemu has included GUS emulation for some time now, however because of the softset files it is rather involved to get working.

The first thing you will need to do is download the soft files here.  You will need to inject them into your MS-DOS disk image.  I prefer to use the following method:

 -hdb fat:xfer/

Where xfer is the directory where I’ve extracted my files. This will make the directory show up as a second hard disk.  Now the drive is read-only so getting files OUT of the emulator still requires either virtual floppy disks (yuck) or a network client.  The archive contains two versions of the wavetables, one that is stock that I couldn’t get to work, and a ‘patched’ version.  Copy the ULTRASND411 directory to c:\ultrasound  .

Next we need to setup the environment variables.  The Gravis UltraSound in Qemu is setup for IO port 240, Irq 7, and DMA channel 3.  As you can see from gus.c in Qemu source:

static Property gus_properties[] = {
DEFINE_PROP_UINT32 (“freq”, GUSState, freq, 44100),
DEFINE_PROP_HEX32 (“iobase”, GUSState, port, 0x240),
DEFINE_PROP_UINT32 (“irq”, GUSState, emu.gusirq, 7),
DEFINE_PROP_UINT32 (“dma”, GUSState, emu.gusdma, 3),
DEFINE_PROP_END_OF_LIST (),
};

This means we need to setup the following environment varriables in the autoexec.bat

SET ULTRASND=240,3,3,7,7
SET ULTRADIR=C:\ULTRASND

 Re-launch Qemu and specify the soundcard emulation something like this:

-soundhw gus,pcspk -parallel none

This will give us both the PC speaker, and the Gravis UltraSound.  Additionally this disables the parallel port which also uses IRQ 7.  We should be able to run games now.  For anyone interested, Maraakate has given me a link to share of his GUS archive.

I found this information on a Qemu patch page (before the GUS support was mainlined), and Vogons support for DOSBox & GUS emulation.

I’ve tested Doom, and Heretic which work fine on Qemu 1.6.1 on OS X.

For anyone who cares, this is what the SoundBlaster/Adlib sounds like, and this is the Gravis UltraSound emulation in Qemu.

Or even better, embedded audio!


UltraSound


SoundBlaster

One thought on “Gravis UltraSound under Qemu

  1. I just found out the hard way that this wasn’t working because of the clean mx nonsense. anyways, sound samples all fixed!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.