Hi-Def NES HDMI Adapter for the NES

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

Moderator: Moderators

User avatar
kevtris
Posts: 504
Joined: Sat Oct 29, 2005 2:09 am
Location: Indianapolis
Contact:

Re: Hi-Def NES HDMI Adapter for the NES

Post by kevtris »

I just posted my first update video evar on this project using my new camera.

https://www.youtube.com/watch?v=rCpwpgRTxcI
/* this is a comment */
User avatar
getafixx
Posts: 373
Joined: Tue Dec 04, 2012 3:28 pm
Location: Canada

Re: Hi-Def NES HDMI Adapter for the NES

Post by getafixx »

Hawt!!
User avatar
kevtris
Posts: 504
Joined: Sat Oct 29, 2005 2:09 am
Location: Indianapolis
Contact:

Re: Hi-Def NES HDMI Adapter for the NES

Post by kevtris »

Here's some example scanline tests from the scanline generator I was working on tonight. I have finished scalers 100% and that is done, so I started on the scanline generators.

http://blog.kevtris.org/blogfiles/hdmi/ ... es/latest/

I ran into a problem which I knew I'd have on 1080p (and PAL modes). That is, each NES scanline requires a non-integer number of scanlines on the HDMI display. Namely at 1080p, each NES scanline needs 4.5 HDMI scanlines.

This means that the height of each subsequent NES scanline alternates 4/5/4/5/4/5 HDMI lines.

To counter this (you can see an example of what this type looks like, see below) I came up with a scan line generator that "free runs" in relation to the NES video, instead of trying to "scanline" each NES line on the HDMI display. The results of this method are in the above /latest/ directory.

There's also a scanline generator that is tied to the actual NES scanlines, but it can look bad (especially on PAL) due to the afore-mentioned problem. Those are here:

http://blog.kevtris.org/blogfiles/hdmi/scanlines/

the filename describes how "Deep" the scanline effect is. 0 = no scanlines at all, FF = maximum.
/* this is a comment */
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by MottZilla »

Very nice. Glad to see lots of options.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hi-Def NES HDMI Adapter for the NES

Post by rainwarrior »

If it was a USB CopyNES and not a parallel port thing, I'd get one for sure.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Hi-Def NES HDMI Adapter for the NES

Post by tepples »

I see artifacts in the free running pattern. Can you make the free running pattern 9 output lines tall, containing two cycles in 1080p or three cycles in 720p?

How tall are the PAL scanlines in the output?
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by mikejmoffitt »

Scanlines that don't correspond to actual NES lines don't really make a whole lot of sense. It would be best to be sure they are aligned if possible...
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by MottZilla »

Considering the high resolution of the upscaled image, having black lines the size of the upscaled line would probably look bad compared to thinner lines that don't fall exactly between NES scanlines. Plus wouldn't it simulate an older display better that way as the lines you'd see in a CRT aren't going to match up with every NES line of pixels.

Either way, I think kevtris made it clear it'll be full of options for everyone's tastes.
Joe
Posts: 650
Joined: Mon Apr 01, 2013 11:17 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by Joe »

MottZilla wrote:the lines you'd see in a CRT aren't going to match up with every NES line of pixels.
Where did you hear that piece of misinformation? :|

The lines on (most) CRT TVs correspond exactly to the lines of the input video signal. A typical 480i signal is interlaced, so the lines alternate between two patterns. Some TVs will narrow the beam enough that there is blank space between scanlines, since a typical interlaced signal will fill in those blank spaces 1/60th of a second later. Since the NES produces a progressive video signal, those spaces never get filled in, which makes them much more apparent than they'd normally be.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Hi-Def NES HDMI Adapter for the NES

Post by tepples »

Joe wrote:
MottZilla wrote:the lines you'd see in a CRT aren't going to match up with every NES line of pixels.
Where did you hear that piece of misinformation? :|
In #nesdev on EFnet, direct from kevtris. Scanlines look fine at 720p. But the NES's 240p picture height doesn't divide evenly into 1080p. Our attempts to make a 4.5-pixel-tall scanline pattern have looked like Venetian blinds, where the 2-line repeating pattern sticks out like a sore thumb. Kev would love to be proven wrong about this.

PAL is even hairier to scale. The PAL NES and Dendy PPUs generate a 288p picture with 240 lines of background and sprites plus 48 pixels of combined top and bottom border. Each NES line corresponds to 2.5 720p lines, 3.75 1080p lines, or 4.167 1200p lines.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by MottZilla »

Joe wrote:
MottZilla wrote:the lines you'd see in a CRT aren't going to match up with every NES line of pixels.
Where did you hear that piece of misinformation? :|

The lines on (most) CRT TVs correspond exactly to the lines of the input video signal. A typical 480i signal is interlaced, so the lines alternate between two patterns. Some TVs will narrow the beam enough that there is blank space between scanlines, since a typical interlaced signal will fill in those blank spaces 1/60th of a second later. Since the NES produces a progressive video signal, those spaces never get filled in, which makes them much more apparent than they'd normally be.
Perhaps a better way of saying it is, when you blow up the image like is being done here, if you have black lines the same size as the NES scanlines in the image it doesn't look so great. I'm not going to go into how CRTs look. We all know how it looks on a CRT. This is just about putting filters on to make it more your taste. I didn't spend a lot of time studying the pictures shown.

The lines that don't exactly match up that I may have been thinking of may have been the aperture grille or shadow mask.
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by mikejmoffitt »

