Home - TIL - Zines

Building a Slot Machine App for an 8-bit Computer

This is a DRAFT… I’m still working on it.

Cassette Audio Cable

I soldered up a cable for the machine. The CoCo existed when floppy drives were very expensive and hard drives were almost non-existent. Instead, it used an audio cassette tape to save data. I don’t have easy access to an audio cassette recorder, but I do have a modern digital audio recorder. I cut a 5-pin din cable and a mono audio cable and wired them together to allow me to save files to my digital audio recorder.

TRS-80 Audio Cable

media/trs80/trs-80-hello.wav

media/trs80/trs-80-save-to-digital.mp4

Compiling CAS2WAV for Linux

I compiled the popular CAS2WAV application under Linux.

Designing on Paper

I started designing the slot machine using modern tools, thinking they would make my life easier. Drawing pixel art is certainly nice on an iPad, but the applications I have were designed for drawing and once that part was done I needed to translate those images into computer code. That computer code, in turn was pretty large. In order to get the grapics down under 32K, I needed to use all the tricks I could think of to minify the size of the images. That meant counting pixels and referencing x,y coordinates. The moderns tools I have started to fall apart.

I also needed to convert back and forth between formats. I do a lot of my testing on an emulator. I do most of that on a Chromebook where I have JSMocha, which is an emulator running in the browser. That can load and save .CAS files but it can’t load a text file.

XROAR on the Mac can load text files, so I can test with that, but my Mac is a work computer. Because I’d like the slot machine graphic interface to have some mild nudity, I didn’t want to use my work computer to work on this project.

I did do some tests using XRoar and I found that saving and re-loading a text file took a ton of time. That’s because I would have to open the file, run CLOAD, and wait for it to load in after each test. Editing in the emulator directly, where I could run my changes instantly, was much faster.

Finally, when I move all this code from the emulator to the actual CoCo machine, I’m going to need audio files that I can load. The best way I could find to generate those audio files was to CSAVE the finished code on the emulator, convert that to a .wav file with CAS2WAV, and then CLOAD that into the CoCo from my digital audio recorder. That’s a complex set of processes that will probably take a few minutes, but I won’t have to do it very often. I won’t wait all the way until the end, but I’ll do it several times as I reach key milestones.

At this point I didn’t want to start over, but I did start to think about how I would have designed this type of application back in the 80’s. Most likely I would have used pencil and paper and the more I thought about it, the more it made sense to do it that way today.

Doing the work analog would probably help me keep better notes so that I can re-tell the tale too.


Do you have a question? I want to hear from you!

Ask Me Anything

JoelDare.com © Dare Companies Dotcom LLC

Terms - Privacy