systemless/lib.rs
1//! High-Level Emulation (HLE) for classic Macintosh applications.
2//!
3//! `systemless` runs Mac OS Toolbox apps without a real ROM by intercepting
4//! 68k A-line trap instructions (`$A000`–`$AFFF`) and dispatching them
5//! to native Rust handlers — the QuickDraw, Window Manager, Resource
6//! Manager, Sound Manager, SANE, and the rest of the Toolbox are
7//! reimplemented natively. The 68k CPU itself is interpreted by the
8//! [`m68k`] crate.
9//!
10//! See the crate's `README.md` for the architecture overview.
11//!
12//! # Quick start
13//!
14//! ```no_run
15//! use systemless::runner::{FixtureRunner, FixtureRunnerConfig};
16//!
17//! // Allocate an 8 MiB guest, default config (kiosk mode — Mac menu
18//! // bar suppressed; arrow keys not remapped to numpad).
19//! let config = FixtureRunnerConfig::default();
20//! let mut runner = FixtureRunner::new(8 * 1024 * 1024, config);
21//!
22//! // Load a Mac executable (StuffIt archive, MacBinary, or raw
23//! // resource fork — the loader auto-detects the format).
24//! let bytes = std::fs::read("MyGame.sit").unwrap();
25//! let _app = systemless::game::load_game(&mut runner, &bytes).unwrap();
26//!
27//! // Step the guest until it halts or the budget runs out.
28//! // The bool is `still_running` — false means the CPU halted.
29//! let (steps_taken, still_running) = runner.run_steps(100_000, None);
30//! println!("ran {} steps, still_running = {}", steps_taken, still_running);
31//! ```
32//!
33//! [`m68k`]: https://crates.io/crates/m68k
34
35pub mod audio;
36pub mod binhex;
37pub mod cpu;
38pub mod debug_overlay;
39pub mod disk_image;
40pub mod display;
41mod error;
42pub mod game;
43pub mod loader;
44pub mod machine_profile;
45pub mod managers;
46pub mod memory;
47pub mod oracle;
48pub mod quickdraw;
49pub mod runner;
50pub mod sound;
51pub mod trap;
52pub mod ui_theme;
53
54pub use error::{Error, Result};