Explain how VGA write mode 2 works. No code changes!
CORE-8164


svn path=/trunk/; revision=72607
This commit is contained in:
Aleksandar Andrejevic 2016-09-07 14:38:58 +00:00
parent fc686705cd
commit d97ea85a86

View file

@ -681,6 +681,19 @@ vgaWriteScan ( int x, int y, int w, void *b )
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;