I'm a nerd with weird interests, I'll admit that. When I go to my local coffee shop, I'm excited about the coffee, I'm excited to chat with the owners, but I'm most excited about what random tech I'll find there. This particular coffee shop, the Flying Disc, also sells a number of other things within their walls. From local art to vintage records, there's a lot for sale aside from the caffeine and confections, but I'm always drawn to the same section: new and recycled electronics. I've powered e-bikes, built a couple of cyberdecks, and fixed game consoles all from the things that end up in this store, but on this particular winter day I was drawn to one Ms. Pac-Man Plug-N-Play sitting behind the glass.
My partner laughed when they saw me staring at this outdated piece of technology, saying they knew once I saw it I would buy it, but I was content as I told them they were right. The owner of the coffee shop asked if I was going to take it apart, but I was sure I was just going to enjoy using it as it was.
Figure 1: Ms. Pac-Man Plug-N-Play device
I get this beautiful piece of Pac-Man tech home and almost immediately plug it in. Even though it's 2022, I still have adapters for RCA, and to my surprise it works perfectly. Downside is, in 2022 Pac-Man holds more nostalgia for me than actual interest. I can't help myself and immediately open it up.
Inside the console is some fairly simple circuitry, spread across three circuit boards: one for the buttons, one for the joystick, and the main board that runs the game. What I found most interesting about this was the way the buttons and the joystick worked. Recently I had taken apart an old Nintendo Switch joystick, but this much older circuit was entirely different.
Figure 2: Ms. Pac-Man Joystick Circuit
As far as circuits go, it's pretty simple. All of the trace lines are completely visible, so I could follow each one and see where it went with relative ease. You can see in the image above of the joystick circuit that there are four silver colored circles at the top, bottom, left, and right. If you look closely at the middle of these circles, you'll notice that there are lines zig-zagging back and forth next to each other, but never touching. These zig-zagging lines connected to common ground on one side, and a data pin on the other side, and the same can be said for the button circuit board. Effectively, the A and B buttons and the joystick all work on the same principal, that of a simple button circuit. When the joystick or the buttons come down, a conductive silicone-based pad comes down to complete the circuit, and the data pin should read that it's dropped to ground when you test it.
Realizing that the circuit was so simple, I immediately thought about all the things I could do with such a device. The Plug-N-Play has a really nostalgia-inducing form factor, and the simple circuitry can be interfaced with just about anything from robotics projects to other video games.
Before turning this device into anything else, I wanted to ensure I didn't destroy the original circuitry. It's still working perfectly fine and Ms. Pac-Man deserves some respect. I started documenting all of the pinouts on the motherboard and carefully removed it from the controller board for the joystick that it was attached to. This went fairly quickly and easily, and I could then move on to playing around with the fun parts. Despite not doing much with the main game board now, I wanted to have the board functional and documented so I can use it in future projects.
Figure 3: Ms. Pac-Man main game circuit
After recovering the main game board and setting it aside, I started to focus on the controller boards. Since the circuits were really simple, I cleaned them up with some rubbing alcohol, removed all of the old wiring, and replaced it with stronger, solid core wire. Following this I put the boards back in place and tested out the continuity between the closed connections with a multimeter. This was fairly successful, so I could start working on a replacement motherboard circuit.
@codewonderland continued hacking of the Ms. Pac-Man plug-n-play #retrogaming #retrotech #techtok #circuitboard #cooltech #pacman ♬ original sound - Alice Easter
At this point, I had finished the easy half of the project, but I still needed to have a main board to listen for button input and do something with them. For this I used the Adafruit KB2040. I'm rather fond of Adafruit tech and CircuitPython, so I already had this board on hand and I knew it has been used for keyboards and macropads traditionally.
@codewonderland nice little prototype coming along with the plug n play #cooltech #techtok #circuitpython #engineering ♬ original sound - Alice Easter
Once the KB2040 was thrown on a breadboard and all the wires were connected, I spun up some simple code to change the neopixel on the board based on what input was used. I was a bit worried about this test not working, as the silicone-based pads that complete the button and joystick circuits don't work perfectly. The code worked like a charm though, so I suppose if the pads were good enough for the original game they are good enough for me.
By now, the joystick was mostly complete. I didn't want to make it overly specific since I want the controller to be versatile, so I just added in some simple keyboard input to be output from the device. Using the Adafruit HID Library for CircuitPython, I was able to replace the bit of the code that changed the color of the neopixel to sending simple keystrokes. The joystick sends 'UpArrow', 'DownArrow', 'LeftArrow', and 'RightArrow'; the buttons send 'A' and 'B'. This kind of layout doesn't work for a modern game console, but it will certainly work for emulated games on my computer, as well as all kinds of robotics projects, so I'm calling it a win here.
The finalized code for this project is available on GitHub, though it honestly isn't too complex. I differed from the standard that Adafruit puts out for macropads with the KB2040 though, so I thought I should throw it somewhere for others to reference. For now, I leave you with one more video of me playing with the joystick and attempting to film at the same time:
@codewonderland Got the joystick fully functional 😁 #techtok #fyp #pacman #videogames #hardwarehacking #engineering ♬ Pacman - Stepz & Fizzler