A lot of people have misconceptions about scanlines and why they are there - they are just gaps between the areas the beam normally strikes that would normally be hit on every other field. To have scanlines superimposed on a generated image is pointless if the spacing of the scanlines does not equal the spacing of the output image's pixels vertically. How wide they should be, how soft / strong, etc. is a matter of taste, but if they don't match the number of lines then you might as well superimpose any horizontal lines and call it a day.

It's not that the lines should be the same size, it's the spacing and number of lines that matters. To fit it properly into 1080 lines, an integer scaling of 5 might not be inappropriate. At first this seems too strong, as 240 * 5 == 1200 which is too tall for 1080. However, most standard NTSC TVs only saw ~224 of these lines, and many backdrop mappings and HUD placements are made for an even safer zoning. Chopping off a few lines on the top and bottom wouldn't be so bad. If you take 224 and scale it by 5, the resulting height is 1120, which almost fits into 1080. Definitely not the ideal solution, but it would allow clean scaling at the expensive of one row of tiles (when compared to a 224-height image). Perhaps something like that could be an option.

EDIT: I'm a bumbling moron when I explain stuff, here are some images I made.

This image is a rough approximation of a scanline filter I whipped together over Super Mario Bros. The important detail is that the dark regions, simulating the gaps between the CRT beam trails, is on the transition point between the pixels. The intended appearance is that the line, the lighter part, looks more like a slightly fuzzy beam going from one side to the other. The dark areas separate the rows.
Image

This second image is the same source image, but the scanlines being overlaid are spaced a little further off of the pixel spacing, giving an interesing moire pattern. The scanlines no longer emphasize the vertical spacing of the pixels, and it just looks like a goof put window blinds over the image. This is what a lot of people do with the Gonbes RGB adapter paired with a scanline generator PCB:

Image

In my opinion the first looks a lot more like what a CRT is doing. I hope that clears up what I'm trying to say.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Hi-Def NES HDMI Adapter for the NES

Post by tepples »

mikejmoffitt wrote:It's not that the lines should be the same size, it's the spacing and number of lines that matters. To fit it properly into 1080 lines, an integer scaling of 5 might not be inappropriate. At first this seems too strong, as 240 * 5 == 1200 which is too tall for 1080. However, most standard NTSC TVs only saw ~224 of these lines, and many backdrop mappings and HUD placements are made for an even safer zoning. Chopping off a few lines on the top and bottom wouldn't be so bad.
According to kevtris, a lot of TVs actually take the 1080 line picture and scale it up, assuming that the content was authored for early 1080i overscanned CRT HDTVs. So we need to in effect scale 240 minus a few percent to 1080 minus a few percent. Besides, the scaling options are limited because it doesn't have a frame buffer but only a circular buffer a few lines tall. This limits to what extent can be expanded or contracted.
The important detail is that the dark regions, simulating the gaps between the CRT beam trails, is on the transition point between the pixels.
True. But we need a 9-pixel-tall pattern that encompasses 2 input lines.

Kev has implemented a "free running" scanlines filter that draws three "scanlines" over every two NES output lines. It looks, frankly, like aliased cr*p.
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by mikejmoffitt »

tepples wrote:
mikejmoffitt wrote:It's not that the lines should be the same size, it's the spacing and number of lines that matters. To fit it properly into 1080 lines, an integer scaling of 5 might not be inappropriate. At first this seems too strong, as 240 * 5 == 1200 which is too tall for 1080. However, most standard NTSC TVs only saw ~224 of these lines, and many backdrop mappings and HUD placements are made for an even safer zoning. Chopping off a few lines on the top and bottom wouldn't be so bad.
According to kevtris, a lot of TVs actually take the 1080 line picture and scale it up, assuming that the content was authored for early 1080i overscanned CRT HDTVs. So we need to in effect scale 240 minus a few percent to 1080 minus a few percent. Besides, the scaling options are limited because it doesn't have a frame buffer but only a circular buffer a few lines tall. This limits to what extent can be expanded or contracted.
A lot of TVs will make this assumption, but if the image is cut off as a result of the TV doing overscan correction then I think it should be up to them to fix their settings if it bothers them, chuck their cheap television in the garbage, or simply not care. Designing around people with poorly configured televisions degrades the experience for other people who have them set up properly.
tepples wrote:
The important detail is that the dark regions, simulating the gaps between the CRT beam trails, is on the transition point between the pixels.
True. But we need a 9-pixel-tall pattern that encompasses 2 input lines.

Kev has implemented a "free running" scanlines filter that draws three "scanlines" over every two NES output lines. It looks, frankly, like aliased cr*p.
Based on the pictures posted above, the free running solution doesn't look so great. Is the scanline filter restricted to blacking out a line entirely, or can there be variation in intensity?

Maybe something like this, repeating?

Code: Select all


TV line             Line Darken %       NES line
0                        60             0
1                        0              0
2                        10             0
3                        90             0
4                        40             1
5                        10             1
6                        0              1
7                        30             1
8                        90             1

I'm not at a machine with appropriate tools right now so I can't test it, but a pattern like that which lines up might look okay.
Last edited by mikejmoffitt on Sat Nov 29, 2014 1:47 am, edited 2 times in total.
Great Hierophant
Posts: 780
Joined: Tue Nov 23, 2004 9:35 pm

Re: Hi-Def NES HDMI Adapter for the NES

Post by Great Hierophant »

This may be a reason to get a 2160p (UHD) TV, because 2160/9 = 240.
Post Reply