Cryptmorrow ZX · 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 sjasmplus (assembler), Fuse (emulator) and Python 3 (build, tests and verifier). Open a terminal in the folder and type:

fuse --machine 48 --tape releases/cryptmorrow-zx-1.0.tap --auto-load

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
  • --machine 128 gives a 128K with its AY chip, and the music. On the title, up and down choose the sound, left and right the controls (Kempston, keys or Sinclair); FIRE starts. Keys: Q up, A down, O left, P right, SPACE fire.
  • To build and play a step, open a command prompt in its folder, for example chain/01-first-room, and type python tools/run_game.py: it builds the data, assembles the game with sjasmplus, makes the tape and opens it in Fuse.
  • Each step folder in chain/ has its own copy of every source and tool it needs, and builds on its own. variants/ holds the 22 experiments of the book, each with a README, and CHAPTERS.md says which step and experiments go with each chapter.
  • Built with sjasmplus 1.24.0 and tested in Fuse 1.6.0 and in the book's test bench, on the 48K and the 128K.

Chapter by chapter

Ch.TitleFolderDownload
1Your workshopchain/01-first-room/
2The Z80, memory and the screenchain/01-first-room/
3The tile enginechain/01-first-room/
4Text, torches and the framechain/01-first-room/
5Software spriteschain/02-explorer/
6The explorerchain/02-explorer/
7The dungeon and the HUDchain/03-dungeon/
8Objects, doors and the portalchain/04-objects-doors/
9The enemieschain/05-combat/
10The blade and the damagechain/05-combat/
11The AY and the musicchain/06-sound/
12The beeper, the effects and the sound modeschain/06-sound/
13The title and its big letterschain/07-title-and-ends/
14States, menu and end screenschain/07-title-and-ends/
15The tapechain/08-complete/
16Reading and checking the gamechain/08-complete/
17Glossary and index—