Urgent.News

What's breaking now, across thousands of outlets.

Tech

Recreating Voodoo Graphics and a Late-1990s Gaming PC on an FPGA

For the past month, I have been enhancing and optimizing z486_MiSTer, focusing primarily on games from the early 1990s. After some contemplation about the future, I decided to investigate the emergence of 3D graphics cards. The Voodoo card, particularly, left a lasting impression on me. The game that truly showcased its capabilities was Need for Speed II SE, with its smooth textures, fog effects, and overall speed, making it feel like a new era in PC gaming.

By utilizing the newly available z486 CPU, I was able to recreate this experience through zSST, a SystemVerilog implementation of the 3dfx Voodoo Graphics, or SST-1. This implementation, when combined with the z486 CPU and the accompanying PC hardware, forms z486 XL: a DOS PC with Voodoo graphics integrated into the programmable logic of a Xilinx KV260 board. With this setup, games such as Tomb Raider can now run using the original 3dfx renderer.

The zSST implementation supports most of the central Voodoo features, including prepared triangles, texture filtering and mipmapping, depth and alpha tests, fog, blending, dithering, framebuffer access, and buffer swaps. Additionally, it accommodates both fixed-point and floating-point setup interfaces. The design was evaluated on the KV260 board, which provided ample logic, DSP blocks, on-chip memory, and DDR bandwidth to accommodate the combined design.

However, due to its limited logic resources, the DE10-Nano board was not suitable for this graphics addition. The KV260 utilizes its onboard DDR memory, eliminating the need for an external SDRAM module. Fortunately, there is abundant documentation available for this project. The Glide source released by 3dfx in 1999 and the SST-1 specification, obtained after 3dfx was acquired by NVIDIA in 2000, provide valuable insights into how software prepares triangles, configures the pixel pipeline, manages textures and framebuffers, and other rendering processes.

The specification, while a behavioral target rather than a circuit diagram, outlines the expected behavior when software writes to specific registers, leaving many implementation choices open to the designer. Additionally, 86Box offers useful references for more complex rendering behavior, and MAME's Voodoo work provides additional Glide traces and reference screenshots for testing purposes.

Despite the relatively compact command interface of the Voodoo Graphics, consisting of just five main command registers, the card handles the majority of the 3D work, leaving a significant amount of processing to the host CPU.

The main drawing primitive is a prepared triangle, with Glide providing a more user-friendly interface for game developers. Prior to rendering, the host CPU transforms the 3D geometry, computes vertex lighting, clips the geometry, projects it onto the screen, and prepares the screen-space triangle along with its parameter gradients.

These gradients are used to interpolate values across the surface of the triangle. Unlike later GPUs like the GeForce 256, SST-1 does not feature a hardware transform-and-lighting engine, leaving ample work for the accelerator. The rasterizer identifies which pixel centers lie within the triangle and interpolates their color, depth, and texture coordinates.

The texture unit fetches and filters texels, while the framebuffer unit combines colors, applies visibility tests and fog, blends the result with the existing image, and writes the final pixel value to the frame buffer. The original Voodoo card divides this workload between two ASICs: the Frame Buffer Interface (FBI) and the Texture Mapping Unit (TREX), commonly referred to as the TMU.

At a 50 MHz graphics clock, the accelerator is capable of rendering one textured, depth-tested output pixel per clock, resulting in approximately 50 million pixels per second. Importantly, this does not imply that a pixel finishes in a single clock cycle; rather, various stages can simultaneously work on different pixels, with some pixels being textured while earlier ones are blended and others are written to the framebuffer.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at nand2mario.github.io →

More in Tech

More from Tuesday 15 September →