RGB output from composite PPU
-
thefox
- Posts: 3134
- Joined: Mon Jan 03, 2005 10:36 am
- Location: the universe
RGB output from composite PPU
Here's a project I've been working on for the last week or two. It's a normal NTSC NES (with composite PPU) with some hooks into an FPGA board. Result: Pixel perfect RGB output through VGA. At this point the project is pretty much done and seems to be working reliably, I've thrown a ton of games at it without problems.
The moire artifacts in the images were caused by the camera.
The moire artifacts in the images were caused by the camera.
You do not have the required permissions to view the files attached to this post.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
-
TmEE
- Posts: 1080
- Joined: Wed Feb 13, 2008 9:10 am
- Location: Norway (50 and 60Hz compatible :P)
-
lidnariq
- Site Admin
- Posts: 11814
- Joined: Sun Apr 13, 2008 11:12 am
Re: RGB output from composite PPU
Awesome! Does it handle emphasis? Do you have a full 256x240 pixel buffer, or are you managing this with just one or two scanlines of memory? If the latter, how do you deal with the intermittently missing prerender pixel? What hardware is on your FPGA board?
-
Jeroen
- Posts: 1049
- Joined: Tue Jul 03, 2007 1:49 pm
Re: RGB output from composite PPU
Care to explain the technical details? NICE
-
tepples
- Posts: 23011
- Joined: Sun Sep 19, 2004 11:12 pm
- Location: NE Indiana, USA (NTSC)
Re: RGB output from composite PPU
Ignoring emphasis, it can be done by sampling the minimum level, maximum level, and phase over an entire pixel period and determining the intended palette entry from there.
-
koitsu
- Posts: 4201
- Joined: Sun Sep 19, 2004 9:28 pm
- Location: A world gone mad
Re: RGB output from composite PPU
Totally awesome, thefox! Looks gorgeous!
-
keropi
- Posts: 66
- Joined: Fri Jul 13, 2012 2:06 am
- Location: Greece
Re: RGB output from composite PPU
awesome
will you be releasing details so people can (hopefully) build it?
will you be releasing details so people can (hopefully) build it?
-
thefox
- Posts: 3134
- Joined: Mon Jan 03, 2005 10:36 am
- Location: the universe
Re: RGB output from composite PPU
Thanks for the comments.
The FPGA board is Altera DE2.

Emphasis is in the lookup table right now (9 bit index) so it works OK, I dumped the palette from Nintendulator. I used two scanline buffers. VGA timing is slightly off because NES only renders 240 scanlines and because of the missing dot, but my TV doesn't seem to care. I don't know if that's an exception or a common thing for displays.lidnariq wrote:Awesome! Does it handle emphasis? Do you have a full 256x240 pixel buffer, or are you managing this with just one or two scanlines of memory? If the latter, how do you deal with the intermittently missing prerender pixel? What hardware is on your FPGA board?
The FPGA board is Altera DE2.
Maybe in the future.Jeroen wrote:Care to explain the technical details? NICE
I don't know yet, right now it's not easy to build because it relies on DE2 (which costs $500, or about $250 for academic users). Also I have never designed a PCB before so there are lot of details that I don't know about when it comes to building a standalone version (like PCB manufacturing, board stuffing, level conversion, cheapest parts to use, etc).keropi wrote:awesome![]()
will you be releasing details so people can (hopefully) build it?
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
-
blargg
- Posts: 3715
- Joined: Mon Sep 27, 2004 8:33 am
- Location: Central Texas, USA
Re: RGB output from composite PPU
My guess is that the ribbon to the NES intercepts the clock to the PPU and perhaps NMI so the external board can know when to sample video output and where it is in each pixel. Then it's just a matter of output levels at various points in the pixel and a lookup table, I imagine. I think that the original estimate of this being prohibitively expensive was on using just the composite output, nothing tapping into the PPU clock.
-
blargg
- Posts: 3715
- Joined: Mon Sep 27, 2004 8:33 am
- Location: Central Texas, USA
Re: RGB output from composite PPU
Or like I said because it would be prohibitively expensive to implement the clock recovery in an FPGA (via oversampling? or a PLL that very quickly locks on?).
-
lidnariq
- Site Admin
- Posts: 11814
- Joined: Sun Apr 13, 2008 11:12 am
Re: RGB output from composite PPU
My LCD PC monitor is just fine with only receiving 524 total lines for VGA, but is really cranky about any jitter in its hsync-locked PLL pixel clock recovery circuit. Hence the question about the missing pixelthefox wrote:VGA timing is slightly off because NES only renders 240 scanlines and because of the missing dot, but my TV doesn't seem to care. I don't know if that's an exception or a common thing for displays.
How many blocks does your design take?
I never considered trying to do this without access to the PPU Clock, although I guess you might be able to use an 8x PLL from /RD or ALE...blargg wrote:Or like I said because it would be prohibitively expensive to implement the clock recovery in an FPGA (via oversampling? or a PLL that very quickly locks on?).
-
lidnariq
- Site Admin
- Posts: 11814
- Joined: Sun Apr 13, 2008 11:12 am
Re: RGB output from composite PPU
After high-precision crystals became available, but before this was all done in digital, I believe it goes something like this:
* Retriggerable one-shot for the period after hsync ends
* One-shot output directly drives crystal with color burst as input
* After one-shot is done crystal is reconnected to itself
* Retriggerable one-shot for the period after hsync ends
* One-shot output directly drives crystal with color burst as input
* After one-shot is done crystal is reconnected to itself
-
tepples
- Posts: 23011
- Joined: Sun Sep 19, 2004 11:12 pm
- Location: NE Indiana, USA (NTSC)
Re: RGB output from composite PPU
So as I see it, a circuit with no connection to NES internals would involve a 6*CB crystal to lock to the color burst and derive the PPU clock from that.