[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”
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.
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.
Now, this is a hack!
Awesome. Now he should recreate the rest of the NES in there as well.
BTW it’s “an” FPGA, not “a” fpga.
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
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.
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.
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.
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.
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.
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.
Dear Kirov, please post something you find hack-a-day worthy so we can all revel in your technical skills.
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.
Here’s my large FPGA project:
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.
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”.
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.
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!
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.
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”…
I used a CPLD to help light up an old PDP-11 control panel. This wasn’t used for the the instruction set (that could be done by the processor). It used the CPLD just as a switch for routing all of the switch / light I/O.
@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.
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.
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]).
Isn’t the CPU in the NES just a Z80 with a couple extra op codes?
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.
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.
Respect – great work!
I made some software reverse hacks and dreamed about such hardware hacks.
Now i would like to see an OpenNES. ;)
No Arduino, no hack simple as that.
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.
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.
John: in this case however it has been done. http://kevtris.org/Projects/console/index.html
^^guy cloned the entire nes system + all mappers. As far as he knows it’s 100% accurate.
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!
@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.
svofsi: yup I talked to him yesterday in fact. Btw he’s the same guy who made the led gbc screen thingie.
Damnit no edit button. John: Kevin Horton in the link I posted already did the graphics chip and cart chips.
@jero32, that’s good news! Is he going to opensource his stuff, perhaps make ports to DE1 and DE0 boards?
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.
even more amazing…kevtris’s FPGA NES was built ENTIRELY using schematic entry…not a line of VHDL or Verilog in the entire project.
Ouch, that wouldn’t make much sense opensourced then..
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.
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.
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.
Interesting, I wonder how hard will be to clone the functionality of a software protection dongle.
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.
I’m currently building an FPGA replacement for a DEC PDP-11/70 which controls a nuclear reactor.
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.
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
I love this. Some of those “Famiclone” systems really suck. Using FPGA would allow the system to work 100% compatability.
“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.
I’m pretty fond of the C-One, the Commodore 64 built on FPGA’s. http://www.c64upgra.de/c-one/
I noticed he has ‘Duck Hunt’ in there; that dog needs to burn in hell. Now that would be a hack.
lol,Duck Hunt.. the first time I played it, I thought I was supposed to shoot the dog…
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.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)