1-Pixel Pacman

I usually see retro-gaming projects using tiny screens with a fair number of pixels (64×64) but what I really like is the look of making every pixel count. With this in mind I built 1-Pixel Pac-Man, the classic coin-op experience but with characters that consist of just one pixel. Playing a throw-back like this wouldn’t be the same without some vintage controls so I picked up an Atari joystick, patched it into a microcontroller, and started coding. Check it out:

Smartmatrix Bundle

This piece of hardware made the project build really easy: the Smartmatrix. [Louis Beaudioin] developed the Smartmatrix and it’s been in the Hackaday Store for a while now. The display module itself is a commodity item that is used in LED billboards. There are shrouded headers on the back of the panels, to the left and right sides, which allow them to be daisy chained. The Smartmatrix PCB plugs into one of these shields, provides a soldering footprint for the Teensy 3.1 which drives the display, and gives you the wiring to connect screw terminals from the PCB to the power terminals on the module. Why the need for beefy power jumpers? At full white the thing can draw about 3.5A — don’t worry there’s a power supply included in the bundle.

Also integral to making this look good is the diffuser panel which is frosted acrylic. The Smartmatrix is designed to be housed in a shadowbox frame; it even includes a frame backer board with a cut-out for the Teensy 3.1 so it can be programmed without opening the thing up. I like looking at the guts so I’m leaving my free floating until I come up with an interesting way to mount everything as one unit.

Programming Pac-Man from the Ground Up

matrix-man-code

If you haven’t looked into it before, the ghost AI and gameplay details for Pac-Man are absolutely brilliant. [Toru Iwatani] did a masterful job with the original, and you should take a look at all of the analysis that has been done over the years. The best collection I could find was the Pac-Man Dossier and I based most of my code on the rules described there.

Basically the ghosts have two modes, chase and scatter. The modes set the enemy targets differently; to points at the four corners of the board in scatter, and to points relative to the player in chase. The relative part is key; only the red enemy actually chases you. Another one of them looks at the red enemy’s distance and angle, and targets the reflection of that vector. Really easy, really clever, and results in enemy behavior that’s believable. It isn’t just the enemy movement, little touches like a speed penalty (1/60 of a second) for each dot the player gobbles up means the enemies can catch up if you continuously eat, but you can escape by taking the path already-eaten.

Library, DMA, and Extra Hardware

The hardware and software running the Smartmatrix made the display portions of the project really simple. First off, the Teensy 3.1 is fast, running at 96MHz in this case. Second, it has Direct Memory Access (DMA) which [Louis] used in the Smartmatrix library. This means that driving the display takes almost no CPU time at all, leaving the rest for your own use. This example of a game is under-utilizing this power… it’s totally capable of full-motion video and calculating amazing visualizations on the fly.

The PCB hosting the Teensy 3.1 breaks out several pins to one side. I’m not sure what I’ll add in the future so I actually used the extra surface-mount IO pins on the bottom of the Teensy to connect the Atari joystick (which is simply a set of switches). The are enough pads for two joysticks so I used pin sockets to interface the Teensy to the PCB so that I can get to it again later.

The kit also includes an IR receiver and remote, and also a microSD card to loading animations (there’s an SD socket on the PCB). The bundle in the Hackaday Store is a kit you solder yourself, but [Louis’] company, Pixelmatix, has a Kickstarter running for fully-assembled versions that come with a black remote and sound-visualization hardware.

Future Improvements

The game is fully working, but there are a few key things that I really want to add. The Teensy 3.1 has a single DAC pin available. I’m fairly certain the original coin-op game had mono audio. It should be possible to reproduce the sound quite accurately with this board. That would really make the project pop.

There are also a bunch of touch-ups that need to happen. I’d like to add an animation when the player is eaten by an enemy, and a countdown before the level restarts. The score, shown in binary on the right column, should be scrolled out in decimal when the game ends, and what’s a coin-op recreation without a high-score screen?

Pac Man Clock

Pac-Man Clock Eats Time, Not Pellets

[Bob’s] Pac-Man clock is sure to appeal to the retro geek inside of us all. With a tiny display for the time, it’s clear that this project is more about the art piece than it is about keeping the time. Pac-Man periodically opens and closes his mouth at random intervals. The EL wire adds a nice glowing touch as well.

The project runs off of a Teensy 2.0. It’s a small and inexpensive microcontroller that’s compatible with Arduino. The Teensy uses an external real-time clock module to keep accurate time. It also connects to a seven segment display board via Serial. This kept the wiring simple and made the display easy to mount. The last major component is the servo. It’s just a standard servo, mounted to a customized 3D printed mounting bracket. When the servo rotates in one direction the mouth opens, and visa versa. The frame is also outlined with blue EL wire, giving that classic Pac-Man look a little something extra.

The physical clock itself is made almost entirely from wood. [Bob] is clearly a skilled wood worker as evidenced in the build video below. The Pac-Man and ghosts are all cut on a scroll saw, although [Bob] mentions that he would have 3D printed them if his printer was large enough. Many of the components are hot glued together. The electronics are also hot glued in place. This is often a convenient mounting solution because it’s relatively strong but only semi-permanent.

[Bob] mentions that he can’t have the EL wire and the servo running at the same time. If he tries this, the Teensy ends up “running haywire” after a few minutes. He’s looking for suggestions, so if you have one be sure to leave a comment. Continue reading “Pac-Man Clock Eats Time, Not Pellets”

The Pac-Man Bus Stop For Gamers At Heart

DSCF3537Combined

