Cryptmorrow MSX · 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), openMSX (emulator, with the free C-BIOS) and Python 3 (build, tests and verifier). Open a terminal in the folder and type:

openmsx -machine C-BIOS_MSX1_EU -cart releases/cryptmorrow-msx-1.0.rom

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
  • The arrow keys move the explorer and SPACE strikes; -machine C-BIOS_MSX1 gives the machine at 60 Hz instead of 50. On the title, up and down choose MUSIC, SOUND FX or SILENT, and FIRE starts the game.
  • 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 (on Windows, if python is not found, try py). Work on a copy of a step, never on the step itself.
  • 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, 14 guided variants and 8 “Where it breaks” versions, 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 openMSX 21.0 with C-BIOS 0.29, at 50 and at 60 Hz, not on a real MSX. The tests also need SkoolKit 10.1 (pip install skoolkit).
  • fase0/cbios is a copy of C-BIOS 0.29, the free BIOS, under its own BSD licence; everything else in the repository is under the MIT licence.

Chapter by chapter

Ch.TitleFolderDownload
1Your workshopchain/01-first-room/
2The Z80, the slots and the VDPchain/01-first-room/
3The tile enginechain/01-first-room/
4Text, torches and the framechain/01-first-room/
5Hardware 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 PSG and the musicchain/06-sound/
12The 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 cartridgechain/08-complete/
16Reading and checking the gamechain/08-complete/
17Glossary and index—