# Starry Night 2.0 with Musashi

This is the complete companion project for the Afterglow tutorial. It runs a
projected After Dark 2.0 **Starry Night** resource fork directly with Musashi;
it does not use `after-dark-vm` or the Afterglow web engine.

## Prerequisites

- `git`, `make`, a native C compiler, Python 3
- [Emscripten](https://emscripten.org/docs/getting_started/downloads.html)
- A legally owned projected resource fork named `starry-night-2.rsrc`. It must
  contain `ADgm` resource ID 0.

## Build and run

```sh
make
make serve
```

Open <http://localhost:8000>. The first build clones a pinned Musashi revision
and generates its opcode table. The Makefile also applies
`musashi-a-line.patch`: upstream Musashi normally takes an A-line exception,
while a Macintosh host needs those opcodes delivered to its Toolbox dispatcher.

For a headless smoke test with the same guest code and host implementation:

```sh
make native
./starry-native starry-night-2.rsrc 120
```

A successful run reports 120 completed frames and a non-zero pixel count.

This deliberately small host implements only the Macintosh calls exercised by
this projected Starry Night build. An unknown A-line trap stops execution and
prints its trap word and guest PC; extending that dispatcher is how this small
experiment grows toward a general After Dark module emulator.
