Author: aandrejevic
Date: Wed Sep 7 14:38:58 2016
New Revision: 72607
URL: http://svn.reactos.org/svn/reactos?rev=72607&view=rev
Log:
[VGADDI]
Explain how VGA write mode 2 works. No code changes!
CORE-8164
Modified:
trunk/reactos/win32ss/drivers/displays/vga/vgavideo/vgavideo.c
Modified: trunk/reactos/win32ss/drivers/displays/vga/vgavideo/vgavideo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/displays/v…
==============================================================================
--- trunk/reactos/win32ss/drivers/displays/vga/vgavideo/vgavideo.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/drivers/displays/vga/vgavideo/vgavideo.c [iso-8859-1] Wed Sep 7 14:38:58 2016
@@ -681,6 +681,19 @@
i += 8, off++;
while (i < w)
{
+ /*
+ * In write mode 2, the incoming data is 4-bit and represents the
+ * value of entire bytes on each of the 4 memory planes. First, VGA
+ * performs a logical operation on these bytes and the value of the
+ * latch register, but in this case there is none. Then, only the
+ * bits that are set in the bit mask are used from the resulting
+ * bytes, and the other bits are taken from the latch register.
+ *
+ * The latch register always contains the value previously read from
+ * VGA memory, and therefore, we must first read from vp[off] to
+ * load the latch register, and then write bp[i] to vp[off], which
+ * will be converted to 4 bytes of VGA memory as described.
+ */
dummy = vp[off];
dummy = bp[i];
vp[off] = dummy;