Reading An N64 Controller With A Microcontroller

We’ve seen NES, SNES, Sega, and just about every weird controller Atari put out connected to microcontrollers, but connecting the N64 controller to a project has remained one of those seldom-seen, rarely copied endeavors, not often tackled by makers around the globe. [Pieter-Jan] decided to throw his hat in the ring and give reading an N64 controller with a PIC a try, and we’re pleased to report he’s been completely successful.

One of the difficulties of reading an N64 controller is simply the speeds involved; with only three pins on the controller port, the N64 controller uses a serial protocol to send 32 bits of controller data at a fairly fast rate. Armed with a PIC18F ‘micro, [Pieter] realized that programming in C would be too slow, he needed to go all the way down to the bare metal and program his micro in assembly.

Every time the N64 controller data needs to be read, the console sends out a 9-bit polling request. The controller responds in turn with a 32-bit sequence informing the console of the status of all the buttons and joysticks. Once [Pieter] got his micro sending the correct polling response, it was only an issue of parsing the data returned from the controller.

Right now, [Pieter] has a small demo board rigged up that flashes a LED whenever the A, B, or Z buttons are pressed. This can be expanded to the remaining buttons and joystick, but for now we’ll just enjoy [Pieter]’s demo after the break.

Continue reading “Reading An N64 Controller With A Microcontroller”

Emulators 101: How To Write A Program That Functions Like An NES CPU

We’d bet everyone reading this article has played a game on an emulator at some time or another. And you may have a base idea of how those emulators work. But we’d wager the vast majority of you are clueless about the actual implementation of game emulators (we know we are). But that has all changed after seeing this demonstration of how [Bisqwit] wrote his own NES emulator. The description doesn’t cover anything more than the basics of writing code that emulates the NES CPU hardware itself. But it’s presented in such a way that makes it quite easy to understand for anyone who has a basic knowledge of programming. He starts with a switch statement for handling the processor’s opcodes and then moves through piece by piece showing how he refined his code to make it work while keeping it readable. We think this is a great teaching method and appreciate the time he put into producing this tutorial.

The explanation starts about 4:22 into the video which is embedded after the break. You’ll also find the first two demo videos there. Those involve mostly fast-motion text editing of the emulator coding process with some gameplay tests at the end of the second video.

Continue reading “Emulators 101: How To Write A Program That Functions Like An NES CPU”

Nintendo Light Gun Retrofit Lets It Play Color-based Games

This Nintendo light gun, aka Zapper, looks like a stock device. But a peek inside shows that the circuit board has been replaced. [CNLohr] added USB functionality and a few extra sensors that let him write his own games for that use the classic controller.

After cracking open the case he measured the shape of the circuit board so that he could recreate it exactly. This let him design his own board that would drop right into the same plastic support pieces as the original. His circuit uses an ATmega8u2 to provide a USB connection and read the attached sensors. One interesting aspect is the group of four long traces that act as an expandable i2c bus. [CNLohr] went with this so that he could use daughter boards to add in sensors later. In the demonstration seen after the video he’s using a photodiode as a color sensor. It allowed him to write the color-based game seen above where you shoot a different color of target in each round.

Continue reading “Nintendo Light Gun Retrofit Lets It Play Color-based Games”

Adding Famicom Audio Channles To An NES Without Messing Up The Console

[Callan Brown] wrote in to show us a really interesting NES audio hack. [Callen] decided that he wanted the full Castlevania III audio experience, which (without modifications) can only be had through the original Japanese Famicom console. [Callen] weighed a few adapter options, and instead decided to come up with his own.

The issue is that the Japanese Famicom and the American NES actually have a different cartridge connector. The change in hardware from a 60 pin to a 72 pin connector added “features” like the 10 pins connected directly to the expansion port (used for stuff like the teleplay modem, who knew). The other two additional pins are used by the annoying 10NES lockout chip. While they were at it, Nintendo decided to route the audio path through the expansion connector instead of the cartridge.

This means that the Japanese cartridges can’t pipe sound to the NES audio channel with just a pin adapter. Good news though, after sourcing a pin adapter hidden inside certain NES games (Stack Up, Gyromite), audio can easily just be pulled from the adapter PCB. This requires the more expensive Famicom Castlevania III cartridge (Akumajou Densetsu). To cleanly route the new audio cable out of his front loading NES [Callan] reuses the sacrificial adapter game’s cart to make some kind of unholy hybrid. To round it off [Callan] also goes over steps to flash a translated ROM to the Japanese game.

What difference could an extra two squares and a sawtooth make? Check out the sound comparison video after the jump! Thanks [Callan].

Continue reading “Adding Famicom Audio Channles To An NES Without Messing Up The Console”

NES Light Gun Gets A Burning Laser Upgrade

The Nintendo Light Gun makes a perfect burning laser. Of course it’s been gutted to make this happen. Nonetheless, the retro look can’t be beat, and the gun form factor is just what you need in a laser weapon.

This will literally burn your eye out of your head, so [Justin] and his buddies over a North Street Labs are all wearing protective goggles designed for this laser’s wavelength. But they also built a safety into the zapper itself. At the beginning of the video clip (embedded after the break) you will see there’s a key lock mounted in the butt. This lock completes the circuit between the battery and driver board. The 2W output is achieved by a 445nm M140 diode. A lot went into the heat sink and mounting cylinder to make sure the diode doesn’t just burn up after a few seconds of use.

Continue reading “NES Light Gun Gets A Burning Laser Upgrade”

PIC-based USB Conversion For An NES Controller

[Andres] wrote in to share his USB for NES controller project (translated). It enumerates as a USB keyboard and is easily mapped on most emulators. Over the weekend we looked in on an AVR programmer used for this purpose. [Andres] went a different direction, using a PIC microcontroller and eventually incorporating his circuit into the body of the controller.

The prototype circuit can be seen above. [Andres] uses a breakout board for the PIC 18F4550 to test the circuit. The chip has native USB support, and reading the button states from the controller’s shift register is a snap. You can see him using this test rig to play Super Mario Bros. on an emulator in the video after the break.

The second iteration of the project moves from breadboard to a soldered circuit. A 18F2550 is used as it comes in a rather small DIP package. If the legs are flattened there’s room inside the controller case for it, along with a few capacitors and a crystal. The original controller cord is removed to make way for a USB cable.

Continue reading “PIC-based USB Conversion For An NES Controller”

Turning A DS Into A Game Boy Advance

The venerable Game Boy is dead – and has been for a long time – after being replaced by the DS, DSi, DSi XL, and the 3DS. That doesn’t mean there’s nothing of value to the old Game Boy catalog; Pokemon Red/Blue is still as much fun as it was 15 years ago, and the game play of Advance Wars is still superb.

[Maarten] over at Bureau voor Gamers decided to put a modern twist on our old friend by taking a first-gen DS and converting it to a proper single screen Game Boy (Dutch, Google translation).

The donor machine was a broken first gen DS with a broken top screen. [Maarten] removed the top screen, did a tiny bit of Bondoing, moved the speaker, and gave his new toy a bright orange paint job.

Now [Maarten] has a modern version of the best portable system ever created, packed full of more powerful hardware and a much more capacious battery. Sure, it’s not a build that requires rewiring everything, but it’s still an awesome build for GBA aficionados.