Defender Remake on Atari ST

70 FPS on 8 MHz hardware

Defender Remake on Atari ST

Recreation of the arcade classic Defender for Motorola 68000-based Atari ST hardware. Implements a 70 Hz Vertical Blank (VBL) interrupt service routine for tear-free double-buffered raster graphics, Yamaha YM2149 PSG sound synthesis, and custom IKBD interrupt handling.

Project Visuals & Screenshots

1 of 2
70 FPS double-buffered arcade gameplay running on Atari ST hardware

70 FPS double-buffered arcade gameplay running on Atari ST hardware

Gameplay Demonstration Video

Overview

A bare-metal retro recreation of the arcade classic Defender written in C and Motorola 68000 assembly for the Atari ST, targeting 70 Hz cycle-synchronized raster graphics and direct chip-level sound synthesis.

Key Features & Engineering Highlights

  • ✦Low-level systems programming in C and Motorola 68000 assembly on the Atari ST architecture
  • ✦Double-buffered raster graphics running at 70 FPS locked to the hardware Vertical Blank (VBL) interrupt
  • ✦Hardware sound synthesis leveraging the onboard Yamaha YM2149 PSG sound generator for music and sound effects
  • ✦Custom IKBD Interrupt Service Routine handling asynchronous keyboard scans and mouse packet parsing
  • ✦Object pooling, collision detection matrices, and wave-based alien AI behavioral state machines
⚠️

The Problem

The Atari ST features an 8 MHz Motorola 68000 processor with no hardware sprite scaling or hardware scrolling registers. Rendering multiple concurrent high-speed alien entities, player projectiles, animated terrain, and radar displays without frame drops or screen tearing requires strict microsecond cycle budgeting.

💡

The Solution

Engineered a double-buffered graphics pipeline locked to the 70 Hz Vertical Blank (VBL) interrupt. Replaced OS polling with custom interrupt service routines (ISRs) for asynchronous keyboard and mouse handling (IKBD) and direct register writes to the Yamaha YM2149 PSG sound generator.

Technical Architecture

System Design
┌────────────────────────────────────────────────────────┐
│             Motorola 68000 CPU (8 MHz)                 │
│         Game Loop / Physics / Alien State Machine      │
└──────────────┬───────────────────────────┬─────────────┘
               │                           │
  70 Hz Sync   │                           │ Vector Jump
┌──────────────▼─────────────┐   ┌─────────▼─────────────┐
│    VBL Interrupt (ISR)     │   │   IKBD Interrupt (ISR)│
│  Page Flip & Raster Render │   │  Async Scan Codes / Mse│
└──────────────┬─────────────┘   └───────────────────────┘
               │
┌──────────────▼─────────────────────────────────────────┐
│        Hardware Double Buffer (320x200 4-Plane)        │
│   Fast word-aligned bitplane blitting & dirty redraws  │
└──────────────────────────────┬─────────────────────────┘
                               │ Direct Register Writes
┌──────────────────────────────▼─────────────────────────┐
│        Yamaha YM2149 Programmable Sound Generator      │
│     Channel A/B/C square wave & noise pulse synthesis  │
└────────────────────────────────────────────────────────┘

The architecture bypasses standard operating system overhead. The main game loop updates physics state, collision detection matrices, and alien state machines. Every 1/70th of a second, the hardware triggers the Vertical Blank interrupt, safely swapping frame buffer base addresses to eliminate tearing. Asynchronous inputs are decoded directly via the 6850 ACIA chip servicing IKBD interrupts.

Key Engineering Decisions

Cycle-Accurate 70 FPS VBL Synchronization

Locked the frame presentation to the Atari ST monochrome/color monitor refresh cycle, eliminating tearing and ensuring constant gameplay speed regardless of entity count.

Direct Hardware Register Sound Synthesis

Programmed the Yamaha YM2149 sound chip directly through 14 hardware registers to synthesize explosions, laser pulses, and engine hums with zero memory allocation.

Word-Aligned Bitplane Blitting & Dirty Clearing

Used optimized 16-bit word blits and cleared only previously rendered sprite coordinates rather than wiping the full 32KB buffer each frame.

Challenges & Solutions

CPU Budget Overruns with Multiple Active Aliens

When 10+ alien landers, mutants, and projectiles were active, naive bounding-box checks caused frame drops. Solved by implementing spatial grid partitioning and dirty rect tracking.

Asynchronous IKBD Packet Desynchronization

The Atari keyboard sends variable-length mouse and keyboard packets. Handled through an interrupt state machine that decodes raw packet headers without blocking the CPU.

Results & Impact

  • ✓Solid 70 FPS double-buffered arcade gameplay running on authentic hardware / Steem emulator
  • ✓Complete sound effects suite generated on the Yamaha YM2149 chip
  • ✓Demonstrated mastery of low-level systems programming, ISRs, and hardware constraints

Related Projects

Other work that shares technologies or themes with Defender Remake on Atari ST.