SourceForge.net Logo

<< PREV | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | NEXT >>
 
If you'll recall, when you scan a color photograph onto your computer, you are basically taking something from the analog world and translating it into the digital world. A scanner, in this case, acts as the translator. It takes information from one world and translates it into the other. In the world of graphic displays, modelines act as the translator, except they take information from the digital world and translate it into the analog world. A modeline is nothing more than a bunch of inter-related numbers. In essence, it's a formula for converting pixels (digital information) into video signals (analog information).

At the heart of the modeline is the pixel clock (or pclock for short), a conversion factor that translates pixels (digital) into seconds (analog). Pixel clock = pixels / second.

We can calculate the pixel clock using the following formula

Pixel Clock = Number of Pixels per Line x Number of Lines x Refresh Rate

Be aware that the Number of Pixels per Line includes both the number of active pixels (ones that display data) and the number of blanking pixels (buffering time for the CRT). Similarly, the Number of Lines includes both active lines (ones that display data) and blanking lines (buffering time for the CRT).

So, for example, we get the following pixel clock for our modeline above

Pixel Clock = 20 Pixels per Line x 15 Lines x 1 refresh per 60 seconds = 5 pixels per second

In order to understand the usefulness of pixel clocks, we need to explore how they are used to manipulate signal timing. Pictured below is a snap shot in time of the VGA signals above. From it we can see how horizontal pixels are divided into active ones (ones that display data) and blanking ones (buffering time for the CRT).

Digital (pixels)

 

Analog (seconds)

 
 

Digital (lines)

 

Analog (seconds)

If you have the technical documentation for your monitor, it's fairly easy to convert your CRT timings (analog) into modelines. Since I happen to be on very good terms with the designer of our theoretical CRT, I was able to obtain the following information from them.
 

Horizontal

Resolution: 16x12
Scanline Period: 4 seconds
Active Video: 3.2 seconds
Front Porch: 0.2 seconds
Sync: 0.2 seconds
Back Porch: 0.4 seconds

Vertical

Resolution: 16x12
Frame Period: 60 seconds
Active Video: 48 seconds
Front Porch: 4 seconds
Sync: 4 seconds
Back Porch: 4 seconds

 
In order to use this information, however, we need to convert it into percentages, as shown below.
 

Horizontal

Scanline Period: 100%
Active Video: 80%
Front Porch: 5%
Sync: 5%
Back Porch: 10%

Vertical

Frame Period: 100%
Active Video: 80%
Front Porch: 6.6%
Sync: 6.6%
Back Porch: 6.6%

 
With these percentages we can create a generic modeline, a modeline that will later enable us to make any modeline we want. In AdvanceMAME this special modeline is called a device video format.
With the device video format we can convert any resolution into a useable modeline, all we do is apply the percentages to the resolution we want to display.
<< PREV | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | NEXT >>