Here is what I get from available documentation. Before making changes to the VGA clocking mode (i.e. doubling/halving the character clock for 40/80 column operation, or toggling 8/9 dots per character), the sequencer must be reset first - using the Sequencer Reset Register (port 3C4h, index 00h).
The question is how exactly to go about doing that, and here's where things get ambiguous.
From http://www.osdever.net/FreeVGA/vga/seqreg.htm:
From https://archive.org/details/Second_Sight_VGA_Registers/page/n9:
Taken together, I assume that bit 0 (AR) should be left at 1, and that it should be enough to set bit 1 (SR) to 0, change the clock, then set SR to 1 again.
However the one VGA BIOS I actually looked at (some Trident or other) does the opposite, i.e. it leaves SR at 1 and changes AR.
Besides that, how should I parse "...must be set to 0 during the active display interval" - does that mean setting it to 0 for at least a full interval, or just waiting for the interval to arrive before I set it? Is there a minimum or maximum amount of time during which it must remain 0?
Also, I'm not entirely clear about the issue of possible data loss. I assume this has to do with the DRAM refresh circuitry but I'd appreciate some insight here. Basically I'm looking for the safest way to do this across multiple VGA chipsets and/or system speeds, etc.
The question is how exactly to go about doing that, and here's where things get ambiguous.
From http://www.osdever.net/FreeVGA/vga/seqreg.htm:
[bit 1] SR -- Sychnronous Reset
"When set to 0, this bit commands the sequencer to synchronously clear and halt. Bits 1 and 0 must be 1 to allow the sequencer to operate. To prevent the loss of data, bit 1 must be set to 0 during the active display interval before changing the clock selection. The clock is changed through the Clocking Mode register or the Miscellaneous Output register."
[bit 0] AR -- Asynchronous Reset
"When set to 0, this bit commands the sequencer to asynchronously clear and halt. Resetting the sequencer with this bit can cause loss of video data"
From https://archive.org/details/Second_Sight_VGA_Registers/page/n9:
Bit 0:
Asynchronous Reset - This bit, synchronous reset, or both should be set to 0 before changing bit 0 or bit 3 of the Clocking Mode register or bit 2 or bit 3 of the Miscellaneous Output register, or all bits of register 3DF index D.
0 - Asynchronous clear and halt the sequencer. This may cause data loss In the dynamic RAM's.
1 - Bit 1 and 0 must be 1 to allow the sequencer to operate.
Bit 1:
Synchronous Reset This bit, asynchronous reset, or both should be set to 0 before changing bit or bit 3 of the Clocking Mode register or bit 2 or bit 3 of the Miscellaneous Output register, or all bits of register 3DF index D.
0 - Synchronous clear and halt the sequencer.
1 - Bit 1 and must be 1 to allow the sequencer to operate.
Taken together, I assume that bit 0 (AR) should be left at 1, and that it should be enough to set bit 1 (SR) to 0, change the clock, then set SR to 1 again.
However the one VGA BIOS I actually looked at (some Trident or other) does the opposite, i.e. it leaves SR at 1 and changes AR.
Besides that, how should I parse "...must be set to 0 during the active display interval" - does that mean setting it to 0 for at least a full interval, or just waiting for the interval to arrive before I set it? Is there a minimum or maximum amount of time during which it must remain 0?
Also, I'm not entirely clear about the issue of possible data loss. I assume this has to do with the DRAM refresh circuitry but I'd appreciate some insight here. Basically I'm looking for the safest way to do this across multiple VGA chipsets and/or system speeds, etc.
Last edited: