mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
[NTVDM]
Fix 16 color modes. Implement 4-bit interleaved shift mode. svn path=/branches/ntvdm/; revision=59738
This commit is contained in:
parent
05b8a9a86c
commit
516653f447
1 changed files with 29 additions and 6 deletions
|
@ -572,13 +572,30 @@ static VOID VgaUpdateFramebuffer(VOID)
|
||||||
}
|
}
|
||||||
else if (VgaGcRegisters[VGA_GC_MODE_REG] & VGA_GC_MODE_SHIFTREG)
|
else if (VgaGcRegisters[VGA_GC_MODE_REG] & VGA_GC_MODE_SHIFTREG)
|
||||||
{
|
{
|
||||||
/*
|
/* Check if this is 16 or 256 color mode */
|
||||||
* 2 bits shifted from plane 0 and 2 for the first 4 pixels,
|
if (VgaAcRegisters[VGA_AC_CONTROL_REG] & VGA_AC_CONTROL_8BIT)
|
||||||
* then 2 bits shifted from plane 1 and 3 for the next 4
|
{
|
||||||
*/
|
/*
|
||||||
|
* 2 bits shifted from plane 0 and 2 for the first 4 pixels,
|
||||||
|
* then 2 bits shifted from plane 1 and 3 for the next 4
|
||||||
|
*/
|
||||||
|
BYTE LowPlaneData = VgaMemory[((j / 4) % 2) * VGA_BANK_SIZE
|
||||||
|
+ (Address + (j / 4)) * AddressSize];
|
||||||
|
BYTE HighPlaneData = VgaMemory[(((j / 4) % 2) + 1) * VGA_BANK_SIZE
|
||||||
|
+ (Address + (j / 4)) * AddressSize];
|
||||||
|
|
||||||
// TODO: NOT IMPLEMENTED!
|
/* Extract the two bits from each plane */
|
||||||
DPRINT1("Interleaved shift mode is not implemented!\n");
|
LowPlaneData = (LowPlaneData >> (6 - ((j % 4) * 2))) & 3;
|
||||||
|
HighPlaneData = (HighPlaneData >> (6 - ((j % 4) * 2))) & 3;
|
||||||
|
|
||||||
|
/* Combine them into the pixel */
|
||||||
|
PixelData = LowPlaneData | (HighPlaneData << 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: NOT IMPLEMENTED
|
||||||
|
DPRINT1("8-bit interleaved mode is not implemented!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -620,6 +637,12 @@ static VOID VgaUpdateFramebuffer(VOID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(VgaAcRegisters[VGA_AC_CONTROL_REG] & VGA_AC_CONTROL_8BIT))
|
||||||
|
{
|
||||||
|
/* In 16 color mode, the value is an index to the AC registers */
|
||||||
|
PixelData = VgaAcRegisters[PixelData];
|
||||||
|
}
|
||||||
|
|
||||||
/* Now check if the resulting pixel data has changed */
|
/* Now check if the resulting pixel data has changed */
|
||||||
if (GraphicsBuffer[i * Resolution.X + j] != PixelData)
|
if (GraphicsBuffer[i * Resolution.X + j] != PixelData)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue