Hello.
I've noticed in the gtemu that Vertical Synchronization signal starts in the same time as Horizontal front porch.
Not from beginning of X or from Horizontal sync signal.
Is that correct in general or it does not matter?
Thanks.
Why vertical sync starts so early
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: Why vertical sync starts so early
Well spotted! We believe it's correct in general. For VGA, a scanline is:
- horizontal front porch
- horizontal pulse
- horizontal back porch
- pixel burst
Vertical sync is a whole number of scanlines, so it begins at a horizontal front porch.
Having said that, it's entirely possible that for many screens it doesn't matter... We haven't tested to deviate from this.
[Edit: To complete the answer: gtemu.c thus emits unaligned scanlines because that's simpler: emit a newline at end of horizontal pulse. Hence the jagged vSync in the Terminal window.
Note: In the same way, the scanline numbering that gtemu.c emits is aligned with pixel lines, and not with the vertical front porch. That's simpler when inspecting the output with a program such as 'less' (you can search for 'line 0' to hop back and forth from frame to frame). But in the ROM source code comments, we still start counting scanlines from the vertical front porch.]