← Back to Blogs
HN Story

Achieving Zero CPU Load: Emulating Atari ST Music on the Amiga

May 19, 2026

Achieving Zero CPU Load: Emulating Atari ST Music on the Amiga

The rivalry between the Amiga and Atari ST was a cornerstone of the 1980s computing era, but the technical divide between their audio capabilities was stark. While the Amiga's PAULA chip offered advanced PCM sample playback, the Atari ST relied on the YM2149, a chip primarily capable of square waves and noise.

For most developers, emulating one on the other required significant CPU overhead. However, a recent project by developer Leonard (z303) demonstrates a masterclass in hardware exploitation, achieving a full emulation of Atari ST music on the Amiga with exactly 0% CPU load on the Motorola 68000. This was achieved not through brute-force software emulation, but by repurposing the Amiga's own custom hardware in ways the original designers likely never intended.

The Challenge: CPU Cycles vs. Audio Fidelity

In the demo scene, every single CPU cycle is a precious resource. When attempting to break a "sin-dots" rendering record (drawing thousands of dots on screen at 50 FPS), the Motorola 68000 must be dedicated entirely to the graphics pipeline.

Previous attempts to play Atari music on the Amiga consumed roughly 50% of the frame time because accurately reproducing modern Atari effects—such as SID voices, Sync Buzzers, and Digidrums—requires emulating not only the sound chip but also the Atari's hardware timers. To eliminate this overhead, Leonard sought a way to offload the entire audio process to the Amiga's custom chips.

Understanding the Hardware Gap

To solve this, one must first understand the fundamental difference between the two chips:

  • YM2149 (Atari): A simple chip with three voices generating square waves, a pseudo-random noise generator, and a basic hardware volume envelope.
  • PAULA (Amiga): A PCM sample playback chip. It has no native support for square waves or envelopes; it simply plays 8-bit signed samples from memory.

Initially, the solution seemed simple: store a single cycle of a square wave in memory and loop it using PAULA. While this worked for early, simple Atari games, it failed to capture the rich, aggressive timbres of later Atari soundtracks.

The "MadMax Buzzer" and YM Envelope Trickery

By the late 80s, musicians like Jochen Hippel (MadMax) discovered a loophole in the YM2149. The chip had a single volume envelope generator shared across all voices. Instead of using it to modulate volume, they used the envelope as the sound source itself.

By setting the envelope frequency to an audible range and combining it with a slightly detuned square wave, they created a complex, sweeping waveform known informally as the "MadMax Buzzer."

Exploiting PAULA's "Attached Voice" Mode

To replicate this on the Amiga, Leonard turned to an obscure feature of the PAULA chip: Attached Voice mode. In this mode, one PAULA voice can be used to modulate the period or volume of another voice. This is a feature almost entirely ignored by the commercial gaming industry and most of the demo scene.

The First Attempt: Coarse Waveforms

The initial plan was to use three PAULA voices for the square waves and the fourth voice as a volume modulator to simulate the YM envelope. However, a critical hardware limitation emerged: in attached mode, volume modulation data runs at half the rate of the audio sample playback.

When analyzing the output in Audacity, the result was "chunky." The smooth triangle shape of the envelope was lost because many intermediate volume values were skipped, resulting in a coarse, low-resolution sound.

The "Eureka" Moment: Reversing the Roles

The breakthrough came from a counter-intuitive reversal. Instead of using the low-resolution modulator to define the envelope shape, Leonard swapped the roles:

  1. The Sample: The triangle envelope shape was stored as a high-resolution 8-bit PCM sample.
  2. The Modulator: The square wave was stored in the 16-bit modulator format.

Because a square wave only transitions between two states (high and low), it does not require high resolution. By using the square wave as the modulator and the triangle as the sample, the high-fidelity sweeping sound of the MadMax Buzzer was perfectly preserved.

Achieving True 0% CPU Load

Even with the audio logic solved, updating PAULA registers every frame still requires some CPU intervention. To reach absolute zero CPU usage, Leonard utilized the COPPER, the Amiga's dedicated coprocessor.

The COPPER runs in parallel with the 68000 and can write immediate values to any custom chip register based on the screen position. By pre-generating a sequence of small COPPER lists—one for each music frame—and chaining them together, the music playback becomes a fully automatic hardware process.

As a result, the Motorola 68000 is never touched. This allowed the developer to increase the sin-dots record from 6,682 to 7,210 dots, as the CPU was now 100% dedicated to the graphics.

Legacy and Insights

This project highlights a recurring theme in retro-computing: the discovery of "hidden" hardware capabilities decades after the original machines were retired. As noted by the community, the Amiga's custom chips provided a level of parallel processing that is often missed in modern PC architecture.

Whether it is the use of attached voices for specific sound effects in early software like X-Copy or the creative misuse of envelopes on the Atari ST, these hacks demonstrate that the most elegant solutions often come from using hardware in ways it was never intended to be used.

References

HN Stories