Developing cheap FPGA replacements for NES CPU & PPU?

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

Post Reply
User avatar
2fadfe
Posts: 17
Joined: Thu Feb 24, 2022 7:55 pm
Location: Earth

Developing cheap FPGA replacements for NES CPU & PPU?

Post by 2fadfe »

I don't think something less this exists, but I think it would be nice in the future for FOSH NES replacement motherboards and clones. So I guess the bare minimum to start developing this would to be having the knowledge, software, equipment, time, and determination to fork existing FPGA implementations of the various CPU/PPU versions... or heavily modify the existing Opentendo schematics to have a cheap FPGA acting as both the CPU and PPU. A cheap tiny FPGA probably would be cheaper than an ASIC, right?
Known as Duncan Idaho #0087 on the Discord Server.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by calima »

You won't be able to match the clone chip pricing, as long as supplies of those exist. Then many FPGA NESes already exist, just not open source.

So what you want is to do a lot of work, in order to get a replica of the existing FPGA NESes but open, which then will be immediately taken and sold as a competitor to those, which you won't get paid for.
alatar
Posts: 1
Joined: Thu Sep 29, 2022 1:48 pm

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by alatar »

This would definitely be a great thing to have in the open-source/hardware community.
Having an open version that others could study and improve would be great.
I think having an FPGA doing all the normal 8bit processor parts is not that complicated, probably the most challenging part would be the audio part.
Right now I'm still not at the right level for this, but I would love to try it in the future.
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Ben Boldt »

I think it would be great if there was an open source FPGA NES CPU and PPU. Especially for the PPU, to get RGB output. This would not necessarily blow away all of the closed-source ones, especially as those have unique features such as video filters, on-screen configuration, CPU speed adjustment, etc. The closed-source ones can always make improvements and stay a step ahead to keep their advantage like that. I think it only does good things for this to happen.

I have a hi-def NES that blew up years ago and I have NO access to schematics or source code that could tell me why, what happened, or how to fix it. I am left completely helpless with it. Only I could buy another one and hope it doesn't blow again. Open source, I could help find the problem and contribute a solution.
Zonomi
Posts: 69
Joined: Wed May 09, 2007 12:45 pm

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Zonomi »

There is already an open source implementation of the NES on a fpga.
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Ben Boldt »

That looks like a whole entire Famicom system, which is really cool. But that looks like a self-contained thing that runs ROM files only from SD card and does not accept cartridges.

The OP (and myself) want something to replace the PPU and/or CPU in an existing NES/Famicom system. So it still runs from cartridges and all of the original hardware. Basically, remove the CPU and/or PPU and replace it with this. Then from that point, extra features can be added such as RGB output and VT03 support, etc.

I am not aware of any FPGA drop-in replacement for the CPU or PPU. Even the existing closed-source stuff still uses the original CPU and PPU.
User avatar
Individualised
Posts: 310
Joined: Mon Sep 05, 2022 6:46 am

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Individualised »

I'm surprised that MISTER / the FPGA emulation scene in general doesn't seem to be well known about here. As I understand it, MISTER is an open source FPGA-based console that allows the use of emulation cores to emulate many different systems. Of course, the disadvantage with a "one size fits all" console is that you can't use cartridges, so the cores have to also emulate things like mappers which takes away one of the biggest advantages of FPGA clones.

I'm sure that the NES core developed for it could be retooled to allow the creation of dedicated FPGA CPUs and PPUs, it does seem like it's an adaptation of something else itself.
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Ben Boldt »

Individualised wrote: Fri Sep 30, 2022 1:26 pm I'm sure that the NES core developed for it could be retooled to allow the creation of dedicated FPGA CPUs and PPUs, it does seem like it's an adaptation of something else itself.
Yes, great idea. Basically connecting everything with I/O pins instead of internally, but still using the same core.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by MottZilla »

In theory nothing should prevent someone from taking the NES MiSTer core and breaking it down into CPU and PPU modules for a different FPGA. It would take some effort and time to get it done but it seems possible. But Calima is correct that as soon as an open source clone is available to program onto a FPGA as a replacement there will be people selling it to try to profit off of it. But that doesn't mean that it shouldn't or can't be done. It would be very nice to have a drop in replacement PPU with RGB video output for example.
User avatar
2fadfe
Posts: 17
Joined: Thu Feb 24, 2022 7:55 pm
Location: Earth

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by 2fadfe »

