- Stubplement the font generator functions for text-mode.
- Store in plane 2+ the font ONLY in text mode (guilty r68085). Fixes spurious graphics corruption in gfx modes.
CORE-9791
CORE-9794 #resolve #comment Should be fixed in r68134.

svn path=/trunk/; revision=68134
This commit is contained in:
Hermès Bélusca-Maïto 2015-06-14 15:35:38 +00:00
parent be73844e6c
commit 64a8bbf00f
3 changed files with 74 additions and 24 deletions

View file

@ -2491,25 +2491,30 @@ static BOOLEAN VidBiosSetVideoMode(BYTE ModeNumber)
switch (Bda->CharacterHeight)
{
/*
* Write the default font to the VGA font plane
* and update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
* Write the default font to the VGA font plane for text-modes only.
* Update the BIOS INT 43h vector (far pointer to the character range 00h-...).
*/
case 8:
{
VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
if (ModeNumber <= 3)
VgaWriteTextModeFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x8_OFFSET, VIDEO_BIOS_DATA_SEG);
break;
}
case 14:
{
VgaWriteFont(0, Font8x14, ARRAYSIZE(Font8x14) / VGA_FONT_CHARACTERS);
if (ModeNumber <= 3)
VgaWriteTextModeFont(0, Font8x14, ARRAYSIZE(Font8x14) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x14_OFFSET, VIDEO_BIOS_DATA_SEG);
break;
}
case 16:
{
VgaWriteFont(0, Font8x16, ARRAYSIZE(Font8x16) / VGA_FONT_CHARACTERS);
if (ModeNumber <= 3)
VgaWriteTextModeFont(0, Font8x16, ARRAYSIZE(Font8x16) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x16_OFFSET, VIDEO_BIOS_DATA_SEG);
break;
}
@ -3371,6 +3376,58 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
{
// FIXME: At the moment we support only graphics-mode functions!
/* Load User-specified Patterns (Character Set) for Text Mode */
case 0x00:
case 0x10: // FIXME: 0x1x performs a full mode reset
{
// FIXME: BL == ??
/* Write the default font to the VGA font plane */
// VgaWriteTextModeFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
UNIMPLEMENTED;
break;
}
/* Load ROM Monochrome 8x14 Patterns (Character Set) for Text Mode */
case 0x01:
case 0x11: // FIXME: 0x1x performs a full mode reset
{
// FIXME: BL == ??
/* Write the default font to the VGA font plane */
VgaWriteTextModeFont(0, Font8x14, ARRAYSIZE(Font8x14) / VGA_FONT_CHARACTERS);
UNIMPLEMENTED;
break;
}
/* Load ROM 8x8 Double-dot Patterns (Character Set) for Text Mode */
case 0x02:
case 0x12: // FIXME: 0x1x performs a full mode reset
{
// FIXME: BL == ??
/* Write the default font to the VGA font plane */
VgaWriteTextModeFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
UNIMPLEMENTED;
break;
}
/* Load ROM 8x16 Character Set for Text Mode */
case 0x04:
case 0x14: // FIXME: 0x1x performs a full mode reset
{
// FIXME: BL == ??
/* Write the default font to the VGA font plane */
VgaWriteTextModeFont(0, Font8x16, ARRAYSIZE(Font8x16) / VGA_FONT_CHARACTERS);
UNIMPLEMENTED;
break;
}
/* Set User 8x8 Graphics Chars (Setup INT 1Fh Vector) */
case 0x20:
{
@ -3383,10 +3440,10 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
/* Set User Graphics Characters */
case 0x21:
{
// /* Write the font to the VGA font plane */
// VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
/* Update the BIOS INT 43h vector */
/*
* Update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
*/
((PULONG)BaseAddress)[0x43] = MAKELONG(getBP(), getES());
/* Update BDA */
@ -3407,11 +3464,9 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
case 0x22:
{
/*
* Write the default font to the VGA font plane
* and update the BIOS INT 43h vector (far pointer
* Update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
*/
VgaWriteFont(0, Font8x14, ARRAYSIZE(Font8x14) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x14_OFFSET, VIDEO_BIOS_DATA_SEG);
/* Update BDA */
@ -3432,11 +3487,9 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
case 0x23:
{
/*
* Write the default font to the VGA font plane
* and update the BIOS INT 43h vector (far pointer
* Update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
*/
VgaWriteFont(0, Font8x8, ARRAYSIZE(Font8x8) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x8_OFFSET, VIDEO_BIOS_DATA_SEG);
/* Update BDA */
@ -3457,11 +3510,9 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
case 0x24:
{
/*
* Write the default font to the VGA font plane
* and update the BIOS INT 43h vector (far pointer
* to the character range 00h-...)
* Update the BIOS INT 43h vector (far pointer
* to the character range 00h-...).
*/
VgaWriteFont(0, Font8x16, ARRAYSIZE(Font8x16) / VGA_FONT_CHARACTERS);
((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x16_OFFSET, VIDEO_BIOS_DATA_SEG);
/* Update BDA */
@ -3715,7 +3766,6 @@ static BOOL Attached = TRUE;
VOID VidBiosAttachToConsole(VOID)
{
// VgaRefreshDisplay();
if (!Attached)
{
VgaAttachToConsole();

View file

@ -22,7 +22,7 @@
/* PRIVATE VARIABLES **********************************************************/
static CONST DWORD MemoryBase[] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 };
static CONST DWORD MemorySize[] = { 0x20000, 0x10000, 0x8000, 0x8000 };
static CONST DWORD MemorySize[] = { 0x20000, 0x10000, 0x08000, 0x08000 };
/*
* Activate this line if you want to use the real
@ -2086,7 +2086,7 @@ VOID VgaClearMemory(VOID)
RtlZeroMemory(VgaMemory, sizeof(VgaMemory));
}
VOID VgaWriteFont(UINT FontNumber, CONST UCHAR* FontData, UINT Height)
VOID VgaWriteTextModeFont(UINT FontNumber, CONST UCHAR* FontData, UINT Height)
{
UINT i, j;
PUCHAR FontMemory = (PUCHAR)&VgaMemory[VGA_BANK_SIZE * VGA_FONT_BANK + (FontNumber * VGA_FONT_SIZE)];

View file

@ -258,7 +258,7 @@ COORD VgaGetDisplayResolution(VOID);
VOID VgaRefreshDisplay(VOID);
VOID FASTCALL VgaReadMemory(ULONG Address, PVOID Buffer, ULONG Size);
BOOLEAN FASTCALL VgaWriteMemory(ULONG Address, PVOID Buffer, ULONG Size);
VOID VgaWriteFont(UINT FontNumber, CONST UCHAR *FontData, UINT Height);
VOID VgaWriteTextModeFont(UINT FontNumber, CONST UCHAR *FontData, UINT Height);
VOID VgaClearMemory(VOID);
BOOLEAN VgaGetDoubleVisionState(PBOOLEAN Horizontal, PBOOLEAN Vertical);