X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=specs%2Ffreevga%2Fvga%2Fcolorreg.htm;fp=specs%2Ffreevga%2Fvga%2Fcolorreg.htm;h=c57fdf20b854d3ff95c949866989ee75ebfdf3d6;hp=0000000000000000000000000000000000000000;hb=8af06d1fd50343e17229618ef4d2693193b2b3d9;hpb=d0d14ca50fbac167253e1e1d8d806bfd749a5e8a diff --git a/specs/freevga/vga/colorreg.htm b/specs/freevga/vga/colorreg.htm new file mode 100644 index 0000000..c57fdf2 --- /dev/null +++ b/specs/freevga/vga/colorreg.htm @@ -0,0 +1,253 @@ + + + + + + + VGA/SVGA Video Programming--Color Regsters + + + + +        The Color Registers in the standard +VGA provide a mapping between the palette of between 2 and 256 colors to +a larger 18-bit color space. This capability allows for efficient use of +video memory while providing greater flexibility in color choice. The standard +VGA has 256 palette entries containing six bits each of red, green, and +blue values. The palette RAM is accessed via a pair of address registers +and a data register. To write a palette entry, output the palette entry's +index value to the DAC Address Write Mode Register then +perform 3 writes to the DAC Data Register, loading the +red, green, then blue values into the palette RAM. The internal write address +automatically advances allowing the next value's RGB values to be loaded +without having to reprogram the DAC Address Write Mode Register.  +This allows the entire palette to be loaded in one write operation. +To read a palette entry, output the palette entry's index to the DAC +Address Read Mode Register. Then perform 3 reads from the DAC +Data Register, loading the red, green, then blue values from palette +RAM. The internal write address automatically advances allowing the next +RGB values to be written without having to reprogram the DAC +Address Read Mode Register. + +

Note: I have noticed some great variance in the actual +behavior of these registers on VGA chipsets. The best way to ensure compatibility +with the widest range of cards is to start an operation by writing to the +appropriate address register and performing reads and writes in groups +of 3 color values. While the automatic increment works fine on all cards +tested, reading back the value from the DAC Address Write +Mode Register may not always produce the expected result. Also interleaving +reads and writes to the DAC Data Register without first +writing to the respected address register may produce unexpected results. +In addition, writing values in anything other than groups of 3 to the DAC +Data Register and then performing reads may produce unexpected results. +I have found that some cards fail to perform the desired update until the +third value is written. +

+  + + + + + + + + + + + + + + + + + + + + + + + + +
DAC Address Write Mode Register +(Read/Write at 3C8h)
76543210
DAC Write Address
+  + +  + + + + + + + + + + + + + + + + + + + + + + + + +
DAC Address Read Mode Register +(Write at 3C7h)
76543210
DAC Read Address
+  + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DAC Data Register (Read/Write at +3C9h)
76543210
DAC Data
+  + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DAC State Register (Read at 3C7h)
76543210
DAC State
+  + + + +

Notice: All trademarks used or referred to on this page are the property +of their respective owners. +
All pages are Copyright © 1997, 1998, J. D. Neal, except where +noted. Permission for utilization and distribution is subject to the terms +of the FreeVGA Project Copyright License. + +