Scalecrown · the code
Every step of the game
The sources and the programs, in folders named exactly as the book names them. Free to use in your own work, commercial or not, under the MIT licence.
Build and play
You need DASM (assembler), Stella (emulator and debugger) and Python 3 (build, tests and verifier). Open a terminal in the folder and type:
python tools/build.py
stella game/build/scalecrown_ntsc.binCheck everything
From the top folder of the full download, this assembles every source again and compares the result with the reference bytes:
python verify.py- Work on a copy of a step: copy chain/01-first-room beside it, for example as chain/01-my-room, open a command prompt in the copy and type the two commands. The build makes the NTSC and the PAL cartridge in game/build. On Windows, if python is not found, try py; on Linux and macOS it may be python3.
- To play without building, open releases/scalecrown-1.0-ntsc.bin (or -pal.bin) in Stella, which recognises the F4SC cartridge by itself. In Stella 7.0 the arrow keys are the joystick, the space bar its button, F1 the SELECT switch and F2 RESET.
- Each step folder in chain/ has its own copy of every source and tool it needs, and builds on its own. variants/ holds the 27 experiments of the book, 18 guided variants and 9 “Where it breaks” versions, each with a README, and CHAPTERS.md says which step and experiments go with each chapter.
- Built with dasm 2.20.14.1 (another version may give other bytes) and tested in Stella 7.0 and in the book's test bench, never on a real console.
Chapter by chapter
| Ch. | Title | Folder | Download |
|---|---|---|---|
| 1 | Your workshop | chain/01-first-room/ | |
| 2 | The 6507, the memory and the cartridge | chain/01-first-room/ | |
| 3 | Racing the beam: the frame | chain/01-first-room/ | |
| 4 | The playfield and the first room | chain/01-first-room/ | |
| 5 | The knight | chain/02-knight/ | |
| 6 | The dungeon and the HUD | chain/03-dungeon/ | |
| 7 | Keys, doors and treasure | chain/04-keys-doors/ | |
| 8 | The serpents | chain/05-serpents/ | |
| 9 | The sword and the damage | chain/05-serpents/ | |
| 10 | The throne room | chain/06-serpent-king/ | |
| 11 | The Serpent King | chain/06-serpent-king/ | |
| 12 | The TIA and the music | chain/07-sound/ | |
| 13 | Effects and sound modes | chain/07-sound/ | |
| 14 | States, title and end screens | chain/08-title-and-ends/ | |
| 15 | The hunt: how hard the game is | chain/09-the-hunt/ | |
| 16 | Reading and checking the game | chain/09-the-hunt/ | |
| 17 | Glossary and index | — |