8bit-Unity 0.3.5: One C Codebase for Atari, Apple II, C64, Oric and Lynx

Multicolour pixel-art village scene with a stone bridge, red-roofed houses and two characters, converted for the Atari

In October 2020 the developer 8bit-Dude gave AtariAge an overview of 8bit-Unity, his multi-platform game SDK, ahead of version 0.3.5, due in November 2020. It summed up eighteen months of work since his last post about the project.

What it is

8bit-Unity is a development kit for cc65, the C compiler for 6502 machines. You write one game in C against its API, and the build scripts produce disk or ROM images for each supported system. Since version 0.3.0 the targets have been Apple //e, Atari 8-bit (XL/XE), Commodore 64, Oric-1/Atmos and Atari Lynx. The author also said he planned to add the 7800, 5200, NES and BBC, all 6502-based.

The library is split into modules, so a game only links the parts it uses and saves memory. The modules cover:

  • multicolour bitmap graphics, with 9 colours on the Atari 8-bit
  • sprite handling
  • music playback
  • GUI widgets
  • on-screen animation

The asset pipeline is the same for every platform: the same tools convert your bitmaps and sprites for each machine, which is usually the hardest part of a cross-platform 8-bit project.

Demos you can learn from

The SDK comes with several tech demos whose code can be reused in your own projects:

  • Demo Disc, which shows every module in use
  • 8bit-Slicks, a complete top-down racing game
  • 8bit-Grubs, a simple artillery game whose whole source is a single C file (projects/grubs/src/grubs.c in the repository), a good first read for anyone wondering what an 8bit-Unity program looks like
  • 8bit-Goblin, a point-and-click adventure demo
  • 8bit-OS, an app-based graphical "OS" built on the widget system

The 8bit-Hub

8bit-Unity also supports the 8bit-Hub, a small add-on board the author designed to give all the supported machines Wi-Fi, SD-card storage and mouse input, with co-processing planned for later. The SDK has built-in support for it.

Why it matters

8bit-Unity lowers the barrier to 8-bit game development in two ways: you write C instead of assembly, and one project reaches the Atari and four other 6502 systems at once. The 8bit-Slicks racer shows it can carry a complete game, not just demos.

Getting it

The SDK is free on GitHub at github.com/8bit-Dude/8bit-Unity (BSD 2-clause licence) and through 8bit-unity.com. To start, run the _builder_ script, open one of the .builder files in the projects folder and click "generate scripts". This writes batch files to the build folder that produce the disks and ROMs for each platform. The Atari builds run on real XL/XE machines or in an emulator such as Altirra.

Credits