"crawling" scanlines?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
Reaper_Man
Posts: 51
Joined: Sat Jun 17, 2006 2:31 pm
Location: Bogota, Colombia

"crawling" scanlines?

Post by Reaper_Man »

I've noticed this on a lot of NTSC TVs. If you look closely, the scanlines on a TV don't stay in place. They look like they crawl slowly upwards. Is that the same for NES video output? how hard would it be to implement into the existant NTSC filter? Just wondering.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

NTSC TV uses the equivalent of 341.25 pixels per line, producing a well-known 4-field dot crawl pattern. The NES uses a different 2-field pattern that results in less upward motion but more artifacts, and Nestopia's NTSC filter appears to display that pattern accurately. But some games that turn the PPU on after some point on the 340-cycle line will create a 3-field pattern; such games include Battletoads.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Most NTSC video signals are interlaced. Each frame all the scanlines on the screen are offset 1/2 scanline height from the previous. The NES video signal (and others from pre-CD consoles) trick most TVs into displaying the image non-interlace (progressive), so that every field's scanlines are in the same vertical positions on screen.
tepples wrote:But some games that turn the PPU on after some point on the 340-cycle line will create a 3-field pattern; such games include Battletoads.
Marty tells me that Nestopia also handles this correctly (it passed a test ROM I wrote for it).
User avatar
Reaper_Man
Posts: 51
Joined: Sat Jun 17, 2006 2:31 pm
Location: Bogota, Colombia

Post by Reaper_Man »

blargg wrote:Most NTSC video signals are interlaced. Each frame all the scanlines on the screen are offset 1/2 scanline height from the previous. The NES video signal (and others from pre-CD consoles) trick most TVs into displaying the image non-interlace (progressive), so that every field's scanlines are in the same vertical positions on screen.
so if the image is shown progressive, then whay are there odd/even fields? Now I'm confused ;/
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Reaper_Man wrote:so if the image is shown progressive, then whay are there odd/even fields? Now I'm confused ;/
A 480i signal consists of fields in the order even, odd, even, odd, even, odd, etc. A 240p signal, on the other hand, consists of odd, odd, odd, odd, or even, even, even, even, forcing the TV to draw the fields directly on top of each other. (Whether all the fields are odd or even matters, as some TVs can handle one better than the other.)
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Post by NewRisingSun »

NTSC TV uses the equivalent of 341.25 pixels per line
How do you figure that? NTSC doesn't use pixels horizontally at all. Or what do you mean by "equivalent"?
Is that the same for NES video output?
No. As said previously, the NES doesn't use an interlaced display, and it also uses a different line rate than real NTSC.
The dot crawl pattern is largely a function of the relationship between the line frequency and the color subcarrier frequency.

Real NTSC uses a line rate that is defined as 4.5 MHz (the video bandwidth size) divided by 286, and defines the color subcarrier frequency (Fsc, 3.579545 MHz) as 455/2 the line frequency. In other words, in real NTSC, the line rate is Fsc * 2/455 = 15734.26573 Hz. The odd multiple 455/2 was chosen by the FCC deliberately so the color subcarrier's dot pattern would alternate and thus cancel itself out over time on monochrome TV sets. The "2/" part tells you that it's a two-stage pattern, meaning that artifacts cancel each other out after two fields (discounting interlace).

The NES uses a line rate that is Fsc*(6/4)/341 = Fsc * 3/682 = 15745.80112 Hz on even fields. The "3/" part tells you that's a three-stage pattern, meaning that artifacts cancel each other out after three fields. Which is what you get if the background had been off, like in Battletoads. It also tells you that the pattern repeats itself after three scanlines, which is always the case.
Since on odd frames, one scanline is shorter by one PPU cycle, the middle of the three pattern stages gets "skipped", thus you get only two stages of the three-stage pattern over time, so that the artifacts never cancel each other out completely over time.

Hope I got everything right. :)
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

NewRisingSun wrote:
NTSC TV uses the equivalent of 341.25 pixels per line
How do you figure that? NTSC doesn't use pixels horizontally at all. Or what do you mean by "equivalent"?
As you have written, each NTSC scanline is 455/2 cycles of the color subcarrier. But as an NES pixel is 2/3 of a cycle of the subcarrier, a conforming NTSC scanline is 455/2 / (2/3) = 341.25 NES pixels wide.
Post Reply