Waiting for the bus can be drag. You never know exactly when it will come, always looking down the road hoping to spot the vehicle as it turns a corner. When it doesn’t show up right away, the result is usually staring down at a ‘smart’ phone checking it for any incoming messages. Directing the attention up might produce a list of estimated arrival times and maybe even a map showing the routes that are taken throughout the day. But there is only one bus stop in the entire world, that we know of, where people can play Pac-Man while they watch for the bus to arrive.

It was created by the combining efforts of two maker communities in town. Norwegian Creations and Trondheim Makers teamed up to build an interactive gaming display that gave individuals the ability to pass the time by directing the famous video gaming character around a blue maze, eating yellow pellets and avoiding colorful ghosts along the way. This display was also made to raise awareness for the upcoming Trondheim Maker Faire that year. They choose Pac-Man as the foundation and integrated a slightly modified invention kit called Makey Makey with a Raspberry Pi running RetroPie into the actual frame of the bus stop. The people involved must have had some serious business connections in order to get approval for that. They figuratively hacked into the bus stop’s power grid gaining the necessary 230 volts required to energize the custom gaming unit. Once hooked up, anyone standing by could play Pac-Man until the bus came. [Ragnar] at Norwegian Creations told us in an email that future ideas of theirs include syncing up several stops that can communicate with each other, which could lead to some great multiplayer interactions. They also have a fantastic video that they uploaded that shows the building process of their current design. Check that out below, and let us know what other types of games you would like to see at a bus stop near you.

Continue reading “The Pac-Man Bus Stop For Gamers At Heart”

Modifying A CRT Television For Use As An Arcade Monitor

Finding himself in need of an arcade monitor [Eric Wright] turned to this ancient CRT television. The problem is that arcade monitors and televisions didn’t operate in the same way, differing in both resolution and refresh rate. [Eric] modified the television to work like an arcade monitor, but only with limited success. He’s hoping a few more alterations will lead him to a complete solution.

The image above shows him testing a Pac-Man machine on the altered Sharp television. Those familiar with the game will immediately notice that there is something wrong. We see most of the tracks upon which Pac-Man and the ghosts travel, but he maze itself is completely missing. To get to this point [Eric] consulted the television and arcade schematics to figure out how to connect the composite sync and three color channels directly to the arcade machine. This way the CRT timing is forced to conform to the game standard. The problem is that there is no way to adjust the drive and cutoff of the individual color channels. This is something [Eric] hopes to fix in the next iteration of his experiments.

If you already have a working arcade monitor but no gaming cabinet why not use a Raspberry Pi?

Continue reading “Modifying A CRT Television For Use As An Arcade Monitor”

DCPU-16 Running Pac-Man

If you’ve been trying to think of stuff you can do with the DCPU-16 this may inspire you to write a clone of  a classic game.

This version of Pac-Man was written using a sprite system with a 16 color pallette. It runs in an HTML-based emulator, so you can even monkey around with the assembly code to help you figure out how it works. But if you’re not into writing code that is this machine-close, you can just click the ‘run’ button and use your keyboard arrows to play through a level or two. You’ll notice there’s only one game board available so far and some things are still missing like that familiar waka-waka as he gobbles up the dots. Let us know if you mange to extend the features of this version.

In case you missed it, this emulator is running the DCPU-16 spec from Notch’s new game, 0x10c (. We have no idea how that’s going to shape up, but getting in on the game early will pay off it turns out to be as popular as Minecraft.

JTAG Dongle Pushes Code To FPGA After Bootup

This gnarly beast has near-magical qualities. [Sprite_TM] patched it together as a dongle which attaches to a JTAG header (we’re fairly certain this is not a standard footprint for that interface though). He uses it to push code to an FPGA after that device boots. Why? Well, there’s several reason, but the most generic answer is that some boards will not boot unless there is a chain of trust that validates the code which will be running.

In this case, [Sprite_TM] is using a knock-off board he acquired from a Chinese supplier. It’s a hardware network terminal (thin client), and as you can see in the video after the break, it works just fine. But that’s pretty boring and he wanted to use it for his own purposes. When he plugs in the dongle and powers up the board the network terminal is nowhere to be found, replaced with the code to play Pac-Man as if were a full arcade cabinet.

The dongle is simply a female DIL header, an ATtiny85, and a flash memory chip. The AVR has a software UART that speaks XSVF, the protocol used to push data to the FPGA. The data to be written is stored in the memory chip, and with that header in place reprogramming the AVR is just a matter of connecting an ISP programmer. Brilliant!

Continue reading “JTAG Dongle Pushes Code To FPGA After Bootup”

Musical [Blinky] Candy Tin

Since it’s the holidays and pine trees are being cut down and installed in living rooms all around the world, [Jarv] though it would be a good idea to make a musical Christmas ornament. He needed to keep some of his geek cred, so [Jarv] decided to build a musical [Blinky] ghost from Pacman.

A few weeks ago, [Jarv] sent in his musical greeting card that uses a minimal amount of parts to play a short 8-bit tune. His project was based around an ATtiny85 and sounded pretty good. For his [Blinky] ornament, [Jarv] used a similar circuit along with some old-school Pacman songs that sound great.

[Jarv] found a [Blinky] candy tin and after dispensing with all that pressed sugar began work on his build. In keeping with his greeting card, everything is very minimal. Just a speaker, ATtiny85, and button make up the build. Pressing the button cycles through three songs from Ms. Pacman. The result sounds uncannily like a vintage arcade game, so be sure to check out the video after the break.

Continue reading “Musical [Blinky] Candy Tin”