Close

Cartridge ROM Chip Selection

A project log for PiCarts: GPIO ROM Carts

Loading from ROM cartridges plugged into the GPIO port. Just like the old days.

dustinDustin 12/07/2020 at 17:210 Comments

A Good Start to the Day

While researching what type of memory to use for the cartridges, I came across a nice article on Hackaday: Game Cartridges and the Technology to Make Them Last Forever. This really got me thinking about the old game cartridges, and just how reliable they really are. It seems that as memory density increases, lifespan decreases. With that in mind, I'm glad I've chosen regular old PROM chips, like this 512Kbit EPROM, for the smaller capacity carts. That one can be erased and reprogrammed with UV light, which means the average user couldn't lose their game data without tampering with the cart. Here's another that is a one time write only: 4Mbit PROM. That 4Mbit PROM is the same price as the 512K, far larger, and should be perfect for production. 512K is far more than the original C64 carts could hold, but bank switching allows them to be used on nearly any system. Modern systems, like the Pi can address more than that. For the 4Mbit EPROM, I'm looking at the SPI interface on the Pi, due to it's possible speed of 8Mbits/s or higher. A game filling the entire 4Mbit chip could be loaded in half a second. Nearly instant as far as humans are concerned. This is the level of performance I'm hoping to get to replicate the old days of loading games instantly. I could do with far slower speeds, but do plan to eventually make far larger cartridges, so the faster load time is better. Looking at the available interfaces on the GPIO, I think SPI is the way to go for this project. The main reason for this, is that SPI seems to offer the fastest interface on the GPIO pins, as well as being very easy to work with. I have no experience with UART and very little with I2C, so SPI it is. I just need to make this decision quickly so I can start putting together a hardware list to get some test equipment made. It would be possible to connect many SPI EPROM chips together, eaither using chip select lines, or daisy chaining the chips together. This should allow me to expand the amount of memory in the cartridge almost infinitely, in the case of the daisy chain method. The first chip I've looked at is this 4Mbit SPI EPROM. It runs at 10Mhz, and has a 40 year data retention. 40 years is good, but 200 is better. I searched again and found a far better performing EPROM. This one from Microchip. SPI interface, 50ns access time, 1MBit capacity, 200 year data retention, can be hand soldered if needed, and looks to meet all electrical specifications to work with the Pi. It may need some supporting hardware, but that would be easy enough to add to the cartridge PCB anyway. When I get some extra money for this project, I'll order a few of these and the hardware to make them work and start working with them on the Pi 4 in my camcorder project. I really think these simple SPI EPROM chips are the way to go for this project. As much as I like the huge capacities of modern flash memory, the data retention isn't nearly as good as some of the simpler, lower capacity technologies. If I had my way(read funding), I'd just order custom masked ROM chips for each run of carts. That's too expensive for me right now, and a 200 year data retention rating is good enough for me. Besides, communicating directly with a ROM chip over SPI on the GPIO pins just feels more hacker-like to me than implementing SDIO or USB over GPIO somehow. Simple is better. The limited ROM capacity will also force developers to get creative with their code, which is something I really appreciate. Maybe I will gang up a ton of these, or make a special high capacity cart later for those huge and epic games people like to make. My favorite Linux game these days is Owlboy, and that comes in at 390MB or so on my Linux laptop. The easiest thing to do here would be to make a cart that has an SD card slot inside and just write the game to that and write protect it. Most people would never know, but I would. Not an ideal solution due to added cost of components and such, and I wouldn't feel too great about people paying for an SD card to GPIO adapter, but it would certainly work. I worry about data retention rates of SD cards, especially micro SD cards, but it appears that the memory only accumulates damage when written to. If written to once and locked, it might last a very long time. 

On a side note: Mouser's website is really making me mad. I try to apply filters and it just takes me to their general electronics page. Doesn't do it every time. Just most of the time. It's made searching their site almost unbearable. It's taken me far longer than it should have...

So far, I've narrowed it down to the two cartridge options: Low capacity, and high capacity.

Low Capacity:

