Skip to content
AgentiLoopPublic

About

Macxine: a Swift Macintosh Classic, Classic II and Quadra 700 emulator for macOS

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Macxine

Macxine MX app icon

A native macOS emulator for the Macintosh Classic, Macintosh Classic II and Quadra 700, written in Swift.

Website: Macxine.xcf.ai · Source: AgentiLoop/Macxine · CLI guide: COMMAND_LINE.md

Formerly MacClassic, with an executable named Classic. The app and executable are now Macxine. The MX icon shares MacMiga's rainbow bands, white lettering and dark halo.

Early alpha: emulation is incomplete. Classic II and Quadra modes are experimental; a successful build, test or boot does not guarantee application compatibility. Supply your own legally obtained Macintosh ROMs and system/disk images. None are included.

Capabilities

Machine Processor and memory Display
Macintosh Classic Motorola 68000, 7.8336 MHz, 4 MiB RAM 512×342 monochrome; experimental 800×600 and 1024×768
Macintosh Classic II MC68030 with MMU and MC68882 FPU, 10 MiB RAM 512×342 monochrome
Quadra 700 MC68040 with built-in FPU/MMU, 36 MiB RAM 640×480 colour; experimental 1024×768 with thousands or millions of colours
  • Sonnet QuadDoubler mode: a configured 50 MHz 68040 instead of the stock Quadra's 25 MHz CPU. Modelled as twice the instructions per emulated time interval, not cycle-accurate accelerator hardware. Device clocks retain their rates.
  • Turbo: an independent unthrottled mode, not DayStar hardware emulation. Runs as fast as the host allows; guest timers also accelerate and sound is muted.
  • Native window and input: keyboard and ADB mouse, model/ROM switching, screen-size selection, drive activity indicators, speed display and per-session logs. Click to capture the mouse; Escape releases it.
  • Metal display: packed framebuffer decoding on the GPU, with a CPU fallback. PNG snapshots are available from bounded/headless runs.
  • Sound: Classic mono, Classic II sound FIFO and Quadra EASC stereo output. Output-device recovery is handled without stopping emulation.
  • Storage: read-only or writable SCSI startup disks, a second hard disk, two floppy drives, CD-ROM images and data discs from host optical devices. New floppy and hard disk images can be created from the Machine menu.
  • Host-to-guest copies: drop files and folders onto the emulator after installing the Desktop Import helper. Data/resource forks and Finder type/creator are preserved; originals stay on the host.
  • Remembered configuration: per-model ROM/startup disk, resolution, processor upgrade, Turbo, auxiliary media and PRAM in window sessions.
  • Guest System Info: CPU, FPU, MMU, RAM, OS version, configured CPU clock and a host-timed loop benchmark. The configured clock is not a measured performance score.
  • Headless tools: instruction budgets, register diagnostics, framebuffer snapshots and opt-in ROM/guest integration tests.

The 68000, 68030 and 68040 cores come from M68K, version 1.2.0 or later. Macintosh memory maps, peripherals, media and the host UI live here. See COMMAND_LINE.md for machine-specific limitations and EXPERIMENTAL_VIDEO.md for non-stock display modes.

Build and run

Requires macOS 13 or later and a Swift 6 toolchain. Swift Package Manager fetches M68K automatically.

git clone https://github.com/AgentiLoop/Macxine.git
cd Macxine
swift build -c release --product Macxine
python3 Tools/build_app.py
open .build/Macxine.app

The bundle contains Contents/MacOS/Macxine, the MX icon and no ROMs or disk images. Local builds are ad-hoc signed, not notarized. On first launch, choose a ROM and startup disk. Later launches restore the selected machine and media.

# Launch a window; choose a ROM if none is remembered.
swift run -c release Macxine --display

# Quadra 700 with Sonnet QuadDoubler and remembered media.
open .build/Macxine.app --args --display --machine quadra700 --cpu-upgrade

# Supply explicit files; a read-only startup disk protects the original.
.build/release/Macxine '/path/to/Quadra.ROM' --display --machine quadra700 \
    --disk '/path/to/system.img' --cpu-upgrade --resolution 1024x768 --thousands

# Turbo is optional and requires a window.
.build/release/Macxine --display --machine quadra700 --cpu-upgrade --turbo

See COMMAND_LINE.md for all arguments, supported ROMs, model selection, headless runs and menus. The hardware names and --machine classic|classic2|quadra700 values have not changed.

