NES processor cloned on a FPGA

nes-on-an-fpga

[Bradley] decided to tackle the challenge to recreate the original Nintendo Entertainment System’s processor in a Field Programmable Gate Array. Say what? The original NES is a Legacy System, still used but no longer manufactured. If a system breaks, it becomes more and more difficult to repair or find replacements parts as time passes. By using a programmable integrated circuit such as a CPLD or a FPGA to clone the functionality of the original hardware, legacy systems can live on long after the original hardware has given up the ghost.

It took [Bradley] about a year to fully implement the NES processor as part of his Master’s project at Bradley University. He used what was known about the processor combined with some detective work with logic probes along the way. The programming was done in VHDL and those files are available for download (click on Documentation).

With the ubiquity of NES emulators on every device known to man you probably won’t be replicating this unless you want a reason to play with a FPGA. What interests us is the hardware solution this type of work provides for obsolete hardware that still serves a useful purpose. If you’ve used a FPGA or similar device to keep an old system running, let us know about it in the comments.

55 thoughts on “NES processor cloned on a FPGA

  1. Kirov, did you read the last paragraph of the post? The one where they say that it isn’t the actual end result that they are posting this for but rather the process of cloning the processor?

    I don’t have any projects where this might be handy, but I’m definitely going to read through it in case something comes up. While the NES has countless emulators out there, there are plenty of things that don’t.

  2. Your comment is worthless. Its not a hack, its his Masters thesis. He probably learned more building this than during last 5 years at the uni.

  3. my point is the end result is stupid so why waste your time on it, while it took a lot of work and learning to create it he could have found something much better to clone

  4. For those that says that is useless, I think that this is like the text adventures.
    The fun It’s not in the end of the game, it’s the way to the end what you enjoy.

  5. The end result is not stupid. Put that in an original NES and you have a working console. I much prefer something like this then leveraging the power of a modern pc to emulate the NES.

    Due to this hack 30 years from now if I want to play a NES and there are no more working ones I can use this to make one.

  6. Personally, I like to use the original NES hardware, emulators are not perfect, even the existing hardware ones (I have a NES+SNES device and the SNES is great, but the NES’s colors are off). While NES emulators are almost perfect, they still lack some of the hardware quirks that have only been possible with the real hardware.

    If this is can function identically to the original hardware, I can see this definitely being worth the effort.

  7. kirov,

    how is reverse engineering a proprietary system and creating a cheap hardware solution not a great hack? it’s not about people NEEDING this. hacking is never about that. its about doing something that other people can’t. its about breaking boundaries. its about gaining knowledge and its about respect. Bradley definitely gain my respect today, simply for the amount of time invested into this project. the fact that he got it working, is noting short of exemplary.

  8. This isn’t a cheap solution. Do you know what one of those FPGA boards costs?

    That said he did a good reverse engineering job and I commend him for his efforts, but the cheapness of his hack probably doesn’t come near the cost of a used NES on ebay.

  9. Here’s my large FPGA project:

    http://code.google.com/p/vector06cc/

    It’s a clone of old Soviet home computer called Vector-06c. Doing old computers in FPGA involves a lot of pretty serious reverse- and forward engineering, inventing your own ways of implementing stuff you only know about from poor docs and so on. Basically you have to re-implement everything from scratch and stay within horrible constraints of the original “features”, solve puzzles all the way. You can’t imagine how many tiny details hide even in the most primitive old home computer. Just for example, the final hiding details of Intel 8080 implementation were cracked only this summer. Every emulator and every ip core in existence kept stubbornly repeating same old bugs originating from someone’s guess, untested.

    One of those FPGA boards costs ~150 US Dollars, which is really not much considering how much you can do with them.

  10. Those who say this is worthless are missing the point of the whole project. Practically speaking it probably isn’t that useful, but as something to show and increase your understanding of this sort of thing, it’s priceless… Nice work. I just want to know if it will play “paper space invaders”.

  11. kirov you don’t know what your talking about, emulators still glitch even on the best systems because neither game nor computer was design to do what they do.

  12. Just an FYI, the guy’s name is not [Bradley] it’s Dan Leach. I also attend Bradley University and am friends with Dan. He graduated a couple years ago. You might want to correct his name though, thanks!

  13. RE: cost of dev board. Sure, the fully featured dev board with extra accessories and power supply costs a lot. But once you have it working right the bare FPGAs aren’t that expensive. Make a carrier circuit board for the bare bones FPGA, crank out about 30 or so and sell em to enthusiasts and persons who would like to use your duplicated cpu in resurrecting an older system.

    Right off the bat I’d expect doing something similar for old arcade consoles might have a healthy market :)

    RE: Kirov you ignorant little twerp – this man has learned a seriously valuable set of skills. He cut his teeth on a nintendo, while your here whining about how he should clone something worthwhile, he’s learned how to do it. Now he can go out there and with some effort actually clone something you may find useful. What have you done in the last year? The last six? Have you learned skills and produced a working product for your efforts? Can you go and right now do what this man has done? I seriously doubt it. I personally am offended by you and your comments.

  14. kirov if your unable to see the technical significance of this work, your clearly an idiot. Its like saying, “well im going to die eventually, I might as well not even live”…

  15. @Economically: The dev board is moderately expensive, but these days, depending on the brand/model/gate count, you can typically buy FPGAs on ebay for around $10 a piece.

  16. I implemented a 1980′s SIMD supercomputer called the “Non-Von1″ inside an FPGA. Reverse-engineering is a really fun (if sometimes extremely frustrating!) hobby. Figuring out all of the random quirks of 30 year old, undocumented hardware (especially if you don’t have access to a machine!) is an incredibly challenge.

    The Non-Von1:

    http://chrisfenton.com/non-von-1/

  17. Kirov you fucking troll.

    Anyways onto the pot: Love it. I loved my NES when I was a kid, I’m sure if I still had it it’d still play too. Nice to know that if it didn’t, fixing it won’t be impossible (just hard [for me that is]).

  18. This is nice. What makes it even better is it’s intriguing, complex, and was done by an individual rather than a big group of boring people who are trying to institutionalize hacking with profit margins off of ad revenue and merchandising.

  19. Kirov, stop pushing pieces of Lego up your nose.

    It is a nice piece of work. For a CS grad learning elec. eng. this is far beyond my capabilities, but is a very impressive piece of work.

  20. Respect – great work!
    I made some software reverse hacks and dreamed about such hardware hacks.
    Now i would like to see an OpenNES. ;)

  21. Seriously if you think that this was a waste of time you are a moron.

    I am also working on an FPGA project for uni. having gone from knowing nothing about FPGA”S to where I am today has given me a huge welth of information both in hte FPGA and into the project I am n involved in.
    This is material you CANNOT learn in a book or from anorther person.
    You obviously need to understand the joy, of the first time you do something that nobody else in the world has done.
    Yep it’s not ground breaking but it’s well worth the effort.

  22. Kirov, don’t lash out at others because you are an invalid. This is an awesome demonstration of technique! You don’t need to clone a old Nintendo to play them, but the idea was to LEARN and LEARN he did. Brad posted this so that others could learn a bit form his experience. Lead the way with your great ideas or fuck off. You have a better idea right? Spit it out right now or retire. The hell are you even reading and posting here if you think this is all crap anyway? Get a new hobby like uhh hacking things together.

  23. There still remains the graphic chip, and the cartridge chips to emulate. It would be nice to shrink the nes down. Until then keep hacking!

    John

  24. @jero32: have you been able to contact the kevtris.org guy? Last update on his site is from 2005 and I never heard back from him when I tried to contact him.

  25. No, he isn’t. He’s kinda personal about his projects. He was thinking of making it avaible for sale iirc. But it would’ve been to expensive.

  26. Ya, that’s another reason why he didn’t give it out. Iirc he once said he partly doesnt wanna release it for fear of chinese pirates stealing it ect…..but don’t quote me on that.

  27. My uni gave me one of the better altera boards. It’s still sitting in its box because I haven’t come up with any interesting projects. This might be a bit hard for me but definately gave me some ideas where to go.
    Thanks.

  28. That FPGA has to be around 2% used unless he stored ROMs on it too. If he can emulate a user who does well at the games, that might use up the MMU/DSP/CPU cores in a modern PSoC or Altera (ARM9 inside) FPGA. Wingman in a box! See if it gracefully moves to single-pixel avoidance in 1080i and translates Touhou (bullet hell) games as a courtesy to interested human players.

  29. I’m currently working to emulate the processing unit in a fairly modern (mid to late 90′s) vending machine (cocacola) it is an interesting project to say the least.

    soon as i get the processor fully emulated i’m going to see if i can port linux to run on it :P i cant wait to run the following command from my desk

    “Sudo venddrop sprite”
    from my desk then run over to the machine like a little school girl and enjoy my sprite…..

    ofcourse i’m jumping ahead of myself, processor first.

  30. Someone else and I did a standalone full hardware duplication (graphics, etc as well) of the NES on an FPGA in a few months as undergraduates… I like the project and appreciate the work, but I’m pretty baffled as to how this is a Master’s Thesis… what’s the contribution/research aspect? It seems more like an ambitious class project than anything else.

    1. Wait what? Pictures or it didn’t happen. You do know that if what you are saying is correct and it works correctly that you could make quite a bit of money right? A few months is quite impressive! Please share something to back up your claim. Thanks KilluaZ =D

  31. I love this. Some of those “Famiclone” systems really suck. Using FPGA would allow the system to work 100% compatability.

  32. “Using FPGA would allow the system to work 100% compatability.”

    It’s not all that easy. Normally implementing a good working FPGA clone is harder than implementing a good working software emulator, at least with the insane processing power of modern CPU’s. Yes, in the perfect end, an FPGA clone will be closer to the real thing. But before the absolute perfection is reached, software emulator is faster and easier to implement, maintain and update with fixes for newly discovered glitches of the original hardware.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s