static VOID EmulatorReadMemory(PVOID Context, UINT Address, LPBYTE Buffer, INT Size)
{
+ UNREFERENCED_PARAMETER(Context);
+
/* If the A20 line is disabled, mask bit 20 */
if (!A20Line) Address &= ~(1 << 20);
static VOID EmulatorWriteMemory(PVOID Context, UINT Address, LPBYTE Buffer, INT Size)
{
+ UNREFERENCED_PARAMETER(Context);
+
/* If the A20 line is disabled, mask bit 20 */
if (!A20Line) Address &= ~(1 << 20);
static VOID EmulatorReadIo(PVOID Context, UINT Address, LPBYTE Buffer, INT Size)
{
+ UNREFERENCED_PARAMETER(Context);
+ UNREFERENCED_PARAMETER(Size);
+
switch (Address)
{
case PIC_MASTER_CMD:
{
BYTE Byte = *Buffer;
+ UNREFERENCED_PARAMETER(Context);
+ UNREFERENCED_PARAMETER(Size);
+
switch (Address)
{
case PIT_COMMAND_PORT:
static VOID EmulatorSoftwareInt(PVOID Context, BYTE Number)
{
+ UNREFERENCED_PARAMETER(Context);
+ UNREFERENCED_PARAMETER(Number);
+
/* Do nothing */
}
static VOID EmulatorHardwareInt(PVOID Context, BYTE Number)
{
+ UNREFERENCED_PARAMETER(Context);
+ UNREFERENCED_PARAMETER(Number);
+
/* Do nothing */
}
static VOID EmulatorHardwareIntAck(PVOID Context, BYTE Number)
{
+ UNREFERENCED_PARAMETER(Context);
+ UNREFERENCED_PARAMETER(Number);
+
/* Do nothing */
}
/* PRIVATE VARIABLES **********************************************************/
-static CONST DWORD MemoryBase[] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 };
-static CONST DWORD MemoryLimit[] = { 0xA7FFF, 0xA7FFF, 0xB7FFF, 0xBFFFF };
+static CONST DWORD MemoryBase[] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 };
+static CONST DWORD MemoryLimit[] = { 0xAFFFF, 0xAFFFF, 0xB7FFF, 0xBFFFF };
static BYTE VgaMemory[VGA_NUM_BANKS * VGA_BANK_SIZE];
static BYTE VgaMiscRegister;
/* Check if this is the first time the rectangle is updated */
if (!NeedsUpdate)
{
- UpdateRectangle.Left = UpdateRectangle.Top = (SHORT)0x7FFF;
- UpdateRectangle.Right = UpdateRectangle.Bottom = (SHORT)0x8000;
+ UpdateRectangle.Left = UpdateRectangle.Top = SHRT_MAX;
+ UpdateRectangle.Right = UpdateRectangle.Bottom = SHRT_MIN;
}
/* Expand the rectangle to include the point */
VgaAcRegisters[VgaAcIndex] = Data;
}
-static BOOL VgaEnterGraphicsMode(PCOORD Resolution, UINT BitDepth)
+static BOOL VgaEnterGraphicsMode(PCOORD Resolution)
{
DWORD i;
CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo;
/* Fill the bitmap info header */
ZeroMemory(&BitmapInfo->bmiHeader, sizeof(BITMAPINFOHEADER));
BitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- BitmapInfo->bmiHeader.biWidth = Resolution->X;
+ BitmapInfo->bmiHeader.biWidth = Resolution->X;
BitmapInfo->bmiHeader.biHeight = Resolution->Y;
BitmapInfo->bmiHeader.biBitCount = 8;
- BitmapInfo->bmiHeader.biPlanes = 1;
+ BitmapInfo->bmiHeader.biPlanes = 1;
BitmapInfo->bmiHeader.biCompression = BI_RGB;
- BitmapInfo->bmiHeader.biSizeImage = Resolution->X * Resolution->Y
- * (BitDepth / 8);
+ BitmapInfo->bmiHeader.biSizeImage = Resolution->X * Resolution->Y;
/* Fill the palette data */
- for (i = 0; i < BitDepth; i++) PaletteIndex[i] = (WORD)i;
+ for (i = 0; i < (VGA_PALETTE_SIZE / 3); i++) PaletteIndex[i] = (WORD)i;
/* Fill the console graphics buffer info */
GraphicsBufferInfo.dwBitMapInfoLength = VGA_BITMAP_INFO_SIZE;
ConsoleFramebuffer = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
Resolution->X * Resolution->Y
- * sizeof(CHAR_INFO));
+ * sizeof(CHAR_INFO));
if (ConsoleFramebuffer == NULL)
{
DisplayMessage(L"An unexpected error occurred!\n");
if (!TextMode)
{
- /* Switching from graphics mode to text mode */
+ /* Leave the current graphics mode */
VgaLeaveGraphicsMode();
}
else
else
{
/* Enter 8-bit graphics mode */
- if (!VgaEnterGraphicsMode(&Resolution, 8)) return;
+ if (!VgaEnterGraphicsMode(&Resolution)) return;
/* Clear the text mode flag */
TextMode = FALSE;
/* Perform a full update */
NeedsUpdate = TRUE;
- UpdateRectangle.Left = 0;
- UpdateRectangle.Top = 0;
- UpdateRectangle.Right = Resolution.X;
+ UpdateRectangle.Left = 0;
+ UpdateRectangle.Top = 0;
+ UpdateRectangle.Right = Resolution.X;
UpdateRectangle.Bottom = Resolution.Y;
}
{
BYTE PlaneData = VgaMemory[k * VGA_BANK_SIZE
+ (Address + (j / 8)) * AddressSize];
-
+
/* If the bit on that plane is set, set it */
if (PlaneData & (1 << (7 - (j % 8)))) PixelData |= 1 << k;
}
ModeChanged = FALSE;
/* Get the data */
- Resolution = VgaGetDisplayResolution();
- CharBuffer = (PCHAR_INFO)ConsoleFramebuffer;
+ Resolution = VgaGetDisplayResolution();
+ CharBuffer = (PCHAR_INFO)ConsoleFramebuffer;
AddressSize = VgaGetAddressSize();
- ScreenRect.Left = ScreenRect.Top = 0;
- ScreenRect.Right = Resolution.X;
+ ScreenRect.Left = ScreenRect.Top = 0;
+ ScreenRect.Right = Resolution.X;
ScreenRect.Bottom = Resolution.Y;
ScanlineSize = (DWORD)VgaCrtcRegisters[VGA_CRTC_OFFSET_REG] * 2;