How it works

Your copy, a rewritten game, and the proof that they match.

What happens when you play a game here, how each game is ported from its original code, and the tools that make the next port easier than the last.

Playing a game

  1. 01Bring your copyThe site hosts no copyrighted games. Your file is read in the browser and never sent anywhere.
  2. 02It is recognisedDisk image or archive, the page finds the game and checks it is the version the port follows.
  3. 03Play, as it wasThe port does what the original did, checked against it routine by routine. Saves stay in your browser.

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.

Why a port, and the rules we keep

Why games are worth keeping playable, how a port differs from an emulator, and what the project will and will not do with your files and the games'.

About macgames