VOGONS


First post, by videogamer555

User metadata
Rank Member
Rank
Member

I know that CGA internally uses 200 lines of image (resolution is 320x200 or 640x200 depending on the mode used), but how did it output this to a TV (which has 484 complete lines of image per frame + 2 half lines). Did it use the full 525 NTSC lines (sync+blanking+image) that is used for normal interlaced video (2 fields per frame, 262.5 lines per field), and then just double the number of image lines from 200 to 400 using a line doubler? Or did it do the same trick that old game consoles (like the SNES and N64) did, and actually output 262 or 263 lines for effectively outputting progressive video instead of interlaced (it rescans the same lines at 60hz instead of 30hz, but only half the lines get used)?

Reply 1 of 5, by Jo22

User metadata
Rank l33t++
Rank
l33t++

To my understanding, it's doing "fake" progressive scan and 200 lines of information. That's all the Motorola CRTC can do.
Ie, it uses merely odd or even lines of an interlaced signal for information but not both.

About "fake": I mean to say the TV/video monitor doesn't change to a native progressive signal format with the matching timings and adapted dot size for 200 lines,
but continues to behave as if the TV signal was normally interlaced (400 lines)
The black lines are "dead" lines without useful picture information (the other 200 lines).

To the TV/video monitor, there are 400 lines total thus (+blank/border etc). As usual.
The TV/video monitor is not natively operating on 200 lines as if it was "real" progressive scan (no odd/even lines or fields).

That's not much unlike NES or any other 240p/288p console.
Though the NES is a bit special, because it uses timing tricks to draw "inbetween" somehow. Not sure how to describe.

Edit: Speaking under correction.
For your amusement, we had some discussion about such things earlier. :)
You can read it here: CGA/EGA "pixel-doubling" of 320-pixel wide modes

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 5, by videogamer555

User metadata
Rank Member
Rank
Member
Jo22 wrote on 2025-07-27, 02:21:
To my understanding, it's doing "fake" progressive scan and 200 lines of information. That's all the Motorola CRTC can do. Ie, i […]
Show full quote

To my understanding, it's doing "fake" progressive scan and 200 lines of information. That's all the Motorola CRTC can do.
Ie, it uses merely odd or even lines of an interlaced signal for information but not both.

About "fake": I mean to say the TV/video monitor doesn't change to a native progressive signal format with the matching timings and adapted dot size for 200 lines,
but continues to behave as if the TV signal was normally interlaced (400 lines)
The black lines are "dead" lines without useful picture information (the other 200 lines).

To the TV/video monitor, there are 400 lines total thus (+blank/border etc). As usual.
The TV/video monitor is not natively operating on 200 lines as if it was "real" progressive scan (no odd/even lines or fields).

That's not much unlike NES or any other 240p/288p console.
Though the NES is a bit special, because it uses timing tricks to draw "inbetween" somehow. Not sure how to describe.

Edit: Speaking under correction.
For your amusement, we had some discussion about such things earlier. 😀
You can read it here: CGA/EGA "pixel-doubling" of 320-pixel wide modes

NES and SNES use 262 total lines per frame, including sync and blanking. Every other scanline on the TV shows image, but the ones inbetween show black. So each video frame of this progressive video is approximately the same duration as single field of interlaced video. The way it works to force progressive scanning, is that each field has an integer number of lines (262, instead of 262.5), therefore every field can be thought of as a complete frame with half the vertical resolution. Interlacing occurs only when a field has a non-integer number of lines.

But there's another problem with this, they chose to make an integer number of lines by removing a half line, rather than adding a half line. This means there's 262 lines per frame (an even number of lines), so that the chroma carrier doesn't switch polarity at the end of the frame. This would normally create a stationary pattern of chroma carrier, that could be visible as a grid on the screen (some chroma carrier leaks through to the brightness/luma part of the circuit). To prevent this from happening, they adjust the timing after every second frame in a way that is still compatible with NTSC TVs, but that keeps there from being a stationary pattern on the screen.

The N64 doesn't have this problem at all, because it uses 263 lines per frame. An odd number of lines per frame means that the chroma carrier inverts polarity for every frame, so no stationary pattern from the chroma carrier, so no timing tricks need to be used like with the NES and SNES to try to remove that pattern.

I'm curious which way the CGA graphics card outputs a signal. Does it use the NES and SNES technique with 262 lines per frame, or the N64 technique with 263 lines per frame?

Reply 3 of 5, by bakemono

User metadata
Rank Oldbie
Rank
Oldbie

The NES outputs 262 lines, but there is a changing phase relationship between the pixel clock and color clock from one line to the next, and from one frame to the next. There are 341 pixel clocks per line which results in 227 1/3 color clocks. https://www.nesdev.org/wiki/NTSC_video

On N64 the video timing is programmable in software. It can do interlaced, line doubled, or noninterlaced.

According to this thread, CGA uses 228 color clocks per line and 262 lines: CGA Timings

GBAJAM 2024 submission on itch: https://90soft90.itch.io/wreckage

Reply 4 of 5, by mkarcher

User metadata
Rank l33t
Rank
l33t
bakemono wrote on 2025-07-27, 09:43:

According to this thread, CGA uses 228 color clocks per line and 262 lines: CGA Timings

The line length of CGA is an integral number of "characters". A character is 2 color clocks wide (in high-res mode) or 4 color clocks wide (in low-res mode). It thus makes perfect sense that the CGA line length is a multiple of 4 color clocks. The default screen height of CGA is 32 complete text lines (including blanking lines) of 8 scan lines each, and then 6 extra lines. You can easily create a new video parameter table and point interrupt 1D to the new parameter table, and increase the count of extra lines from 6 to 7. This also applies to graphics mode that consists of 128 "text lines" consisting of two scan lines each with 6 extra scan lines added.

Reply 5 of 5, by reenigne

User metadata
Rank Oldbie
Rank
Oldbie
videogamer555 wrote on 2025-07-27, 02:02:

actually output 262 or 263 lines for effectively outputting progressive video instead of interlaced (it rescans the same lines at 60hz instead of 30hz, but only half the lines get used)?

This is what it does - same line rate (more or less) but trades vertical resolution for frame rate.

Because there are an integer number of color carrier cycles per frame (and an integer number of color carrier cycles per scanline) the color fringing patterns don't alternate from frame to frame (or from scanline to scanline) on the CGA the way that they do with other signal sources. This makes the fringing effects more pronounced, but also easier for software to exploit. Hence all the CGA games that have a more colourful mode using a composite monitor.