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.

58 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.

    1. Because the skills you learn doing a project like that are really useful if you’re interested in FPGA designs, and might also lay the groundwork to clone other, more complex, systems. There was an article on here the other day that pointed out that it’s very difficult to emulate some systems with perfect accuracy due to weird hardware interactions – but potentially this could be fixed with FPGA emulation.

    1. Not a big fan of text adventures.
      Didn’t really developed a reading habit due to lack of exposure.
      The thing is, without visuals, it’s hard to fathom.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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”.

  8. 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!

  9. 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.

  10. 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”…

  11. 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/

  12. 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]).

  13. 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.

  14. 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.

  15. 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.

  16. 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.

  17. 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.

  18. 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.

  19. 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.

  20. 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

  21. “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.

  22. If you look at Bradley’s code he didn’t actually write the processor code himself. 99% of it was written (and is still maintained) by MikeJ at http://www.fpgaarcade.com. All Bradley did was interface an existing NES mobo processor socket to the FPGA running MikeJ’s processor code. Bradley made a few minor edits to the processor (like removing BCD support which the NES’ 2A03 doesn’t have, but other than that there was very little original HDL written by Bradley himself. But either way, it’s pretty neat.

    I am actually in the process of implementing the entire NES console inside an FPGA from scratch (all my own HDL). The CPU and PPU are pretty much complete (albeit a few minor bugs). I’m working on the APU right now. You can check it out at my site: https://rm-rfroot.net/nes_fpga/

    As for the people saying that it’s a dumb thing to do and a waste of time – it really depends on your perspective. Personally, I do it for the learning experience (becoming a better programmer and engineer) and because the NES is a really cool little piece of hardware and many people can relate to it.

Leave a Reply to fcoCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.