240p NTSC
Posted: Sat Jun 25, 2011 5:52 pm
My TV interlaces when it displays a regular cable tv signal, and it interlaces on the "INPUT" screen, but when it's displaying the signal from the NES, it stops interlacing.
I wanted to know why this happens, so I turned to our good friend Google, and it said that a standard 480i NTSC signal is 525 scanlines per frame, with each frame being made up of 2 262.5 scanline "fields" which alternate between the odd and even scanlines of the full resolution 480-scanline picture. I knew this already, but it didn't mention how a composite NTSC signal can be non-interlaced 240p @ ~60hz, instead of the regular 480i @ ~30hz.
I dug a little more info up, and ntsc-tv.com says that the vertical sync signal is as follows:
For odd fields:
6 pulses of hblank at double rate
6 pulses of vblank at double rate (vblank being hblank with an inversed duty cycle)
6 pulses of hblank at double rate
This equates to 9 scanlines of sync signals, then what I'm guessing to be 11 regular "active" scanlines (including a normal hsync signal and colorburst) of just black, and then 242.5 active scanlines of visible data.
Note that the odd field ends halfway through its last scanline.
The even field begins with the same 6-6-6 sequence of sync pulses, but they start in the middle of a scanline, so the sequence is offset by half of a scanline (which is why the pulses are at double rate; each scanline is guaranteed to begin with an hsync pulse that way). Since the even field's vsync signal ends in the middle of a scanline, the black level is output to fill the remainder of the scanline. Then, 10 blank scanlines follow, followed by a scanline whose first half is blank and whose second half is visible data, followed by 242 visible scanlines.
The important information is that odd fields have their vertical retrace command aligned with the scanlines, and the even fields have their vertical retrace command half a scanline early.
To detect the vertical retrace command, ancient TVs use a simple lowpass filter. For the 6-6-6 sequence, the first 6 pulses will average out to "slightly lower than black", the second 6 pulses to "vertical retrace", and the last 6 pulses to almost black again.
Remember, on even fields, this sequence occurs half a scanline earlier than on odd fields, so the TV detects the vertical retrace command half a scanline earlier than it would on an odd field.
This is what causes interlacing, on even fields, the vertical retrace occurs half a scanline earlier, which offsets the scanning by half a scanline's width. Because of this constant alternation between scanline-aligned and half-scanline offset vblanks, each field's scanlines will be drawn in between the scanlines of the previous field.
Knowing this, the way to have a non-interlaced signal, you just make sure vblank occurs at the same time for each field, rather than alternating. This seems to be referred to as 526 or 524-line NTSC, which kinda hints on how this is accomplished.
Pretend like you're always drawing an odd field, and either remove the half-active scanline at the end of the field (524-line), or add an extra hblank double-rate pulse at the end of the field (526-line).
On another note, this also explains why most LCD TVs make the NES graphics look like ass: They're trying to deinterlace a progressive signal.
I wanted to know why this happens, so I turned to our good friend Google, and it said that a standard 480i NTSC signal is 525 scanlines per frame, with each frame being made up of 2 262.5 scanline "fields" which alternate between the odd and even scanlines of the full resolution 480-scanline picture. I knew this already, but it didn't mention how a composite NTSC signal can be non-interlaced 240p @ ~60hz, instead of the regular 480i @ ~30hz.
I dug a little more info up, and ntsc-tv.com says that the vertical sync signal is as follows:
For odd fields:
6 pulses of hblank at double rate
6 pulses of vblank at double rate (vblank being hblank with an inversed duty cycle)
6 pulses of hblank at double rate
This equates to 9 scanlines of sync signals, then what I'm guessing to be 11 regular "active" scanlines (including a normal hsync signal and colorburst) of just black, and then 242.5 active scanlines of visible data.
Note that the odd field ends halfway through its last scanline.
The even field begins with the same 6-6-6 sequence of sync pulses, but they start in the middle of a scanline, so the sequence is offset by half of a scanline (which is why the pulses are at double rate; each scanline is guaranteed to begin with an hsync pulse that way). Since the even field's vsync signal ends in the middle of a scanline, the black level is output to fill the remainder of the scanline. Then, 10 blank scanlines follow, followed by a scanline whose first half is blank and whose second half is visible data, followed by 242 visible scanlines.
The important information is that odd fields have their vertical retrace command aligned with the scanlines, and the even fields have their vertical retrace command half a scanline early.
To detect the vertical retrace command, ancient TVs use a simple lowpass filter. For the 6-6-6 sequence, the first 6 pulses will average out to "slightly lower than black", the second 6 pulses to "vertical retrace", and the last 6 pulses to almost black again.
Remember, on even fields, this sequence occurs half a scanline earlier than on odd fields, so the TV detects the vertical retrace command half a scanline earlier than it would on an odd field.
This is what causes interlacing, on even fields, the vertical retrace occurs half a scanline earlier, which offsets the scanning by half a scanline's width. Because of this constant alternation between scanline-aligned and half-scanline offset vblanks, each field's scanlines will be drawn in between the scanlines of the previous field.
Knowing this, the way to have a non-interlaced signal, you just make sure vblank occurs at the same time for each field, rather than alternating. This seems to be referred to as 526 or 524-line NTSC, which kinda hints on how this is accomplished.
Pretend like you're always drawing an odd field, and either remove the half-active scanline at the end of the field (524-line), or add an extra hblank double-rate pulse at the end of the field (526-line).
On another note, this also explains why most LCD TVs make the NES graphics look like ass: They're trying to deinterlace a progressive signal.