[stella] Relationship of # of scanlines to framerate
seagtgruff at aol.com
seagtgruff at aol.com
Mon May 19 18:45:24 CDT 2008
If you want to be exact, the framerate is based on how many color clocks are being displayed in each frame (or in each field, if the picture is interlaced), as well as the color clock rate.
For the NTSC format, the color clock rate (or "color subcarrier frequency") is approximately 3.579545 MHz, or 3579545 Hz. The exact value is 227.5 * 262.5 * 60 * 1000 / 1001, which equals 3579545.45 repeating 45. These numbers represent (in order) the number of color subcarrier cycles per scanline, the number of scanlines per field, the number of fields per second, and the adjustment factor that was added when the old black-and-white NTSC signal was updated to add the color information to the signal, which slowed down the original 60-fields-per-second signal to?59.94005994 repeating 005994 fields per second (i.e., 60 * 1000 / 1001).
The Atari has a slightly different scanline length-- 228 color clocks per scanline, rather than 227.5-- but the color clock rate is the same. So for a 262-line frame, the Atari's framerate is actually 227.5 * 262.5 * 60 * 1000 / 1001 / 228 / 262, which equals approximately 59.922751 Hz. That value is arrived at by dividing the color subcarrier frequency (227.5 * 262.5 * 60 * 1000 / 1001) by the number of color clocks per Atari scanline (228), and then further dividing by the number of scanlines per frame (262, or however many scanlines are being displayed).
Thus, you can calculate the exact NTSC Atari framerate as FR = 227.5 * 262.5 * 60 * 1000 / 1001 / 228 / SL, where "SL" is the number of scanlines per frame, and "FR" is the resulting framerate. Thus, a 264-line display would have a framerate of approximately 59.46879 Hz.
PAL is different, because the color subcarrier frequency is different, and the CPU clock speed is also different-- plus, the PAL Atari uses 228 color clocks per scanline, rather than the actual PAL value!
The PAL TV signal has 283.7516 color subcarrier cycles per scanline, 312.5 scanlines per field, and 50 fields per second, so that gives us a color subcarrier frequency of 283.7516 * 312.5 * 50, which equals 4433618.75 Hz, or 4.43361875 MHz. But the PAL Atari generates 228 color clocks per scanline (the same as the NTSC Atari), and then it converts those 228 color clocks into a PAL signal. Note that the PAL Atari's 228 color clocks per scanline are *not* drawn at the NTSC rate (which is roughly 3579545 Hz)
I'm not sure about the PAL Atari numbers, but I *think* that each of the 228 color clocks (which are neither NTSC color clocks nor PAL color clocks) have a rate of 283.7516 * 312.5 * 50 * 4 / 5 (or four-fifths the rate of a PAL color clock), which equals 3546895 Hz, or 3.546895 MHz.
Assuming the above formula is correct, you can calculate the exact PAL Atari framerate as FR = 283.7516 * 312.5 * 50 * 4 / 5 / 228 / SL. So a 312-line frame has a framerate of approximately 49.86076 Hz.
Obviously, you can simplify these formulas by combining (multiplying and/or dividing) the numbers together, but I kept them separate to help emphasize the color subcarrier cycles per scanline, scanlines per field, fields per second, and any adjustment factors.
Michael
-----Original Message-----
From: Stephen Anthony <sa666666 at gmail.com>
To: Atari 2600 programming list <stella at atari2600.org>
Sent: Mon, 19 May 2008 2:01 pm
Subject: [stella] Relationship of # of scanlines to framerate
Can anyone point me to documentation on how the above is determined?
Specifically, I know NTSC/262 is 60Hz and PAL/312 is 50Hz. However,
what 'formula' is used to determine this? Put another way, if the
scanline count was say, 280, what formula would I use to determine the
framerate?
Thanks,
Steve
_______________________________________________
Stella mailing list
Stella at atari2600.org
http://atari2600.org/mailman/listinfo/stella
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://atari2600.org/pipermail/stella/attachments/20080519/f71da107/attachment.html
More information about the Stella
mailing list