Dreadcastle · 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 64tass (assembler), VICE (emulator (x64sc)) and Python 3 (build, tests and verifier). Open a terminal in the folder and type:

x64sc -pal -autostartprgmode 1 -joydev2 1 -autostart releases/dreadcastle-1.0.prg

Check 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
  • Joystick in port 2; -joydev2 1 puts it on the numeric keypad: 4 left, 6 right, 8 up, 2 down, 0 Fire.
  • To build and play a step, open PowerShell in its folder, for example chain/01-village-at-night, and type .\tools\run-game.ps1 -Mode Play. Without PowerShell, the README of the repository gives the same stages by hand.
  • Each step folder in chain/ has its own copy of every source and tool it needs, and builds on its own. variants/ holds the 37 experiments of the book, each with a README, and CHAPTERS.md says which step and experiments go with each chapter.
  • Built with 64tass 1.60.3243 and tested in VICE 3.10 on a PAL C64 with a 6581 SID.

Chapter by chapter

Ch.TitleFolderDownload
1Your workshopchain/01-village-at-night/
2Memory and the VIC-IIchain/01-village-at-night/
3The level on screenchain/01-village-at-night/
4The raster and the HUDchain/01-village-at-night/
5Smooth scrollingchain/02-scrolling/
6Oscar walkschain/03-oscar/
7Jumps and solid groundchain/03-oscar/
8The batchain/04-bat/
9Heirlooms, the gate and the nightchain/05-heirlooms-and-gate/
10The enemieschain/06-enemies/
11The Count's staffchain/07-staff/
12Packed levels and the castlechain/09-castle/
13Tom Darkfangchain/10-tom/
14The fight with Tomchain/10-tom/
15The SID and the musicchain/11-music/
16States, title and menuchain/12-title-and-ends/
17The tally, dawn and victorychain/12-title-and-ends/
18Effects, jingles and the diskchain/13-complete/
19Reading and checking the gamechain/13-complete/
20Glossary and index—