Skip to content

The Macintosh ​

The Mac has had four CPU families, each with its own code format. 68k code is stored in resource forks, PowerPC code in PEF fragments, and Intel and Apple silicon code in Mach-O files. macOS since Catalina cannot run 32-bit apps, so most older Mac games now run only in an emulator or on old hardware. A fat or universal file holds two compiled versions of the same game. You can compare the two versions of each function.

EraYearsCPUCode formatEmulator
68k Classic Mac OS1984–1998 (Mac OS 8.1 is the last 68k release)68000, 68020, 68030, 68040CODE resources in the resource fork, A5 world, A-line trapsMini vMac, MAME, Basilisk II
PowerPC Classic and early OS X1994–2006601 to G5PEF loaded by the Code Fragment Manager; fat apps carry bothSheepShaver, QEMU
Intel2006–2020x86, x86-64Mach-O, universal binariesNative, VMs
Apple silicon2020 onARM64Mach-ONative; Rosetta 2 for x86-64

68k Macintosh ​

Hardware ​

The Macintosh 128K arrived on 24 January 1984, the Mac II in March 1987 and the Quadra 700 and 900 in October 1991 (not confirmed) (Macintosh 128K; Macintosh II; Macintosh Quadra). The CPUs run from the 68000 to the 68040 (CPU families). Mac OS 8.1 (January 1998) was the last release for 68k Macs (Basilisk II).

How games were made and loaded ​

68k application code is stored as CODE resources in the resource fork. The details below are (not confirmed) (Inside Macintosh: Mac OS Runtime Architectures).

  • CODE 0 holds the jump table.
  • The globals and the jump table sit around register A5, the "A5 world".
  • The Segment Loader loads segments on demand.
  • Toolbox calls are A-line traps.

Myst (1993) was built with HyperCard (not confirmed) (Myst).

Media and image formats ​

Forks are lost on file systems other than the Mac's. Archives therefore use MacBinary, BinHex, AppleSingle/AppleDouble or DiskCopy images (not confirmed) (Resource fork).

Tools ​

  • Ghidra does not understand resource forks. On macOS, open a fork by adding ..namedfork/rsrc to the path. Import the CODE resources as raw binaries. Add the A-trap names to the 68000 spec by hand. RetroGhidra has a basic Classic Mac loader (A-Traps in Ghidra, 68kMLA; 68kmla.org thread).
  • resource_dasm decodes many classic resource types and disassembles 68k and PPC code resources (not confirmed) (resource_dasm).
  • The emulators below are (not confirmed). Basilisk II (GPL, 1999) emulates 68k Macs up to Mac OS 8.1 (Basilisk II). Mini vMac covers the Mac Plus era (Mini vMac). MAME has Mac drivers (MAME).
  • Executor and Advanced Mac Substitute reimplement the 68k Mac OS without Apple ROMs (not confirmed) (Executor; Advanced Mac Substitute).
  • Unicorn runs 68k code (not confirmed) (Unicorn Engine). A function from a single CODE segment could run under Unicorn with the A5 world and the needed traps stubbed. That is how tools/emu/dos_env stubs DOS (re-emulate).

Projects to learn from ​

Bungie's Marathon (1994) (not confirmed) (Marathon). Bungie released the Marathon 2 source in January 2000, and Aleph One was developed from it. The trilogy's data became freeware in 2005. "Classic Marathon 2" was re-released on Steam on Aleph One (Marathon 2: Durandal; Aleph One on GitHub). Aleph One is a fan engine. For an exact match, study the shipped binary.

For an exact reimplementation ​

A 68k Mac binary needs three steps before analysis. No mainstream loader does all three.

  1. Extract the resource fork.
  2. Split the CODE resources.
  3. Rebuild the A5 jump table.

Then name the A-line traps, so that each Toolbox call shows as a named call.

PowerPC Macintosh ​

Hardware ​

The first Power Macs launched on 14 March 1994 with a 68k emulator in ROM (not confirmed) (Power Macintosh). The CPUs run from the 601 to the G5 (CPU families).

How games were made and loaded ​

PEF is Apple's RISC executable format for Classic Mac OS. The Code Fragment Manager loads it. PowerPC Mac OS X kept it for Carbon apps (Preferred Executable Format). Fat Classic apps held 68k CODE resources and a PPC fragment together (not confirmed) (Fat binary). The Classic environment ran Mac OS 9 apps up to 10.4 and never on Intel (not confirmed) (Classic environment).

Media and image formats ​

As for 68k Macs: MacBinary, BinHex, AppleSingle/AppleDouble or DiskCopy images (not confirmed).

Tools ​

Projects to learn from ​

The Marathon games and Aleph One, as above.

For an exact reimplementation ​

  • In a fat app, compare the 68k and PPC versions of each function. Both were compiled from the same source.

Intel Macintosh ​

Hardware ​

Intel Macs arrived in January 2006 (not confirmed) (Mac transition to Intel processors).

How games were made and loaded ​

Rosetta translated PowerPC code from Mac OS X 10.4.4 until Lion removed it in 2011 (Rosetta). macOS Catalina (7 October 2019) runs only 64-bit apps (macOS Catalina).

Media and image formats ​

Mach-O magic is 0xfeedface or 0xfeedfacf. Universal files use 0xcafebabe (Mach-O).

Tools ​

Ghidra has a built-in Mach-O loader (not confirmed) (Ghidra file formats overview). Unicorn runs x86 code.

Projects to learn from ​

None listed yet.

For an exact reimplementation ​

  • A universal file carries two compiled versions of the same game. Use the second one as a check on each function.
  • A 32-bit Intel build needs a Mac older than Catalina or a VM.

Apple silicon Macintosh ​

Hardware ​

ARM64 Macs, from 2020 (CPU families).

How games were made and loaded ​

Rosetta 2 shipped with Big Sur. Apple said at WWDC 2025 that most of it will go in macOS 28 (2027), keeping support for older unmaintained games. The article gives both 27 and 28 as the version (Rosetta). Rosetta 2 does not translate kernel extensions or AVX instructions (not confirmed) (About the Rosetta translation environment, Apple).

Media and image formats ​

Mach-O, as for Intel Macs.

Tools ​

Ghidra has AARCH64 built in. Unicorn runs ARM64 code.

Projects to learn from ​

None listed yet.

For an exact reimplementation ​

  • Record whether the reference run used native ARM64 code or x86-64 code under Rosetta 2.

Code: Apache 2.0. Content: CC0 1.0. No game material: bring your own copy.