The 3D card: 3dfx Voodoo Graphics

With -voodoo, the emulator adds a 3dfx Voodoo Graphics (SST-1) in a PCI slot. In BeOS, the 3dfx support of the BeOS-Glide project finds it as a real card: the thdfx driver, the Glide 2.x library, OpenGL (Mesa 3.2.1), the 3dfx tests, the OpenGL demos and games run on it (Virtua Racing, Mage Slayer).

The emulated card

cardVoodoo Graphics, PCI 121a:0001, revision 2; one 16 MB memory BAR
FBI4 MB of frame buffer: two or three 16 bit buffers and the z-buffer, 640x480 or 800x600
TMUtwo (-voodoo, like the Obsidian cards), or one (-voodoo1tmu, the Diamond Monster 3D and most retail cards); 4 MB of textures each
DACICS5342 (the PLLs Glide reads to identify it)

With two TMUs, games apply two textures in one pass (texture and lightmap); some, like the Mage Slayer port, only show their lightmaps then.

Like the real card, the Voodoo has its own video output: while a Glide program runs, the emulator window shows the Voodoo's picture instead of the Cirrus screen, then goes back to the desktop when it ends.

Installing the 3dfx support in BeOS

The package ready to install, 3dfx-beos-ppc-1.0.tar.gz, is in the downloads.

  1. Bring it into BeOS through the shared directory: put the archive in a directory of the host, for example share/, then start

    bebox -romdump flash.bin -hd0 beos.img -voodoo -share share

    In BeOS, mount the shared disk (Mount menu of the desktop) and copy the archive to the BeOS disk before extracting it (the shared disk is FAT). In a Terminal:

    cd /boot/home
    gunzip -c 3dfx-beos-ppc-1.0.tar.gz | tar xf -
  2. Install the Voodoo Graphics version (install.sh without argument installs the Voodoo 2 one, which is not emulated):

    cd 3dfx-beos-ppc-1.0
    sh install.sh voodoo1

    The script must print OK: card found (/dev/3dfx_0). If it answers that the driver is installed but /dev/3dfx_0 did not appear: check that the emulator was started with -voodoo, then restart BeOS.

The installation copies the driver to ~/config/add-ons/kernel/drivers, Glide and Mesa to ~/config/lib, and the glidereset and voodoo commands to ~/config/bin. The full guide of the package is its README.txt.

Glide tests

From a Terminal, in the tests directory (they read their .3df textures):

cd tests/voodoo1
./test00 -n 300      # clears the screen
./test01 -n 300      # points
./test11 -n 300      # direct writes to the frame buffer
./test17 -n 300      # textures
./test21 -n 300      # texture combine (lightmap)

Without -n, a test waits for a key. All 24 tests (test00 to test23) run.

OpenGL

The Mesa demos for the 3Dfx (full screen, keyboard through the Terminal; h: help, Escape: quit):

cd opengl/demos
./teapot
./fire
./tunnel

An ordinary BeOS OpenGL program (BGLView) runs on the Voodoo without being recompiled, with the voodoo command:

voodoo /boot/apps/GLTeapot/GLTeapot
voodoo opengl/glspin

Its window stays on the desktop (keyboard, mouse) and the 3D picture is full screen on the Voodoo.

Games

Glide games run with sound, like Virtua Racing and the Glide port of Mage Slayer; they are not provided: they belong to their rights holders. Games that use the Voodoo need -voodoo (two TMUs).

Troubleshooting

SymptomCause and fix
install.sh does not find the cardemulator started without -voodoo, or BeOS not restarted yet after the installation
the window stays on the 3D picture after a crashtype glidereset in the Terminal: it opens and closes the Voodoo screen, which gives the display back to the Cirrus
it is slowright Ctrl + F10 shows the speed the emulator reaches; the Windows version is the fastest
strange picture or behaviortry BEBOX_VOODOO_NOTHREAD=1 (rendering in the main thread) to know whether the rendering thread is at fault

Useful Glide environment variables: FX_GLIDE_NO_SPLASH=1 (no 3dfx logo), SST_INITDEBUG=1 (trace of the card initialization).

What is emulated

The emulation follows the register definitions and initialization code of the Glide 2 sources published by 3dfx, and the pipeline behavior described by MAME's Voodoo emulation (Aaron Giles): triangles (Gouraud, Z and W), every texture format, mipmaps, bilinear filtering, perspective, texture combine, color and alpha combine, chroma key, alpha test, fog, blending, dithering, linear frame buffer access, video timing and buffer swaps. Rendering runs in its own thread, alongside the processors.

Not emulated: the Voodoo 2, SLI, trilinear blending and detail textures.