FPGA NES ppu?

Discussion in 'Modding and Hacking - Consoles and Electronics' started by brainpann, Dec 30, 2011.

  1. brainpann

    brainpann Site Supporter 2012

    Joined:
    May 1, 2011
    Messages:
    403
    Likes Received:
    6
    I came across a blog a few weeks ago that detailed steps on emulating an NES with an FPGA.

    http://danstrother.com/fpga-nes/



    What intrigued me the most was where the author noted that he

    "Completely re-wrote the PPU in Verilog (and fixed all sorts of obscure bugs in the process – and, by fixed, I mean that I actually implemented many of the NES’ quirks and bugs)"

    I only have a basic understanding of FPGA's but could one be used as a replacement PPU on an NES for RGB output? Hell, if it could, why not add VGA out? :)

    I know FPGA's might be cost prohibitive but I don't think 100.00 would be too much to pay considering the alternative.
     
    Last edited: Dec 30, 2011
  2. scrap628

    scrap628 Member

    Joined:
    May 1, 2010
    Messages:
    9
    Likes Received:
    0
    I look forward to Calpis chiming in on this, as I highly respect his input on all things console logic related. In the meantime, I'll try to provide some insight based on (the little) bit that I know about the NES.

    Firstly, regarding the FPGA, cost, I think you are way over estimating it. Something capable of implementing the NES PPU should be far less than $100. The author indicates that his development platform used a Spartan 3 1000 FPGA to implement the entire NES, but I would not be surprised if an FPGA in the $10 to $25 range could implement just the PPU functionality and then some.

    Now, regarding your question on whether or not the FPGA could be made to output RGB color information, the answer is yes. Keep in mind that everything within the FPGA is digital, including the color information. I believe (and somebody feel free to correct me if I am wrong), the original NES PPU was responsible for converting the RGB values to a composite representation. Since this FPGA implementation will be calculating the raw color values based on RGB, it can output RGB, or even output in different formats such as HDMI (after HDMI protocol encoding and TMDS signaling) or YPbPr (after color conversion and analog signaling).
     
  3. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    The NES PPU took the video signal and output composite yes, but if it was a matter of RGB->Composite we would simply tap the RGB rather than bother with swapping the NES PPU with that of the Play Choice 10 hardware.
     
  4. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    You aren't the first to think of this :p It's possible to replace the original PPU with a FPGA but there are some issues:

    -For the last decade it's been difficult to interface FPGA with old 5V electronics. Basically you'll have to hope your game carts don't mind 3.3V logic signals which is the highest FPGA from the last decade can handle, most don't, some do (and/or lower VCC to 3.3V). Or you can buffer the outputs at the cost of board realestate (which will already be high with all the resistors to limit I/O clamping current). Another realestate isue are the two non-5V voltage supplies needed by recent FPGA. This can be taken care of with linear regulators (simple but big) or DC-DC converters (small but complex and expensive). Basically your FPGA subboard will be kind of big to fit into place.

    -FPGA need to be configured (assuming a normal SRAM one). Using a configuration SEEPROM is an option but it probably takes longer than the CPU to come up to speed. Some mechanism to keep the CPU reset while the FPGA is configured is probably a good idea but means a little reworking to the CPU circuit.

    -Writing a hardware PPU emulator is very different than implementing the actual PPU logic. People tend to take a lot of liberties when emulating a system leading to an acceptable but technically inaccurate design. This means that while his design may interface well with other logical components like the CPU or his memory arbitration system and play games faithfully, it probably cannot interface directly to a real game cart which expects exact logical operation, exact timing and exact interfaces. If this was easy to pull off people would have done it a long time ago. I think the closest anyone's come is probably Kevtris, but I'm not sure his implementation is 100% hack-free and accurate enough to actually interface with all carts. I like to think my implementation is very accurate, but I don't have the tools or time to do exhaustive tests.

    ----

    As for the actual PPU, it doesn't translate RGB to composite, it directly generates video in the composite domain. When implementing a PPU it really doesn't matter because you can just use a lookup table to get the "equivalent" (this is a hot topic) RGB palette values. Or you can generate composite directly like the real PPU, I do it this way so I can use a TV for display instead of a monitor (needs scandoubling), it's more accurate and requires a much narrower DAC.
     
    Last edited: Dec 31, 2011
  5. H360

    H360 Familiar Face

    Joined:
    Mar 5, 2011
    Messages:
    1,474
    Likes Received:
    1
    Internal clamp diodes in some FPGA's can handle a 5 volt LVTTL BUS (so I have learned).
     
    Last edited: Dec 31, 2011
  6. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Which is why I stated you need a lot of resistors to limit the clamp current. Clamp diodes typically have a forward drop of 0.5V, so above 3.3+0.5=3.8V you're looking at damage. TTL outputs sometimes rise above 3.8V, 5V NMOS/CMOS as seen in 8 and 16-bit systems routinely rise to nearly 5V and are good current sources. 5V is TTL BTW, the LV stands for low voltage or <=3.3V supply-friendly.
     
    Last edited: Dec 31, 2011
  7. H360

    H360 Familiar Face

    Joined:
    Mar 5, 2011
    Messages:
    1,474
    Likes Received:
    1
    Thanks for the information Calpis!
     
    Last edited: Dec 31, 2011
  8. brainpann

    brainpann Site Supporter 2012

    Joined:
    May 1, 2011
    Messages:
    403
    Likes Received:
    6
    I certainly never thought I was the first to think of this but I had not yet come across much information regarding the matter other than a little hearsay. :) It's nice to get some clarification.
     
    Last edited: Jan 7, 2012
  9. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    I'm sure plenty of people would love to see a drop in replacement PPU that supports RGB and perhaps S-Video or Component. Maybe not a huge number but I know I would. Or just a quality NES/Famicom clone that is perfectly accurate but also features RGB Video output. Though I've found the Composite output from a standard US NES is not really that bad. But I have a good CRT as well.
     
  10. Melchior

    Melchior Rapidly Rising Member

    Joined:
    Jun 12, 2011
    Messages:
    79
    Likes Received:
    3
  11. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    Who needs a NES when you've got an FPGA and a SD card slot?
     
    Last edited: Jan 15, 2012
  12. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    Who need an FPGA when you've got a computer?

    ;)
     
    Last edited: Jan 15, 2012
  13. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    Wheres the fun in that?
     
  14. SGGG2

    SGGG2 Active Member

    Joined:
    Dec 30, 2010
    Messages:
    40
    Likes Received:
    0
    Well, whoever's working on it, hurry up already :):banghead:
     
  15. brainpann

    brainpann Site Supporter 2012

    Joined:
    May 1, 2011
    Messages:
    403
    Likes Received:
    6
    Who is this Kevin Horton guy? It seems like I see him or "kevtris" pop up a lot. I was just on gamesx.com and saw his name in an article over there.
     
  16. Melchior

    Melchior Rapidly Rising Member

    Joined:
    Jun 12, 2011
    Messages:
    79
    Likes Received:
    3
    Ask him yourself;

    http://kevtris.org/Contact/index.html

    Also I DO recall a separate project started (before/elsewhere) for a PPU replacement chip.

    I think someone was trying to reverse engineer a Playchoice 10 PPU (Its special).

    May have had to do with building a N.o.a.C.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page