MExp: Context
2024-02-02
I recently released MExp, a calculator remake of A Monster's Expedition by Draknek & Friends. This is the first of a series of articles on interesting technical aspects of the game.
In this article, I will discuss the context of MExp, including why I made it, and details on MExp's technical medium.
Motivations
I first thought to make MExp in November of 2021. I wondered, would it be possible to recreate A Monster's Expedition on an old TI-84 calculator, despite the calculator's limited resources?
After a few hours of sketching and designing (some of which is shown in Figure 1), I decided that MExp was likely possible, and started to work on it.
Why remake an existing game in a more limited medium?
- To sate my curiosity! I wanted to know if MExp was possible, so I implemented it.
- Working in a limited medium presents fun technical challenges. You must design carefully around the system's capabilities!
- If you're lucky, then like MExp, implementation differences may allow you to design wholly unique gameplay experiences. Your remake can become a reimagining!
I'm not sure if I would have started MExp if I had known that it would stay with me for the next two years. But I'm glad that I did.
The Calculator
MExp runs on TI-83 series graphing calculators, including the TI-83+, TI-83+SE, TI-84+, and TI-84+ Silver Edition calculators. Texas Instruments released these calculators in the late 1990s and early 2000s. Figure 2 shows a TI-83+, as an example of what these calculators look like.
Though the specifics vary by calculator, MExp runs on limited resources. MExp is designed to run on a 6MHz Zilog Z80 microprocessor, with less than 32 kilobytes of RAM, and less than 32 kilobytes of flash ROM. These tight processing and memory limitations demand thoughtful optimizations in how MExp stores and works with data.
My Development Setup
I developed MExp on the TI-84+, pictured in Figure 3!
Though that isn't quite correct. I developed on the TilEm emulator, using a ROM dumped from my calculator. This works better for two reasons:
- TilEm lets the user save and load the state of the calculator, which is excellent for recreating bugs and testing code.
- Although clicking calculator buttons is slower in the emulator than real life, TilEm lets the user create keyboard shortcuts and macros, which greatly speeds up typing in code. You can find my keybindings file here: keybindings.ini. Look at the
[ti84p]
section to see the keybindings I added to the default file.- I would generally type out my programs in Vim with thorough commenting, and then later transcribe them on the calculator without comments.
I often sent MExp to my physical calculator throughout development to ensure compatibility. I used TiLP for the transfers.
The Language
By default, the TI-83 series calculators come with two main programming languages:
- TI-83 BASIC, which is the "default" language you get when you make a program through the
PRGM
menu.- Easier to code in, but fairly slow.
- Z80 Assembly, which you can execute with the
Asm
command.- Much faster, but harder to code in.
For MExp, I use a third option: Axe Parser! Axe was made in 2010 by Kevin Horowitz. The Axe Parser compiler compiles Axe, a BASIC-like language, down to Z80 assembly. This offers a desirable compromise. Axe programs have a speed comparable to assembly while being much easier to code.
Conveniently, Axe also includes many useful game development routines, like functions for drawing 8x8 sprites.
Conclusion
Thus concludes the context for why I made MExp, and a high-level description of the technology behind it! I plan to create more articles, discussing specific technical aspects of MExp's code.
Resources
- History of TI-83 series calculators: http://tibasicdev.wikidot.com/thecalcs
- Axe Parser: https://www.ticalc.org/archives/files/fileinfo/456/45659.html