1Mbit SPI EPROM, banked together to make various capacity carts in the few MB range. Perfect for retro style and small games. Not very fast read speeds, but should be fine for games of very small sizes. Will require some supporting hardware, but is very simple to work with and very reliable. Should hold code for up to 200 years as long as it isn't abused. I worry that people will buy these carts and they'd lose their data in the person's lifetime, and this chip should prevent that. I also just really want to play around with making large arrays of these and have a really nice looking board full of ROM chips like the old days. Smaller, but still many beautiful chips on a board.  The chip above is a 20Mhz clock max, which is double some of the 4Mbit chips I've looked at. Using a real world example game, Jupiter Lander for the Vic-20, the ROM comes out at 8.2Kbytes, or 65.6Kbits. That's quite small, and could easily fit on the chip I've chosen here. For emulators, these chips should be perfect. The largest NES ROM image I have seen floating around is Kirby's Adventure at 6Mbits. That would require 2 of the 4Mbit chips connected together. I could use a 4Mbit and a 2Mbit chained together, but that might require ordering more than one type of chip, which just adds complexity. That does increase the price of the cartridge, and I have to find a way to split the file neatly between two chips. An interesting problem, but one I'm sure can be solved with some clever code.

High Capacity:

There isn't too much to say here, aside from restating that I plan to use the SDIO interface on the Pi to read SD cards mounted to the cart. I might be able to spice up the boring SD cart with extra hardware somehow and have it do fun things. Perhaps a camera flash bulb that blinds you every time you die or screw up in a game? Or just adding speakers and lights to make a cart more annoying or more fun. Higher capacity carts would cost far more to produce, as the SD cards and their slots are more expensive than the SPI memory chips. Having multiple gigbytes to work with would be nice though, and open up proper gigantic adventure games on the Pi. 

The Ridiculous Cart

Anything above 1MB in size seems to be getting closer to the not-so-practical range. Although, the 48Mbit Tales of Phantasia for the SNES would make a very fun special edition cart. I imagine a see through case, with a PCB populated with 8 4Mbit chips. That would run at 10Mhz, but a cart with 48 1Mbit chips at 20Mhz would be far more impressive. It might even require a double stacked PCB. It would cost me $19.52USD just for the 8 4Mbit chips, or $135.84USD for 48 1Mbit chips. Programming for that 48 chip ROM array might be quite difficult and the performance might be terrible. It would be a very fun project, and something I'd probably make for myself for fun. Finishing that would force me to master these little SPI chips, and would be an awesome little collectible to have. $20 is reasonable for a special edition cart with all kinds of goodies and a classic game, I suppose, but the markup, packaging, and other goodies would probably push it above the $50 mark. $135 just in memory ICs is ridiculous, and the entire cart would probably end up costing a consumer over $200 if it were ever made available. I doubt many people would want one, unless the Pi took off as a serious retro console and the games started to become collectible. It would have to be a very limited release, and I still don't think I could ever justfy making more than one for myself. A fun concept to toy with, but not a viable product. That's most of the fun of it though.

Test Games:

Single chip: Jupiter Lander for Commodore Vic-20: 0.0656Mbits

Multi-chip low capacity: Kirby's adventure for Nintendo Entertainment System: 6Mbits

Multi-chip high capacity: Tales of Phantasia for SNES: 48Mbits

High Capacity: SuperTuxKart for Linux: ~1GB

Final Thoughts

The three games listed above should provide some good, fun test games for the cart design process. I picked games I would actually play so I don't die of boredom during testing. Jupiter lander is the first game I ever played on a Commodore, jsut yesterday. My cousin and I loved it. Kirby's adventure is a game I've played before, and should force me to learn how to expand the memory bank. SuperTuxKart is one of the very few native linux games I've seen that I enjoy playing and is open source and such.

As much as people say cartridges are dead and everything is going to mass storage, I think there's a place for it still. The carts are perfect for kids and long term storage. People put their heart and soul into games, and to have it stored on a medium that could last over 200 years would be far more satisfying than it only ever existing on server and the fragile hard drives of consumer systems. There's a very satisfying simplicity in ROM storage and it makes me very happy to have physical objects to work with and collect. From a technical standpoint, this entire project is obsolete and pointless. That won't stop me and other people from enjoying cartridge games and other older formats. 

Development Hardware

The first hardware I will get is going to be the 40 pin connector for the GPIO, a handful of the SPI ROM chips, some SD cards, and some SD card slots. That should let me start testing out the hardware and developing the carts. I'm highly considering making a special development cart for myself that uses one of the UV EPROM chips so I can make a UV erasing machine. I've always been fascinated by that type of memory and want to play with one. Perhaps I'll make it a special cart with a glass window over the EPROM chip, with a little door or cover for erasing. Once I get some hardware in, I'll make up a test rig to determine actual throughput of the memory chips and start to come up with game load time figures. 

I'm still very excited about this project as I have wanted to make my own game console for a very long time. It's starting to fall into place at last.

Discussions