It is currently Fri Dec 15, 2017 9:12 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: The NES Stretch Effect
PostPosted: Thu Nov 25, 2004 10:47 pm 
Offline

Joined: Tue Nov 23, 2004 9:35 pm
Posts: 634
Before emu authors get all fancy with their filters, I would hope more took the opportunity to make sure the games looked more like they do on a TV. I don't mean fuzziness, I mean aspect ratio. The NES does not display its picture inside a proportional rectangle. It stretches the picture horizontally to fill the picture tube. (This inbcludes the portions cut off by the pastic casing.) Most emulators include a stretch option, but this does not stretch the pixels proportionally, causing the screens to look and scroll weirdly. It probably decreases performance too. Unfortunately, CRT computer monitors cannot stretch the screen enough for the picture to entirely cover it if the NES's video is centered in a standard 1.33:1 resolution like 640x480.

Lets review the pixel ratios. If the NES were outputting squareish pixels, then the ratio of each pixel would be 1.067:1. However, it must stretch them out over a screen ratio of 1.33:1 Unfortunately, PCs these days do not allow emu authors to put out custom full screen resolutions. FCE Ultra does something very good, however. It allows you to scale pixel dimensions in windowed and full screen resolutions. Consider 1024x768. The NES's resolution of 256x240 would fit into a tiny box in the center of the screen without scaling. If you multiply 256x4=1024! So much for huge horizontal borders. Then multiply 240x3=720. Not quite 768, but it will have to do. Adjustments to the vertical and horizontal stretch of the monitor take care of the rest. 1280x960, 5:4 pixel ratio is also very nice but not quite right. 8bits per pixel ensures maximum sharpness.

I feel that this is a must for mature emulators. That and a ROM launcher.


Top
 Profile  
 
 Post subject: CCIR 601
PostPosted: Fri Nov 26, 2004 12:26 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19347
Location: NE Indiana, USA (NTSC)
No, 1.250 to go from 256x240 to a 4:3 box is a little too much stretching, as it would imply that the TV cuts off a nearly equal number of pixels on all four sides of the screen. In fact, the TV cuts off fewer pixels on the left and right than on the top and bottom, so it's probably a little less than 1.25. Using the 256x224 resolution of the Super NES (which is often also cited for the NES after overscan) gives a ratio of 1.167.

To settle it exactly, I'll appeal to authority, namely the International Telecommunication Union. According to the ITU standard commonly known as CCIR 601, the effective resolution of NTSC TV is 704x480 pixels, where a "pixel" is 1/4 color clock by 1 interlaced scanline. (Actually, a scanline of a CCIR 601 bitstream has 720 pixels, but 8 on each side are blank.) Take into account the limited bandwidth of composite video and the progressive-scan methods of early consoles, and you're down to 352x240, where each color clock period (at 3.580 MHz) is two "pixels". Squeeze this to fit a 4:3 display, and each half color-clock has 10:11 ratio. That seems to jibe with the stretching of the picture on the Sega Genesis console and Apple II computer, which output two pixels per color clock.

The master clock generator of a Famicom or NTSC NES console runs at 21.48 MHz. A divide-by-6 counter produces the color clock, and a divide-by-4 counter produces the 5.369 MHz pixel clock. (A separate divide-by-12 counter clocks the CPU.) This means each pixel is 2/3 of a color clock wide or 4/3 times as wide as a Genesis pixel. ("State of the art high resolution graphics" my ass.)

4/3 times 10:11 is 40:33, the exact aspect ratio of NTSC NES pixels. This corresponds to a pixel aspect ratio of 1.212 in FCE Ultra. Close ratios involving small integers are 6:5 (1.200) and 5:4 (1.250). The best way to scale the NES picture to 1024x768 is by 1. applying a simple pixel doubler in both directions and then 2. using DirectDraw built-in linear interpolation to put the result into a 931x720 pixel window.

Great Hierophant wrote:
That and a ROM launcher.

How are the implementations of the Open ROM... command in current Windows-based emulators deficient? What do you want in a ROM launcher?

(edit: correct ratio in the part about assuming snes fullscreen == 4:3)


Last edited by tepples on Fri Nov 26, 2004 2:45 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 26, 2004 6:36 am 
Offline

Joined: Tue Nov 23, 2004 9:35 pm
Posts: 634
In a ROM launcher, there must be at least ROM name, PRG size, CHR size, mapper #, and mirroring. That way you won't have to scroll every time you want to open a ROM starting with the letter W.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 26, 2004 12:39 pm 
Offline

Joined: Mon Sep 20, 2004 6:47 am
Posts: 48
why not simply organise roms into alphabet letter directorys then it does't matter?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 6:52 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
I stretch the NES image to 640x480. While the horizontal axis must be stretched, the vertical axis must not be. This is the simples rule:

1122233444... or
1122*3344*...

If someone knows another formula to handle this... on 640x480... let me know. ;)

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 8:31 pm 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
1122*3344* looks like it'd be 1.4x scaling.

Unless I'm wrong, of course. :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 9:34 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19347
Location: NE Indiana, USA (NTSC)
1122233444... is 2.5x scaling, presumably in a 2.5x by 2.0x setup.

To get a proper 2.4x setup, try 1122a3344b55, where a=(2+3) mixed and b=(4.5) mixed. Or just do pixel doubling to a surface in video memory and use DirectX to stretch-blit it to the screen.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 07, 2004 11:30 pm 
Offline
User avatar

Joined: Sat Nov 13, 2004 2:45 pm
Posts: 18
Location: Vancouver BC, Canada
I have at times stretched the emu window (many allow you to stretch it to any scale you like). However, I prefer debugging my game with clear pixels, rather than blurred or antialiased ones. I can run the game on hardware anytime I like, so I know what it looks like stretched. Emus don't have perfect palettes, but it's not a big deal either.

If one really cares about perfect scaling and such, they should just use real hardware, of it they can't do that, simply resize the window manually, heh ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group