As you may know, becoming an Autopian Member comes with a vast number of benefits, both to you personally and human society at large. Sure, there’s the joy of becoming instantly more desirable to all genders, the increased respect you get from your peers, the knowing glances from other Autopians you encounter at junkyards and opium dens, all of that is great, no question. But I hope you realize that, in addition to getting a hand-drawn car on your birthday (for Velour members and above), on subsequent birthdays you get a custom-generated car of your own produced via graphics hand-drawn by me and assembled, randomly, by a vintage 1982 Apple II computer. Last year, these cars were front views. This year, they’re much larger and more varied side views, and they’ve been challenging to make. Which is why I want to kvetch at you now! Because no one else wants to hear this!
Now, don’t get me wrong, I love this kind of challenge. It uses a very different part of my brain than I usually use at work, so it feels like a little break, and even the challenges that had been banging my head against ancient computer plastic this time were sort of fun. So, are you ready for some really, really obsolete geeky talk? If not, too bad! Because that’s about to happen!
Essentially, the goal here is to make randomized, fun-looking cars in big batches, with each one being unique. To do this, I make a lot of parts that are randomized and put together into a finished graphic by an Applesoft BASIC program. The computer I run this on has a special doohickie wired to its game port that can trigger a DSLR camera, so once the car is assembled from random graphic parts, a photo is taken of the screen. This way, the whole thing is made from vintage tech.
Now, there are a lot of challenges here. Making the graphic elements themselves is one, as it is pretty tedious, pixel-by-pixel work. For this last batch, I was making cars with four main sections:

This time, I wanted to step up my game and make bigger images, so I made side-view cars:

So, now instead of four sections, I have six. Each section has five different graphic options, and each of those options has four different color scheme options: two arrangements for two separate palettes. This means, let’s see, each cell can have, what, 20 different visual possibilities, so 20 possible options for six sections gives a potential combination number of, um, carry the two, I think over 27 million combinations? Is that right? It’s a lot.
Here’s a fun GIF of the program making a bunch of cars– this is from an emulator, so it doesn’t look as good as the actual thing looks on a real CRT, but you get the idea:

Just by the nature of the way this works, almost everything is a Harlequin-type of car, but I think that’s kind of fun. They’re all pretty bonkers. Here are a few more samples, shot right off the CRT connected to the real Apple II plus:

So, I’ve made more work for myself in the graphics-creation stage, which, again, is tedious, especially with the weird way Apple IIs handle color. But that’s not what tripped me up! What tripped me up was a deeply old-school problem: memory.
You see, an old Apple II uses a 6502 processor, and those CPUs can only address up to 64K at a time. I have some Apple IIs with 128K, but they have to bank-switch that memory, and, besides, when using BASIC, I only have access to 64K. Even worse, when you’re running BASIC, you don’t have access to the full 64K, because the computer needs memory to make things work. The Disk Operating System (DOS) has to get loaded into memory, the BASIC language itself and other ROM routines need to get loaded into main memory, there’s no separate video RAM so the graphics screens need to have memory space – by the time everything gets loaded in, there’s maybe, what 32K or less of free memory for the BASIC program and data like all those car part graphics I made!
Here, let’s look at a memory map of the Apple II:

So, the white areas are free space in memory I can potentially use. I need to keep hi-res page 1 open because that’s the graphics screen I’m drawing the cars on. My big issue is loading my car part shapes into memory: the set of 15 shapes for the top row (3 sections, 5 options for each – color changes are handled in code and don’t need to be stored separately) takes up over 16K of memory! The lower row takes up less, just under 8K, because they’re a good bit smaller (38×24 pixels instead of 38×38).
The issue is that I can’t load them both into memory at once. And loading the top row actually creeps into the area of memory for DOS! I would have liked to have loaded them into the memory area for the second hi-res graphics page (used for page-flipping animations and other stuff, it’s nice to have), but for some reason I could never get that to work.
After banging my head against a metaphorical memory wall, I realized I would have to draw the top row, access the disk to load in the bottom row, draw that, generate the randomized car name, take the picture, and then clear memory and load in the top row again.
This is much slower than before, when I was able to load all the shapes into RAM and not touch the disk at all once it started making random cars. Now the disk gets accessed twice per car, and it’s not super quick. It’ll be fine, I can still set it up and walk away, but I am wondering how these 40-year-old salvaged floppy disks will hold up under all this use! I’d better make some backup copies.
I’m pretty certain this is vastly more than you ever wanted to know about this, but I just had to tell somebody about all the work that had to go into making this all happen, work that, hopefully, will never have to be seen, really, if all goes well.
Oh! There is one more thing! There’s a glitch that happens every now and then where the middle section of the bottom gets repeated:

I don’t know why it does this: sometimes I get two, sometimes three lower middle bits, which ends up making these pickup truck-like vehicles. I kinda like it, so I think I’ll just leave it, and if you happen to get one of the glitch trucks for your birthday car, I say consider it good luck.





Actually pretty interesting read even for one not at all well versed in things computer.
“What tripped me up was a deeply old-school problem: memory.”
You’re in good company: NASA had to deal with the limited amount of memory available to use at any time with their ferrite-core-based (at least as I’m given to understand) computer systems where the astronauts had among their numerous duties the tasks of periodically swapping out memory banks at various times during each space flight from the Apollo program (and earlier) up to and including the Space Shuttles into the 1980s and even the 1990s (not sure about the last decade of operation, though; the last flight was in 2011, some 15 years ago!!)
If you’re using the 3.5″ floppy discs I probably have a bunch of new ones I could send you…..left over from days gone by…..
Gonna have to find some 5.25″ floppies, I think. Or maybe a tape drive.
Yeah this is a 5.25 disk only situation.
Pretty sure that only the Apple IIgs supported the 3.5″ floppies.
Speaking of which, maybe Torch should upgrade to a IIgs. Its graphics capabilities are better than the Apple II plus he currently uses.
You can probably make it even slower by saving to and recalling it from a piece of salami instead of the disk.
T shirts, how difficult could that be?
I just took a Byte off my Big Mac while reading this. If the Bits that have fallen onto my keyboard get stuck in the keys, I’ll just have to add more Memory so that I don’t repeat that mistake.
I think you need some crude data compression for the graphics, for example run length encoding
Well Torch, time to write your own kernel to reduce memory usage. You can call it OStopian!
I’ve got an old laptop I can load OStopian on for testing!!!
The reverse Tyrrell P34 axle setup on some of these is dope. I heartily congratulate you on how awesome these are and how well your program seems to work in spite/because of the ancient constraints.
The extent of my Basic memory
10 CLS
20 Print “HELLO EVERYONE”
30 goto 10
I would’ve done GOTO 20 and repeated HELLO EVERYONE infinitely, or until the power went out.
But if I goto 10, it makes it look like the words are blinking 🙂
Epileptic seizures for everyone!