MottZilla wrote: Fri Sep 30, 2022 1:49 pm In theory nothing should prevent someone from taking the NES MiSTer core and breaking it down into CPU and PPU modules for a different FPGA. It would take some effort and time to get it done but it seems possible. But Calima is correct that as soon as an open source clone is available to program onto a FPGA as a replacement there will be people selling it to try to profit off of it. But that doesn't mean that it shouldn't or can't be done. It would be very nice to have a drop in replacement PPU with RGB video output for example.
I wonder if, on the MiSTer side, they regularly update the CPU and PPU elements of the core more than anything else?
Known as Duncan Idaho #0087 on the Discord Server.
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Ben Boldt »

That’s a good point. It may be written more like an emulator that runs on a computer. I would highly doubt that it is doing all of the normally redundant PPU fetches for example. I don’t know this for sure but it sure seems like this is a lot more than just “hooking things up”; more like a complete redesign would be needed. We’re looking at this from 10,000 feet and it’s tempting to think, drop the core in there and hook it up. Not knowing anything at all about how MiSTer works, I am already very skeptical that starting from this is any easier than starting from scratch.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by MottZilla »

There is a change log topic on the MiSTer forum. It isn't necessarily every single core change ever but you can see some of the changes from one version to another. https://misterfpga.org/viewtopic.php?t=147

I don't suspect the CPU and PPU get updates very often at this point. Infact some of the CPU files look like they haven't needed to be updated for 2 years. The PPU file had an update related to this fix 6 months ago. https://github.com/MiSTer-devel/NES_MiSTer/pull/310

Why would you say you "highly doubt that it is doing all of the normally redundant PPU fetches"? You don't seem to be basing that on anything but assumptions. And saying it may be written more like an emulator that runs on a computer, what does that mean? The MiSTer core runs on the FPGA, there is no software emulator interpreting going on there. MiSTer is an open source project, feel free to look at it and see what you can learn from it.

https://github.com/MiSTer-devel/NES_MiSTer

I agree that it would be incorrect for someone to think just anyone can approach it and "hook things up" in short order. However I disagree that starting from scratch is easier. The most important thing needed is experience working with the hardware description language used as well as experience working with a suitable target chip for making actual replacements. I have a feeling the parts needing some adjustment would be the parts of each module that are exposed externally. So things like audio output probably need some special care. Connections with other chips, etc. But none of this seems exceedingly problematic. I imagine unless another alternative comes out first, someone will probably do this eventually.

The NeoGeo MiSTer core actually has resulted in replacement custom chips. Infact you could actually say the NeoGeo MiSTer core was the result as Furrtek was originally cloning these custom chips for making replacements, not for making the NeoGeo MiSTer core. https://twitter.com/furrtek
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by Ben Boldt »

MottZilla wrote: Sat Oct 01, 2022 11:17 am Why would you say you "highly doubt that it is doing all of the normally redundant PPU fetches"? You don't seem to be basing that on anything but assumptions.
You are exactly right, it was all assumptions. I have not looked at the MiSTer source code.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by lidnariq »

There's lots of stupid things about the NES that aren't emulated correctly if you don't (virtually) do all the extraneous things it does.

The most recent patches from Kitrinx in fact are fixing one of those, and as such they were able to remove some of the "cheats" their emulation needed for accurate recreation of behaviors by more accurately emulating the system.

The real question is just how much work it would be to add a real external bus back onto the existing code, complete with voltage translation and all... and how big of an FPGA would be needed. (Also, if it even makes any sense to try to separate the CPU and PPU cores, or just have a single module that uses all 56 unique signals across the two DIP40s )
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Developing cheap FPGA replacements for NES CPU & PPU?

Post by rainwarrior »

I don't have a MiSTer personally, but I've seen that several of the cores are even able to support lightgun peripherals when using the CRT output options. Each core has different maintainers, but I've seen a lot of ongoing effort to get the popular ones highly accurate.
Post Reply