tetrode kink, on Wed Apr 7, 2010 4:51 AM, said:
Hi, I normally just lurk in the programming forums because I find the discussions fascinating (even when they go over my head, which is most of the time...

). But, having had some training in [old-school] television werx, I believe I have something to contribute re: the "overscan" and "underscan" discussion.
SeaGtGruff, on Wed Apr 7, 2010 12:14 AM, said:
...I have a personal issue with those terms the way they're used, because technically "overscan" means to draw the picture bigger than the viewable area of the TV screen, so the "overscanned area" is the part of the picture that can't be seen-- on all four sides, top, bottom, left, and right-- because it runs past the edges of the TV screen.
Well, technically, not exactly. The VCS programmer doesn't draw the picture bigger than the screen, any more than the broadcaster at the local TV station did.
tetrode kink, on Wed Apr 7, 2010 4:51 AM, said:
I just noticed in your text the possibility of interpreting that you said "the Atari programmer or the VCS itself overscans the screen," when it's really the TV that overscans the screen. It may be a microscopic distinction, but an important one IMHO.
Right, I hadn't meant to imply that the *programmer* or the *Atari* is causing the overscan to happen, because it's the TV itself that's displaying less than the full picture signal and cropping the rest.
There's no way to make the 2600 do a horizontal overscan, because the horizontal blanking is done automatically by the TIA, and you absolutely *cannot* make the HBLANK period any shorter than 68 color clocks. On the other hand, you can turn VBLANK on and off on each line to make the HBLANK period *longer* than 68 color clocks, thus getting a narrower playfield than usual.
Vertically, you have full control, to the point of being able to royally screw up the picture by outputting far more or far less than 262 lines between each VSYNC. Assuming you've got a rock-steady frame of 262 lines, you can create a vertical overscan by decreasing the VBLANK period to get more active lines, such as by trying to draw 515 "active" lines instead of 480-to-485 active lines. But if, say, you had one of those nice old-timey TVs that let you adjust the vertical controls to scrunch the picture together, like in the opening images of "The Outer Limits," then it might be possible that what some programmer thought would be a deliberately overscanned game screen ends up being underscanned on your TV!
Anyway, you're right; overscanning is (mostly) the TV's fault, not the Atari's-- except for the occasional crazy programmer.
The best way to define it is that overscanning is when the picture or "active signal" is bigger than the viewing area of the screen, *regardless* of whether it's the fault of the signal generator (TV camera, Atari, etc.), the signal receiver (TV set, monitor, etc.), or both.
The point I was trying to make is that, since the "overscan area" is actually the part of the picture that's being drawn "offscreen," and since the black area that's visible at the bottom edge of the TV screen, just below the game screen, is actually caused by underscanning rather than overscanning, it strikes me as 180 degrees contrary to the meaning of "overscan" to use that term for the portion of the VBLANK routine that's at the bottom of the TV screen. And since the "bottom border" or so-called "overscan" (as used by Atarians) is vertical blanking, too, it doesn't seem right to use the term "vertical blank" for just the portion of the VBLANK routine that's at the top of the screen. "[Vertical] front porch" and "[vertical] back porch" might sound funny, but I think they're more technically-correct terms to apply to those two routines, since the "bottom border" or so-called "overscan" is just a vertical front porch that's been deliberately increased to about 30 lines or so (I think the standard for NTSC is about 3 lines). Likewise, the "top border" or so-called "vertical blank" is just a vertical back porch that's been deliberately increased to about 37 lines or so (I think the standard for NTSC is about 10 or 12 lines, depending on which documentation you're looking at).
It would make more sense to use the term "underscan area" or "underscan routine" to refer to the VBLANK lines at the bottom of the screen, although that term could just as easily apply to the VBLANK lines at the top of the screen. But at least it would make more sense than calling something "overscan" when it's really the result of a deliberate "underscan."
tetrode kink, on Wed Apr 7, 2010 4:51 AM, said:
Here's where I think you're spot-on:
SeaGtGruff, on Wed Apr 7, 2010 12:14 AM, said:
Atari programmers deliberately "underscan" the picture (draw it smaller than the TV screen) to make sure it's all visible, which is why you can see the blanking (or black "border" area) surrounding the game screen at the top, bottom, left, and right sides of the TV screen. And "vertical blank" includes *all* of the lines that are blanked, both at the bottom of the picture and at the top.
Pity the poor schmoe whose TV is so crappy that the 2600's deliberately-reduced-in-size game screen ends up being overscanned *anyway*!
tetrode kink, on Wed Apr 7, 2010 4:51 AM, said:
This is exactly why producers of early TV shows, aware of this deliberate "overscan" defense mechanism built into TV sets of the time, made sure to film (or shoot with live camera) objects or talent so that nothing visually important strayed off center of the screen. This behavior is plainly obvious in credits, especially end credits, with all the smaller text of lesser contributors; the text will always be arranged center-screen, with vast amounts of unused space on the top, bottom and sides. It's just more visible today because there is far less (or no) overscan built into modern TVs.
Yes, the "safe" areas. There are two kinds-- "action safe" and "title safe." If I remember correctly, "action safe" allows for an overscan that's 5% of the picture on all four edges, or tries to keep the action within the central 90% in the vertical dimension (5% + 90% + 5% = 100%), and the central 90% in the horizontal direction (5% + 90% + 5%). "Title safe" allows for even more overscan-- I think it's 10% in all directions, or the central 80% in the vertical and horizontal directions (10% + 80% + 10%).
If we assume that the standard NTSC picture has an active area of about 240 lines (non-interlaced), that gives us an "action safe" area of 216 lines, and a "title safe" area of... drum roll, please... 192 lines! It's just icing on the cake that 192 scan lines is perfect for displaying 24 lines of 8-pixel-high character text on a computer screen. Some computers had 25 lines of text (200 scan lines), and we could certainly do that on the Atari-- but 24 is more highly divisible than 25 is.
Horizontal resolution is another animal. If we go by the color subcarrier cycles, there are 227.5 color clocks per line in a normal "old-timey" TV signal, although the Atari has 228 color clocks. The horizontal resolution of the TV picture might be higher than that, because you can display alternating black and white vertical lines across the screen using the crests and troughs of the color signal (or "half-clocks"), which is how the Atari 800, 5200, and 7800 can display 320 pixels using 160 color clocks. So in theory (ignoring the need for HBLANK and HSYNC), 227.5 color clocks should give use a maximum horizontal resolution of 455 pixels. But in reality the horizontal resolution is affected by the quality of the camera or other device that captured/recorded/replayed the incoming video signal, the quality of the incoming signal itself, and the quality of the TV receiver that's displaying the picture. For the 2600, we might as well just use 228 as the magic number, since that's how many color clocks there are, and the 2600 can't do half-clock pixels as the 800, 5200, or 7800 can.
The old NTSC signal had about 10.9 microseconds of HBLANK, and about 52.6 microseconds of active video on each line, or a total of about 63.5 microseconds for the total scan line. I think those numbers can vary a little bit depending on the video standard used. The NTSC line length of 227.5 color clocks is really 63.555 repeating 5 microseconds long, and the Atari's 228-clock line is 63.6952380952380 repeating 952380 microseconds long (due to the extra half-clock). But the other two numbers-- 10.9 (HBLANK) and 52.6 (active)-- add up to 63.5, so we'll just use that. This means the HBLANK period is about 17.165% (or 10.9 / 63.5) of the line, and the active period is about 82.835% (or 52.6 / 63.5) of the line, giving us a maximum of about 188.45 color clocks for the active portion of the line (227.5 * 82.835%). The "action safe" area would be about 169.60 color clocks, and the "title safe" area would be about 150.76 color clocks. The Atari's active screen width-- 160 color clocks-- is about 84.90%, or about midway between "action safe" and "title safe."
tetrode kink, on Wed Apr 7, 2010 4:51 AM, said:
Interestingly, since the VCS programmer is almost completely responsible for generating the TV image, he can build in as much or as little overscan as he wants. I've read programming posts about varying the number of VBLANK and/or overscan lines. If you need more screen real estate, reduce the number of VBLANK and or overscan, as long as it all adds up to 262 lines for an NTSC game. Similarly, if you need more game computation time, you can expand VBLANK and/or overscan to accomodate it, at the expense of visible screen space.
Yeah, like I said, you can decrease (or increase) the number of VBLANK lines at the top and/or bottom of the screen, although you can't decrease the HBLANK period to get a wider game screen-- only make it narrower if you really want to.
tetrode kink, on Wed Apr 7, 2010 4:51 AM, said:
I wonder how much overscan can be eliminated. If a programmer had a game that needed very little computation time, and this game was assured to only be displayed on a non-overscan TV, he could theoretically devote almost all the screen to display and only a few lines to VBLANK and overscan.
When I was programming the (in)famous "ET Book Cart" for Atari Charles, I wanted to put as many lines of text on the screen as I could, but I was also concerned about some people not being able to see the text at the very top or bottom. Right now I can't remember what I finally settled on, but I think it was either a multiple of 12-- namely, either 216 ("action safe") or 204 (halfway between "action safe" and "title safe")-- or it had an extra 4 lines (i.e., 208 lines in all). That's because (if I remember correctly) the characters were 8 lines tall, but I had 4 blank lines between each row (call it 12 lines per character), with an extra 4 lines to center things:
4 blank lines
8 lines for text
4 blank lines
8 lines for text
4 blank lines
8 lines for text
...
4 blank lines
8 lines for text
4 blank lines
= (4 + 8
) * X + 4 = 12 X + 4, where X is the number of text rows. So
16 rows would be 12 * 16 + 4 = 196 lines,
17 rows would be 12 * 17 + 4 = 208 lines, and
18 rows would be 12 * 18 + 4 = 220 lines, etc.
As I recall, I was afraid to try for 220 lines, so I went with 208 lines because it's between the "title safe" and "action safe" values. The only reason this was feasible was because a text screen requires very little "busy work" for calculations between frames, and all of the real "grunt work" occurs during the 4 lines before the row of text, and within the row while the text is being drawn.
I thought my (no-longer-all-that-new) 1080p HD LCD-TV didn't do *any* overscanning (except for when using zoom and such). But I created a little 2600 program to draw a screen display that lets me count how many lines are visible, as well as figure out *which* lines are being displayed. If I've figured things correctly, it turns out my set actually displays only 226.5 non-interlaced or 453 interlaced lines in the 480i mode. I believe they are lines 30 through 255 on the first field (226 lines), and lines 292 through 518 on the second field (227 lines). I should be ecstatic, because that's about 94%, more than the "title safe" area-- but I can't help feeling sort of bummed out about it!
Michael
Edit 1: 180 degrees contrary, not 180% contrary. D'oh!
Edit 2: Undoing the

. (the forum software strikes again!)
Edited by SeaGtGruff, Wed Apr 7, 2010 8:27 PM.