KevinGisi.com Whatever is here is here

Some Hardware Alternatives

I’m at a bit of a roadblock moving forward with the emulator project while I wait for hardware to arrive. But it hasn’t stopped me doing some thinking about the right path forward.

We’ve demonstrated we can launch a specific ROM via a Python script, and that we can power it off and on, reset, etc. Wiring up those GPIO pins should be reasonably straightforward. But the remaining gap is around how we can read an identifier off a physical cartridge.

Standard SNES cartridges have contact points at the bottom which slide into an appropriate socket in the SNES. The contact points where electrical signal passes through are electroplated hard gold, which can handle the abrasion of frequent insertion and removal. This is, however, a rather expensive process. Some PCB prototype manufacturers don’t even offer hard gold plating - though many do provide electroless nickel immersion gold, which operates in a similar way but can’t stand up to frequent wear and tear. If we were looking to mate two circuit boards together permanently, only decoupling them for maintenance, ENIG would work just fine. A quick quote for hard gold plating though (such as on PCBgogo) sees an initial price of around $250, for a mere 5 boards. We could get 100 boards for $284, so it’s mostly the overhead of the process itself; we could manage more at scale.

So I got to thinking about alternatives for how we might encode some data. For context, here’s the interior of a SNES cartridge.

Push-Button Array

Let’s assume we were 3d printing the circuit board. We could leave notches in the mating surface, and then use push buttons to measure where the notches are. Each board would have to be printed with a unique pattern, but in theory we could get a number of bits equal to the size of the buttons. There were less than a thousand SNES games released into the US market, so we’d need at-most 11 buttons. One button to detect the presence of a cartridge, and 10 buttons to uniquely identify a game (2^10 being 1024).

However, the springs of the buttons would exert at least some upward force, and presumably over time they would start to wear down. Probably better is if we were able to avoid mechanical contact at all.

IR Break Beam

Thinking about my son’s toys, there are a a few that use cutouts in paper to actually signal the device what it ought to do (I’m sure there’s a term-of-art for this “each card, cartridge, whatever has a pattern that sends a pattern to switches” idea, but thus far Google hasn’t helped me). Much like the Hollerith punch cards that our ancestors used to program their Macbooks.

So okay, what about using interposition. The presence or absence of a hole signifies the bit. Looking at how that used to be measured, there’s a mechanical process that used brushes to complete a circuit through the hole — that seems prohibitively complex — but there’s also mention of photoelectric sensors. We can detect whether an infrared beam is interrupted! This has potential, but we’ll need to verify a few things:

  • How many IR beams could we fit next to each other?

  • How worried do we have to be about light spillage effects? It’s possible if the holes are small enough that the light will be very directional - especially at close range. But we’d need to be absolutely sure that one LED isn’t going to trigger the receiver for its neighbor. And it’s likely to be hard to test this fully without building the thing - we need to worry about reflection too. Imagine 1111101111. Are we positive that the ambient light from the 9 other LEDs isn’t gonna make its way to that one remaining detector?

  • Again, we’re still talking about custom cartridge inserts. No additional wear and tear, but it’s additional work all the same.

RFC chips

Lastly, there’s another “spooky action at a distance” option: near-field communication. If we can smack a sticker inside a cartridge, and mount an NFC reader near enough to reliably identify it, we’re done. NFC stickers can be written to with a phone, and we can use the existing (unused) SNES cartridge receiver without any modifications. The entire thing would be merely a physical housing for an NFC sticker. If we can get the distance right, this is undoubtedly the easiest and cheapest path forward.

Next Steps

Waiting on the RPi4, breadboard kit, NFC stickers, NFC reader, IR Break Beam sensor, and some EEPROMs to be delivered, some subset of which should arrive tomorrow. So we’ll start playing around then!