About

Not an emulator: the games, rewritten and proven.

An emulator runs the original program on an imitation of the old machine. macgames does something slower and stranger: it reads each game's original 68k code, works out what every routine does, and writes it again in TypeScript, then proves the new code gives the same results as the old. What you play here is that rewrite, drawing what the original drew, pixel for pixel.

A labour of love. These games were made with care, often by a handful of people. Rebuilding them keeps them playable, so they are remembered rather than lost.

Why it matters

Games disappear more easily than books or films. The machines that ran them wear out, disks decay, installers stop working, and rights become tangled or forgotten. When a game is no longer worth selling, there is often nobody left to keep it playable. A game nobody can play is not being protected; it is being lost.

Archives and projects such as the Internet Archive, DOSBox and ScummVM do vital work here. macgames adds one more way: rebuilding a game so it runs in any browser, while the original stays with you.

Port or emulator

An emulator

  • Runs the original code, unchanged
  • Many games at once, with little work per game
  • Right where the imitation is right; gaps show as glitches

A port, as here

  • New, readable code that can be fixed and extended
  • One game at a time, months of work each
  • Every routine checked against the original's results

Both are worth having. If you want to play many classic Mac games today, an emulator is the way; Mini vMac does it well.

How a game is ported

  1. 01Pick one version

    The exact release the port will follow, and nothing from any other.

  2. 02Read the files

    Disk images and resource forks: pictures, sounds, maps, the code segments.

  3. 03Understand the code

    Disassemble the 68k code with MacRE, name routines and data as they are understood.

  4. 04Rewrite a piece

    One routine at a time, in TypeScript, on the rebuilt Mac Toolbox.

  5. 05Prove it

    Run the original and the rewrite on the same inputs; the results must match.

Proof

A differential test runs the original routine inside an emulator on recorded inputs, runs the TypeScript on the same inputs, and compares the results. A step of a port is done when they match.

The toolkits

Each port stands on shared tools, written so the next game is easier than the last. Each part is checked against the original, as the games are.

MacRE

C# · .NET · the reverse-engineering workbench

  • Opens disk images and archives, lists files and resources
  • Disassembles 68k code segments, with routines, switch tables and cross-references
  • Keeps our own names and comments in a project file
  • A 68020 interpreter with a minimal Mac runtime, to run original routines for the proofs

macfiles

TypeScript · reads classic Mac files in the browser

  • HFS disk images, DiskCopy, StuffIt, MacBinary, AppleSingle
  • Resource forks and their types: pictures, sounds, dialogs, menus, icons, fonts
  • Recognises a game in whatever you drop, by checksums

mactoolbox

TypeScript · the Macintosh Toolbox, rebuilt for the browser

  • QuickDraw, bitmapped fonts, colour tables, pictures
  • Windows, menus, dialogs, controls, lists, TextEdit
  • Events at the Mac's 60.15 ticks a second, and sound
  • Checked against System 7's own drawing code, run in MacRE

And a set of browser checks that drive each game in a headless browser, comparing what it draws and how it behaves, so a change that breaks a game is caught.

The rules we keep

No original bytes
The code repository holds none of the games' code, pictures, sounds or text, nor Apple's. Only games whose licence allows it are offered here, unchanged.
Your files stay yours
What you drop is read in your browser and kept there. Nothing is uploaded, and the site has no server to upload to.
The game as it was
Each port follows one exact version of its game, named on its page, and plays as that version did: the same rules, numbers and pictures. Where a port changes something on purpose to play better today, such as smoother frames or keys that suit a modern keyboard, its page says so.
Made to fit the site
A few small things work a little differently from the original, such as quitting and saving, so every game here behaves the same way and nothing gets lost.