Weird games I made on my calculator as a kid.

2024-03-18

Let's go back to middle school. We barely had flip phones at this point-- and they were absolutely not allowed in the classroom.

But graphing calculators?

ti84

For some kids, this was better than a GameBoy. A whole world of coding creativity, which goes deeper than you might think.

This post is just a humble recollection of my own personal experience as your local classroom game developer with the awesome TI-84 calculator.

The BASICs

I think most people messed around with BASIC programs on this thing, at least to write funny messages to your friends.

Also used it to help out in physics class.

only for homework i swear

find prime

These are kind of boring. Rod pivot frictionless? Yeah right, buddy.

Luckily, we have a whole mountain of weird programs I wrote to sift through.

mountain of trash

I wanted to make games. And I quickly learned that BASIC was just too slow for that. I remember discovering that it would run "1 line per screen refresh".

If you think this is a weird limitation, your intuition is correct-- it is completely artificial. If I had to guess, TI hacked in this speed limiter so that graphs would render interactively or something, or maybe it was actually just that slow.

slow basic 0

slow basic 1

These are two cool projects made by other people in the "calculator coding community". They are awesome, but they sure render slow. BASIC was just like that.

Naturally, this means-- for anything fast/interactive like a platformer game-- BASIC was off limits. But fast, interactive games were the most popular/fun, so I tried building one anyway.

Shipping classroom hits

Have you heard of SFCave? It's an old-- hideously old, 1995 old-- Java applet. It was the original Flappy Bird.

sfcave

SFCave was super popular, and has been ported every which way. There's even a port on iOS that survives to this day. It even has a 3D mode. Wow.

Lurking on the SFCave site was another game that was absolutely popular in computer class. Snake Jump!

What better game to bring to my friends in geometry class? Naturally, this was the first game I wanted to make, so I did.

I tried and failed in BASIC once. BASIC was just too slow, so I swapped to Z80 assembly.

ASM was much faster. And there were actually a ton of resources online-- lots of forum posts demonstrating graphics tricks, how to render sprites quickly, stuff like that. It was a super cozy, federated corner of the internet that you just don't see nowadays.

I think most of it is long gone, but Omnimaga survives. The holy grail for calculator developer resources.

omnimaga

I caught the tailwinds of this community and I'm really glad I did. I don't think there's anything comparable on the modern internet.

Anyway, Snake Jump was a classroom phenomenon.

Smooth, realtime games were just not a thing on calculators, at least at my school. Of course, in other corners of the internet, people were doing far more mindblowing things. I was just working on my humble snake jump.

However, I was really struggling to write Z80 ASM. It really wasn't 14-year old friendly, it was hard.

The Axe thing

After Snake Jump, I wanted to build something even better. Assembly was hard, and I wanted something higher level like C. For whatever reason, I never really saw anybody using C. Not sure, but maybe even C was too high level for the calculator, though somehow I doubt it.

And then I found Axe.

axe splash screen

Axe is awesome. It looks like BASIC, even though it is not much higher level than Assembly, but hey-- at least I can name my variables in the source code. It has high level constructs like variables (not registers), dereferencing operators, and for/while loops. It even comes bundled with a standard library full of graphics rendering subroutines.

Some genius on Omnimaga even figured out that you can do 2-bit grayscale on the 1-bit screen by flickering pixels at 60hz. Even better, there were sprite editors you could use on-device that supported exporting a standardized 2-bit image format.

You might notice the logo at the beginning-- sircmpwn aka Drew DeVault. There were a lot of cool people hacking on calculators.

So, with Snake Jump under my belt, I started working on my next great hit. At the time, I was obsessed with Mega Man. One of my projects at home was a really shitty multiplayer Mega Man clone-- I want to write about that some time too.

Not Mega Man don't DMCA

To make a platformer, you need a level editor. So that's where I started.

I knew I wrote this thing, but after sifting through all the weird programs on my calculator, I just couldn't find it.

It was tedious work. Resolving linker errors in each project (Axe supported libraries, very cool) as I farted around the calculator UI to compile/run every project individually with the clunky buttons. The thing kept crashing, but luckily I had dumped the ROM and was using an emulator at this point.

But I did find it.

This was it for sure.

It supported a bunch of cool tile types, and you could scroll the viewport around too. It was everything an insane person would want to make a platformer game on a calculator.

Here's a flythrough of a level I made real quick while writing this.

But what about the game itself? A real platformer would require smooth scrolling. You may not realize this, but smooth scrolling is actually a pretty demanding effect to achieve on a computer-- at least for the geriatric 15 MHz Zilog Z80 in this calculator.

Luckily, John Carmack was my childhood hero, and I learned about the technique used in Commander Keen from reading internet developer lore.

adaptive tile refresh

I won't go into the details on the scrolling technique, but Fabian Sanglard has a really cool post talking about the technical details. Screenshot above from that.

The technique is called "adaptive tile refresh". In the most general sense possible, you basically shift the background's pixels by abusing hardware quirks (instead of redrawing the entire background when it moves, which is the typical approach). Then, you re-render the missing bits on the edges, and fix any dirty areas caused by dynamic objects moving.

This minimizes the cost of scrolling the background on the CPU, which is necessary for the TI-84's humble 15 MHz processor. There were a few examples of this technique on the Omnimaga forums, and I was able to implement it into my engine.

With that, smooth as butter 60hz scrolling for my game. You can even shoot. And look how darn cute he is.

That's basically where I left it, though. I never implemented enemies, or lots of other gameplay elements. I distinctly remember adding the black bars on the side to hide artifacts from the adaptive tile refresh algorithm.

Code review

I sucked at coding when I was a kid, but I made it work out of love for the game. The source was a 14 year old's fever dream and I couldn't handle it. Check out these candid snippets.

mega_source_1

mega_source_2

An entire screen height of only conditional End statements, on the tiny TI-84 screen. That's what I was working with.

At least I left helpful comments like SPIKE IS 3. To be honest, that one actually is helpful.

mega_source_3

mega_source_4

On the technical side, notice those lines like {Str0+3}-- in Axe, {} is the dereference operator. Str0 is a pointer and 3 is an offset to a field. I don't think Axe had structs. Or at least I didn't know about 'em.

If you're wondering why the name of the pointer was Str0, it's because typing was so slow on the calculator that I preferred to use the built-in symbols when possible. Don't worry, I kept track of what they were in my notebook.

Anyway, Mega Man portable was a failure. My kid brain couldn't handle the complexity of the project on my calculator alone, even with Axe. Never made any enemies or proper levels, but it was fun to make.

What I learned

I learned a ton about low level programming while writing those games. This was my first exposure to any assembly code, and it was pretty early.

I've always had a soft spot for this kind of coding, and I super envy boomers who grew up with a Commodore 64. This odd life experience feels like the closest I'll ever get.

Goodbye forever

I have a few other games and gizmos on this calculator, but it's time for the TI-84 to take a break.

This blog post finally let me put my TI-84 to rest. No longer will I have to pray that the ROM doesn't crap out and lose all my nostalgia. It's finally dumped and secured in a backup.

buddy

Rest in peace, buddy. And thanks for teaching me a thing or two 🙂