0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x0F, 0xFF,
/* CRTC Registers */
- 0x2D, 0x27, 0x28, 0x90, 0x2B, 0xA0, 0xBF, 0x1F, 0x00, 0x4F, 0x0E, 0x0F,
+ 0x2D, 0x27, 0x28, 0x90, 0x2B, 0xA0, 0xBF, 0x1F, 0x00, 0x4F, 0x0D, 0x0F,
0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x14, 0x1F, 0x96, 0xB9, 0xA3,
0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x0F, 0xFF,
/* CRTC Registers */
- 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F, 0x00, 0x4F, 0x0E, 0x0F,
+ 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F, 0x00, 0x4F, 0x0D, 0x0F,
0x00, 0x00, 0x00, 0x00, 0x9C, 0x8E, 0x8F, 0x28, 0x1F, 0x96, 0xB9, 0xA3,
0xFF,
/* Update the values in the BDA */
Bda->VideoMode = ModeNumber;
Bda->VideoPage = 0;
- Bda->VideoPageSize = BIOS_PAGE_SIZE;
+ Bda->VideoPageSize = BIOS_PAGE_SIZE;
Bda->VideoPageOffset = 0;
- Bda->CharacterHeight = 16;
+
+ /* Get the character height */
+ VgaWritePort(VGA_CRTC_INDEX, VGA_CRTC_MAX_SCAN_LINE_REG);
+ Bda->CharacterHeight = 1 + (VgaReadPort(VGA_CRTC_DATA) & 0x1F);
Resolution = VgaGetDisplayResolution();
Bda->ScreenColumns = Resolution.X;
return FALSE;
}
- /* Store the cursor position */
- Bda->CursorPosition[0] = MAKEWORD(BiosSavedBufferInfo.dwCursorPosition.X,
- BiosSavedBufferInfo.dwCursorPosition.Y);
-
- VgaInitialize(BiosConsoleOutput);
+ /* Initialize VGA */
+ if (!VgaInitialize(BiosConsoleOutput))
+ {
+ CloseHandle(BiosConsoleOutput);
+ CloseHandle(BiosConsoleInput);
+ return FALSE;
+ }
+
+ /* Update the cursor position */
+ BiosSetCursorPosition(BiosSavedBufferInfo.dwCursorPosition.Y,
+ BiosSavedBufferInfo.dwCursorPosition.X,
+ 0);
/* Set the console input mode */
SetConsoleMode(BiosConsoleInput, ENABLE_MOUSE_INPUT | ENABLE_PROCESSED_INPUT);
BYTE Page,
BYTE FillAttribute)
{
- INT i;
+ DWORD i;
LPWORD WindowData;
DWORD WindowSize = (Rectangle.Bottom - Rectangle.Top + 1)
* (Rectangle.Right - Rectangle.Left + 1);
case 0x00:
{
BiosSetVideoMode(LOBYTE(Eax));
+ VgaClearMemory();
+
break;
}
break;
}
+ /* Query Light Pen */
+ case 0x04:
+ {
+ /*
+ * On modern BIOSes, this function returns 0
+ * so that we can ignore the other registers.
+ */
+ EmulatorSetRegister(EMULATOR_REG_AX, 0);
+ break;
+ }
+
/* Select Active Display Page */
case 0x05:
{
};
/* Call the internal function */
- BiosScrollWindow((HIBYTE(Eax)== 0x06)
+ BiosScrollWindow((HIBYTE(Eax) == 0x06)
? SCROLL_DIRECTION_UP : SCROLL_DIRECTION_DOWN,
LOBYTE(Eax),
Rectangle,