Fork of the Basilisk II and SheepShaver Macintosh emulators, modified to be compiled to WebAssembly and run in the browser. Part of the Infinite Mac, see its README and introductory blog post for more details.
Based on James Friend's original browser port of Basilisk II.
The TECH document describes the basic Basilisk II architecture. The WebAssembly port ends up being a modified Unix version, with a subset of Unix implementations of Basilisk II parts are replaced with JavaScript-based ones. They generally use the ES_ASM() macros to call into JavaScript code, with EmulatorWorkerApi
in the infinite-mac repo serving as the receiving endpoint.
The Basilisk emulator runs in an infinite loop (simulating the classic Mac and its CPU) thus it cannot yield to the browser's event loop. Therefore it is executed in a web worker, which interacts with the main browser thread for input and output. SharedArrayBuffer
s and Atomics
operations are used to efficiently communicate with the worker in the absence of postMessage
/message
event handlers.
SheepShaver ends up working pretty much the same way.
Not a standalone project, see the build instructions in the infinite-mac repo for details on how to build this.
This repository contains multiple branches, the notable ones are:
- infinite-mac-kanjitalk755: Current Infinite Mac work, based on the kanjitalk755/macemu fork of Basilisk II and SheepShaver.
- bas-emscripten-release: Initial Infinite Mac work, based on James Friend's jsdf/macemu fork.
- infinite-mac-jsdf: Squashed version of the work done in the
bas-emscripten-release
branch, so that it could serve as a starting point for theinfinite-mac-kanjitalk755
work.
To sync with the upstream kanjitalk755/macemu
fork, run:
git remote add upstream-kanjitalk755 https://github.com/kanjitalk755/macemu.git
git fetch upstream-kanjitalk755
git rebase --committer-date-is-author-date upstream-kanjitalk755/master