The Sinclair ZX81 was my first computer, in 1982. Around 1984, I made some games for this computer. Most of the time, it was the recreation of popular games. One of these games was called USINE in French, FACTORY in English, and involved two brothers in a factory.
It was great but suffered from a bug: when you pressed a key to move one of the brothers, it was not always taken into account, and because of that, you lost the game. Kind of frustrating.
Time passed, and I lost the sources of the game (those sources were never in electronic form but only on paper). Fortunately, I sold the game around 1985 to a journal, and it was published in 1986. Some people took the time to type it again, and I was able to recover the binary. But even after some disassembly, a binary is far from a usable source code. I recently had the occasion to work on this game again. But out of the question to work on paper and assemble the code by hand this time. I want to use modern tools, a good editor, Z80 assembler, and a debugger. So I created two projects: A Z80 assembler written in Typescript and an extension for Visual Studio Code called ZX81-Debugger.
With those tools, I was able to reverse-engineer my own old code and fix the bug (it was a conception problem). I also take the time to restructure the code, remove all parts in BASIC, and document the code. This code is available in this repository.
There are several ways to play:
- The game is available in binary form (.P file) in this repository. You can load it into your favorite ZX81 emulator, such as ZEsarUX.
- The game is included in the ZX81 emulator for iOS and iPadOS.
- You can run it in the [ZX81 Debugger]((https://marketplace.visualstudio.com/items?itemName=andrivet.zx81-debugger)
- You can run it in your browser using my ZX81 Typescript Emulator.
The game uses the following keys:
- Q - Move left brother (Marius) up
- A - Move left brother (Marius) down
- P - Move right brother (Louis) up
- P - Move right brother (Louis) down
- J - Exit the game
- Install Visual Studio Code (Windows, Linux or macOS).
- Install the ZX81-Debugger extension in Visual Studio Code.
- Clone or download this repository.
- In Visual Studio Code, open the folder containing the files.
- Open the
factory2023.zx81
file (double-click on its name on the left) - Click on the Run and Debug icon in the Action bar (on the left)
- Click on the Run and Debug button to start debugging.
- FACTORY Copyright © 1984-2023 Sebastien Andrivet.
- ZX81-Debugger, Copyright © 2023 Sebastien Andrivet.
- Z80 Assembler in Typescript Library, Copyright © 2023 Sebastien Andrivet.
- DeZog, Copyright © Thomas Busse.
- Z80.js simulator Copyright © Molly Howell
- ZX81 ROM Copyright © 1981 Nine Tiles.
- FACTORY is licensed under GPLv3.
- ZX81-Debugger is licensed under GPLv3.
- Z80 Assembler in Typescript Library is licensed under GPLv3.
- DeZog is licensed under the MIT license.
- Z80.js simulator is licensed under the MIT license.