I was looking to build a Z Machine to play Zork and similar games using an Arduino-like microcontroller. What I found was one of the smallest ones around: the Adafruit ItsyBitsy M4 Express. This device measures only 1.4″ by.7″ (35.9mm x 17.8mm) and can fit in the palm of your hand.
This project does not require any building or soldering, but you will need to compile the program using the Arduino IDE and copy the story files to the device.
A more extensive description of the project is available on my blog site, but here is a quick start guide:
In addition to code from the GitHub library for the A2Z Machine at https://github.com/ZContent/A2Z_Machine, you will also need the following libraries installed:
- Adafruit SPIFlash Library - https://github.com/adafruit/Adafruit_SPIFlash
- Adafruit QSPI Library - https://github.com/adafruit/Adafruit_QSPI
- mcurses Library - https://github.com/ChrisMicro/mcurses
You may find the article "Introducing Adafruit ItsyBitsy M4" helpful when setting up the ItsyBitsy with the Arduino IDE.
You will need to have Circuit Python installed on the ItsyBitsy to manage the filesystem, which gets removed when sketches are uploaded to the device. Circuit Python can be reinstalled by copying a Circuit Python boot image for the ItsyBitsy M4, instructions can be found here:
https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython
The filesystem is used to store the game files and saved games. Create 2 folders from the root folder of the device:
- "stories"
- "saves"
Copy the game files from the games folder in the library to the stories folder on the device.
Create a sketch called "a2z_machine" and copy the project files into the folder. Compile and upload the sketch to the ItsyBitsy.
Use a terminal emulator to play the game (i.e. PuTTY for Windows). BAUD rate should be set to 9600, no local echo.
Comments