RGB output from composite PPU
Moderators: B00daW, Moderators
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.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
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?
Re: RGB output from composite PPU
Care to explain the technical details? NICE
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.
Re: RGB output from composite PPU
Totally awesome, thefox! Looks gorgeous!
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?
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
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.
Re: RGB output from composite PPU
The PPU clock can be recovered from the sync and color burst. Perhaps the tapping is just to ensure an even cleaner clock signal.
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?).
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?).
Re: RGB output from composite PPU
How is sync to color burst accomplished in an actual TV?
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
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.