seishun / macemu

Emscripten/WebAssembly ports of the Basilisk II and SheepShaver emulators

Home Page:https://system7.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

How It Works

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. SharedArrayBuffers 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.

Build Instructions

Not a standalone project, see the build instructions in the infinite-mac repo for details on how to build this.

Branches

This repository contains multiple branches, the notable ones are:

About

Emscripten/WebAssembly ports of the Basilisk II and SheepShaver emulators

https://system7.app


Languages

Language:C++ 65.2%Language:C 27.2%Language:M4 2.6%Language:Objective-C++ 1.7%Language:Assembly 1.2%Language:Makefile 0.7%Language:HTML 0.6%Language:Objective-C 0.5%Language:Shell 0.3%Language:Roff 0.1%Language:Perl 0.0%Language:Batchfile 0.0%