How VGA's vertical and horizontal total and retrace rendering affect output?

What happens when the VGA encounters a pixel/row with a vertical/horizontal retrace/total? I assume the retraces are fired first, next the totals. Horizontal priority over vertical?

So when both horizontal and vertical retrace and total is fired on the same row/column:

1
2
3
4
5
Order	What
1.	Horizontal retrace
2.	Vertical retrace
3.	Horizontal total
4.	Vertical total


Is this correct? Also, what effects do the horizontal and vertical retrace and total have on the VGA and CRT?

I'm currently assuming this:

1
2
3
4
5
6
7
8
9
10
11
12
Vertical total: Resets VGA's internal scanline counter.

Horizontal total: Resets VGA's horizontal counter (character clock), increases the VGA's scanline counter and CRT scanline.

Vertical retrace: Resets the CRT scanline.
Horizontal retrace: Resets the CRT column (pixel).

During the retraces, the character clock counts normally, but no output is send to the CRT (preventing display from occurring, effectively rendering black).
Thus VGA pixels are skipped effectively during the horizontal/vertical counters containing the retraces.

During the totals, the horizontal clock is unused (no horizontal increase in the VGA's internal counters).
Also no output is rendered during this time (preventing the horizontal clock from increasing the counter, or resetting it in the case of the horizontal total).


So the information combined:

1
2
3
4
5
6
7
8
9
10
11
12
13
Horizontal timing:
- First normal output is started until the retrace occurs, effectively going to the beginning of the scanline during the period it's selected.
- The area of the retrace has no output.
- After retrace (if any), output is continued until the total occurs.
- The total increases both the VGA's scanline and the CRT's scanline.

Vertical timing:
- Normal output is started (horizontal timing) until the retrace occurs, effectively going to the top of the screen during the period it's selected.
The horizontal position is maintained (whatever the horizontal counter/clock/position is set to will still apply after the retrace).
- The area of retrace has no output.
- After retrace (if any), output is continued until the total occurs.
- The total only resets the VGA's scanline. This will cause the next frame to continue where the previous frame left off
(either at the top of the screen or something lower, depending on the ammount of scanlines between vertical retrace and vertical total). 


Anyone can tell me if this is correct operations during the VGA's rendering?
Last edited on
Topic archived. No new replies allowed.