Upgrading from MacClassic

The app keeps its existing bundle identifier (com.agentiloop.MacClassic) to preserve saved ROM/media preferences and PRAM. Internal Swift modules, MACCLASSIC_* diagnostic variables, guest disk identity and the existing ~/Library/Logs/MacClassic location remain compatible. They are not the public product name.

Shut down the guest normally before switching from the old app to Macxine. Do not run two instances against one writable image. If you move the repository folder, choose any ROM or media whose saved absolute path still points to the old folder.

Protect your disks

Use a separate working copy for writable sessions:

cp -n '/path/to/original.img' '/path/to/working.img'
.build/release/Macxine --display --machine quadra700 --writable-disk '/path/to/working.img'

Choose Shut Down inside Mac OS before quitting, changing machines or replacing disks. Completed writes go directly to the image, but guest filesystem caches are not flushed by host write-through. A forced quit, power loss or bounded run can leave a mounted image inconsistent. The emulator warns when a writable disk is still mounted and exclusively locks writable images against another emulator instance. Keep backups.

Desktop Import and System Info

The Desktop Import helper creates real files through the guest File Manager rather than editing a mounted HFS image from the host. It supports nested folders, both forks and type/creator metadata. Existing names are not overwritten. Transfers are limited to 64 MiB and 4,096 entries, with classic Mac Roman filename restrictions.

Install into a new image while the emulator is closed, using Python with machfs/macresources and m68k-elf-gcc plus binutils:

python3 Tools/build_desktop_import.py '/path/to/source.img' '/path/to/import-enabled.img'

For an existing helper, Tools/build_desktop_import.py /path/to/working.img --in-place updates its code and retains a backup. Helpers installed before December 1, 2026 need this update to respond correctly to Finder shutdown requests. Use a bootable source image appropriate for the selected machine.

Build the guest information utility with the same toolchain:

python3 Tools/build_system_info.py

Copy GuestTools/SystemInfo/System Info into the guest using Desktop Import, or insert the generated System Info.img. Rename/remove an older guest copy first. See the System Info guide.

Disk checking and repair

With the guest shut down and emulator closed:

python3 Tools/repair_hfs.py '/path/to/working.img'                  # check only
python3 Tools/repair_hfs.py '/path/to/working.img' --repair         # repair with backup
python3 Tools/repair_hfs.py '/path/to/working.img' --remove-stale-aliases

Repair is not a substitute for backups. The tool refuses repairs that require guessing, such as overlapping file extents or missing parent folders. Stale-alias removal targets installer-volume aliases in Apple Menu Items, not arbitrary guest files.

Limits and testing

  • CPU timing for the Classic II and Quadra is instruction-based, not cycle-accurate. The Sonnet model is an approximation, not a benchmark against a physical card.
  • Expanded resolutions patch a supported ROM in memory; ROM files are never rewritten.
  • Floppies use a replacement ROM driver, not full SWIM transfer emulation. Low-level Disk Copy modes are unsupported.
  • CD-ROM support is for data, not audio playback; the guest needs appropriate filesystem extensions.
  • Serial/networking hardware is incomplete. This is not a working Ethernet or LocalTalk networking implementation.
  • Quadra millions-of-colours compatibility remains under investigation; --thousands is available as an alternative.
  • Desktop Import is host-to-guest only, not a shared filesystem or bidirectional synchronization.
swift test -c release

Tests cover CPU/device integration, media, disk safety, video, input and timing. Some require opt-in environment variables and locally supplied ROM/system images. Hardware-dependent, headless and UI tests have different coverage; passing one does not certify another. No copyrighted ROM or system image is distributed with the tests.

Source layout

  • Sources/Classic/: Macxine's native UI, CLI, worker, audio and media controls (internal target name retained).
  • Sources/MacClassicCore/: machine and peripheral emulation.
  • Tests/MacClassicCoreTests/: unit and opt-in integration tests.
  • Tools/: app/guest builders and image preparation/repair utilities.
  • Bundle/: reproducible MX icon source and PNG.
  • site/: source for Macxine.xcf.ai.

See LICENSE for the project license. Macintosh, Motorola and accelerator product names identify the emulated hardware; Macxine is an independent project.

About

Macxine: a Swift Macintosh Classic, Classic II and Quadra 700 emulator for macOS

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages