Grubby Brings Sonic the Hedgehog 2 to the TI-84+ CE Calculator — Thanks to the Zilog eZ80 CPU

As Zilog finally discontinues the original Z80 CPU, this unusual game porting project shows how the eZ80 can be used in its place.

Gareth Halfacree
3 months agoRetro Tech / Games

Pseudonymous programmer and vintage gaming enthusiast "Grubby" has taken something written for the classic Zilog Z80 CPU and brought it to a device running on the modern eZ80 equivalent — meaning you can now play the Sega Master System version of Sonic the Hedgehog 2 on your Texas Instruments TI-84+ CE graphing calculator.

"It all started in fall of 2022, when I was watching This Does Not Compute's video on the history of graphing calculator gaming. Around the five-minute mark, he offhandedly mentions the kind of processors TI's graphing calculator line uses. Most of them use the [Zilog] Z80, the 89 and 92 use the [Motorola] M68K, and the Nspire line uses an Arm-based processor. That really piqued my interest, since I already knew the processors that Sega's retro game consoles used: the Z80 for the Master System, and the M68K for the Genesis. The calcs have a grayscale screen, but I wanted to know if anyone ever tried porting a Sonic game from the consoles to one of the calcs."

Despite using, effectively, the same CPUs, the answer turned out to be a surprising no: nobody had yet ported an original Sonic the Hedgehog game to a Texas Instruments calculator, though the Arm-base Nspire line could play them through fully-fledged console emulation. "That made me wonder if I was capable of porting an existing Sonic disassembly to a TI graphing calculator," Grubby notes — and this time, the answer turned out to be yes.

Grubby picked the eight-bit version of Sega's Sonic the Hedgehog 2, originally made for the Master System console, as the game to port, and the TI-84+ CE as the device to which it would be ported. Inside this calculator is an eZ80 core, a modernized variant of the Zilog Z80 CPU that drove the original Master System — only 24-bit rather than eight-bit.

Using a disassembled version of Sonic 2, Grubby was able to make the necessary changes to accommodate the shift to a while new hardware platform — including adapting the control system for the calculator's keys, bringing the Master System's six-bit 32-active-color palette to the system, recreate the original cartridge's mapper using the calculator's operating system to simulate ROM banking, and deleting anything to do with sound as the calculator lacks a speaker.

With a new custom renderer in place, the game runs on the calculator with, admittedly, a somewhat variable framerate depending on exactly what's happening on-screen. The project also serves to demonstrate the compatibility between the original Z80 and the eZ80, which comes following Zilog's announcement that it was to discontinue production of the standalone Z80 and later Z180 processors — but leave the eZ80 alone, undoubtedly to TI's relief.

The full project write-up is available on Grubby's blog, while the project source code and a downloadable binary can be found on GitHub under an unspecified license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles