First post, by OPLx
I was recently look up some information on the VGA registers and came across something that I'm a bit confused about. In Mode 0x1 (40x25 text mode) the CRTC horizontal registers are as follows:
Horizontal Total: 0x2D
Horizontal Display End: 0x27
Start Horizontal Blanking: 0x28
End Horizontal Blanking: 0x90
Start Horizontal Retrace: 0x2A
End Horizontal Retrace: 0xA0
There are a total of 0x32 character clocks per scan line and the part that's perplexing me is the value for the End Horizontal Retrace. Since it uses the lower 5 bits of the result of the Start Horizontal Retrace added to the desired with, the lower 5 bits are all zeros. This would seem to imply that (based on my calculations) that the width of the horizontal retrace period is 0x40 characters, but this value exceeds the horizontal total. I'm used to seeing Horizontal Retrace period values generally falling within the Start Horizontal Blanking and End Horizontal Blanking range, so I'm curious as to what actually VGA hardware does when the retrace period exceeds the Horizontal Total. I can't seem to find make sense of the relation of what the lower 5 bits of the End Horizontal Retrace value are and how the Sequencer's Clocking Mode (master clock divided by 2) affects how the lower 5 bits are calculated. I would have though that (perhaps) it should be something along the lines of 0x30 rather than 0x0.